if (!currentsection) {
	var currentsection = 0;
	}
var navnormal='#7F7BAB';
var navhighlight='#363274';
var navcurrent='#363274';


    //Define global variables

	    var timerID = null;
		var timerOn = false;
		var timecount = 5000;
		var what = null;
		var newbrowser = true;
		var check = false;

function showmenu(menulayer)
{
//	if(window.document.images) 
//	{
//		alert("menulayer is "+menulayer);
		hideAll();
		showLayer(menulayer);
		stopTime();
//	}
}

function reDo(){ window.location.reload() }
    window.onresize = reDo;

    	function init(){
//    	  alert ("Running Init");
          if (document.layers) {
 //                       alert ("Running Netscape 4");
                        layerRef="document.layers";
                        styleSwitch="";
                        visibleVar="show";
			screenSize = window.innerWidth;
			what ="ns4";


          }else if(document.all){
  //                      alert ("Running IE");
                        layerRef="document.all";
                        styleSwitch=".style";
                        visibleVar="visible";
			screenSize = document.body.clientWidth + 18;
			what ="ie";

		  }else if(document.getElementById){
   //                    alert ("Running Netscape 6");
                        layerRef="document.getElementByID";
                        styleSwitch=".style";
                        visibleVar="visible";
			what="moz";
		  
		  }else{
		  	//alert("Older than 4.0 browser.");
			what="none";
			newbrowser = false;
		  }
		  
 
		//window.status='status bar text to go here';
		check = true;
		showcurrent();

  	 	}

	// Turns the layers on and off
        function showLayer(layerName){
 // 			alert("Running showLayer");
      	if(check){
        		if (what =="none"){
        			return;
        			}
	        	else if (what == "moz"){
				cellName = layerName+"cell";
        			document.getElementById(layerName).style.visibility="visible";
        			document.getElementById(cellName).style.background=navhighlight;
        			}
        		else{
                  eval(layerRef+'.'+layerName+styleSwitch+'.visibility="visible"');
			eval(layerRef+'.'+layerName+'cell'+styleSwitch+'.background="'+navhighlight+'"');
                  }
		 }
        	else {// alert ("Please wait for the page to finish loading.");
        		return;}
		}

        function hideLayer(layerName){
        	if(check){
//alert("running hidelayer for "+layerName+" in "+what);
        		if (what =="none"){
        			return;
        			}
        		else if (what == "moz"){
				cellName = layerName+"cell";
        			document.getElementById(layerName).style.visibility="hidden";
        			document.getElementById(cellName).style.background=navnormal;
        			}
        		else{
                  eval(layerRef+'.'+layerName+styleSwitch+'.visibility="hidden"');
			eval(layerRef+'.'+layerName+'cell'+styleSwitch+'.background="'+navnormal+'"');
				}
        
        	}
        	else {// alert ("Please wait for the page to finish loading.");
        		return;}
        }


		function hideAll() {
			for (z=0; z<menus.length; z++)
				{
					hideLayer(menus[z]);
				}
		}


		function startTime() {
	        if (timerOn == false) {
                timerID=setTimeout( "hideAll();showcurrent();" , timecount);
                timerOn = true;

	        }

		}


		function stopTime() {
	        if (timerOn) {
    	        clearTimeout(timerID);
                timerID = null;
                timerOn = false;
	        }
		}

		function onLoad(){
			init();
			
			}
	
	function  showcurrent() {
		if (currentsection!=0) {
			var showthis=currentsection - 1;
			showLayer(menus[showthis]);
			}
		}
