//promotion movie
function openMovie(url,w,h){
	window.open('/common/popup/popup_movie.jsp', 'KNDU_PROMOTION_MOVIE', 'width=800, height=477, left=10, top=10, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, scrollbars=no, copyhistory=no')
}

function goRelateSite() {
    var linkUrl = "";

    linkUrl = document.frmRelateSite.relateSite.value;

    if(linkUrl != "") {
        window.open(linkUrl);
    }
}

// gnbMenu
function initNavigation(seq) {
	nav = document.getElementById("tab_js");
	nav.menu = new Array();
	nav.current = null;
	nav.menuseq = 0;
	navLen = nav.childNodes.length;
	
	allA = nav.getElementsByTagName("a")
	for(k = 0; k < allA.length; k++) {
		allA.item(k).onmouseover = allA.item(k).onfocus = function () {
			nav.isOver = true;
		}
		allA.item(k).onmouseout = allA.item(k).onblur = function () {
			nav.isOver = false;
			setTimeout(function () {
				if (nav.isOver == false) {
					if (nav.menu[seq])
						nav.menu[seq].onmouseover();
					else if(nav.current) {
						menuImg = nav.current.childNodes.item(0);
						menuImg.src = menuImg.src.replace("r.gif", ".gif");
						if (nav.current.submenu)
							nav.current.submenu.style.display = "none";
						nav.current = null;
					}
				}
			}, 500);
		}
	}

	for (i = 0; i < navLen; i++) {
		navItem = nav.childNodes.item(i);
		if (navItem.tagName != "LI")
			continue;

		navAnchor = navItem.getElementsByTagName("a").item(0);
		navAnchor.submenu = navItem.getElementsByTagName("ul").item(0);
		
		navAnchor.onmouseover = navAnchor.onfocus = function () {
			if (nav.current) {
				menuImg = nav.current.childNodes.item(0);
				menuImg.src = menuImg.src.replace("r.gif", ".gif");
				if (nav.current.submenu)
					nav.current.submenu.style.display = "none";
				nav.current = null;
			}
			if (nav.current != this) {
				menuImg = this.childNodes.item(0);
				menuImg.src = menuImg.src.replace(".gif", "r.gif");
				if (this.submenu)
					this.submenu.style.display = "block";
				nav.current = this;
			}
			nav.isOver = true;
		}
		nav.menuseq++;
		nav.menu[nav.menuseq] = navAnchor;
	}
	if (nav.menu[seq])
		nav.menu[seq].onmouseover();
}

/*	±ÛÀÚÈ®´ëÃà¼Ò */	
	var currentFontSize = 1;
	function zoomUtil(state, e){
		var idx;
		var arrFontSize = new Array();
	
		arrFontSize[0] = "65%";
		arrFontSize[1] = "100%";
		arrFontSize[2] = "110%";
		arrFontSize[3] = "120%";
		arrFontSize[4] = "130%";
		arrFontSize[5] = "140%";
		arrFontSize[6] = "150%";
		
		var e = e || window.event;
		if (e) {
			if (state == "plus") {		
				if (currentFontSize < 6 ) {
					idx = currentFontSize + 1;
					currentFontSize = idx;
				}else{
					idx = 6;
					currentFontSize = idx;
					alert("´õÀÌ»ó ´Ã¸± ¼ö ¾ø½À´Ï´Ù.");
				}			
			} else if (state == "default") {
				idx = 1;
				currentFontSize = idx;
			} else if (state == "minus") {			
				if ( currentFontSize >= 1) {
					idx = currentFontSize - 1;
					currentFontSize = idx;
				}else{
					idx = 0;
					currentFontSize = idx;
					alert("´õÀÌ»ó ÁÙÀÏ ¼ö ¾ø½À´Ï´Ù.");
				}
			}		
		}
		document.body.style.fontSize = arrFontSize[idx];
		return false;
	}


/* img over */
function imgMenuOver(containderID) {
	var objwrap = document.getElementById(containderID);
	var imgMenu = objwrap.getElementsByTagName("a");

	for (i=0; i<imgMenu.length; i++) {
		if(imgMenu[i].getElementsByTagName("img").length == 0) continue;

		if (imgMenu[i].getElementsByTagName("img")[0].src.indexOf("r.gif") != -1 ) {
			continue;
		}
		imgMenu[i].onmouseover = function() {
			subImage = this.getElementsByTagName("img")[0];
			if (subImage.src.indexOf("r.gif") != -1) return false;
			subImage.src = subImage.src.replace(".gif","r.gif");
			subImage.src = subImage.src.replace("rr.gif","r.gif");
		}
		imgMenu[i].onfocus = function() {
			subImage = this.getElementsByTagName("img")[0];
			if (subImage.src.indexOf("_over.gif") != -1) return false;
			subImage.src = subImage.src.replace(".gif","r.gif");
			subImage.src = subImage.src.replace("rr.gif","r.gif");
		}
		imgMenu[i].onmouseout = function() {
			subImage = this.getElementsByTagName("img")[0];
			subImage.src = subImage.src.replace("r.gif", ".gif");
		}
		imgMenu[i].onblur = function() {
			subImage = this.getElementsByTagName("img")[0];
			subImage.src = subImage.src.replace("r.gif", ".gif");
		}
	}
}

function imgLinkOver(containderID) {
	var objwrap = document.getElementById(containderID);
	var imgMenu = objwrap.getElementsByTagName("a");

	for (i=0; i<imgMenu.length; i++) {
		if(imgMenu[i].getElementsByTagName("img").length == 0) continue;

		if (imgMenu[i].getElementsByTagName("img")[0].src.indexOf("_on.gif") != -1 ) {
			continue;
		}
		imgMenu[i].onmouseover = function() {
			subImage = this.getElementsByTagName("img")[0];
			if (subImage.src.indexOf("on.gif") != -1) return false;
			subImage.src = subImage.src.replace("_off.gif","_on.gif");
		}
		imgMenu[i].onfocus = function() {
			subImage = this.getElementsByTagName("img")[0];
			if (subImage.src.indexOf("_over.gif") != -1) return false;
			subImage.src = subImage.src.replace("_off.gif","_on.gif");
		}
		imgMenu[i].onmouseout = function() {
			subImage = this.getElementsByTagName("img")[0];
			subImage.src = subImage.src.replace("_on.gif", "_off.gif");
		}
		imgMenu[i].onblur = function() {
			subImage = this.getElementsByTagName("img")[0];
			subImage.src = subImage.src.replace("_on.gif", "_off.gif");
		}
	}
}


// Tab Content
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tabclick") {
			thismenu = tabAnchor.item(i);
        }
		else {
			continue;
		}

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", "_off.gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" over", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace("_off.gif", "_on.gif");
			} else {
				this.className += " over";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

function setPNG24(obj) {
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bPNG24\b/i,'');
	obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src='';
	return '';
	}



/* mglobal */
function mglobal(num) {
	var d=document,a=mglobal.arguments;
	for ( i=1 ; d.getElementById("global0"+i+"_img") ; i++ ) {
		var dimg=d.getElementById("global0"+i+"_img"),dsub=d.getElementById("globals0"+i);
		if ( i == a[0] ) {
			dimg.src='/images/menu/n_on_0'+i+'.gif';
			//dimg.src='/images/main/common/gnb_'+i+'_on.gif';
			if ( dsub!=null ) { 
				dsub.style.left="20px"; 
//				alert("d");
			}
		} else {
			dimg.src='/images/menu/n_off_0'+i+'.gif';
			//dimg.src='/images/main/common/gnb_'+i+'_off.gif';
			if ( dsub!=null ) { dsub.style.left="-3000px"; }
		}
	}
}

/** rollover **/
function rollover_off() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function rollover_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function rollover_on() { //v3.0
  var i,j=0,x,a=rollover_on.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=rollover_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}