/*===============================================================================
' @Programe Path			: /iyforg/library/js
' @Programe ID				: commom.js
' @Programe Name			:  Ǵ Լ 
' @Description				: ۼҽļȸ 
' @Relation DB Table	:
' @Writer(Edit) Name	: â
' @Writer(Edit) Date	: 2009-05-22
' @Comment				:
'===============================================================================*/	
	
/** --------------------------------------------  **/
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/**  -------------------------------------  **/
function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

/** -------------------------------------------------- **/
function showServiceMenuA() {
	gmap2.style.display="none";
	gmap.style.display="";
}
function showServiceMenuB() {
	gmap.style.display="none";
	gmap2.style.display="";
}

/** ----------------------------------------------- **/
function showGospelMenuA() {
	gospel_01_op.style.display="";
	gospel_01_cl.style.display="none";
}
function showGospelMenuB() {
	gospel_01_cl.style.display="";
	gospel_01_op.style.display="none";
}

function showGospelMenuC() {
	gospel_02_op.style.display="";
	gospel_02_cl.style.display="none";
}
function showGospelMenuD() {
	gospel_02_cl.style.display="";
	gospel_02_op.style.display="none";
}

function showGospelMenuE() {
	gospel_03_op.style.display="";
	gospel_03_cl.style.display="none";
}
function showGospelMenuF() {
	gospel_03_cl.style.display="";
	gospel_03_op.style.display="none";
}

function showGospelMenuG() {
	gospel_04_op.style.display="";
	gospel_04_cl.style.display="none";
}
function showGospelMenuH() {
	gospel_04_cl.style.display="";
	gospel_04_op.style.display="none";
}

function showGospelMenuI() {
	gospel_05_op.style.display="";
	gospel_05_cl.style.display="none";
}
function showGospelMenuJ() {
	gospel_05_cl.style.display="";
	gospel_05_op.style.display="none";
}


/** ---------------------------------------- **/	
function gnbNavi(zz) {
	var gnbNavi = document.getElementById("gnb");
	var subMenu = gnbNavi.getElementsByTagName("ul");
	for (i=0; i<subMenu.length; i++) {
		subMenu[i].style.display = "none"; // ---------------------
		
		var subLink = subMenu[i].getElementsByTagName("a");
		for (var m=0; m<subLink.length; m++) { // ----------------------------
			thismenu = subLink[m];
			thismenu.onmouseover = function() {
				subImage = this.getElementsByTagName("img")[0];
				if(subImage.src.indexOf('_over.gif') == -1) subImage.src = subImage.src.replace(".gif","_over.gif");
			}
			subLink[m].onmouseout = function() {
				subImage = this.getElementsByTagName("img")[0];
				if(subImage.src.indexOf('_over.gif') != -1) subImage.src = subImage.src.replace("_over.gif",".gif");
			}
			subLink[m].onfocus = function() {
				subImage = this.getElementsByTagName("img")[0];
				if(subImage.src.indexOf('_over.gif') == -1) subImage.src = subImage.src.replace(".gif","_over.gif");
			}
			subLink[m].onblur = function() {
				subImage = this.getElementsByTagName("img")[0];
				if(subImage.src.indexOf('_over.gif') != -1) subImage.src = subImage.src.replace("_over.gif",".gif");
			}			
		}
	}	

	var gnbMenu = gnbNavi.getElementsByTagName("li");
	for (j=0; j<gnbMenu.length; j++) {
		if (gnbMenu[j].className == "gnb_menu") {
			thismenu = gnbMenu[j].getElementsByTagName("a")[0];

			thismenu.onmouseover = function() {
				subMenu = gnbNavi.getElementsByTagName("ul");
				for (k=0; k<subMenu.length; k++) {
					subMenu[k].style.display = "none";
					subMenu[k].parentNode.style.zIndex = "";
				}
				
				gnbImg = gnbNavi.getElementsByTagName("img");
				for (l=0; l<gnbImg.length; l++) {
					if (gnbImg[l].src.indexOf("_over.gif") != -1 ){
						gnbImg[l].src = gnbImg[l].src.replace("_over.gif",".gif");
					}
				}

				this.getElementsByTagName("img")[0].src = this.getElementsByTagName("img")[0].src.replace(".gif","_over.gif");
				if (!this.parentNode.getElementsByTagName("ul")[0]) return false;
				this.parentNode.getElementsByTagName("ul")[0].style.display = "block";
				this.parentNode.getElementsByTagName("ul")[0].parentNode.style.zIndex = "1";				
			}
			thismenu.onfocus = function() {
				subMenu = gnbNavi.getElementsByTagName("ul");
				for (k=0; k<subMenu.length; k++) {
					subMenu[k].style.display = "none";
					subMenu[k].parentNode.style.zIndex = "0";
				}
				
				gnbImg = gnbNavi.getElementsByTagName("img");
				for (l=0; l<gnbImg.length; l++) {
					if (gnbImg[l].src.indexOf("_over.gif") != -1 ){
						gnbImg[l].src = gnbImg[l].src.replace("_over.gif",".gif");
					}
				}

				this.getElementsByTagName("img")[0].src = this.getElementsByTagName("img")[0].src.replace(".gif","_over.gif");
				if (!this.parentNode.getElementsByTagName("ul")[0]) return false;
				this.parentNode.getElementsByTagName("ul")[0].style.display = "block";
				this.parentNode.getElementsByTagName("ul")[0].parentNode.style.zIndex = "1";				
			}
		}
	}	
	
	if (zz == 0)
	{
		top_menu01.fireEvent('onmouseover');
	}
	else if (zz == 1)
	{
		top_menu02.fireEvent('onmouseover');
	}
	else if (zz == 2)
	{
		top_menu03.fireEvent('onmouseover');
	}
	else if (zz == 3)
	{
		top_menu04.fireEvent('onmouseover');
	}
	else if (zz == 4)
	{
		top_menu05.fireEvent('onmouseover');
	}
}
