
var loadst = false;

function loadstSet(){
	loadst = true;
}

// LayerClearAll
function ClearAll(nowlayer){
	if(loadst == true){
		if(Agent == "NN"){
			for( i = 0 ; i < layerlist.length ; i++) {
				if(layerlist[i] != nowlayer) {
					document.layers[layerlist[i]].visibility = 'hide';
				}
			}
		}

		if((Agent == "NN6")||(Agent == "IE5")){
			for(i = 0 ; i < layerlist.length ; i++) {
				if(layerlist[i] != nowlayer){
					document.getElementById(layerlist[i]).style.visibility = 'hidden';
				}
			}
		}

		if(Agent == "IE"){
			for(i = 0 ; i < layerlist.length ; i++) {
				if(layerlist[i] != nowlayer){
					document.all[layerlist[i]].style.visibility = 'hidden';
				}
			}
		}
	}
}

//LayerCtrl
var View
function LayerCtRl(theLayerID,switchType){

	if(loadst == true){

		if(View == "fixed"){clearTimeout(ClrTimer);}


		if(switchType == "show"){
			View = "show";
			if (Agent == "NN"){
				document.layers[theLayerID].visibility = 'show';
			}
			if((Agent == "NN6")||(Agent == "IE5")){
				document.getElementById( theLayerID ).style.visibility ='visible' 
			}
			else if (Agent == "IE"){
				document.all[theLayerID].style.visibility = 'visible';
			}
		}

		if(switchType == "hide" && View != "fixed"){
			if (Agent == "NN"){
				document.layers[theLayerID].visibility = 'hide';
				document.layers[theLayerID].zindex = 0;
			}
			if((Agent == "NN6")||(Agent == "IE5")){
				document.getElementById(theLayerID).style.visibility = 'hidden';
				document.getElementById(theLayerID).style.zindex = 0;

			}
			else if (Agent == "IE"){
				document.all[theLayerID].style.visibility = 'hidden';
				document.all[theLayerID].style.zindex = 0;
			}
		}
		if(switchType == "fixed"){
			View = "fixed";
			ClrTimer = setTimeout("ClearAll('theLayerID')",900);
		}
	}
}
