// ¸ÞÀÎ ¸Þ´º
function initNavigation (seq)
{
	var nav	= document.getElementById("head_menu");
		nav.menu	= new Array();
		nav.current	= null;
		nav.menuseq	= 0;

	var navLen	= nav.childNodes.length;
	var menuImg;
	var allA = nav.getElementsByTagName("a");

	for (var 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)
					{
						nav.current.className	= "";
						if (nav.current.submenu) { nav.current.submenu.style.display = "none"; }
						nav.current = null;
					}
				}
			}, 3000);
		}
	}

	for (var i=0; i<navLen; i++)
	{
		var navItem	= nav.childNodes.item(i);

		if (navItem.tagName!="LI") { continue;}
		
		var navAnchor	= navItem.getElementsByTagName("a").item(0);
			navAnchor.submenu	= navItem.getElementsByTagName("ul").item(0);
	
			navAnchor.onmouseover = navAnchor.onfocus = function ()
			{
				if (nav.current)
				{
					nav.current.className	= "";
					if (nav.current.submenu) { nav.current.submenu.style.display = "none"; }
					nav.current = null;
				}
				
				if (nav.current!=this)
				{
					this.className	= "menu_on";
					if (this.submenu) { this.submenu.style.display = "block"; }
					nav.current = this;
				}
				nav.isOver = true;
			};
			
			nav.menu[nav.menuseq] = navAnchor;
			nav.menuseq++;
	}
	if (nav.menu[seq]) { nav.menu[seq].onmouseover(); }
}

// ¼­ºê¸Þ´º º¸±â
var sMenu_launch = "";
function detailSubMenu(name)
{
	submenu = document.getElementById(name).style;
	if(sMenu_launch != submenu)
	{
		if(sMenu_launch != "")
		{
			sMenu_launch.display = "none";
		}
		submenu.display = "block";
		sMenu_launch = submenu;
	}
	else
	{
		submenu.display = "none";
		sMenu_launch = "";
	}
}

// ÆË¾÷Ã¢ openWin(ÆÄÀÏ°æ·Î, Å¸°Ù, ³ÐÀÌ, ³ôÀÌ, ½ºÅ©·Ñ¹Ù¿©ºÎ, );
function openWin (url, target, width, height, scrollbars, pos, resize)
{   
	var uri		= url.replace(/(&amp;)/gi, "&");
	var xy_pos	= "";
	
	if (pos)
	{
		xy_pos  = ",left=" + (Math.round(screen.width/2) - Math.round(width/2));
		xy_pos += ",top="  + (Math.round(screen.height/3) - Math.round(height/3));
	}

	var remote	= window.open(uri, target, "width=" + width
				+ ",height=" + height 
				+ ",scrollbars=" + scrollbars 
				+ ",resizable=" + resize
				+ xy_pos
				+ ",toolbar=no,location=no"
				+ ",directories=no,menubar=no,status=yes");
	
	remote.focus();
	return remote;
}

// input type box
function inputFunction(formObj, inputType){
	
	var keycode = event.keyCode;
	var smark   = formObj.mark;
	var rvalue  = formObj.value;

	var keychar = String.fromCharCode(keycode);

	// ´ë¹®ÀÚ·Î º¯È¯
	if(inputType.toUpperCase() == "L"){
		formObj.value = rvalue + keychar.toUpperCase();
		event.returnValue = false;
	}

	// ¼Ò¹®ÀÚ·Î º¯È¯
	if(inputType.toUpperCase() == "S"){
		formObj.value = rvalue + keychar.toLowerCase();
		event.returnValue = false;
	}

	// ¼ýÀÚ¸¸ ÀÔ·Â
	if(inputType.toUpperCase() == "N" && (event.keyCode < 48 || event.keyCode > 57)){
		event.returnValue = false;
	}
}



function visualControl (obj)
{
	var target	= document.getElementById(obj.href.split("#")[1]);
	
	if (parseInt(target.offsetHeight, 10)<1)
	{
		target.style.display	= "block";
		obj.className	= obj.className + "_off";
	}
	else
	{
		target.style.display	= "none";
		obj.className	= obj.className.replace("_off", "");
	}
}

function visualHide (id)
{
	var target	= document.getElementById(id);
		target.style.display	= "none";
}

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


function changeToFlash (src, w, h)
{
	if (src)
	{
		var str	= '<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="' + w + '" height="' + h + '">'
				+ '<param name="movie" value="' + src + '" />'
				+ '<param name="wmode" value="transparent" />'
				+ '<!--[if !IE]> <-->\n'
				+ '<object type="application/x-shockwave-flash" data="' + src + '" width="' + w + '" height="' + h + '">'
				+ '<param name="wmode" value="transparent" />'
				+ '</object>'
				+ '\n<!--> <![endif]-->'
				+ '</object>';

				document.write(str);
	}
}

function setPng24(obj) {
	var useragent = navigator.userAgent;
	
	if ((useragent.indexOf('MSIE 6')>0) && (useragent.indexOf('MSIE 7')==-1)){
		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 '';
	}
}

// ¼±ÅÃ¸µÅ© »õÃ¢ (µ¿ÁÖ¹Î¼¾ÅÍ)
function gomove(frm) {
	if(frm.options[frm.selectedIndex].value != 0)
	{
		newwindow = window.open("");
		newwindow.location = frm.options[frm.selectedIndex].value;
		frm.selectedIndex = 0;
	}
}

// È­¸é È®´ë Ãà¼Ò
var zoomRate = 10;
var curRate = 100;
var minRate = 100;
var maxRate = 200;

function zoomInOut(value) {
	var browserEl = navigator.userAgent.toLowerCase();
	if(browserEl.indexOf('firefox')!=-1) { alert("ÀÍ½ºÇÃ·Î¾î Àü¿ë ±â´ÉÀÔ´Ï´Ù.\n\nº¸±â¸Þ´º > Å©±âÁ¶Á¤ > È®´ë/Ãà¼Ò¸¦ ÀÌ¿ëÇÏ¼¼¿ä."); }
	else if(browserEl.indexOf('opera')!=-1) { alert("ÀÍ½ºÇÃ·Î¾î Àü¿ë ±â´ÉÀÔ´Ï´Ù.\n\nº¸±â¸Þ´º > zoomÀ» ÀÌ¿ëÇÏ¼¼¿ä."); }
	else if(browserEl.indexOf('safari')!=-1) { alert("ÀÍ½ºÇÃ·Î¾î Àü¿ë ±â´ÉÀÔ´Ï´Ù.\n\n º¸±â¸Þ´º > ÅØ½ºÆ®Å©°Ô/ÀÛ°Ô¸¦ ÀÌ¿ëÇÏ¼¼¿ä."); }
	if (((value == "plus")&&(curRate >= maxRate))||((value == "minus") && (curRate <= minRate))) {
	    return;
	}  
	if (value == "plus")
	{
		curRate = parseInt(curRate) + parseInt(zoomRate);
	}
	else if (value == "minus")
	{
		curRate = parseInt(curRate) - parseInt(zoomRate);
	}
	else
	{
		curRate = 100;
	}
	document.body.style.zoom = curRate + '%';	
	try
	{
		var obj = document.getElementById('flash_visual').getElementsByTagName('object')[0];

		if (curRate==100)
		{
			obj.style.display	= 'block';
		}
		else
		{
			obj.style.display	= 'none';
		}
	}
	catch (e)
	{
	}
}

// ÇÁ¸°Æ®
function printAreaAction(){
	window.onbeforeprint = beforePrint;
	window.onafterprint  = afterPrint;
	window.print();
}
// ÇÁ¸°Æ®ÇÒ ³»¿ë
var initBody;
function beforePrint(){
	initBody = document.body.innerHTML;
	document.body.innerHTML = contents.innerHTML;
}
function afterPrint(){
	document.body.innerHTML = initBody;
}

// Áñ°ÜÃ£±â
function bookmarkSite(title, url)
{
	if(window.opera && window.print){	// opera
		var elem = document.createElement('a');
		elem.setAttribute('href', url);
		elem.setAttribute('title', title);
		elem.setAttribute('rel', 'sidebar');
		elem.click();
	}else if(document.all){				// ie
		window.external.AddFavorite(url, title);
	}else if(widnow.sidebar){			// firefox
		window.sidebar.addPanel(title, url, "");
	}
}

// rollover
function initRollovers() {
	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 == 'imgover') {
			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 = initRollovers;

//¸Þ´ºÀÌµ¿_ÇöÆäÀÌÁö
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}