/*
	Panasonic Global
	JS FILE [menu_function.js]
	This file contains the definition of "menu highlight".
 */


function setBtnHighLight(){
	this.w3c = document.getElementById; if (!this.w3c) return false;
	var agent = navigator.userAgent.toLowerCase(); 
	this.ie = agent.indexOf('msie') != -1;
	return this;
}


setBtnHighLight.prototype = {
	init : function(){
		if(!BH.btn) return false;
		BH.gndiv = document.getElementById("globalnav"); if(!BH.gndiv) return false;BH.setGN();
		BH.lcdiv = document.getElementById("localnav"); if(!BH.lcdiv) return false;
		BH.setLN();
	},

	setGN : function(){
		if(!BH.btn.gn) return false;
		gi = document.getElementById(BH.btn.gn);if(!gi || !BH.btn.gn) return false;
		ga = gi.getElementsByTagName("a");ga[0].className = "on";
	},

	setLN : function(){
		ti = document.getElementById(BH.btn.ln);if(!ti || !BH.btn.ln) return false;
		cti = ti.childNodes;pti = ti.parentNode;
		function setsubli(){
			for(var i=0; i<cti.length ; i++){
				if(cti[i].nodeName.toLowerCase() == "ul"){
					cti[i].style.display = "block";
				}
			}
		}
		if(BH.btn.ln.substring(2,3) == 1){//2nd
			setsubli();
		}else if(BH.btn.ln.substring(2,3) == 2){//3rd
			pti.style.display = "block";
			setsubli();
		}else if(BH.btn.ln.substring(2,3) == 3){
			ti.parentNode.parentNode.parentNode.style.display = "block";
			ti.parentNode.style.display = "block";
		}
		ti.className="on";
		BH.lcdiv.style.visibility = "visible";
	}
}



var BH = new setBtnHighLight();//BH : Set Btn Highlight .
window.addOnload(BH.init);
