
function searchBox(which){
	if(which == 'on' && document.forms['headerSearchBox'].searchCriteria.value == '[search]'){
		document.forms['headerSearchBox'].searchCriteria.value = ''
		document.forms['headerSearchBox'].searchCriteria.style.color = '000000'
	} else if(document.forms['headerSearchBox'].searchCriteria.value == ''){		
		document.forms['headerSearchBox'].searchCriteria.value = '[search]'
		document.forms['headerSearchBox'].searchCriteria.style.color = '666666'	
	}
}

var activeSub=0;
var SubNum=0;

function reDo(){ 
	if(what == 'ns4'){
		window.location.reload()
	}
}

window.onresize = reDo;


    //Define global variables

	    var timerID = null;
		var timerOn = false;
		var timecount = 250;
		var what = null;
		var newbrowser = true;
		var browserDetect = false;
		var displayVar
		var what = 'none'
		var siteMapstart

    	function menuinit(){
		if (document.layers) {
                      //  alert ("Running Netscape 4");
                        layerRef="document.layers";
                        styleSwitch="";
                        visibleVar="show";
						what ="ns4";
		} else if(document.all){
                      //  alert ("Running IE");
				 		windowWidth = document.body.offsetWidth
						displayVar = 'block'
						siteMapstart = windowWidth/2 - 50
						what ="ie";

		} else if(document.getElementById){
                      //  alert ("Running Netscape 6");
						windowWidth = document.width
						displayVar = 'table-row'
						siteMapstart = windowWidth/2 - 50 + 'px;'
						what="moz";
		  
		} else {
		  			//alert("Older than 4.0 browser.");
					what="none";
					newbrowser = false;
		}
		var browserDetect = true
	 }

	// Turns the layers on and off
        function showLayer(layerName){
          	if(!browserDetect){
				menuinit()
			}
			
			if (what =="none"){
        		return;
			} else {
				document.getElementById(layerName).style.visibility = 'visible'
				document.getElementById(layerName).style.display = displayVar
				document.getElementById(layerName + 'curveleft').style.background = 'url(/images/navigation/mainNav_left_fill.gif) no-repeat'
				document.getElementById(layerName + 'top').style.background = 'url(/images/navigation/mainNav_top_fill.gif) no-repeat'
				document.getElementById(layerName + 'curveright').style.background = 'url(/images/navigation/mainNav_right_fill.gif) no-repeat'
				document.getElementById(layerName + 'top').style.zIndex = '99'
				document.getElementById(layerName + 'curveleft').style.zIndex = '99'
				document.getElementById(layerName + 'curveright').style.zIndex = '99'
			 }
		}

        function hideLayer(layerName){
          	if(!browserDetect){		
				menuinit()
			}
		
			if (what =="none"){
        			return;
        	} else {
				document.getElementById(layerName).style.visibility = 'hidden'
				document.getElementById(layerName).style.display = 'none'
				if(document.getElementById(layerName + 'curveleft')){
					document.getElementById(layerName + 'curveleft').style.background = 'url(/images/spacer.gif)'
					document.getElementById(layerName + 'top').style.background = 'url(/images/spacer.gif)'
					document.getElementById(layerName + 'curveright').style.background = 'url(/images/spacer.gif)'
				document.getElementById(layerName + 'top').style.zIndex = '0'
				document.getElementById(layerName + 'curveleft').style.zIndex = '0'
				document.getElementById(layerName + 'curveright').style.zIndex = '0'
				}
        	}
		}


		function hideAll(){
			for(var i = 0; i <= 9; i++){
				if(document.getElementById('layer' + i)){
					hideLayer('layer' + i);
				}
			}
//				hideLayer('headerconnectlayer');
//				hideLayer('headerresourceslayer');
//				hideLayer('headermyeasthilllayer');
//				hideLayer('layer2');
//				hideLayer('layer3');
//				hideLayer('layer4');
				}

		function startHandler(){
			startTime()
		}
				
		function startTime() {
	        if (timerOn == false) {
                timerID=setTimeout( "hideAll()" , timecount);
                timerOn = true;
	        }

		}

		function stopHandler(){
			stopTime()
		}

		function stopTime() {
	        if (timerOn) {
    	        clearTimeout(timerID);
                timerID = null;
                timerOn = false;
	        }
		}
		
		function flipSiteMap(){
          	if(!browserDetect){		
				menuinit()
			}
			if(document.getElementById('siteMap').style.visibility != 'visible'){
				document.getElementById('siteMap').style.visibility = 'visible'
				document.getElementById('siteMap').style.display = displayVar
//				document.getElementById('siteMap').style.left = siteMapstart
			} else {
				document.getElementById('siteMap').style.visibility = 'hidden'
				document.getElementById('siteMap').style.display = 'none'
			}
		}

/*		function onLoad(){
			menuinit();
			
			}
*/
		function gotoLink(where){
			location = where
			return false
		}

		
var imgcurveleft= new Image(8,59); 
imgcurveleft.src = '/images/navigation/mainNav_left_fill.gif'
var imgcurvetop= new Image(200,30); 
imgcurvetop.src = '/images/navigation/mainNav_top_fill.gif'
var imgcurveright= new Image(8,59); 
imgcurveright.src = '/images/navigation/mainNav_right_fill.gif'
var imgdisc= new Image(9,12); 
imgdisc.src = '/images/sitemap_disc.gif'


