/*************************************************************/
/***common.js*************************************************/
/*************************************************************/
function showflash(str, width, height) {

	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+width+"' height='"+height+"'>")
	document.write("<param name='movie' value='"+str+"'>")
	document.write("<param name='wmode' value='transparent'>")
	document.write("<param name='quality' value='high'>")
	document.write(" <embed  src='"+str+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"' wmode='transparent'></embed></object>")
}

function MM_swapImgRestore() { //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 MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_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 MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function popupWindow(url, w, h) {
        var posX = (screen.width - w) / 2;
        var posY = (screen.height - h) / 2;
        var option = ",resizable=no,scrollbars=no,status=no";
        window.open(url, "new_win","width="+w+",height="+h+",left="+posX +",top="+posY+option);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(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 jf_load() {
    for ( var i = 0; i < document.images.length; i++ ) {
        if ( document.images[i].id != "img_line" && document.images[i].id != "img_title" && document.images[i].id != "img_bottom" ) {
            if ( document.images[i].width > 660 ) {
                //alert(document.images[i].width);
                document.images[i].width = 660; 
            }
        }
    }
}

// ¿¹¾àÂÊ °ËÁ¤·¹ÀÌ¾î ¹è°æ
function layercontent(){
    function posDocMiddle(){
    
        var target = $("#layer-opacityback");
        var w=document.documentElement.clientWidth;
        var h=document.documentElement.clientHeight;
        target.css({"width":w, "height":h});

        var scroll_w=document.documentElement.scrollWidth;
        var scroll_h=document.documentElement.scrollHeight;

        if(scroll_h>h) h=scroll_h;
        if(scroll_w>w) w=scroll_w;
        target.css({"width":w, "height":h});
        
    }

    $(window).ready(function(){
        $("body").append('<div id="layer-opacityback"><\/div>');
        $("#layer-opacityback").css({"position":"absolute", "top":0, "left":0, "width":"100%", "height":document.documentElement.scrollHeight, "background":"black", "z-index":9994, "opacity":0.5});

        //$("#container, .subwrap").css("position", "static");
        //$("#gototop").css("display", "none");
        $("#reservation").css({"position":"absolute", "z-index":9995,"background":"white"});

        posDocMiddle();
        setInterval(function(){
            posDocMiddle();
        }, 1000);
    });
    $(window).resize(function(){
        posDocMiddle();
    });
    $(window).trigger('resize');
}  

/*************************************************************/
/***default.js************************************************/
/*************************************************************/
// global navigation bar
function gnbctl(t)  {
    var target = "gnb0" + t;
    for(var i=1; i<=8; i++) {
        var a = "gnb0" + i;
            if (document.getElementById(a) != null)
            {
                //document.getElementById(a).style.display='none';
                document.getElementById('gnbimg0'+i).src='../../../images/share/gnb0'+i+'_off.gif';
            }
        }
    //document.getElementById(target).style.display='block';
    document.getElementById('gnbimg0'+t).src='../../../images/share/gnb0'+t+'_on.gif';
    }

function gnbctl2(t) {
    var target = "gnb0" + t;
    for(var i=1; i<=8; i++) {
        var a = "gnb0" + i;
            if (document.getElementById(a) != null)
            {
                //document.getElementById(a).style.display='none';
                document.getElementById('gnbimg0'+i).src='../../images/share/gnb0'+i+'_off.gif';
            }
        }
    //document.getElementById(target).style.display='block';
    document.getElementById('gnbimg0'+t).src='../../images/share/gnb0'+t+'_on.gif';
    }

//Æ÷·³ Á¢±Ù ±ÇÇÑ °æ°í
function aceessDenied1(){
    alert("ºñ°ø°³ Æ÷·³ÀÔ´Ï´Ù.");
}
function aceessDenied2(){
    alert("Á¤È¸¿øÀÌ»ó¸¸ ¿­¶÷ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
}
function aceessDenied3(){
    alert("¿î¿µÁøÀÌ»ó¸¸ ¿­¶÷ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
}
//Æ÷·³ °¡ÀÔÃ¼Å©
function joinDenied1(){
    alert("ÀÌ¹Ì È¸¿ø°¡ÀÔÀÌ µÇ¾î ÀÖ½À´Ï´Ù.");
    history.back();
}
function joinDenied2(){
    alert("½ÂÀÎ´ë±âÁßÀÔ´Ï´Ù.\n½ÂÀÎ ÈÄ »ç¿ëÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.");
    history.back();
}



function MM_swapImgRestore() { //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 MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
 var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
 if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_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 MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function swf_include(swfUrl,swfWidth,swfHeight,bgColor,swfName,access,flashVars){
    // ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
    var flashStr=
    "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+swfWidth+"' height='"+swfHeight+"' id='"+swfName+"' align='middle' >"+
    "<param name='allowScriptAccess' value='"+access+"' />"+
    "<param name='movie' value='"+swfUrl+"' />"+
    "<param name='FlashVars' value='"+flashVars+"' />"+
    //"<param name='loop' value='false' />"+
    "<param name='menu' value='false' />"+
    "<param name='quality' value='high' />"+
    "<param name='scale' value='noscale' />"+
    "<param name='wmode' value='transparent' />"+
    "<param name='bgcolor' value='"+bgColor+"' />"+
    "<embed src='"+swfUrl+"' FlashVars='"+flashVars+"'  wmode='transparent' quality='best' bgcolor='#EEF8FF' width='"+swfWidth+"' height='"+swfHeight+"' name='"+swfName+"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
    "</object>";

    // ÇÃ·¡½Ã ÄÚµå Ãâ·Â
    document.write(flashStr);
};

function get_swf_include(swfUrl,swfWidth,swfHeight,bgColor,swfName,access,flashVars){
    // ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
    var flashStr=
    "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+swfWidth+"' height='"+swfHeight+"' id='"+swfName+"' align='middle' >"+
    "<param name='allowScriptAccess' value='"+access+"' />"+
    "<param name='movie' value='"+swfUrl+"' />"+
    "<param name='FlashVars' value='"+flashVars+"' />"+
    //"<param name='loop' value='false' />"+
    "<param name='menu' value='false' />"+
    "<param name='quality' value='high' />"+
    "<param name='scale' value='noscale' />"+
    "<param name='wmode' value='transparent' />"+
    "<param name='bgcolor' value='"+bgColor+"' />"+
    "<embed src='"+swfUrl+"' FlashVars='"+flashVars+"'  wmode='transparent' quality='best' bgcolor='#EEF8FF' width='"+swfWidth+"' height='"+swfHeight+"' name='"+swfName+"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
    "</object>";

    return flashStr;
};

function siteChange() {
    window.open('','redirect','');
    var f = document.getElementById('siteForm');
    f.target='redirect';
    f.submit();
}



// png24 IE6¿¡¼­ Åõ¸íÁö¿ø ¾ÈµÊ ÇØ°á
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='about:blank;';
return '';
}

/*************************************************************/
/***menu.js***************************************************/
/*************************************************************/
function div_p_view(a){
        try{
                if (a=='1') {
                    document.getElementById("tlmenu01").style.display = "";
                    document.getElementById("tlmenu02").style.display = "none";
                    document.getElementById("tlmenu03").style.display = "none";
                    document.getElementById("tlmenu04").style.display = "none";
                    document.getElementById("tlmenu05").style.display = "none";
                    
                    document.getElementById("tlmenuImg01on").style.display = "";
                    document.getElementById("tlmenuImg01off").style.display = "none";
                    document.getElementById("tlmenuImg02on").style.display = "none";
                    document.getElementById("tlmenuImg02off").style.display = "";
                    document.getElementById("tlmenuImg03on").style.display = "none";
                    document.getElementById("tlmenuImg03off").style.display = "";
                    document.getElementById("tlmenuImg04on").style.display = "none";
                    document.getElementById("tlmenuImg04off").style.display = "";
                    document.getElementById("tlmenuImg05on").style.display = "none";
                    document.getElementById("tlmenuImg05off").style.display = "";
                }else if (a=='2') {
                    document.getElementById("tlmenu01").style.display = "none";
                    document.getElementById("tlmenu02").style.display = "";
                    document.getElementById("tlmenu03").style.display = "none";
                    document.getElementById("tlmenu04").style.display = "none";
                    document.getElementById("tlmenu05").style.display = "none";
                    
                    document.getElementById("tlmenuImg01on").style.display = "none";
                    document.getElementById("tlmenuImg01off").style.display = "";
                    document.getElementById("tlmenuImg02on").style.display = "";
                    document.getElementById("tlmenuImg02off").style.display = "none";
                    document.getElementById("tlmenuImg03on").style.display = "none";
                    document.getElementById("tlmenuImg03off").style.display = "";
                    document.getElementById("tlmenuImg04on").style.display = "none";
                    document.getElementById("tlmenuImg04off").style.display = "";
                    document.getElementById("tlmenuImg05on").style.display = "none";
                    document.getElementById("tlmenuImg05off").style.display = "";
                }else if (a=='3') {
                    document.getElementById("tlmenu01").style.display = "none";
                    document.getElementById("tlmenu02").style.display = "none";
                    document.getElementById("tlmenu03").style.display = "";
                    document.getElementById("tlmenu04").style.display = "none";
                    document.getElementById("tlmenu05").style.display = "none";
                    
                    document.getElementById("tlmenuImg01on").style.display = "none";
                    document.getElementById("tlmenuImg01off").style.display = "";
                    document.getElementById("tlmenuImg02on").style.display = "none";
                    document.getElementById("tlmenuImg02off").style.display = "";
                    document.getElementById("tlmenuImg03on").style.display = "";
                    document.getElementById("tlmenuImg03off").style.display = "none";
                    document.getElementById("tlmenuImg04on").style.display = "none";
                    document.getElementById("tlmenuImg04off").style.display = "";
                    document.getElementById("tlmenuImg05on").style.display = "none";
                    document.getElementById("tlmenuImg05off").style.display = "";
                }else if (a=='4') {
                    document.getElementById("tlmenu01").style.display = "none";
                    document.getElementById("tlmenu02").style.display = "none";
                    document.getElementById("tlmenu03").style.display = "none";
                    document.getElementById("tlmenu04").style.display = "";
                    document.getElementById("tlmenu05").style.display = "none";
                    
                    document.getElementById("tlmenuImg01on").style.display = "none";
                    document.getElementById("tlmenuImg01off").style.display = "";
                    document.getElementById("tlmenuImg02on").style.display = "none";
                    document.getElementById("tlmenuImg02off").style.display = "";
                    document.getElementById("tlmenuImg03on").style.display = "none";
                    document.getElementById("tlmenuImg03off").style.display = "";
                    document.getElementById("tlmenuImg04on").style.display = "";
                    document.getElementById("tlmenuImg04off").style.display = "none";
                    document.getElementById("tlmenuImg05on").style.display = "none";
                    document.getElementById("tlmenuImg05off").style.display = "";
                 }else if (a=='5') {
                    document.getElementById("tlmenu01").style.display = "none";
                    document.getElementById("tlmenu02").style.display = "none";
                    document.getElementById("tlmenu03").style.display = "none";
                    document.getElementById("tlmenu04").style.display = "none";
                    document.getElementById("tlmenu05").style.display = "";
                    
                    document.getElementById("tlmenuImg01on").style.display = "none";
                    document.getElementById("tlmenuImg01off").style.display = "";
                    document.getElementById("tlmenuImg02on").style.display = "none";
                    document.getElementById("tlmenuImg02off").style.display = "";
                    document.getElementById("tlmenuImg03on").style.display = "none";
                    document.getElementById("tlmenuImg03off").style.display = "";
                    document.getElementById("tlmenuImg04on").style.display = "none";
                    document.getElementById("tlmenuImg04off").style.display = "";
                    document.getElementById("tlmenuImg05on").style.display = "";
                    document.getElementById("tlmenuImg05off").style.display = "none";
               
                }
        }catch(e){}
}

/*************************************************************/
/***navigation.js*********************************************/
/*************************************************************/
function initNavigation(seq) {
    var nav = document.getElementById("topmenu");
    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;
            //alert(event.button);
            setTimeout(function () {
                if (nav.isOver == false) {
                    if (nav.menu[seq]) {
                        nav.menu[seq].onmouseover();    
                    } else if(nav.current) {            
                        if( seq != 0)
                        this.current.parentNode.className = this.current.parentNode.className.replace(" over","");                      
                        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) {      
                if( seq !=0)
                nav.current.parentNode.className = nav.current.parentNode.className.replace(" over","");            
                if (nav.current.submenu)                
                    nav.current.submenu.style.display = "none";
                nav.current = null;
            }
            
            if (nav.current != this) {
                if( seq !=0)
        this.submenu.parentNode.className +=" over";            
                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();
}      







/*************************************************************/
/***main_tab*********************************************/
/*************************************************************/

function chg_ntc_tab(idx)
{
	//alert(idx);
	for ( var mg=1; mg <= 4; mg++ )
	{
		var obj1 = document.getElementById('main_notice_list_0' + mg);
		var obj3 = document.getElementsByName("img_ntc0" + mg);

		if ( idx == mg )
		{
			obj3[0].src = "../../img/neo_2009/btnon_" + idx + ".gif";
			obj1.className = "view";
		}else{
			obj3[0].src = "../../img/neo_2009/btnoff_" + mg + ".gif";
			obj1.className = "hid";
		}
	}
}




/* cssÀüÇô ¾øÀ¸¸é */
function styleLinkCheck(){
	var ss = document.styleSheets[0];
	if(ss) return true;
	else return false;
}

// tabList
function tabList(ele, active){
	if(styleLinkCheck() === false) return;
	
	var ele = document.getElementById(ele);
	if(active === undefined) active = 0;						
	
	// tabtit¸¦ Æ÷ÇÔÇÏ´Â Á¦¸ñ ³ëµåµé ¼öÁý 
	var btn = ele.getElementsByTagName("*");
	for(var i=0; i<btn.length; i++){
		if(btn[i].className.indexOf('tabtit') != -1){
			btn = btn[i].nodeName;
			btn = ele.getElementsByTagName(btn);
			break;
		}
	}
	
	// Å¸ÀÌÆ²ÀÇ Å¸°Ù ·¹ÀÌ¾î ÀÌ¸§Áß ¼ýÀÚ¸¸ »« ¿µ¹®¸¸ tab1 Áß tab¸¸
	var layerName = btn[0].getElementsByTagName("A")[0].href.split("#")[1];
	layerName = layerName.slice(0, layerName.length-1);
	
	for(var i=0; i<btn.length; i++){
		ele["target" + i] = document.getElementById(layerName + (i+1)); // ³ëµåÀúÀå ¿¹) tab1, tab2, tab3
		ele["a" + i] = btn[i].getElementsByTagName("A")[0]; // ÅÇ¸µÅ©
		ele["img" + i] = btn[i].getElementsByTagName("IMG")[0]; // ÀÌ¹ÌÁö³ëµå ÀúÀå
		btn[i].style.position = "absolute"; // Á¦¸ñ·¹ÀÌ¾î Àû¿ë
		ele.getElementsByTagName("P")[i].style.position = "absolute"; // ´õº¸±â ·¹ÀÌ¾î
		ele.getElementsByTagName("P")[i].style.marginTop = 0;
	}
	
	/* ÃÊ±â¼¼ÆÃ */
	var oldActive = active;
	for(var i=0; i<btn.length; i++){
		ele["a" + i].cnt = i;
		ele["a" + i].onclick = ele["a" + i].onfocus = function menuActive(){
			ele["target" + oldActive].style.display = "none";
			if(ele["img" + oldActive])
				ele["img" + oldActive].src = ele["img" + oldActive].src.replace("_on", "_off");
			else
				addClass(btn[oldActive], "off");
			ele["target" + this.cnt].style.display = "block";
			
			if(ele["img" + this.cnt])
				ele["img" + this.cnt].src = ele["img" + this.cnt].src.replace("_off", "_on");
			else
				removeClass(btn[this.cnt], "off");
			oldActive = this.cnt;
			return false;
		}
		
		if(active == i) continue; // ÃÊ±â È°¼ºÈ­
		ele["target" + i].style.display = "none";
		if(ele["img" + i])
			ele["img" + i].src = ele["img" + i].src.replace("_on", "_off");
		else
			addClass(btn[i], "off");
	}
}


function div_chg(n){// top menu div hidden 2010-09-30 ¿õ
	for(i=1; i<=7; i++){			
		submenu_num = document.getElementById("submenu_0"+i);
		
		if (i == n)
		{				
			submenu_num.style.display = "block";
		}else{			
			submenu_num.style.display = "none";		
		}		
	}	
	return;
}
