function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  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);



//3-menu dropdown system

//Set the timerID as a global variable to allow other functions to reset it
var timerID = null;

//set the variables that track which layers are visible
drop1state=0
drop2state=0
drop3state=0
drop4state=0
drop5state=0
drop6state=0
drop7state=0
drop8state=0

//check which browser the viewer's using
n = (document.layers) ? 1:0
ie = (document.all) ? 1:0

//If any menus are open, it closes them automatically
function closeall()
{
	if((drop1state==1)|(drop2state==1)|(drop3state==1)|(drop4state==1)|(drop5state==1) |(drop6state==1) |(drop7state==1) |(drop8state==1))
	{
		if (ie){
			dropdown1.style.visibility="hidden"; 
			dropdown2.style.visibility="hidden"; 
			dropdown3.style.visibility="hidden"; 
	 	   dropdown4.style.visibility="hidden"; 

dropdown5.style.visibility="hidden";
dropdown6.style.visibility="hidden";
dropdown7.style.visibility="hidden";
dropdown8.style.visibility="hidden"
			 }
		else if (n){ 
			document.dropdown1.visibility="hide"; 
			document.dropdown2.visibility="hide"; 	
			document.dropdown3.visibility="hide"; 

document.dropdown4.visibility="hide"; 
	
			document.dropdown5.visibility="hide"; 
			document.dropdown6.visibility="hide";
			document.dropdown7.visibility="hide";
			document.dropdown8.visibility="hide" 
			}	
		drop1state=0; drop2state=0; drop3state=0; drop4state=0; drop5state=0; drop6state=0; drop7state=0; drop8state=0;
	}
}

//tell browser how to open and close menus
function openclose(drop){
	//set which menu we're going to open or close				
	if (drop=="dropdown1") { dropstate=drop1state  }
	if (drop=="dropdown2") { dropstate=drop2state }
	//update tracker
	else if (drop=='dropdown3') { dropstate=drop3state }
	else if (drop=='dropdown4') { dropstate=drop4state }
	else if (drop=='dropdown5') { dropstate=drop5state }
	else if (drop=='dropdown6') { dropstate=drop6state }
		else if (drop=='dropdown7') { dropstate=drop7state }
			else if (drop=='dropdown8') { dropstate=drop8state }

	//first close all the menus
	if (ie){dropdown1.style.visibility="hidden"; 
			dropdown2.style.visibility="hidden"; 
			dropdown3.style.visibility="hidden"; 

dropdown4.style.visibility="hidden"; 
 			dropdown5.style.visibility="hidden" ;
			 			dropdown6.style.visibility="hidden";
						 			dropdown7.style.visibility="hidden";
									 			dropdown8.style.visibility="hidden"
		 }
	else if (n){ 
			document.dropdown1.visibility="hide"; 
			document.dropdown2.visibility="hide"; 	
			document.dropdown3.visibility="hide"; 

document.dropdown4.visibility="hide"; 
			document.dropdown5.visibility="hide" ;
			document.dropdown6.visibility="hide";
			document.dropdown7.visibility="hide";
			document.dropdown8.visibility="hide"
			}
	drop1state=0; drop2state=0; drop3state=0; drop4state=0; drop5state=0; drop6state=0; drop7state=0; drop8state=0;

	//now open a menu if appropriate
	clearTimeout(timerID);
	if (dropstate==0){
		if (n){ document.layers[drop].visibility="show" }
		else if (ie){ document.all[drop].style.visibility="visible" }
		//update tracker
		if (drop=="dropdown1") { drop1state=1; }
		if (drop=="dropdown2") { drop2state=1; }
		if (drop=="dropdown3") { drop3state=1; }
		if (drop=="dropdown4") { drop4state=1; }
		if (drop=="dropdown5") { drop5state=1; }
		if (drop=="dropdown6") { drop5state=1; }
		if (drop=="dropdown7") { drop5state=1; }
		if (drop=="dropdown8") { drop5state=1; }
		}
	}

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;
	clearTimeout(timerID);
	timerID = setTimeout("closeall()", 5);

}

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) { //v3.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=MM_findObj(n,d.layers[i].document); 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];}
}


