


function CheckLogin(uid){
    
	if(uid == ''){
		if(confirm("·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ¼­ºñ½ºÀÔ´Ï´Ù. ·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")){
			document.location.href = ma9_Login_Url + escape(document.URL);
		}
	}
}

//±¸¸ÅÃ¢¿¡¼­ ±¸¸Å¹öÆ° ´©¸¦¶§..
function btnbuy(uid,mycash) {

	if(uid == ""){
		CheckLogin('');
		return;
	}
	if (eval(mycash) < eval(document.frm.Amtsel.value.split("|")[1]))
	{
		 
		if(confirm("Ä³½¬°¡ ºÎÁ·ÇÕ´Ï´Ù. \nÄ³½¬¸¦ ÃæÀü ÇÏ½Ã°Ú½À´Ï±î?"))
		{
		    if (ma9_Site == "paran" ) {
		        pop_cashcharging(false);
		    }
		    else if ( ma9_Site == "hangame" ) {
		        pop_cashcharging_hangame(false);
		    }
		}
	}
   	else
	{
		if(confirm("¾ÆÀÌÅÛÀ» ±¸¸ÅÇÏ½Ã°Ú½À´Ï±î?"))
    	{
		  document.all.item('cashing').style.display = '';
		  document.all.item('cashbut').style.display = 'none';
		  document.frm.action = "buyItemExec.asp?gubu=By";
		  document.frm.target="ExeFrame";
		  document.frm.submit();
		}
	}
}


//¼±¹°Ã¢¿¡¼­ ¼±¹°¹öÆ° ´©¸¦¶§..
function btngift(uid,mycash) {
    
	if(uid == ""){
		CheckLogin('');
		return;
	}
	
	if(!check_space(document.frm.txtGiftID.value)){
		alert("¼±¹° ¹ÞÀ» À¯ÀúÀÇ ÆÀ¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä");
		document.frm.txtGiftID.focus();	
		return;
	}
	
	//if(!check_space(document.frm.txtjumin.value)){
	//	alert("ÁÖ¹Î¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
	//	document.frm.txtjumin.focus();	
	//	return ;
	//}
	
	if (document.frm.teamcf.value=="0")
	{
	  alert("¼±¹° ¹ÞÀ» À¯ÀúÀÇ ÆÀ¸íÀÌ È®ÀÎÀÌ ¾ÈµÇ¾ú°Å³ª ÆÀ¸íÀÌ ¾ø½À´Ï´Ù.");
      document.frm.txtGiftID.focus();
	  return;
	}	
	if (document.frm.cfmteam.value != document.frm.txtGiftID.value)
	{
	  
	  alert("È®ÀÎµÈ ÆÀ¸í°ú ÇöÀç ÀÔ·ÂÇÑ ÆÀ¸íÀÌ ´Ù¸¨´Ï´Ù.");
      document.frm.txtGiftID.focus();
	  return;
	}	
	
	else
	{
		if (eval(mycash) < eval(document.frm.Amtsel.value.split("|")[1]))
		{
			if(confirm("Ä³½¬°¡ ºÎÁ·ÇÕ´Ï´Ù. \nÄ³½¬¸¦ ÃæÀü ÇÏ½Ã°Ú½À´Ï±î?"))

			{
			    if (ma9_Site == "paran" ) {
		            pop_cashcharging(false);
		        }
		        else if ( ma9_Site == "hangame" ) {
		            pop_cashcharging_hangame(false);
		        }
			}
		}
		else
		{
			if(confirm("¾ÆÀÌÅÛÀ» ¼±¹°ÇÏ½Ã°Ú½À´Ï±î?"))
			{
			  document.all.item('cashing').style.display = '';
		      document.all.item('cashbut').style.display = 'none';
			  document.frm.action = "buyItemExec.asp?gubu=Gf";
			  document.frm.target="ExeFrame";
			  document.frm.submit();
			}
		}
    }


}
//¼±¹°Ã¢¿¡¼­ ¼±¹° ¹ÞÀ» ¾ÆÀÌµð È®ÀÎÇÏ±â
function teamconf() {

	
	if(!check_space(document.frm.txtGiftID.value)){
		alert("¼±¹° ¹ÞÀ» À¯ÀúÀÇ ÆÀ¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		document.frm.txtGiftID.focus();	
		return;
	}
	
	
	else
	{	
			  
			  document.frm.action = "teamconfexec.asp";
			  document.frm.target="TeamCon";
			  document.frm.submit();			
	
    }
}
//±¸¸ÅÃ¢¿¡¼­ ¼±¹°¹öÆ° ´©¸¦¶§..(¼±¹°ÆäÀÌÁö·Î ÀÌµ¿)
function giftCfm(uid,mycash,p_itemcode) {

	if(uid == ""){
		CheckLogin('');
		return;
	}
	
   /*
	if (eval(mycash) < eval(document.frm.Amtsel.value.split("|")[1]))
	{
		  if(confirm("ÆÄ¶õ Ä³½¬°¡ ºÎÁ·ÇÕ´Ï´Ù. \nÄ³½¬¸¦ ÃæÀü ÇÏ½Ã°Ú½À´Ï±î?"))

		{
		  alert('Ä³½ÃÃ¢À¸·Î ÀÌµ¿');
		  //location.href=""

		}
	}
	*/
	else
	{
    
	   location.href = ma9url + "/item/giftCfm.asp?itemcode="+p_itemcode;	 
	   windowResizeBy(400, 480, true);
	}

}

//±¸¸ÅÃ¢ ÆË¾÷
function buyinfo(p_itemcode) {

	if(typeof(buyinfo_G)=="function") {
		buyinfo_G(p_itemcode);
	}
	else {
		openWinW(ma9url + "/item/buycfm.asp?itemcode="+p_itemcode, "buyitem", "400", "350", "", "", "0", "0");
	}
   
}
//¼±¹°Ã¢ ÆË¾÷
function giftinfo(p_itemcode) {

	if(typeof(giftinfo_G)=="function") {
		giftinfo_G(p_itemcode);
	}
	else {
		openWinW(ma9url + "/item/giftCfm.asp?itemcode="+p_itemcode, "buyinfo", "400", "480", "", "", "0", "0");
	}
   
}
//»ó¼¼º¸±â ÆË¾÷
function detailinfo(p_itemcode) {
	//openWin(url, w, h)
	
	//openWin(ma9url + "/item/itemCfm.asp?itemcode="+p_itemcode,400,255);
	openWinW(ma9url + "/item/itemCfm.asp?itemcode="+p_itemcode, "detail", "400", "255", "", "", "0", "0");
	
	//openWinN(ma9url + "/item/buycfm.asp?itemcode="+p_itemcode,"buyinfo",400,350,false);
   
}
//ÂòÃ³¸®
function btnzzim(p_itemcode,p_itemprice) {

	if(typeof(btnzzim_G)=="function") {
		btnzzim_G(p_itemcode,p_itemprice);
	}
	else {
		if(confirm("ÇØ´ç ¾ÆÀÌÅÛÀ» ÂòÇÏ½Ã°Ú½À´Ï±î?"))

		{
		document.frm.action = "itemZzimExec.asp?itemcode="+p_itemcode+"&itemprice="+p_itemprice;
		document.frm.target="ExeFrame";
		document.frm.submit();
		}
	}
	


}
//°øÁöÃ¢ ÆË¾÷
function notice(p_reqseq) {
	
    
	openWinW(ma9url + "/item/buyNotice.asp?reqseq="+p_reqseq, "noticeinfo", "400", "300", "", "", "0", "0");
   
}

//opener ÀÌµ¿
function openerURL(p_URL) {
	
	opener.location.href= ma9url + "/item/"+p_URL;
	window.close();	
	
}
//opener ÀÌµ¿
function openerPURL(p_URL) {
	
	opener.parent.location.href= ma9url + "/item/"+p_URL;
	window.close();	
	
}



function cash(mycash) {
	
	
	if (mycash == '')
	{
	   mycash = 0
	} 
	
   
   
   if (eval(mycash) < eval(document.frm.Amtsel.value.split("|")[1]))
	{
    
	
	 document.all.item('cash').style.display = ''
	 
    }
   else
	{
	document.all.item('cash').style.display = 'none'
	 
	}

}

function pop_cashcharging()
{
	//CheckLogin('');
	var argv	= pop_cashcharging.arguments;   
	var argc	= pop_cashcharging.arguments.length;   
	var openWin	= (argc > 0) ? argv[0] : true; //ÆË¾÷À» ¿­Áö ÇöÀçÃ¢¿¡¼­ ½ÇÇàÇÒÁö ¿©ºÎ.(false:ÇöÀçÃ¢¿¡¼­ ½ÇÇà, true:ÆË¾÷Ã¢¶ç¿ò)
	
	var payMethod= "CAD|BAT|MOB|PBL|WPC|MUL|ASL|CSH";
	var chrg_url = "http://bill.paran.com/processGet.jspa?pathWay=CASH&payMethod=" + escape(payMethod);
	var chrg_win = "settleWindows";
	
	if (!openWin) 
	{
		self.location.href = chrg_url;
	}
	else 
	{
		window.open(chrg_url, chrg_win, "width=480,height=570");
	}
}

function pop_cashcharging_netmarble()
{
	var dest;
	dest = NM_DOMAIN_CASHCHARGE + "/refill/cashFrameWin.asp"; 
					var iMyWidth; 
					var iMyHeight; 
					iMyWidth = (window.screen.width/2) - (122 + 10); //half the screen width minus half the new window width (plus 5 pixel borders). 
					iMyHeight = (window.screen.height/2) - (27 + 50); //half the screen height minus half the new window height (plus title and status bars). 
	location.href = dest;
}

function pop_cashcharging_hangame()
{
	var argv	= pop_cashcharging_hangame.arguments;   
	var argc	= pop_cashcharging_hangame.arguments.length;   
	var openWin	= (argc > 0) ? argv[0] : true; //ÆË¾÷À» ¿­Áö ÇöÀçÃ¢¿¡¼­ ½ÇÇàÇÒÁö ¿©ºÎ.(false:ÇöÀçÃ¢¿¡¼­ ½ÇÇà, true:ÆË¾÷Ã¢¶ç¿ò)
	
	if ( openWin )
	{
	    var payMethod= "HG";
	    var chrg_url = "https://bill.hangame.com/pay/charge.nhn?CHNL=" + escape(payMethod);
	    var chrg_win = "settleWindows";
	    window.open(chrg_url, chrg_win, "width=480,height=570");
	}
	else
	{
	    var payMethod= "HG";
	    self.location.href = "https://bill.hangame.com/pay/charge.nhn?CHNL=" + escape(payMethod);
	}
}

//Ä³½¬ÃæÀü 
function ui_doCharge()
{
	//if(confirm("Ä³½¬ÃæÀü ÆäÀÌÁö·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?"))
    pop_cashcharging(false);	//ÇöÀçÃ¢¿¡¼­ ½ÇÇà.
}

function ui_doCharge_hangame()
{
    pop_cashcharging_hangame(false);	//ÇöÀçÃ¢¿¡¼­ ½ÇÇà.
}
