/*********************************************************************************************************
	onload function
**********************************************************************************************************/
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}
/*********************************************************************************************************
	GNB function
**********************************************************************************************************/
function gnbFunc(){
	if(!document.getElementById("gnb")) return false;
	var gnb = document.getElementById("gnb");
	var gnbItem = gnb.getElementsByTagName("li");
 
	for(var i=0; i<gnbItem.length; i++){
		if(gnbItem[i].className.indexOf("On")=="-1"){ //¼­ºêÆäÀÌÁö¿¡¼­ È°¼ºÈ­µÈ ¸Þ´º Á¦¿Ü
			gnbItem[i].onmouseover = function(){ return gnbEvent(this,this.className); }
			gnbItem[i].onmouseout = function(){ return gnbEvent(this,this.className); }
		}
	}
}
function gnbEvent(v,n){
	var vSelf = n.substring(0,6);

	v.className = v.className.replace(n,function(){
		if(n.indexOf("On")>-1) return vSelf;
		else return n+"On";
	});
}
addLoadEvent(gnbFunc);

function gnbMenu(idx){   
	if (idx == "e") return false;
	if(!document.getElementById("gnb")) return false;
	var gnb = document.getElementById("gnb");
	var gnbList = gnb.getElementsByTagName("li");
	
	gnbList[idx-1].className = "item0"+idx+"On";
}
/*********************************************************************************************************
	È­¸é È®´ë Ãà¼Ò
**********************************************************************************************************/
function funcZoom(param){
	if(document.body.style.zoom==null||document.body.style.zoom==""){
		zoomStat = 100;
	}

	if(param=="in"){
		zoomStat = zoomStat + 20;
	} else if(param=="out") {
		zoomStat = zoomStat - 20;
	}

	if(zoomStat > 100){
		//$(".countrySel").css("display","none");
	}

	if(zoomStat > 160){
		zoomStat = 160;
	}

	if(zoomStat < 100){
		zoomStat = 100;
	}

	document.body.style.zoom = zoomStat+"%";
}

/*****************************************************
'°øÅë ÆäÀÌÁö ÀÌµ¿ 
'*****************************************************/
function movePaging(obj1) {
	 location.href=obj1;
}

/*********************************************************************************************************
	[html content] class="contentIndex" anchor style
**********************************************************************************************************/
function contentIndexAnchor(v,n){

    var gIndex = document.getElementById("contentIndex");
    var gIndexLen = gIndex.getElementsByTagName("a")
    var gIndexDivNum = new Array;
    var gCntDiv = new Array;
    for(var i=0; i<gIndexLen.length; i++){
        gIndexLen[i].className = "";
        gIndexDivNum[i] = gIndexLen[i].getAttribute("href");
    }
    v.className = "select";    
    for(var i=0; i<gIndexLen.length; i++){

        gCntDiv[i] = gIndexDivNum[i].substring((gIndexDivNum[i].length - 15),gIndexDivNum[i].length);
        document.getElementById(gCntDiv[i]).style.display = "none";
    }
    document.getElementById(gCntDiv[n-1]).style.display = "block";

    /*
    #contentIndex_01
    #contentIndex_02
    #contentIndex_03
    */
}


/*****************************************************
'ÇÃ·¡½¬
'*****************************************************/
/*ActiveX ÇÃ·¡½¬*/
// id: flash id
// url: source url
// w: source width
// h: source height
// t: wmode (window/transparent/opaque)
function Flash(id,url,w,h,bg,t){
document.write("\
	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width="+w+" height="+h+" id="+id+">\
	<param name='movie' value="+url+" />\
	<param name='wmode' value="+t+" />\
	<param name='bgcolor' value="+bg+" />\
	<param name='allowScriptAccess' value='always' />\
	<param name='quality' value='high' />\
	<param name='menu' value='false' />\
	<embed src="+url+" width="+w+" height="+h+" wmode="+t+" name="+id+" bgcolor="+bg+" allowScriptAccess='always' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
	</object>\
");
}

/*****************************************************
'ÆäÀÌÁö¸µÅ©
'*****************************************************/

function pageLink(num) {
	var temp = document.frm.p_code.value;
	if (num==1) {
		if(temp == "0")  {
			document.frm.action="01_Location.asp";   // Korea
		}
		if(temp == "1")  {
			document.frm.action="01_Location01.asp";	  // Gyung-gi
		}
		if(temp == "2")  {
			document.frm.action="01_Location02.asp"	  // Gang-won
		}
		if(temp == "3")  {
			document.frm.action="01_Location03.asp"	  //Chungcheongbu-do
		}
		if(temp == "4")  {
			document.frm.action="01_Location04.asp"		//Chungcheongnam-do
		}
		if(temp == "5")  {
			document.frm.action="01_Location05.asp"		//Jeollabuk-do
		}
		if(temp == "6")  {
			document.frm.action="01_Location06.asp"		//Jeollanam-do
		}
		if(temp == "7")  {
			document.frm.action="01_Location07.asp"		//Gyeongsangbuk-do
		}
		if(temp == "8")  {
			document.frm.action="01_Location08.asp"		//Gyeongsangbuk-do
		}
		if(temp == "9")  {
			document.frm.action="01_Location09.asp"		//Jeju-island
		}
	
		document.frm.submit();
	}

	else if (num==2) {
		if(temp == "0")  {
			document.frm.action="02_Travel01.asp";   // Changdeokgung
		}
		if(temp == "1")  {
			document.frm.action="02_Travel02.asp";	  // Suwon Hwaseong Fortress
		}
		if(temp == "2")  {
			document.frm.action="02_Travel03.asp"	  // Seokguram Bulguksa
		}
		if(temp == "3")  {
			document.frm.action="02_Travel04.asp"	  //Jongmyo Shrine
		}
		if(temp == "4")  {
			document.frm.action="02_Travel05.asp"		//Jeju Island
		}
		if(temp == "5")  {
			document.frm.action="02_Travel06.asp"		//Heyri Cultural Art Village
		}
		if(temp == "6")  {
			document.frm.action="02_Travel07.asp"		//Hallyeohaesang National Marine Park
		}
		if(temp == "7")  {
			document.frm.action="02_Travel08.asp"		//Seoraksan National Park
		}
		if(temp == "8")  {
			document.frm.action="02_Travel09.asp"		//Blanco Beach
		}
		if(temp == "9")  {
			document.frm.action="02_Travel10.asp"		//Oe Botania (Marine Botanical Garden)
		}
		if(temp == "10")  {
			document.frm.action="02_Travel11.asp"		//Jeonju Hanok Village
		}
		if(temp == "11")  {
			document.frm.action="02_Travel12.asp"		//Onyang Hot Springs
		}
		if(temp == "12")  {
			document.frm.action="02_Travel13.asp"		//Gyeongbokgung Palace
		}
		if(temp == "13")  {
			document.frm.action="02_Travel14.asp"		//Nami Island 
		}
		if(temp == "14")  {
			document.frm.action="02_Travel15.asp"		//Namsangol Hanok Village
		}
		if(temp == "15")  {
			document.frm.action="02_Travel16.asp"		//N Seoul Tower
		}
		if(temp == "16")  {
			document.frm.action="02_Travel17.asp"		//Bosung Green Tea Field
		}
		document.frm.submit();
	}

	else if (num==3) {
		if(temp == "0")  {
			document.frm.action="03_Culture01.asp";   // Language (Hangeul)
		}
		if(temp == "1")  {
			document.frm.action="03_Culture02.asp";	  // Religion
		}
		if(temp == "2")  {
			document.frm.action="03_Culture03.asp"	  // Traditional Arts(Music, Dance)
		}
		if(temp == "3")  {
			document.frm.action="03_Culture04.asp"	  //Traditional Arts(Painting, Crafts)
		}
		if(temp == "4")  {
			document.frm.action="03_Culture05.asp"		//Traditional Garment(Hanbok)
		}
		if(temp == "5")  {
			document.frm.action="03_Culture06.asp"		//Traditional Cuisine
		}
		if(temp == "6")  {
			document.frm.action="03_Culture07.asp"		//Cultural Difference
		}
		if(temp == "7")  {
			document.frm.action="03_Culture08.asp"		//Invitation Culture
		}
		if(temp == "8")  {
			document.frm.action="03_Culture09.asp"		//Drinking Culture
		}
		if(temp == "9")  {
			document.frm.action="03_Culture10.asp"		//Dining Culture
		}
		if(temp == "10")  {
			document.frm.action="03_Culture11.asp"		//Pansori (a traditional Korean narrative song)
		}
		if(temp == "11")  {
			document.frm.action="03_Culture12.asp"		//Traditional Musical Instruments
		}
		if(temp == "12")  {
			document.frm.action="03_Culture13.asp"		//Taekkyon
		}
		if(temp == "13")  {
			document.frm.action="03_Culture14.asp"		//Game of Yut
		}
		if(temp == "14")  {
			document.frm.action="03_Culture15.asp"		//Jongmyojeryeak(or Royal Ancestral Rites Music)
		}
		if(temp == "15")  {
			document.frm.action="03_Culture16.asp"		//Yangjubeolsandaenori
		}
		if(temp == "16")  {
			document.frm.action="03_Culture17.asp"		//Tightrope Walking
		}
		document.frm.submit();
	}
}


