var menuTimer;
function MenuOpen(menuName){
	document.getElementById('localHaw').style.display = "none";
	document.getElementById('localGum').style.display = "none";
	document.getElementById('localBal').style.display = "none";
	document.getElementById('localEur').style.display = "none";
	document.getElementById('localOce').style.display = "none";
	document.getElementById('localAme').style.display = "none";
	document.getElementById('localDom').style.display = "none";
	document.getElementById('naviItemMenu').style.display = "none";
	document.getElementById('naviGuideMenu').style.display = "none";
	document.getElementById(menuName).style.display = "block";
	clearTimeout(menuTimer);
};
function MenuClose(menuName){
	menuTimer = setTimeout(function(){document.getElementById(menuName).style.display = "none"},300)
};

function layerOpen(layerName){
	document.getElementById(layerName).style.display = "block";
};
function layerClose(layerName){
	document.getElementById(layerName).style.display = "none";
};





function imgChange(imgId,imgSrc){
	document.getElementById(imgId).src = imgSrc;
};


function winOpen(theURI,winWidth,winHeight,winNAME,optionMenu,optionTool) {
subwin = window.open(theURI,winNAME,"directories=no,location=no,menubar="+optionMenu+"yes,toolbar="+optionTool+",status=no,scrollbars=yes,resizable=yes,left=0,top=0,width="+winWidth+",height="+winHeight+",left=0,top=0");
subwin.focus();
}


function areaSelectJump(){
	mySelect = document.areaSelect.areaSelectList.selectedIndex;
	location.href = document.areaSelect.areaSelectList.options[mySelect].value;
}

function imgRoll() {
	if (!document.getElementById) return
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');
	for (var i = 0; i < aImages.length; i++) { 
		if (aImages[i].className == 'ro') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_on'+ftype);
			aImages[i].setAttribute('hsrc', hsrc);
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
				} 
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = function(){
	imgRoll();
	SetPID(true);
}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
	node = document;
	if ( tag == null )
	tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (var i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}



