// Top Menu
function top2menuView(a) // Top 2 Menu
{
	if(this.id){
		eidStr = this.id;
		eidNum=eidStr.substring(eidStr.lastIndexOf("m",eidStr.length)+1,eidStr.length);
		a = parseInt(eidNum);
	}
	top2menuHideAll();
	top1Menu = document.getElementById("top1m"+a);
	top2Menu = document.getElementById("top2m"+a);
	if(a<10){ann='0'+a;} else {ann=''+a;}
	if (a=0) { //Main 2 Menu Open
	} else {
		if (top1Menu) {
			top1Menu.getElementsByTagName("img")[0].src="http://tour.busan.go.kr/kor/images/top1m" + ann + "on.gif";
			if (top2Menu) { top2Menu.style.display = 'inline'; }
		}
	}
}
var num;
function top2menuHide(a) // 2 Menu Close
{
	if(this.id){
		eidStr = this.id;
		eidNum=eidStr.substring(eidStr.lastIndexOf("m",eidStr.length)+1,eidStr.length);
		a = parseInt(eidNum);
	}

	if(num == null){
		num = a;
	}

	top2menuHideAll();
	top1Menu = document.getElementById("top1m"+a);
	top2Menu = document.getElementById("top2m"+a);
	top1MenuCurr = document.getElementById("top1m"+num);
	top2MenuCurr = document.getElementById("top2m"+num);
	if(a<10){ann='0'+a;} else {ann=''+a;}
	if (top1Menu) {
		top1Menu.getElementsByTagName("img")[0].src="http://tour.busan.go.kr/kor/images/top1m" + ann + ".gif";
		if (top2Menu) { top2Menu.style.display = 'none'; }
		if (top1MenuCurr) {
			top1MenuCurr.getElementsByTagName("img")[0].src = "http://tour.busan.go.kr/kor/images/top1m0" + num + "on.gif";
		}
		if (top2MenuCurr) { top2MenuCurr.style.display = 'inline'; }
	}
}
function top2menuHideAll() //2 Menu All Close
{
	top1menuEl = document.getElementById("top1menu").childNodes;
	for (i=1;i<=top1menuEl.length;i++)
	{
		top1Menu = document.getElementById("top1m"+i);
		top2Menu = document.getElementById("top2m"+i);
		if(i<10){inn='0'+i;} else {inn=''+i;}
		if (top1Menu) {
			top1Menu.getElementsByTagName("img")[0].src="http://tour.busan.go.kr/kor/images/top1m" + inn + ".gif";
			if (top2Menu) { top2Menu.style.display = 'none'; }
		}
	}
}

function initTopMenu() { 
 	top1menuEl = document.getElementById("top1menu").childNodes;
		for (i=1;i<=top1menuEl.length;i++)
	{
		top1Menu = document.getElementById("top1m"+i);
		top2Menu = document.getElementById("top2m"+i);
		if (top1Menu) {
			top1Menu.onmouseover = top1Menu.onfocus = top2menuView;
			top1Menu.onmouseout = top2menuHide;
			if (top2Menu) { 
				top2Menu.onmouseover = top2Menu.onfocus = top2menuView;
				top2Menu.onmouseout = top2menuHide;
			}
		
		}
	}
	top2MenuCurrAct = document.getElementById("top2m2m1");
	if (top2MenuCurrAct) {
		top2MenuCurrActA = top2MenuCurrAct.getElementsByTagName("a")[0];
		var thisClassName = top2MenuCurrActA.className;
		(thisClassName)? top2MenuCurrActA.className= thisClassName+" on" : top2MenuCurrActA.className="on";
	}
}




// open & Close
//ex) displayOff('idName','idName'); displayOn('idName','idName'); 
function displayOn() {
	var i,j,a=displayOn.arguments;
	for(i=0;i<a.length;i++) {
		obj = document.getElementById(a[i]);
		if (obj) { obj.style.display = "block"; }
	}
}
function displayOff() {
	var i,j,a=displayOff.arguments;
	for(i=0;i<a.length;i++) {
		obj = document.getElementById(a[i]);
		if (obj) { obj.style.display = "none"; }
	}
}




