/********************************************************************************
CREDITS...
*** BROWSER VERSION *** detection scripts - Source unknown
*** PAGE CODE *** by LIONHEART GROUP - http://www.lionheart.info
********************************************************************************/

var sitePath = "http://www.bancroftwestern.com/new/"
defaultStatus = ""

    var agt=navigator.userAgent.toLowerCase();
	var bVer = parseInt(navigator.appVersion); 

    // *** BROWSER VERSION *** 
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5. 
    var is_major = parseInt(navigator.appVersion); 
    var is_minor = parseFloat(navigator.appVersion); 

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection. 
    // If you want to allow spoofing, take out the tests for opera and webtv. 
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
                && (agt.indexOf('webtv')==-1)); 
    var is_nav2 = (is_nav && (is_major == 2)); 
    var is_nav3 = (is_nav && (is_major == 3)); 
    var is_nav4 = (is_nav && (is_major == 4)); 
    var is_nav4up = (is_nav && (is_major >= 4)); 
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) || 
                          (agt.indexOf("; nav") != -1)) ); 
    var is_nav5 = (is_nav && (is_major == 5)); 
    var is_nav5up = (is_nav && (is_major >= 5)); 

    var is_ie   = (agt.indexOf("msie") != -1); 
    var is_ie3  = (is_ie && (is_major < 4)); 
    var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) ); 
    var is_ie4up  = (is_ie  && (is_major >= 4)); 
    var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) ); 
    var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4); 

    var is_aol   = (agt.indexOf("aol") != -1); 
    var is_aol3  = (is_aol && is_ie3); 
    var is_aol4  = (is_aol && is_ie4); 

    var is_opera = (agt.indexOf("opera") != -1); 
    var is_webtv = (agt.indexOf("webtv") != -1);

/********************************************************************************
*** PAGE CODE ***
*********************************************************************************/

// DREAMWEAVER 2004 MX ROLLOVER CODE

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];}
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/*--------------------------------------------------------------*/
// PARENT TRAP

function checkFrame() {
	if (top.location != self.location) top.location = self.location ;
	} 
	
/*--------------------------------------------------------------*/
// INIT SITE

function preLoadRings() {
	MM_preloadImages('images/splash_ring01.jpg','images/splash_ring02.jpg','images/splash_ring03.jpg','images/splash_ring04.jpg','images/splash_ring05.jpg','images/splash_ring06.jpg','images/splash_ring07.jpg') ;
}

function initSite() {
	checkFrame() ;
	preLoadRings() ;
	setTimeout("runSplashRingAni()", 3000) ;
	} 

/*--------------------------------------------------------------*/
// SPLASH RING ANIMATIONS   

arraySplashRing = new Array("images/splash_ring01.jpg","images/splash_ring02.jpg","images/splash_ring03.jpg","images/splash_ring04.jpg","images/splash_ring05.jpg","images/splash_ring06.jpg","images/splash_ring07.jpg");
arrayLake = new Array("images/lake_before.jpg","images/lake_after.jpg");

var counter = 0;
var stopAni = 1;

function stopRings() {
	stopAni = 0;
}

function initLakePondsAni() {
	if (document.images) {
        setTimeout("runLakePondsAni()", 5000); // 5 second initial delay
    }
}

function runLakePondsAni() {
    counter++
    if (counter == arrayLake.length) { // individual loop lengths determined by arrays
        counter = 0
    }
    document.lake.src = arrayLake[counter];
	setTimeout("runLakePondsAni()", 2600);
}

function runSplashRingAni() {
    counter++
    if (counter == arraySplashRing.length) { // loop length determined by the array
        counter = 0
    }
    document.ring0.src = arraySplashRing[counter];
	if (stopAni == 1) {
		setTimeout("runSplashRingAni()", 1800);
	}
}
    
    
/*--------------------------------------------------------------*/
// POP-UP WINDOWS

var prodPath = sitePath + 'Products/'

slideRef = new Array("diffuser","PPC","handys","PT4","1W","840","stationary","420","agitator");
slideWinURL = new Array("Diffusers/overview.html","PPC.html","Oxyguard_Handy/overview.html","PT4/overview.html","Oxyguard_1W/overview.html","Oxyguard_840/overview.html","Oxyguard_Stationary/overview.html","Oxyguard_420/overview.html","Agitator/overview.html");
slidePix = new Array("GFX/splash_ring4.jpg","GFX/splash_ring42.jpg","GFX/splash_ring43.jpg");

function gotoSlide(s) {
    document.location.replace(s.options[s.selectedIndex].value);
}
   
function loadSlide(slideDoc) {
	slidePath = sitePath + 'Slides/' + slideDoc + '.html' ;
	W = 530 ;
	H = 394 ;
	if (bVer >= 4) {
		L = screen.width / 2 - W / 2 ;
		T = screen.height / 2 - H / 2 ;
	}
	else {
		L = 20 ;
		T = 20 ;
	}
		    
    slideWindow = window.open(slidePath,'photoWin','menubar=no,width='+W+',height='+H+',left='+L+',top='+T+',screenX='+L+',screenY='+T+',status=no,scrollbars=no,resize=no,alwaysRaised=yes');
	slideWindow.focus();
	if (slideWindow.opener == null) slideWindow.opener = window;
}
    
function gotoProduct(dirName, docName) {
	if (dirName == '0') {
		docURL = prodPath + docName +'.html';
		}
	else {
		docURL = prodPath + dirName + '/' + docName +'.html';  
		}           
    window.opener.location.href = docURL ;
    setTimeout('window.close()','1500');
}
    
/*--------------------------------------------------------------*/
// FORMS
    
function loadForm(formName) {
	formPath = sitePath + 'Forms/' + formName + '.html' ;
	W = 760 ;
	H = 400 ;
	if (bVer >= 4) {
        screenW = screen.width ;
        screenH = screen.height ;
        if (W > screenW) {
            W = screenW ;
            H = screenH ;
            L = 0 ;
            T = 0 ;
        }
        else {
            L = screenW / 2 - W / 2 ;
		    T = screenH / 2 - H / 2 ;
		}
    }
	else {
		L = 0 ;
		T = 0 ;
    }
        
    formWindow = window.open(formPath,'formWin','menubar=yes,width='+W+',height='+H+',left='+L+',top='+T+',screenX='+L+',screenY='+T+',status=no,scrollbars=yes,resize=yes,alwaysRaised=yes');
    formWindow.focus();
	//if (formWindow.opener == null) formWindow.opener = window;
}
    
function getStyles() {
	if (is_nav == true) {
		return('<link rel="stylesheet" href="http://www.pointfour.ca/css/form_Nav.css" type="text/css">');
	}
	else {
		return('<link rel="stylesheet" href="http://www.pointfour.ca/css/form_IE.css" type="text/css">');
	}
}
    
/*--------------------------------------------------------------*/
// PROBE MOUNT GIZMO

var mountState = 'false'

function toggleMount(){
    switch (mountState) {
        case 'false':
            document.mount.src = '../GFX/Diagrams/probe_mount_service.gif';
            mountState = 'true';
            break;
        case 'true':
            document.mount.src = '../GFX/Diagrams/probe_mount_working.gif';
            mountState = 'false';
            break;
    }
}
            