	// IE 5 - 6 & NS 6 
    if(document.getElementById){
    layerStyleRef="layer.style.";
    layerRef="document.getElementById(";
    styleSwitch=").style";
    visibleVar="visible";
	hideVar="hidden";
	leftVar=".left"         
   }
   // IE > 5
   else if(document.all){
    layerStyleRef="layer.style.";
    layerRef="document.all";
    styleSwitch=".style";
    visibleVar="visible";
	hideVar="hidden";
	leftVar=".pixelLeft"     
 
   }
   // NS > 6
   else if(document.layers){
    layerStyleRef="layer.";
    layerRef="document.layers";
    styleSwitch="";
    visibleVar="show";
	hideVar="hide";
	leftVar=".left"
    }
        
var TopActivecolor = "93C902"
var TopDeActivecolor = "648700"
var TopPxDeActivecolor = "ffffff"

// MENU FLIP FUNCTION START
    function menuFlip(layerName){
    if (eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility == visibleVar')){
    hideLayer(layerName);
    }else{
    showLayer(layerName);
    }
    }
// MENU FLIP FUNCTION END
		
		
// MENU SHOW FUNCTION START
	function showLayer(layerName){
		//temp
			if (layerName.match("Section")){
				hideAll(4)		
			
				lastChar = layerName.length -1
				section = layerName.substring(lastChar)
				tdTop = "top" + section
				tdPx = "toppx" + section
				colorTd(tdTop, TopActivecolor)
				colorTd(tdPx, TopActivecolor)

			}
		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
        }
// MENU SHOW FUNCTION END
    
// MENU HIDE FUNCTION START
    function hideLayer(layerName){
		if (layerName.match("Section")){
				lastChar = layerName.length -1
				section = layerName.substring(lastChar)
				tdTop = "top" + section
				tdPx = "toppx" + section
				colorTd(tdTop, TopDeActivecolor)
				colorTd(tdPx, TopPxDeActivecolor)
		}			
	
    eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
    }
// MENU HIDE FUNCTION END

// MENU HIDE ALL FUNCTION START

	function hideAll(maxCount){
				
				// START SECTION
				tdTop = "top0"
				tdPx = "toppx0"
				colorTd(tdTop, TopDeActivecolor)
				colorTd(tdPx, TopPxDeActivecolor)
	
	
		 for (i = 1; i <= maxCount; i++){
		 	layerName = "layers_Level2_Section" + i
		 	hideLayer(layerName)
		 }
	}


// MENU HIDE ALL FUNCTION END

// ONLOAD LAYER FUNCTION START

	function onLoadLayer(layerID) {
	
	tdTop = "top" + layerID
	tdPx = "toppx" + layerID
	colorTd(tdTop, TopActivecolor)
	colorTd(tdPx, TopActivecolor)
	
	 	if (layerID > 0){
			layerName = "layers_Level2_Section" + layerID
			showLayer(layerName);	
		}
	}

// ONLOAD LAYER FUNCTION START


// CheckColor LAYER FUNCTION START

	function checkColor(tdName, colorToCheck){
	
		color = "";	
		
		if(document.getElementById){
			color = eval(document.getElementById(''+tdName+'').style.backgroundColor)
		}else if(document.all){
			color = eval(tdName + ".style.backgroundColor")
		}
		alert(color)
			if (colorToCheck == color){
			return true;
			}else{
			return false;
			}
		
	}

// CheckColor LAYER FUNCTION END

// ColorTD LAYER FUNCTION START

	function colorTd(tdName, color){
		
		if(document.getElementById){
			document.getElementById(''+tdName+'').style.backgroundColor = color
		}else if(document.all){
			eval(layerRef+'["'+tdName+'"]'+styleSwitch+'.backgroundColor="'+color+'"');
		}	
	}
// ColorTD LAYER FUNCTION End
