/* ------------------------------------------------------------------------ */
/* --------------------------- Random Tagline ----------------------------- */
/* ------------------------------------------------------------------------ */
function generateTagline(){
	var theImages = new Array()
	theImages[0] = '01.gif'
	theImages[1] = '02.gif'
	theImages[2] = '03.gif'
	theImages[3] = '04.gif'
	theImages[4] = '05.gif'
	theImages[5] = '06.gif'
	theImages[6] = '07.gif'
	theImages[7] = '08.gif'
	theImages[8] = '09.gif'
	theImages[9] = '10.gif'
	theImages[10] = '11.gif'
	theImages[11] = '12.gif'
	theImages[12] = '13.gif'
	theImages[13] = '14.gif'
	theImages[14] = '15.gif'
	theImages[15] = '16.gif'
	theImages[16] = '17.gif'
	theImages[17] = '18.gif'
	theImages[18] = '19.gif'
	theImages[19] = '20.gif'
	theImages[20] = '21.gif'
	theImages[21] = '22.gif'
	theImages[22] = '23.gif'
	theImages[23] = '24.gif'
	theImages[24] = '25.gif'
	theImages[25] = '26.gif'
	theImages[26] = '27.gif'
	theImages[27] = '28.gif'
	var j = 0
	var p = theImages.length;
	var preBuffer = new Array()
	for (i = 0; i < p; i++){
   		preBuffer[i] = new Image()
   		preBuffer[i].src = theImages[i]
	}
	var whichImage = Math.round(Math.random()*(p-1));
		document.write('<img src="images/saiBabaQuote_'+theImages[whichImage]+'">');
}
/* ------------------------------------------------------------------------ */
/* ------------------------- Virtual Your Popup --------------------------- */
/* ------------------------------------------------------------------------ */
function openVirtualTour() {
	var iMyWidth;
	var iMyHeight;
	//gets top and left positions based on user's resolution so hint window is centered.
	iMyWidth = (window.screen.width/2) - (430 + 13); //half the screen width minus half the new window width. ***NOTE: +13 becos of off ctr design***
	iMyHeight = (window.screen.height/2) - (310); //half the screen height minus half the new window height.
	var win2 = window.open("vTour.html","Window2","status=no,height=620,width=860,resizable=no,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=no");
	win2.focus();
}
/* ------------------------------------------------------------------------ */
/* ------------------------------ runSwfs --------------------------------- */
/* ------------------------------------------------------------------------ */
function runSwf_logo()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="170" height="140">\n')
    document.write('<param name="movie" value="images/logo.swf">\n')
    document.write('<param name="quality" value="high"/>\n')
    document.write('<param name="menu" value="false">\n')	
    document.write('<embed src="images/logo.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="170" height="140"></embed>\n')
    document.write('</object>\n')
}
function runSwf_intro()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="710" height="350">\n')
    document.write('<param name="movie" value="images/intro.swf">\n')
    document.write('<param name="quality" value="high"/>\n')
    document.write('<param name="menu" value="false">\n')	
    document.write('<embed src="images/intro.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="710" height="350"></embed>\n')
    document.write('</object>\n')
}
function runSwf_navMain(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="700" height="110">\n')
    document.write('<param name="movie" value="images/navMain.swf?target='+location+'">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navMain.swf?target='+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="700" height="110"></embed>\n')
    document.write('</object>\n')
}
function runSwf_navServices(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="180" height="250">\n')
    document.write('<param name="movie" value="images/navServices.swf?target='+location+'">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navServices.swf?target='+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="180" height="250"></embed>\n')
    document.write('</object>\n')
}
function runSwf_navSub_aboutUs(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="200" height="177">\n')
    document.write('<param name="movie" value="images/navSub_aboutUs.swf?target='+location+'">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navSub_aboutUs.swf?target='+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="200" height="177"></embed>\n')
    document.write('</object>\n')
}
function runSwf_navSub_application(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="200" height="51">\n')
    document.write('<param name="movie" value="images/navSub_application.swf?target='+location+'">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navSub_application.swf?target='+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="200" height="51"></embed>\n')
    document.write('</object>\n')
}
function runSwf_navSub_careers(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="200" height="72">\n')
    document.write('<param name="movie" value="images/navSub_careers.swf?target='+location+'">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navSub_careers.swf?target='+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="200" height="72"></embed>\n')
    document.write('</object>\n')
}
function runSwf_navSub_volunteers(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="200" height="72">\n')
    document.write('<param name="movie" value="images/navSub_volunteers.swf?target='+location+'">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navSub_volunteers.swf?target='+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="200" height="72"></embed>\n')
    document.write('</object>\n')
}
function runSwf_navSub_faq(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="200" height="135">\n')
    document.write('<param name="movie" value="images/navSub_faq.swf?target='+location+'">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navSub_faq.swf?target='+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="200" height="135"></embed>\n')
    document.write('</object>\n')
}
function runSwf_navSub_contact(location)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="200" height="72">\n')
    document.write('<param name="movie" value="images/navSub_contact.swf?target='+location+'">\n')
    document.write('<param name="quality" value="high"/>\n')
	document.write('<param name="menu" value="false">\n')
    document.write('<embed src="images/navSub_contact.swf?target='+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="200" height="72"></embed>\n')
    document.write('</object>\n')
}
function runSwf_virtualTour()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="860" height="620">\n')
    document.write('<param name="movie" value="images/virtualTour.swf">\n')
    document.write('<param name="quality" value="high"/>\n')
    document.write('<param name="menu" value="false">\n')	
    document.write('<embed src="images/virtualTour.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="860" height="620"></embed>\n')
    document.write('</object>\n')
}
/* ------------------------------------------------------------------------ */
/* ---------------------------- DW Functions ------------------------------ */
/* ------------------------------------------------------------------------ */
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/* ------------------------------------------------------------------------ */
/* ---------------------------- FAQ Show & Hide ---------------------------- */
/* ------------------------------------------------------------------------ */
function faq_hideNshow(divID) {
  var item = document.getElementById(divID);
  if (item) {
    item.className=(item.className=='faq-hide')?'faq-show':'faq-hide';
  }
}
/* ------------------------------------------------------------------------ */
/* ---------------------------- Floating Anchor --------------------------- */
/* ------------------------------------------------------------------------ */
var target_x = 0;
var target_y = 375 + 27;

var has_inner = typeof(window.innerWidth) == 'number';
var has_element = document.documentElement && document.documentElement.clientWidth;

var fm_id='floatingAnchor';

var fm_shift_x, fm_shift_y, fm_next_x, fm_next_y;

function move_menu()
{
    if (document.layers)
    {
        //floating_menu.left = fm_next_x;
        floating_menu.top = fm_next_y;
    }
    else
    {
        //floating_menu.style.left = fm_next_x + 'px';
        floating_menu.style.top = fm_next_y + 'px';
    }
}

function compute_shifts()
{
    fm_shift_x = has_inner
        ? pageXOffset
        : has_element
          ? document.documentElement.scrollLeft
          : document.body.scrollLeft;
    if (target_x < 0)
        fm_shift_x += has_inner
            ? window.innerWidth
            : has_element
              ? document.documentElement.clientWidth
              : document.body.clientWidth;

    fm_shift_y = has_inner
        ? pageYOffset
        : has_element
          ? document.documentElement.scrollTop
          : document.body.scrollTop;
    if (target_y < 0)
        fm_shift_y += has_inner
            ? window.innerHeight
            : has_element
              ? document.documentElement.clientHeight
              : document.body.clientHeight;
}

function float_menu()
{
    var step_x, step_y;

    compute_shifts();

    step_x = (fm_shift_x + target_x - fm_next_x) * .07;
    if (Math.abs(step_x) < .5)
        step_x = fm_shift_x + target_x - fm_next_x;

    step_y = (fm_shift_y + target_y - fm_next_y) * .07;
    if (Math.abs(step_y) < .5)
        step_y = fm_shift_y + target_y - fm_next_y;

    if (Math.abs(step_x) > 0 ||
        Math.abs(step_y) > 0)
    {
        fm_next_x += step_x;
        fm_next_y += step_y;
        move_menu();
    }

    setTimeout('float_menu()', 20);
};

function float_it()
{
compute_shifts();
if (document.layers)
{
    // Netscape 4 cannot perform init move
    // when the page loads.
    fm_next_x = 0;
    fm_next_y = 0;
}
else
{
    fm_next_x = fm_shift_x + target_x;
    fm_next_y = fm_shift_y + target_y;
    move_menu();
}
float_menu();

}
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */
