function setNavigation(nMenu){
	var flash_url="http://static.hangame.com/public/pristontale/";
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="730" HEIGHT="184" id="Untitled-1" ALIGN="">');
	document.write('<PARAM NAME=movie VALUE="'+flash_url+'navigation_'+nMenu+'re.swf"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> ');
	document.write('<EMBED src="'+flash_url+'navigation_'+nMenu+'re.swf" menu=false quality=high bgcolor=#FFFFFF  WIDTH="730" HEIGHT="184" NAME="Untitled-1" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	document.write('</OBJECT>');

//	if (nMenu==0) nMenu="";
//	else nMenu="_"+nMenu;
//	document.write('<Object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="730" HEIGHT="184" id="Untitled-1" ALIGN="">');
//	document.write('<PARAM NAME=movie VALUE="'+flash_url+'navigation'+nMenu+'.swf"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> ');
//	document.write('<EMBED src="'+flash_url+'navigation'+nMenu+'.swf" menu=false quality=high bgcolor=#FFFFFF  WIDTH="730" HEIGHT="184" NAME="Untitled-1" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
//	document.write('</Object>');

}



//¸Þ´º¼³Á¤
function go_page(main,sub){
    var filename  ;
    filename=""

    if((main== -1 ) && (sub== 1 )){
        go_game()
        return ;
    }
    
    if(main==100){
        top.location.href="http://hangame.com";
        return true;
    }

    if (main == -1 ){
        switch(sub){
            case 0 :        filename = "/index.asp" ;                               break ;
        } 
    }else if (main== 0 ){
        switch(sub){
            case -1 :       filename = "/introduction/peculiarity.htm" ;            break ;
            case 0 :        filename = "/introduction/peculiarity.htm" ;            break ;
            case 1 :        filename = "/introduction/system_1.htm" ;               break ;
            case 2 :        filename = "/introduction/notice.htm" ;                 break ;
            case 3 :        filename = "/introduction/update.htm" ;                 break ;
        } 
    }else if (main== 1 ){
        switch(sub){
            case -1 :       filename = "/guide/junior_guide_1.htm" ;                break ;
            case 0 :        filename = "/guide/junior_guide_1.htm" ;                break ;
            case 1 :        filename = "/guide/intermediate_guide_1.htm" ;          break ;
            case 2 :        filename = "/guide/character_1.htm" ;                   break ;
            case 3 :        filename = "/guide/monster_1.htm" ;                     break ;
            case 4 :        filename = "/guide/item_1_1.htm" ;                      break ;
            case 5 :        filename = "/guide/skill_1.htm" ;                       break ;
            case 6 :        filename = "/guide/map_1.htm" ;                         break ;
        }
    }else if (main== 2 ){
        switch(sub){
            case -1 :       filename = "/download/client.htm" ;                     break ;
            case 0 :        filename = "/download/client.htm" ;                     break ;
            case 1 :        filename = "/download/driver.htm" ;                     break ;
        } 
    }else if (main== 3 ){
        switch(sub){
            case -1 :       filename = "/gallery/movie.htm" ;                       break ;
            case 0 :        filename = "/gallery/movie.htm" ;                       break ;
            case 1 :        filename = "/gallery/screenshot.htm" ;                  break ;
            case 2 :        filename = "/gallery/wallpaper.htm" ;                   break ;
        } 
    }else if (main== 4 ){
        switch(sub){
            case -1 :       filename = "/community/free.htm" ;                      break ;
            case 0 :        filename = "/community/free.htm" ;                      break ;
            case 1 :        filename = "/community/quastion.htm" ;                  break ;
            case 2 :        filename = "/community/screen.htm" ;                    break ;
            case 3 :        filename = "/community/weekly_pristontale.htm" ;        break ;
            case 4 :        filename = "/community/event.htm" ;                     break ;
        } 
    }else if (main== 5 ){
        switch(sub){
            case -1 :       filename = "/guild/guild.htm" ;                         break ;
            case 0 :        filename = "/guild/guild.htm" ;                         break ;
            case 1 :        filename = "/guild/guild_make.htm" ;                    break ;
        } 
    }else if (main== 6 ){//°í°´¼¾ÅÍ
        switch(sub){
            case -1 :       filename = "/support/customer.htm" ;                    break ;
            case 0 :        filename = "/support/customer.htm" ;                    break ;
            case 1 :        filename = "/support/bug_report.htm" ;                  break ;
//            case 1 :        filename = "/support/faq.htm" ;                       break ;
        } 
	}else if (main== 7 ){//¿ä±Ý/°áÁ¦
        switch(sub){
            case -1 :       filename = "/payment/pay.htm" ;       					break ;
            case 0 :        filename = "/payment/pay.htm" ;       					break ;
            case 1 :        filename = "http://hangamepcbang.pristontale.com" ;     
            				top.location.href=filename;
            				filename=""
            				break ;
            case 2 :        filename = "/payment/pay.htm?page=1" ;       		break ;
        } 
    }

    if (filename!="") location.href = filename ;

}





//°ÔÀÓ½ÃÀÛÇÏ±â
function go_game(){
	if (login_check() ){
		var ispop = window.open('/event/popup/gamepop.htm','','')	// °ÔÀÓ ·±ÃÄ ÆË¾÷
		if (ispop != null)
			goRoom(0,'PSTALE'); // °ÔÀÓ½ÃÀÛ :: 2005³â 4¿ù 14ÀÏ ¿äÃ»¿¡ ÀÇÇÑ ¼öÁ¤
			
			// ÀÌÀü Ã³¸®
			// location.href="hangame://"+GSTRAPPURL+"/?gtype=EXGM001&k22e=PSTALE&lang=KOREAN&k3e=" + getCookie(CK_MEMBERID) +"&kpw=" + getCookie(CK_PASSWORD) +"&k37e=" + getCookie(CK_LASTDATE)  
			// hanstarter¿¡¼­ ±âº» ÆÄ¶ó¹ÌÅÍ ÀÌ¿Ü¿¡ °ÔÀÓ¼­¹ö ¸ñ·ÏÀ» º¸¿©ÁÖ´Â url¸¦ ÇÏ³ª´õ ³Ñ°ÜÁØ´Ù. 
			// ÂüÁ¶ url : http://haninfo.pristontale.com/pstale/launch.asp (ÃÖ½Å)
			//            http://pristontale.hangame.com/info/launch.asp   (ÀÌÀü)

	}
}






function login_check(){

	// betalogin = "http://ids.hangame.com"						// OLD ¿øº» ( ÇöÁ¦ °­Á¦ÇÒ´çÁß test )
	// betalogin = "http://alphaweb-ids.hangame.com"				// º¯°æ
	// betalogin º¯¼ö --> definecode.js ÆÄÀÏ¿¡ ÀÖ½À´Ï´Ù.
	
	if ( getCookie(CK_MEMBERID) =="" || getCookie(CK_PASSWORD)==""  ){
		alert("ÇÑ°ÔÀÓ ¾ÆÀÌµð·Î ·Î±×ÀÎ ÇØÁÖ½Ê½Ã¿À") ;
		//location.href=betalogin+"/wlogin.asp?nxturl="+location.href;//±Û·Î¹ø Àü¹öÀü
		location.href=betalogin+"/login.nhn?nxturl="+location.href;//±Û·Î¹ø Àü¹öÀü
		return false;
	}
	return true;
}






function grade_check(){
	if ( getCookie(CK_USERGRADE)<3 ) { alert("ÁØÈ¸¿ø");top.detail.location.href="/index.asp";
	}
}

function SearchPCBang()
{
 	window.open('http://kr.pristontale.com/Home/Popup/SearchPCBang.aspx','beta','height=100,scrollbars=1, resizable=0,width=100,top=50,left=50');
}
