// CHECK CLIENT BROWSER & PLATFORM

	// this.ver - The version string from the navigator object
	// this.agent - The useragent string from the navigator object
	// this.dom - True if the browser support DOM
	// this.opera5 - True if the browser is Opera 5
	// this.ie5 - True if the browser is Explorer 5
	// this.ie6 - True if the browser is Explorer 6
	// this.ie4 - True if the browser is Explorer 4
	// this.ie - True if the browser is Expl
	// this.mac - True if the user is using MAC OS
	// this.ns6 - True if the browser is Netscape 6
	// this.ns4 - True if the browser is Netscape 4
	// this.bw - True if any of the other browsers are true. If this is false then the browser does not support DHTML
	
	function checkBrowser(){ 
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
	}
	
	var bw=checkBrowser()



// IMAGE ROLLOVER 
	if (this.bw) { roll = 'true'; }
	else { roll = 'false'; }
	function msover(img,ref) { if (roll == 'true') { document.images[img].src = ref; } }
	function msout(img,ref)  { if (roll == 'true') { document.images[img].src = ref; } }

	// preload images for mouseover	
	if (document.images) {
		  
	  service_update_On = new Image();
	  service_update_On.src = "../images/service_update_over.gif";
	  service_update_Off = new Image();
	  service_update_Off.src = "../images/service_update.gif";
	  
	  // checkbox images
	  remember_On = new Image();
	  remember_On.src = "../images/check_off.gif";
	  remember_Off = new Image();
	  remember_Off.src = "../images/check_off.gif";
	  remember_dn = new Image();
	  remember_dn.src = "../images/check_on.gif";	  
	}

//new kosher!!!!!!!
function swapImgRestore() { //v3.0
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function findObj(n, d) { //v4.0
  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=findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function swapImage() { //v3.0
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



	// mouseover image switching
	// USEAGE: <a href="#" onMouseover="changeImages('buttonimage', 'buttonimage_On'); self.status='status text'; return true" onMouseout="changeImages('buttonimage','buttonimage_Off'); self.status=''; return true">
	function changeImages() {
	  if (document.images) {
	    for (var i=0; i<changeImages.arguments.length; i+=2) {
	      document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
	    }
	  }
	}
	
	function toggleImage(imgName) {  
	        if (imageActive) {
	                deactivateSelectedImage('remember');
	                imageActive = false
	                document.logon.rememberNum.checked=false; 
	                forget();
	                
	        }
	        else {
	        activateSelectedImage('remember');
	        imageActive = true
	        document.logon.rememberNum.checked=true; 
	        }
	}
	
	function toggleImage2(imgName) {  
	        if (imageActive) {
	                deactivateSelectedImage('radio');
	                imageActive = false
	                //document.logon.rememberNum.checked=false; 
	                //forget();
	                
	        }
	        else {
	        activateSelectedImage('radio');
	        imageActive = true
	       // document.logon.rememberNum.checked=true; 
	        }
	}
	
	
// imagemap rollover
	browser_name = navigator.appName;
	browser_version = parseFloat(navigator.appVersion); 
	if (browser_name == "Netscape" && browser_version >= 3.0) { roll = 'true'; }
	else if (browser_name == "Microsoft Internet Explorer" && browser_version >= 3.0) { roll = 'true'; }
	else { roll = 'false'; }
	function msover(img,ref) { if (roll == 'true') { document.images[img].src = ref; } }
	function msout(img,ref)  { if (roll == 'true') { document.images[img].src = ref; } }
	
	

// POPUP WINDOW (FIXES THE IE4/MAC PROBLEM WHICH MAKES WINDOWS TOO SMALL)
// USAGE:	<a href="#" onclick="popWindow('400x300.html','windowname',400,300,'no');">
// NOTES:	substitute 400 with the width, 300 with the height, windowname with the name of the new window, scroll with either 'yes', 'no' or 'auto'
// WORKS:	ie4+, ns4+, opera5

	function popWindow(desktopURL,windowName,width,height) {
		if (this.mac) {
 			var newheight = parseInt(height - 16);
		}
		else {
			var newheight = height;
		}
		window.open(desktopURL,windowName,'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,width='+width+',height='+newheight+',resizable=0');
	}



// HIDE AND SHOW LAYERS

	//Shows the div
	function show(div,nest){
		obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 
		obj.visibility='visible'
	}
	//Hides the div
	function hide(div,nest){
		obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 
		obj.visibility='hidden'
	}
	
	function showadvanced() {
		show('advancedDiv');
		hide('searchDiv');
	}
	
	function hscroll() {
		show('divArrowLeft'); 
		hide('divMore');
	}
	
	function form1() {
		show('form1'); hide('form2'); hide('form3'); hide('form4'); hide('form5'); hide('form6');
	}
	
	function form2() {
		show('form2'); hide('form1'); hide('form3'); hide('form4'); hide('form5'); hide('form6');
	}
	
	function form3() {
		show('form3'); hide('form2'); hide('form1'); hide('form4'); hide('form5'); hide('form6');
	}
	
	function form4() {
		show('form4'); hide('form2'); hide('form3'); hide('form1'); hide('form5'); hide('form6');
	}
	
	function form5() {
		show('form5'); hide('form2'); hide('form3'); hide('form4'); hide('form1'); hide('form6');
	}
	
	function form6() {
		show('form6'); hide('form2'); hide('form3'); hide('form4'); hide('form5'); hide('form1');
	}

	
// OLD NETSCAPE 4 REFRESH BUG
	function MM_reloadPage(init) {
  				if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    				document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  				else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
	}
	
	MM_reloadPage(true);	
			

// REMOVES THE LINK BORDER IN IE4+, NS6 

	function unblur() {
		this.blur();
	}

	function getLinksToBlur() {
		if (!document.getElementById) return
		links = document.getElementsByTagName("a");
		for(i=0; i<links.length; i++) {
			links[i].onfocus = unblur
		}
	}		

// CELL COLOR CHANGE

	function barOver1(title) {
	  title.style.backgroundColor = "#EBEBFE";
	}

	function barOut1(title) {
	  title.style.backgroundColor = "#f2f2f2";
	}
	

// FUNCTIOIN CALLED WHEN WINDOW LOAD

	function startUp() {
				getLinksToBlur();	
			}
			
	onload = startUp;		


