	//check browser
	var isNS4 = (document.layers) ? true : false;
	var isIE4 = (document.all && !document.getElementById) ? true : false;
	var isIE5 = (document.all && document.getElementById) ? true : false;
	var isNS6 = (!document.all && document.getElementById) ? true : false;
	var lastLayer1 = null;
	var lastLayer2 = null;
	var lastLayer4 = null;
	var lastSelectLayer = null;
	var mmHideMenuTimer = null;
	var shiftPixels = 0;
	

	//////////////////////////////////////////////////////////////////////////////
	//	  layer	mechanisms for menu
	//////////////////////////////////////////////////////////////////////////////

	function MM_startTimeout(hideTimeout)
	{
		if (lastLayer2 != null)
		{
			mmHideMenuTimer = setTimeout("singleOff(lastLayer2)", hideTimeout);	
		}
	}
	function MM_resetTimeout()
	{
		if (mmHideMenuTimer) clearTimeout(mmHideMenuTimer);
			mmHideMenuTimer = null;
	}

	function triggerOff()
	{
		//check if lastlayer is not null
		if(lastLayer1 != null)
		{
			//call turn off function
			singleOff(lastLayer1);
		}

		//check if lastlayer is not null
		if(lastLayer2 != null)
		{
			//call turn off function
			singleOff(lastLayer2);
		}

		if(lastSelectLayer != null)
		{
			//call turn off function
			selectsingleOff(lastSelectLayer);
		}			
	}

	function triggerOnHover(target1,target2,selecttarget,target4)
	{
        	if (lastLayer1 != null)
        		singleOff(lastLayer1);
        	if (lastLayer2 != null)
        		singleOff(lastLayer2);
		if (lastLayer4 != null)
			resetColor(lastLayer4);

        	lastLayer1 = target1;
        	lastLayer2 = target2;
		lastLayer4 = target4;
        	lastSelectLayer= selecttarget;

	       	if (isIE5 || isNS6)
                {
			if (target4 != null)
				document.getElementById(target4).style.color = '#DC241F';
		}
		else if (isIE4)
		{
			if (target4 != null)
                        	eval("document.all." + target4 + ".style.color = '#DC241F'");
		}
		else if (isNS4)
		{
			if (target4 != null)
                        	eval("document." + target4 + ".color = '#DC241F'");
		}
	}


        function triggerOn(target1,target2,selecttarget,target4)
        {
        	if (lastLayer1 != null)
        		singleOff(lastLayer1);
        	if (lastLayer2 != null)
        		singleOff(lastLayer2);
		if (lastLayer4 != null)
			resetColor(lastLayer4);

        	lastLayer1 = target1;
        	lastLayer2 = target2;
		lastLayer4 = target4;
        	lastSelectLayer= selecttarget;

        	if (isIE5 || isNS6)
                {
			if (target1 != null)
                		document.getElementById(target1).style.visibility = 'visible';
                		document.getElementById(target2).style.visibility = 'visible';
			if (selecttarget) {              	
                	//	document.getElementById(selecttarget).style.visibility = 'hidden';
			}
			if (target1 != null)
                		document.getElementById('main_div').style.visibility = 'visible';
			if (target4 != null)
				document.getElementById(target4).style.color = '#DC241F';
		}
		else if (isIE4)
		{
			if (target1 != null)
                        	eval("document.all." + target1 + ".style.visibility = 'visible'");
                        eval("document.all." + target2 + ".style.visibility = 'visible'");
                        if (selecttarget) { 
                        	eval("document.all." + selecttarget + ".style.visibility = 'hidden'");
                        }
			if (target1 != null)
                        	eval("document.all.main_div.style.visibility = 'visible'");
			if (target4 != null)
                        	eval("document.all." + target4 + ".style.color = '#DC241F'");
		}
		else if (isNS4)
		{
			//make visible
			if (target1 != null)
                        	eval ("document." + target1 + ".visibility = 'visible'");
                        eval ("document." + target2 + ".visibility = 'visible'");                        
                        if (selecttarget) { 
                        	eval ("document." + selecttarget + ".visibility = 'hidden'");
                        }
                        if (target1 != null)
	                        eval ("document.main_div.visibility = 'visible'");
			if (target4 != null)
                        	eval("document." + target4 + ".color = '#DC241F'");
		}
	} // end triggerOn

         // Enter the ID of each layer/div
        function singleOff(id)
        {

		MM_resetTimeout();
		if(lastLayer4 != null)
		{
			resetColor(lastLayer4);
		}

		if (isIE5 || isNS6)
		{
                        document.getElementById(id).style.visibility = 'hidden';
        		document.getElementById('main_div').style.visibility = 'hidden';
		}
		else if (isIE4)
		{
			eval("document.all." + id +".style.visibility = 'hidden'");
			eval("document.all.main_div.style.visibility = 'hidden'");
		}

		else if (isNS4)
		{
                        eval ("document." + id + ".visibility = 'hidden'");
                        eval ("document.main_div.visibility = 'hidden'");
		}
	}	

         // Enter the ID of each layer/div
        function selectsingleOff(id)
        {

		if (isIE5 || isNS6)
		{
                        //document.getElementById(id).style.visibility = 'visible';
		}

		else if (isIE4)
		{
                	eval("document.all." + id +".style.visibility = 'visible'");
		}

		else if (isNS4)
		{
                        eval ("document." + id + ".visibility = 'visible'");
		}
	}

	// change the color of the main selected nav link to black
        function resetColor(id)
        {

		if (isIE5 || isNS6)
		{
			document.getElementById(lastLayer4).style.color = '#000000';
		}
		else if (isIE4)
		{
			eval("document.all." + lastLayer4 +".style.color = '#000000'");
		}

		else if (isNS4)
		{
			eval("document." + lastLayer4 +".color = '#000000'");
		}
	}