﻿//Web Function Menu
function Fun_Web_GoMenu(menuNo){
	
	var go = window.top.document.location;

	
	if (menuNo == "00000") {go.href = WebHttp + "/";}
	
	if (menuNo == "00001") {go.href = WebHttps + "/Login/Login.html";}
	if (menuNo == "00002") {go.href = WebHttps + "/Login/LogOut.html";}
		
	if (menuNo == "01010") {go.href = ThisUrl + "/GameInfo/General.html";}
	if (menuNo == "01020") {go.href = ThisUrl + "/GameInfo/History.html";}
	if (menuNo == "01030") {go.href = ThisUrl + "/GameInfo/Character_Human.html";}
	if (menuNo == "01031") {go.href = ThisUrl + "/GameInfo/Character_Elf.html";}
	if (menuNo == "01032") {go.href = ThisUrl + "/GameInfo/Character_HalfElf.html";}
	if (menuNo == "01033") {go.href = ThisUrl + "/GameInfo/Character_Dekan.html";}
	if (menuNo == "01034") {go.href = ThisUrl + "/GameInfo/Character_Dhan.html";}
	if (menuNo == "01035") {go.href = ThisUrl + "/GameInfo/Character_DarkElf.html";}
	if (menuNo == "01040") {go.href = ThisUrl + "/GameInfo/WorldMap.html";}
	
	if (menuNo == "01050") {go.href = ThisUrl + "/GameInfo/Dellagos.html";}
	if (menuNo == "01051") {go.href = ThisUrl + "/GameInfo/ViaMarea.html";}
	if (menuNo == "01052") {go.href = ThisUrl + "/GameInfo/Morrisen.html";}
	if (menuNo == "01053") {go.href = ThisUrl + "/GameInfo/Armenes.html";}
	if (menuNo == "01054") {go.href = ThisUrl + "/GameInfo/Bahran.html";}
	if (menuNo == "01055") {go.href = ThisUrl + "/GameInfo/Ignis.html";}

	if (menuNo == "02010") {go.href = ThisUrl + "/GameGuide/System.html";}
	if (menuNo == "02011") {go.href = ThisUrl + "/GameGuide/Install.html";}
	if (menuNo == "02012") {go.href = ThisUrl + "/GameGuide/Character.html";}
	if (menuNo == "02013") {go.href = ThisUrl + "/GameGuide/Interface.html";}
	
	if (menuNo == "02020") {go.href = ThisUrl + "/GameGuide/LevelUp.html";}
	if (menuNo == "02021") {go.href = ThisUrl + "/GameGuide/Armor.html";}
	if (menuNo == "02022") {go.href = ThisUrl + "/GameGuide/Bindstone.html";}
	if (menuNo == "02023") {go.href = ThisUrl + "/GameGuide/Merchant.html";}
	if (menuNo == "02024") {go.href = ThisUrl + "/GameGuide/TreasureBox.html";}
	if (menuNo == "02025") {go.href = ThisUrl + "/GameGuide/Trading.html";}


	if (menuNo == "02030") {go.href = ThisUrl + "/GameGuide/Hunting.html";}
	if (menuNo == "02031") {go.href = ThisUrl + "/GameGuide/Party.html";}
	if (menuNo == "02032") {go.href = ThisUrl + "/GameGuide/Items.html";}
	if (menuNo == "02033") {go.href = ThisUrl + "/GameGuide/Death.html";}

	
	
	if (menuNo == "02040") {go.href = ThisUrl + "/GameGuide/Mounts.html";}
	if (menuNo == "02050") {go.href = ThisUrl + "/GameGuide/Pets.html";}
	if (menuNo == "02060") {go.href = ThisUrl + "/GameGuide/Skills.html";}
	
	if (menuNo == "02070") {go.href = ThisUrl + "/GameGuide/Pvp.html";}
	if (menuNo == "02071") {go.href = ThisUrl + "/GameGuide/Township.html";}
	if (menuNo == "02072") {go.href = ThisUrl + "/GameGuide/Guilds.html";}
	if (menuNo == "02073") {go.href = ThisUrl + "/GameGuide/Forge.html";}
	if (menuNo == "02074") {go.href = ThisUrl + "/GameGuide/Refine.html";}
	if (menuNo == "02075") {go.href = ThisUrl + "/GameGuide/Reset.html";}
	if (menuNo == "02076") {go.href = ThisUrl + "/GameGuide/Economy.html";}
	if (menuNo == "02077") {go.href = ThisUrl + "/GameGuide/Style.html";}
	if (menuNo == "02078") {go.href = ThisUrl + "/GameGuide/Kill.html";}
	if (menuNo == "02079") {go.href = ThisUrl + "/GameGuide/Mini.html";}

	
	
	
	
	if (menuNo == "03010") {go.href = ThisUrl + "/Guild/Guild.html";}
	
	//trade center
	if (menuNo == "04010") {go.href = ShopUrl;}
	//if (menuNo == "04010") {go.href = ThisUrl + "/Trading/Trading.html";}
	
		
	if (menuNo == "05010") {go.href = ThisUrl + "/DownLoad/Client.html";}
	if (menuNo == "05011") {alert('coming soon');}
	if (menuNo == "05012") {alert('coming soon');}
	if (menuNo == "05013") {alert('coming soon');}
	//if (menuNo == "05011") {go.href = ThisUrl + "/DownLoad/Wallpapers.html";}
	//if (menuNo == "05012") {go.href = ThisUrl + "/DownLoad/Movies.html";}
	//if (menuNo == "05013") {go.href = ThisUrl + "/DownLoad/Fansite.html";}
		
	
	if (menuNo == "06010") {
		if (strID=="" )
		{
		alert('Please Login');
		go.href = WebHttps + "/Login/Login.html";
		}
		else
		{
		go.href = WebHttps + "/Member/VerifyAccount.html";	
		}
		
	}
	
	if (menuNo == "07010") {go.href = ThisUrl + "/Help/Help.html";}
	
	
	if (menuNo == "08010") {go.href = WebHttp + "/forum_action.asp";}
	
	//member
	if (menuNo == "09010") {go.href = WebHttps + "/Member/VerifyAccount.html";}
	if (menuNo == "09020") {go.href = WebHttps + "/Member/Registration.html";}
	
	
	
}



// flash 
// 2008-04-25 jang youngho
// 플래쉬 불러오기
function callFlash(flashURL,flashVALUE, flashWIDTH, flashHEIGHT)
{
	document.writeln ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" WIDTH=100% HEIGHT=100%>');
	document.writeln ('<PARAM NAME=movie VALUE="'+flashURL+'">');
	document.writeln ('<PARAM NAME=FlashVars VALUE="'+flashVALUE+'">');
	document.writeln ('<PARAM NAME=wmode VALUE=transparent>');
	document.writeln ('<PARAM NAME=loop VALUE=true>');
	document.writeln ('<PARAM NAME=quality VALUE=high>');
	document.writeln ('<PARAM NAME=base VALUE=.>');
	document.writeln ('<PARAM NAME=allowScriptAccess VALUE=always>');
	document.writeln ('<EMBED base="."  src='+flashURL+' flashvars='+flashVALUE+' loop=true wmode=transparent quality=high swLiveConnect=FALSE WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
	document.writeln ('</OBJECT>');
}

//menu script
// 2008-04-25 jang youngho
function Fun_GoMenu(menuNo){
	
	var go = window.top.document.location;

	//go rohan(official site)
	if (menuNo == "goRohan") {go.href = WebHttp;}
	//Create an account
	if (menuNo == "create") {go.href = WebHttps + "/Member/Registration.html";}
	//login
    if (menuNo == "login") {     document.all.shoplogin.style.display= "";    }
    
    if (menuNo == "login_dis") {     document.all.shoplogin.style.display= "none";    }
	//logout
	if (menuNo == "logout") {go.href = ThisUrl + "/Login/Logout.html";}
	//my account
	if (menuNo == "myAccount") {go.href = WebHttps + "/Member/VerifyAccount.html";}
	//trading center home
	if (menuNo == "goHome") {go.href = ThisUrl;}

	//item mall
	if (menuNo == "1_1_1") {go.href = ThisUrl + "/ItemMall/ItemMall.html";}
	if (menuNo == "1_2_1") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=0";}
	if (menuNo == "1_2_2") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=1";}
	if (menuNo == "1_2_3") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=2";}
	if (menuNo == "1_2_4") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=3";}
	if (menuNo == "1_2_5") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=4";}
	if (menuNo == "1_2_6") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=5";}
	if (menuNo == "1_2_7") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=6";}
	if (menuNo == "1_2_8") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=7";}
	if (menuNo == "1_2_9") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=8";}
	if (menuNo == "1_2_10") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=9";}
	if (menuNo == "1_2_14") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=10";}
	if (menuNo == "1_2_15") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=11";}
	if (menuNo == "1_2_11") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=12";}
	if (menuNo == "1_2_12") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=13";}
	if (menuNo == "1_2_13") {go.href = ThisUrl + "/ItemMall/ItemList.html?ItemListType=14";}
   
    //if (menuNo == "1_3_1") {	alert('Coming Soon'); return false;}
   // if (menuNo == "1_3_2") {	alert('Coming Soon'); return false;}
    if (menuNo == "1_3_1") {go.href = ThisUrl + "/Gachapon/BigFive/BigFive.html";}
    if (menuNo == "1_3_2") {go.href = ThisUrl + "/Gachapon/Lotto/Lotto.html";}
    if (menuNo == "1_3_3") {go.href = ThisUrl + "/Gachapon/Lucky/Lucky.html";}
    
    if (menuNo == "1_4_1") {go.href = ThisUrl + "/ItemMall/WhatMall.html";}

	//exchange market
	if (menuNo == "2_1_1") {go.href = ThisUrl + "/Exchange/Exchange.html";}
    if (menuNo == "2_2_1") {go.href = ThisUrl + "/Exchange/Buy.html";}
	if (menuNo == "2_2_2") {go.href = ThisUrl + "/Exchange/Item_Sale_List.html";}
	if (menuNo == "2_2_3") {go.href = ThisUrl + "/Exchange/Cron_Sale_List.html";}
	if (menuNo == "2_2_4") {go.href = ThisUrl + "/Exchange/Character_Sale_List.html";}
	if (menuNo == "2_3_1") {go.href = ThisUrl + "/Exchange/Sell.html";}
	if (menuNo == "2_4_1") {go.href = ThisUrl + "/Exchange/WhatEx.html";}
	if (menuNo == "2_5_1") {go.href = ThisUrl + "/Exchange/WhatEx.html";}
	
	
	//if (menuNo == "2_1_1") {	alert('Coming Soon'); return false;}
	//if (menuNo == "2_2_1") {	alert('Coming Soon'); return false;}
	//if (menuNo == "2_2_2") {	alert('Coming Soon'); return false;}
	//if (menuNo == "2_2_3") {	alert('Coming Soon'); return false;}
	//if (menuNo == "2_2_4") {	alert('Coming Soon'); return false;}
	//if (menuNo == "2_3_1") {	alert('Coming Soon'); return false;}
	//if (menuNo == "2_4_1") {	alert('Coming Soon'); return false;}
	//if (menuNo == "2_5_1") {	alert('Coming Soon'); return false;}

	
	
	
	
	
	
	
	//special services
	if (menuNo == "3_1_1") {go.href = ThisUrl + "/Special/Special.html";}
    if (menuNo == "3_2_1") {go.href = ThisUrl + "/Special/NameChange.html";}
	if (menuNo == "3_2_2") {go.href = ThisUrl + "/Special/SexChange.html";}
	if (menuNo == "3_3_1") {go.href = ThisUrl + "/Special/WhatSp.html";}
	
	////if (menuNo == "3_1_1") {	alert('Coming Soon'); return false;}
	//if (menuNo == "3_2_1") {	alert('Coming Soon'); return false;}
	//if (menuNo == "3_2_2") {	alert('Coming Soon'); return false;}
	//if (menuNo == "3_3_1") {	alert('Coming Soon'); return false;}

	
	

	//rohan point
	if (menuNo == "4_1_1") {go.href = ThisUrl + "/RohanPoint/RohanPoint.html";}
	if (menuNo == "4_2_1") {go.href = ThisUrl + "/RohanPoint/AddRp.html";}
	if (menuNo == "4_3_1") {go.href = ThisUrl + "/RohanPoint/WhatRp.html";}
	
	//Mytrade
	if (menuNo == "5_1_1") {go.href = ThisUrl + "/MyTrade/MyTrade.html";}
	if (menuNo == "5_2_1") {go.href = ThisUrl + "/MyTrade/Cart.html";}
	if (menuNo == "5_3_1") {go.href = ThisUrl + "/MyTrade/WishList.html";}
	if (menuNo == "5_3_2") {go.href = ThisUrl + "/MyTrade/SellingList.html";}
	if (menuNo == "5_3_3") {go.href = ThisUrl + "/MyTrade/ShopingList.html";}
	if (menuNo == "5_3_4") {go.href = ThisUrl + "/MyTrade/SpecialList.html";}
	
	

	//if (menuNo == "5_3_5") {	alert('Coming Soon'); return false;}
	if (menuNo == "5_3_5") {go.href = ThisUrl + "/MyTrade/BigFive_MyList.html";}

	if (menuNo == "5_3_6") {go.href = ThisUrl + "/MyTrade/BigCoin_MyList.html";}
	
	//if (menuNo == "5_3_7") {	alert('Coming Soon'); return false;}
	if (menuNo == "5_3_7") {go.href = ThisUrl + "/MyTrade/BigTicket_MyList.html";}
	


	if (menuNo == "5_4_1") {go.href = ThisUrl + "/MyTrade/Messages.html";}
	//if (menuNo == "5_4_1") {	alert('Coming Soon'); return false;}
	if (menuNo == "5_5_1") {go.href = ThisUrl + "/MyTrade/SealList.html";}
	//if (menuNo == "5_5_1") {	alert('Coming Soon'); return false;}
	
	
	
	
	
	
	if (menuNo == "5_6_1") {go.href = ThisUrl + "/MyTrade/Rp.html";}
	if (menuNo == "5_7_1") {go.href = ThisUrl + "/MyTrade/MemberShip.html";}
	if (menuNo == "5_8_1") {go.href = ThisUrl + "/MyTrade/Coupon.html";}
	
	
	//Help
	if (menuNo == "6_1_1") {go.href = ThisUrl + "/Help/Help.html";}
	
	//itemMall		  	/ItemMall/ItemMall.html
	//itemist		  	/ItemMall/ItemList.html	
	//what is mall		/ItemMall/WhatMall.html	
	
	//Exchange			/Exchange/Exchange.html
	//buy				/Exchange/Buy.html
	//sell				/Exchange/Sell.html
	//what exchange		/Exchange/WhatEx.html
	
	//Special			/Special/Special.html
	//name change		/Special/NameChange.html
	//sex change		/Special/SexChange.html
	//whatSpecial		/Special/WhatSp.html
	
	
	
	//rohanpoint home 	/RohanPoint/RohanPoint.html
	//Add Rohan point 	/RohanPoint/AddRp.html
	//whatrohan point 	/RohanPoint/WhatRp.html
	
	
	//Mytrade			/MyTrade/MyTrade.html
	//Cart Name			/MyTrade/CartName.html
	//Cart Sex			/MyTrade/CartSex.html
	//MyList			/MyTrade/MyList.html
	//Messages			/MyTrade/Messages.html
	//SealList			/MyTrade/SealList.html
	//Rp				/MyTrade/Rp.html
	//Rp				/MyTrade/Coupon.html
	
	
	//Help				/Help/Help.html
	//AddRp				/Help/AddRp.html
	//What Rp			/Help/WhatRp.html
}


//null check
function Fun_TextNull_Check(a,b)
{
	if(a.value == "")
	{
		alert(b);
		a.focus();

		
		return true;
	}
	else
	{
		
		return false;
	}
}


//special character check
function intcheckTF(sval){
	var i = 0;
	for(m=0;m<sval.length;m++){
		if((sval.charCodeAt(m)==37)){i++;}
		if((sval.charCodeAt(m)==39)){i++;}
		if((sval.charCodeAt(m)==59)){i++;}
		if((sval.charCodeAt(m)==61)){i++;}
	}
	if ( i > 0 ){	return true	;}
	else{	return false	;}

}





/* gif, jpg check */
function validImageExt(filename) {
	filename = filename.toLowerCase();
	if(filename.match(".gif")!=null || filename.match(".jpg")!=null) return true;
	else return false;
}

/*not logi nalert */
function LoginAl()
{
	alert('Please Login');

}

/*digit check */
/*keypress*/
function gNumCheck()
{
    event.returnValue=false;
    if (event.keyCode == 8) event.returnValue=true;            
    
    if(event.keyCode >= 48 && event.keyCode <= 57) event.returnValue=true;
}


/*keyup */
function gNumCheck2(frm)
{
	
	event.returnValue=false;
    if (event.keyCode == 8) event.returnValue=true;            
    
    if(event.keyCode >= 48 && event.keyCode <= 57) event.returnValue=true;
    
    if (event.returnValue==false)
    {
    frm.value='';
    }
    
    
}

function CheckLength(input,len) 
  {
     var byteLength = 0;
     for (var inx = 0; inx < input.length; inx++) {
       var oneChar = escape(input.charAt(inx));
       if ( oneChar.length == 1 ) {
     byteLength ++;
    } else if (oneChar.indexOf("%u") != -1) {
         byteLength += 2;
    } else if (oneChar.indexOf("%") != -1) {
          byteLength += oneChar.length/3;
    }
   }     
   if(byteLength <= len) return true;
   else false;  
  } 

function MoneySwap(mValue)
 {
  var temp_str = String(mValue);
  
  if (temp_str.length > 3)
  {
  	  
	  for(var i = 0 , retValue = String() , stop = temp_str.length; i < stop ; i++)
	  {
	   retValue = ((i%3) == 0) && i != 0 ? temp_str.charAt((stop - i) -1) + "," + retValue : temp_str.charAt((stop - i) -1) + retValue;
	  }
  }
  else
  {
  retValue=mValue;
  }
  
  
  
  //alert(retValue);
  return retValue;
 }
 
 
 
 
 