//GNB
/*
function smenuOver() {
	tgtItem = this.parentNode.parentNode;
	tgtNum = this.parentNode.parentNode.getAttribute("id").replace("topmenu", "");
	for (i=1;i<=menunum;i++)	{
		if (i==tgtNum)	{
			if (document.getElementById("submenu"+i)) {
				document.getElementById("submenu"+i).style.display = "block";
			}
		} else {
			otherImg = document.getElementById("topmenu"+i).getElementsByTagName("img");
			if (document.getElementById("submenu"+i))	document.getElementById("submenu"+i).style.display = "none";
		}
	}
}
function setNavigation(navid) {
	menunum = 0;
	var gnbmenu = document.getElementById(navid);
	var totalsub = gnbmenu.childNodes;
	for (i=0;i<totalsub.length;i++) {
		if (totalsub[i].nodeName=="LI") {
			menunum = menunum + 1;
			if (document.getElementById("submenu"+menunum)) document.getElementById("submenu"+menunum).style.display = "none";
		}
	}
}
function initGNB() {
	setNavigation('gnb'); // GNB ID
	for (i=1;i<=menunum;i++) {
		tgtEl = document.getElementById("topmenu"+i);
		if (tgtEl.getElementsByTagName("img").length>0) {
			tgtEl.getElementsByTagName("img").item(0).onmouseover = smenuOver;
			tgtEl.getElementsByTagName("img").item(0).onkeydown = smenuOver;
		}
	}
	return menunum;
}
window.onload = initGNB;
*/

//Flash
//swfprint(ÇÃ·¡½ÃÆÄÀÏ°æ·Î,Æø,³ôÀÌ,¿É¼Ç);
//¿É¼ÇÀº t¿Í o°¡ ÀÖÀ¸¸ç, t´Â transparent, o´Â opaque¸¦ ¶æÇÔ. ¿É¼ÇÀÌ ÇÊ¿ä¾øÀ» °æ¿ì ºñ¿öµÎ¸é µÊ.
function swfprint(furl,fwidth,fheight,transoption) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ fwidth +'" height="' + fheight +'" align="middle">');
	document.write('<param name="movie" value="'+ furl +'"/>');
	if (transoption == "t") {
		document.write('<param name="wmode" value="transparent"/>');
	} else if (transoption == "o") {
		document.write('<param name="wmode" value="opaque"/>');
	}
	document.write('<!-- Hixie method -->');
	document.write('<!--[if !IE]> <-->');
	document.write('<object type="application/x-shockwave-flash" data="'+ furl +'" width="'+ fwidth +'" height="' + fheight +'"');
	if (transoption == "t") {
		document.write(' wmode="transparent"');
	} else if (transoption == "o") {
		document.write(' wmode="opaque"');
	}
	document.write('></object>');
	document.write('<!--> <![endif]-->');
	document.write('</object>');
}

//Togle
function showMenu(ID) {
	var Id = document.getElementById(ID);
	Id.style.display = 'block';
	Id.style.top = - Id.offsetHeight + 'px';
	Id.style.zIndex = '20';
}
function hideMenu(ID) {
	var Id = document.getElementById(ID);
	Id.style.display = 'none';
}

//Popup
function WinPop(url,name,w,h,s) {
	var position, top, left;
	top = screen.height/2 - h/2;
	left = screen.width/2 - w/2;
	position = ",top="+top+",left="+left;
	if(s!==0) {
		sOp = ",scrollbars=yes";
	} else {
		sOp = "";
	}
	winOptions = 'width='+w+',height='+h+sOp+position;
	window.open(url,name,winOptions);
}
//Popup Close
function closeWin() {
	window.close();
}

//faq Drop-Down
function faq_menu(sw) {
	var faq_dl = document.getElementById('faq_list');
	var cnt = 0;
	var cnt2 = 0;
	for (i=0; i<faq_dl.childNodes.length; i++) {
		if (faq_dl.childNodes[i].tagName == 'DT') {
			cnt2++;
			if (sw == cnt2) {
				faq_dl.childNodes[i].className='on';
			} else {
				faq_dl.childNodes[i].className='';
			}
		}
		else if (faq_dl.childNodes[i].tagName == 'DD') {
			cnt++;
			if (sw == cnt) {
				faq_dl.childNodes[i].className='';
			} else {
				faq_dl.childNodes[i].className='none';
			}
		}
	}
}

//sitemap
function sitemap(m) {
	var mid = document.getElementById('sitemap');
	var mid2 = document.getElementById('sitemap1');
	if (mid.style.display == 'block') {
		mid.style.display = 'none';
		mid2.style.display = 'none';
	} else {
		mid.style.display = 'block';
		mid2.style.display = 'block';
	}
	if (m == 'main') {
		if ( navigator.appName.indexOf("Explorer") != -1 ) {
			mid.style.top = document.body.scrollHeight - 555 + "px";
			mid2.style.top = document.body.scrollHeight - 555 + "px";
		} else {
			mid.style.top = document.body.scrollHeight - 500 + "px";
			mid2.style.top = document.body.scrollHeight - 500 + "px";
		}
	} else {
		if ( navigator.appName.indexOf("Explorer") != -1 ) {
			mid.style.top = document.body.scrollHeight - 463 + "px";
			mid2.style.top = document.body.scrollHeight - 463 + "px";
		} else {
			mid.style.top = document.body.scrollHeight - 433 + "px";
			mid2.style.top = document.body.scrollHeight - 433 + "px";
		}
	}
}
//
function sitemapLoad(m) {
	var mid = document.getElementById('sitemap');
	var mid2 = document.getElementById('sitemap1');
	if (mid.style.display == 'block') {
		mid.style.display = 'none';
		mid2.style.display = 'none';
	} else {
		mid.style.display = 'block';
		mid2.style.display = 'block';
	}
	
	if (m == 'main') {
		ifrmSite.document.location.href = "/inc/inc.footer_iframe.asp";
//        ifrmSiteMap()
		if ( navigator.appName.indexOf("Explorer") != -1 ) {
			mid.style.top = document.body.scrollHeight - 555 + "px";
			mid2.style.top = document.body.scrollHeight - 555 + "px";
		} else {
			mid.style.top = document.body.scrollHeight - 500 + "px";
			mid2.style.top = document.body.scrollHeight - 500 + "px";
		}

	} else {
		if ( navigator.appName.indexOf("Explorer") != -1 ) {
			mid.style.top = document.body.scrollHeight - 463 + "px";
			mid2.style.top = document.body.scrollHeight - 463 + "px";
		} else {
			mid.style.top = document.body.scrollHeight - 433 + "px";
			mid2.style.top = document.body.scrollHeight - 433 + "px";
		}
	}
}

function popup_Layer(event) {
	var lightbox;
	var idx1 = document.getElementById('zip_box');
	var idx2 = document.getElementById('zip_bg');

	idx1.style.display = 'block';
	idx2.style.display = 'block';

	lightbox = document.createElement('div');
	lightbox.setAttribute('id', 'lightbox');
	document.getElementById('zip_layer').appendChild(lightbox);

	lightbox.style.display = 'block';
	lightbox.style.height = document.documentElement.scrollHeight + 'px';
	lightbox.style.width = document.documentElement.scrollWidth + 'px';
	lightbox.style.background = '#000';
	lightbox.style.position = 'absolute';
	lightbox.style.top = '0';
	lightbox.style.left = '0';
	lightbox.style.zIndex = '1';
	lightbox.style.cursor = 'pointer';
	if ( navigator.appName.indexOf("Explorer") != -1 ) {
		lightbox.style.filter="Alpha(opacity=50)";
	} else {
		lightbox.style.opacity=0.5;
	}
	lightbox.onclick = function() { popup_close(); }

}
function popup_close() {
	var idx1 = document.getElementById('zip_box');
	var idx2 = document.getElementById('zip_bg');

	idx1.style.display = 'none';
	idx2.style.display = 'none';
	var lightbox = document.getElementById('lightbox');
	document.getElementById('zip_layer').removeChild(lightbox);
}



function sch_layer(tPosition, day) {
	var mid = document.getElementById('date_' + day);
	var sTop = document.getElementById('sch').scrollTop;
	if (mid.className == 'sch_layer hidden') {
		Positions = tPosition.split(',');
		mid.style.top = parseInt(Positions[1]) + 45 + "px";
		mid.className = 'sch_layer visible';
	} else {
		mid.className = 'sch_layer hidden';
	}
}


function numInput() {
	var keyCode = event.keyCode;
	if ((keyCode > 47 && keyCode < 58) || keyCode == 13) {}
	else {
		event.returnValue=false;
	}
}