/****************************
card.jsp »ç¿ëÇÏ´Â ½ºÅ©¸³Æ® 
****************************/

//ISP, ¾È½ÉÅ¬¸¯ Ä«µåÆ÷¸Ë ±¸ºÐ ½ºÅ©¸³Æ®
function Display( flag ) {
	form_name = document.cardInfo;
	form_name.Card_Select.value=flag;
	if ( form_name.Card_Select.value=="isp"){
		document.all.Ispold1Display.style.display = "none";
		document.all.Ispold2Display.style.display = "none";
		document.all.Ispold3Display.style.display = "none";
		document.all.Ispold4Display.style.display = "none";
		document.all.Isp1Display.style.display = "";
		document.all.Isp2Display.style.display = "";
		document.all.Isp3Display.style.display = "";
		document.all.Isp4Display.style.display = "";
		document.all.Visa1Display.style.display = "none";
		document.all.Visa2Display.style.display = "none";
		document.all.Visa3Display.style.display = "none";
		document.all.Visa4Display.style.display = "none";
		form_name.ispcardno1.value="";
		form_name.ispcardno2.value="";
		form_name.ispcardno3.value="****";
		form_name.ispcardno4.value="";
		form_name.deal_won.value="";
		form_name.Card_Method.value="isp";
	} else if (form_name.Card_Select.value=="ispold") {
		document.all.Ispold1Display.style.display = "";
		document.all.Ispold2Display.style.display = "";
		document.all.Ispold3Display.style.display = "";
		document.all.Ispold4Display.style.display = "";
		document.all.Isp1Display.style.display = "none";
		document.all.Isp2Display.style.display = "none";
		document.all.Isp3Display.style.display = "none";
		document.all.Isp4Display.style.display = "none";
		document.all.Visa1Display.style.display = "none";
		document.all.Visa2Display.style.display = "none";
		document.all.Visa3Display.style.display = "none";
		document.all.Visa4Display.style.display = "none";
		form_name.ispoldcardno1.value="";
		form_name.ispoldcardno2.value="";
		form_name.ispoldcardno3.value="";
		form_name.ispoldcardno4.value="****";
		form_name.deal_won.value="";
		form_name.Card_Method.value="ispold";
	} else {
		document.all.Ispold1Display.style.display = "none";
		document.all.Ispold2Display.style.display = "none";
		document.all.Ispold3Display.style.display = "none";
		document.all.Ispold4Display.style.display = "none";
		document.all.Isp1Display.style.display = "none";
		document.all.Isp2Display.style.display = "none";
		document.all.Isp3Display.style.display = "none";
		document.all.Isp4Display.style.display = "none";
		document.all.Visa1Display.style.display = "";
		document.all.Visa2Display.style.display = "";
		document.all.Visa3Display.style.display = "";
		document.all.Visa4Display.style.display = "";
		form_name.visacardno1.value="";
		form_name.visacardno2.value="";
		form_name.visacardno3.value="";
		form_name.visacardno4.value="";
		form_name.deal_won.value="";
		form_name.Card_Method.value="visa";
	}
}

function Display2( flag ) {
	form_name = document.bankInfo;
	form_name.Bank_Select.value=flag;
	if ( form_name.Bank_Select.value=="bank_normal"){
		document.all.normal.style.display= "";
		document.all.escrow.style.display= "none";
		form_name.bank_deal_won.value="";
		form_name.bank_acct_nm.value="";
		form_name.Bank_Method.value="bank_normal";
	} else {
		document.all.normal.style.display= "none";
		document.all.escrow.style.display= "";
		form_name.bank_deal_won.value="";
		form_name.bank_acct_nm.value="";
		form_name.Bank_Method.value="bank_escrow";
	}
}

function mpay_display( flag ) {
	form_name = document.mpayinfo;
	form_name.mpay_select.value=flag;
	if ( form_name.mpay_select.value=="mpay_card"){
		document.all.bill_card.style.display= "";
		document.all.bill_hp.style.display= "none";
		document.all.bill_ars.style.display= "none";
		form_name.mpaycardno1.value="";
		form_name.mpaycardno2.value="";
		form_name.mpaycardno3.value="";
		form_name.mpaycardno4.value="";
		form_name.mpaycarddealwon.value="";
		form_name.mpayhpno2.value="";
		form_name.mpayhpno3.value="";
		form_name.mpayhpdealwon.value="";
		form_name.mpayarsno2.value="";
		form_name.mpayarsno3.value="";
		form_name.mpayarsdealwon.value="";
		form_name.mpay_method.value="mpay_card";
	} else if ( form_name.mpay_select.value=="mpay_hp"){
		document.all.bill_card.style.display= "none";
		document.all.bill_hp.style.display= "";
		document.all.bill_ars.style.display= "none";
		form_name.mpaycardno1.value="";
		form_name.mpaycardno2.value="";
		form_name.mpaycardno3.value="";
		form_name.mpaycardno4.value="";
		form_name.mpaycarddealwon.value="";
		form_name.mpayhpno2.value="";
		form_name.mpayhpno3.value="";
		form_name.mpayhpdealwon.value="";
		form_name.mpayarsno2.value="";
		form_name.mpayarsno3.value="";
		form_name.mpayarsdealwon.value="";
		form_name.mpay_method.value="mpay_hp";
	} else if ( form_name.mpay_select.value=="mpay_ars"){
		document.all.bill_card.style.display= "none";
		document.all.bill_hp.style.display= "none";
		document.all.bill_ars.style.display= "";
		form_name.mpaycardno1.value="";
		form_name.mpaycardno2.value="";
		form_name.mpaycardno3.value="";
		form_name.mpaycardno4.value="";
		form_name.mpaycarddealwon.value="";
		form_name.mpayhpno2.value="";
		form_name.mpayhpno3.value="";
		form_name.mpayhpdealwon.value="";
		form_name.mpayarsno2.value="";
		form_name.mpayarsno3.value="";
		form_name.mpayarsdealwon.value="";
		form_name.mpay_method.value="mpay_ars";
	}
}

function phone_display( flag ) {
	form_name = document.phoneInfo;
	form_name.phone_select.value=flag;
	if ( form_name.phone_select.value=="phone_hp"){
		document.all.phone_hp.style.display= "";
		document.all.phone_ars.style.display= "none";
		form_name.phone_num_02.value="";
		form_name.phone_num_03.value="";
		form_name.phone_num.value="";
		form_name.ars_num_01.value="";
		form_name.ars_num_02.value="";
		form_name.ars_num_03.value="";
		form_name.phone_deal_won.value="";
		form_name.phone_method.value="phone_hp";
	} else if ( form_name.phone_select.value=="phone_ars"){
		document.all.phone_hp.style.display= "none";
		document.all.phone_ars.style.display= "";
		form_name.phone_num_02.value="";
		form_name.phone_num_03.value="";
		form_name.phone_num.value="";
		form_name.ars_num_01.value="";
		form_name.ars_num_02.value="";
		form_name.ars_num_03.value="";
		form_name.ars_num.value="";
		form_name.phone_deal_won.value="";
		form_name.phone_method.value="phone_ars";
	}
}

function Account_Display( flag ) {
	form_name = document.accountInfo;
	form_name.Account_Select.value=flag;
	if ( form_name.Account_Select.value=="account"){
		document.all.account.style.display= "";
		document.all.account_escrow.style.display= "none";
		form_name.id_num_01.value="";
		form_name.id_num_02.value="";
		form_name.co_num_01.value="";
		form_name.co_num_02.value="";
		form_name.co_num_03.value="";
		form_name.account_order_nm.value="";
		form_name.account_deal_won.value="";
		form_name.Account_Method.value="account";
	} else {
		document.all.account.style.display= "none";
		document.all.account_escrow.style.display= "";
		form_name.id_num_01.value="";
		form_name.id_num_02.value="";
		form_name.co_num_01.value="";
		form_name.co_num_02.value="";
		form_name.co_num_03.value="";
		form_name.account_order_nm.value="";
		form_name.account_deal_won.value="";
		form_name.Account_Method.value="account_escrow";
	}
}

function Escrow_Display( flag ) {
	form_name = document.escrowInfo;
	form_name.value_select.value=flag;
	if ( form_name.value_select.value=="url"){
		document.all.url.style.display= "";
		document.all.biz.style.display= "none";
		form_name.retailer_url.value="";
		form_name.biz_no_01.value="";
		form_name.biz_no_02.value="";
		form_name.biz_no_03.value="";
		form_name.biz_no.value="";
		form_name.Escrow_Method.value="url";
	} else {
		document.all.url.style.display= "none";
		document.all.biz.style.display= "";
		form_name.retailer_url.value="";
		form_name.biz_no_01.value="";
		form_name.biz_no_02.value="";
		form_name.biz_no_03.value="";
		form_name.biz_no.value="";
		form_name.Escrow_Method.value="biz";
	}
}

//³¯Â¥ °Ë»ö½Ã ¼±ÅÃ select¹® ½ºÅ©¸³Æ®
function sneddt_disp_thr()
{
	today = new Date();
	year=today.getFullYear();
	month=today.getMonth();
	month+=1;
	if(month <10) month="0" + month;
	date=today.getDate();
	if(date<10) date="0" + date;

	// °Ë»ö ½ÃÀÛ ÀÏÀÚ 
	document.writeln("<select name=from_yy class='formbox_input_index'>");
	for (index=2002;index <= 2009;index++) {
		if(index==year) document.writeln("<option value=" + index + " selected>" + index);
		else document.writeln("<option value=" + index + ">" + index);
	}  	
	document.writeln("</select> ³â");

	document.writeln("<select name=from_mm class='formbox_input_index'>");	
	for (index=1;index <= 12;index++) {
		if(index==month){
			if(index <10) document.writeln("<option value=0" + index + " selected>0" + index);
			else document.writeln("<option value=" + index + " selected>" + index);
		}else{
			if(index <10) document.writeln("<option value=0" + index + ">0" + index);
			else document.writeln("<option value=" + index + ">" + index);
		}
	}
	document.writeln("</select> ¿ù");

	document.writeln("<select name=from_dd class='formbox_input_index'>");	
	for (index=1;index <= 31;index++) {
		if(index==date){
			if(index <10) document.writeln("<option value=0" + index + " selected>0" + index);
			else document.writeln("<option value=" + index + " selected>" + index);
		}else {
			if(index <10) document.writeln("<option value=0" + index + ">0" + index);
			else document.writeln("<option value=" + index + ">" + index);
		}
	}
	document.writeln("</select> ÀÏºÎÅÍ&nbsp;&nbsp;  &nbsp;");
	// °Ë»ö Á¾·á ÀÏÀÚ
	document.writeln("<select name=to_yy class='formbox_input_index'>");
	for (index=2002;index <= 2009;index++) {
		if(index==year) document.writeln("<option value=" + index + " selected>" + index);
		else document.writeln("<option value=" + index + ">" + index);
	}
	document.writeln("</select>³â");

	document.writeln("<select name=to_mm class='formbox_input_index'>");
	for (index=1;index <= 12;index++) {
		if(index==month){
			if(index <10) document.writeln("<option value=0" + index + " selected>0" + index);
			else document.writeln("<option value=" + index + " selected>" + index); 
		}else {
			if(index <10) document.writeln("<option value=0" + index + ">0" + index);
			else document.writeln("<option value=" + index + ">" + index);
		}
	}
	document.writeln("</select>¿ù");

	document.writeln("<select name=to_dd class='formbox_input_index'>");
	for (index=1;index <= 31;index++) {
		if(index==date){
			if(index <10) document.writeln("<option value=0" + index + " selected>0" + index);
			else document.writeln("<option value=" + index + " selected>" + index);
		}else {
			if(index <10) document.writeln("<option value=0" + index + ">0" + index);
			else document.writeln("<option value=" + index + ">" + index);
		}
	}
	document.writeln("</select> ÀÏ±îÁö");
}

//³¯Â¥ °Ë»ö½Ã ¼±ÅÃ select¹® ½ºÅ©¸³Æ®
function sneddt_disp_thr_month()
{
	today = new Date();
	year=today.getFullYear();
	month=today.getMonth();
	month+=1;
	if(month <10) month="0" + month;
	date=today.getDate();
	if(date<10) date="0" + date;

	// °Ë»ö ½ÃÀÛ ÀÏÀÚ 
	document.writeln("<select name=from_yy class='formbox_input_index'>");
	for (index=2002;index <= 2009;index++) {
		if(index==year) document.writeln("<option value=" + index + " selected>" + index);
		else document.writeln("<option value=" + index + ">" + index);
	}  	
	document.writeln("</select> ³â");

	document.writeln("<select name=from_mm class='formbox_input_index'>");	
	for (index=1;index <= 12;index++) {
		if(index==month){
			if(index <10) document.writeln("<option value=0" + index + " selected>0" + index);
			else document.writeln("<option value=" + index + " selected>" + index);
		}else{
			if(index <10) document.writeln("<option value=0" + index + ">0" + index);
			else document.writeln("<option value=" + index + ">" + index);
		}
	}
	document.writeln("</select> ¿ùºÎÅÍ&nbsp;&nbsp;  &nbsp;");
	// °Ë»ö Á¾·á ÀÏÀÚ
	document.writeln("<select name=to_yy class='formbox_input_index'>");
	for (index=2002;index <= 2009;index++) {
		if(index==year) document.writeln("<option value=" + index + " selected>" + index);
		else document.writeln("<option value=" + index + ">" + index);
	}
	document.writeln("</select>³â");

	document.writeln("<select name=to_mm class='formbox_input_index'>");
	for (index=1;index <= 12;index++) {
		if(index==month){
			if(index <10) document.writeln("<option value=0" + index + " selected>0" + index);
			else document.writeln("<option value=" + index + " selected>" + index); 
		}else {
			if(index <10) document.writeln("<option value=0" + index + ">0" + index);
			else document.writeln("<option value=" + index + ">" + index);
		}
	}
	document.writeln("</select>¿ù±îÁö");
}

//³¯Â¥ °Ë»ö½Ã ¼±ÅÃ select¹® ½ºÅ©¸³Æ®
function sneddt_disp_thr_scredit()
{
	today = new Date();
	year=today.getFullYear();
	month=today.getMonth();
	month+=1;
	if(month <10) month="0" + month;
	date=today.getDate();
	if(date<10) date="0" + date;

	// °Ë»ö ½ÃÀÛ ÀÏÀÚ 
	document.writeln("<select name=from_yy class='formbox_input_index'>");
	for (index=2007;index <= 2009;index++) {
		if(index==year) document.writeln("<option value=" + index + " selected>" + index);
		else document.writeln("<option value=" + index + ">" + index);
	}  	
	document.writeln("</select> ³â");

	document.writeln("<select name=from_mm class='formbox_input_index'>");	
	for (index=1;index <= 12;index++) {
		if(index==month){
			if(index <10) document.writeln("<option value=0" + index + " selected>0" + index);
			else document.writeln("<option value=" + index + " selected>" + index);
		}else{
			if(index <10) document.writeln("<option value=0" + index + ">0" + index);
			else document.writeln("<option value=" + index + ">" + index);
		}
	}
	document.writeln("</select> ¿ù");

	document.writeln("<select name=from_dd class='formbox_input_index'>");	
	for (index=1;index <= 31;index++) {
		if(index==date){
			if(index <10) document.writeln("<option value=0" + index + " selected>0" + index);
			else document.writeln("<option value=" + index + " selected>" + index);
		}else {
			if(index <10) document.writeln("<option value=0" + index + ">0" + index);
			else document.writeln("<option value=" + index + ">" + index);
		}
	}
	document.writeln("</select> ÀÏºÎÅÍ&nbsp;&nbsp;  &nbsp;");
	// °Ë»ö Á¾·á ÀÏÀÚ
	document.writeln("<select name=to_yy class='formbox_input_index'>");
	for (index=2007;index <= 2009;index++) {
		if(index==year) document.writeln("<option value=" + index + " selected>" + index);
		else document.writeln("<option value=" + index + ">" + index);
	}
	document.writeln("</select>³â");

	document.writeln("<select name=to_mm class='formbox_input_index'>");
	for (index=1;index <= 12;index++) {
		if(index==month){
			if(index <10) document.writeln("<option value=0" + index + " selected>0" + index);
			else document.writeln("<option value=" + index + " selected>" + index); 
		}else {
			if(index <10) document.writeln("<option value=0" + index + ">0" + index);
			else document.writeln("<option value=" + index + ">" + index);
		}
	}
	document.writeln("</select>¿ù");

	document.writeln("<select name=to_dd class='formbox_input_index'>");
	for (index=1;index <= 31;index++) {
		if(index==date){
			if(index <10) document.writeln("<option value=0" + index + " selected>0" + index);
			else document.writeln("<option value=" + index + " selected>" + index);
		}else {
			if(index <10) document.writeln("<option value=0" + index + ">0" + index);
			else document.writeln("<option value=" + index + ">" + index);
		}
	}
	document.writeln("</select> ÀÏ±îÁö");
}

//ÀÚµ¿ Æ÷Ä¿½º ÀÌµ¿(ÇöÀç°´Ã¼, ÀÌµ¿°´Ã¼, MaxLength)
function autoFocus(input1, input2, maxLen) {
	if(input1.value.length == maxLen && event.keyCode != 9 && event.keyCode != 16) input2.focus() ;
}

//µ¥ÀÌÅÍ Ã¼Å© ¹× card_result.jsp·Î ³»¿ë submit
function sendData(form_name)
{
	//°áÁ¦ ±Ý¾× Ã¼Å©
	var check_num = form_name.deal_won.value + "";
	if ( check_num == "") {
		alert("°Å·¡±Ý¾×À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		return;
	}
	for ( var i = 0; i < check_num.length; i++ ){
		if ( check_num.charAt(i) < "0" || check_num.charAt(i) >  "9") {
			alert("°áÁ¦±Ý¾×Àº ¼ýÀÚ¸¸À¸·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			return;
		}
	}
	
	// Ä«µå ¹øÈ£ Ã¼Å©
	if( form_name.Card_Method.value == 'isp' ) {
		if( form_name.ispcardno1.value.length < 4 ) {
			 alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.ispcardno1.focus()
			 return;
		}
		if( form_name.ispcardno2.value.length < 4 ) {
			 alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.ispcardno2.focus()
			 return;
		}
		if( form_name.ispcardno4.value.length < 4 ) {
			 alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.ispcardno4.focus()
			 return;
		}
		form_name.ispcardno.value = form_name.ispcardno1.value + form_name.ispcardno2.value + form_name.ispcardno4.value;
		if( form_name.ispcardno.value.length < 12) {
			alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			return;
		}
	} else if ( form_name.Card_Method.value == 'ispold' ) {
		if( form_name.ispoldcardno1.value.length < 4 ) {
			 alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.ispoldcardno1.focus()
			 return;
		}
		if( form_name.ispoldcardno2.value.length < 4 ) {
			 alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.ispoldcardno2.focus()
			 return;
		}
		if( form_name.ispoldcardno3.value.length < 4 ) {
			 alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.ispoldcardno3.focus()
			 return;
		}
		form_name.ispoldcardno.value = form_name.ispoldcardno1.value + form_name.ispoldcardno2.value + form_name.ispoldcardno3.value;
		if( form_name.ispoldcardno.value.length < 12) {
			alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			return;
		}
	} else {
		if( form_name.visacardno1.value.length < 4 ) {
			 alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.visacardno1.focus()
			 return;
		}
		if( form_name.visacardno2.value.length < 4 ) {
			 alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.visacardno2.focus()
			 return;
		}
		if( form_name.visacardno3.value.length < 4 ) {
			 alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.visacardno3.focus()
			 return;
		}
		if( form_name.visacardno4.value.length < 2 ) {
			 alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.visacardno4.focus()
			 return;
		}
		form_name.visacardno.value = form_name.visacardno1.value + form_name.visacardno2.value + form_name.visacardno3.value + form_name.visacardno4.value;
		if( form_name.visacardno.value.length < 14) {
			alert("Ä«µå¹øÈ£ 14ÀÚ¸® ¶Ç´Â 16ÀÚ¸®¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			return;
		}
	}

	// °áÁ¦ ÀÏÀÚ Ã¼Å©
	from_y = Number(form_name.from_yy.value);
	from_m = Number(form_name.from_mm.value);
	from_d = Number(form_name.from_dd.value);
	to_y = Number(form_name.to_yy.value);
	to_m = Number(form_name.to_mm.value);
	to_d = Number(form_name.to_dd.value);

	if( (to_y - from_y) < 0 ) {
		alert("Àß¸øµÈ Á¶È¸ ±â°£ ÀÔ´Ï´Ù \n ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		return;
	} else if ( (to_y - from_y) == 0 ){
		if ( (to_m - from_m) < 0 ){
			alert("Àß¸øµÈ Á¶È¸ ±â°£ ÀÔ´Ï´Ù \n ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			return;
		} else if ( (to_m - from_m) > 1 ){
			alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return;
		} else if ( (to_m - from_m) == 0 ){ 
			if ( (to_d - from_d) < 0 ) {
				alert("Àß¸øµÈ Á¶È¸ ±â°£ ÀÔ´Ï´Ù \n ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
				return;
			}
		} else if ( (to_m - from_m) == 1 ){
			if ( from_d < to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			} else if ( from_d == to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			}
		}
	} else if ( (to_y - from_y) > 1) {
		alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
		return;
	} else {
		if( (from_m - to_m) != 11) {
			alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return;
		} else {
			if ( from_d < to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			} else if ( from_d == to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			}
		}
	}

	form_name.submit();
}


//°èÁÂÀÌÃ¼ ³»¿ªÁ¶È¸ Ã¼Å© ½ºÅ©¸³Æ®
function sendData_bank(form_name)
{
	//°áÁ¦ ±Ý¾× Ã¼Å©
	var check_num = form_name.bank_deal_won.value + "";
	if ( check_num == "") {
		alert("°Å·¡±Ý¾×À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.bank_deal_won.focus()
		return;
	}
	for ( var i = 0; i < check_num.length; i++ ){
		if ( check_num.charAt(i) < "0" || check_num.charAt(i) >  "9") {
			alert("°áÁ¦±Ý¾×Àº ¼ýÀÚ¸¸À¸·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			return;
		}
	}

	form_name.bank_acct_nm.value = form_name.bank_acct_nm_01.value + form_name.bank_acct_nm_02.value;
	//°áÁ¦ ¿¹±ÝÁÖ¸í Ã¼Å©
	if( form_name.bank_acct_nm.value == "" ) {
			 alert("¿¹±ÝÁÖ¸íÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 return;
	}

	// °áÁ¦ ÀÏÀÚ Ã¼Å©
	from_y = Number(form_name.from_yy.value);
	from_m = Number(form_name.from_mm.value);
	from_d = Number(form_name.from_dd.value);
	to_y = Number(form_name.to_yy.value);
	to_m = Number(form_name.to_mm.value);
	to_d = Number(form_name.to_dd.value);

	if( (to_y - from_y) < 0 ) {
		alert("Àß¸øµÈ Á¶È¸ ±â°£ ÀÔ´Ï´Ù \n ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		return;
	} else if ( (to_y - from_y) == 0 ){
		if ( (to_m - from_m) < 0 ){
			alert("Àß¸øµÈ Á¶È¸ ±â°£ ÀÔ´Ï´Ù \n ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			return;
		} else if ( (to_m - from_m) > 1 ){
			alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return;
		} else if ( (to_m - from_m) == 0 ){ 
			if ( (to_d - from_d) < 0 ) {
				alert("Àß¸øµÈ Á¶È¸ ±â°£ ÀÔ´Ï´Ù \n ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
				return;
			}
		} else if ( (to_m - from_m) == 1 ){
			if ( from_d < to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			} else if ( from_d == to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			}
		}
	} else if ( (to_y - from_y) > 1) {
		alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
		return;
	} else {
		if( (from_m - to_m) != 11) {
			alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return;
		} else {
			if ( from_d < to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			} else if ( from_d == to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			}
		}
	}

	form_name.submit();

}

//°¡»ó°èÁÂ ³»¿ªÁ¶È¸ Ã¼Å© ½ºÅ©¸³Æ®
function sendData_account(form_name)
{
	//°áÁ¦ ±Ý¾× Ã¼Å©
	var check_num = form_name.account_deal_won.value + "";
	if ( check_num == "") {
		alert("°Å·¡±Ý¾×À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.account_deal_won.focus()
		return;
	}
	for ( var i = 0; i < check_num.length; i++ ){
		if ( check_num.charAt(i) < "0" || check_num.charAt(i) >  "9") {
			alert("°áÁ¦±Ý¾×Àº ¼ýÀÚ¸¸À¸·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			form_name.account_deal_won.focus()
			return;
		}
	}

	if( form_name.Account_Method.value == "account" ) {
		if( form_name.bank.value == "00" ) {
			alert("ÀºÇàÀ» ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À.");
			form_name.bank.focus()
			return;
		}
		var check_num2 = form_name.acct_no.value + "";
		if( form_name.acct_no.value == "" ) {
			alert("°èÁÂ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			form_name.acct_no.focus()
			return;
		}
		for ( var i = 0; i < check_num2.length; i++ ){
			if ( check_num2.charAt(i) < "0" || check_num2.charAt(i) >  "9") {
				alert("°èÁÂ¹øÈ£´Â ¼ýÀÚ¸¸À¸·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				form_name.acct_no.focus()
				return;
			}
		}
	} else {
		//°áÁ¦ ÁÖ¹®ÀÚ¸í Ã¼Å©
		if( form_name.account_order_nm.value == "" ) {
				 alert("ÁÖ¹®ÀÚ¸íÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.account_order_nm.focus()
				 return;
		}
	}

	// °áÁ¦ ÀÏÀÚ Ã¼Å©
	from_y = Number(form_name.from_yy.value);
	from_m = Number(form_name.from_mm.value);
	from_d = Number(form_name.from_dd.value);
	to_y = Number(form_name.to_yy.value);
	to_m = Number(form_name.to_mm.value);
	to_d = Number(form_name.to_dd.value);

	if( (to_y - from_y) < 0 ) {
		alert("Àß¸øµÈ Á¶È¸ ±â°£ ÀÔ´Ï´Ù \n ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		return;
	} else if ( (to_y - from_y) == 0 ){
		if ( (to_m - from_m) < 0 ){
			alert("Àß¸øµÈ Á¶È¸ ±â°£ ÀÔ´Ï´Ù \n ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			return;
		} else if ( (to_m - from_m) > 1 ){
			alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return;
		} else if ( (to_m - from_m) == 0 ){ 
			if ( (to_d - from_d) < 0 ) {
				alert("Àß¸øµÈ Á¶È¸ ±â°£ ÀÔ´Ï´Ù \n ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
				return;
			}
		} else if ( (to_m - from_m) == 1 ){
			if ( from_d < to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			} else if ( from_d == to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			}
		}
	} else if ( (to_y - from_y) > 1) {
		alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
		return;
	} else {
		if( (from_m - to_m) != 11) {
			alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return;
		} else {
			if ( from_d < to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			} else if ( from_d == to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			}
		}
	}

	form_name.submit();

}

//°¡»ó°èÁÂ ³»¿ªÁ¶È¸ Ã¼Å© ½ºÅ©¸³Æ®
function sendData_phone(form_name)
{
	//°áÁ¦ ±Ý¾× Ã¼Å©
	var check_num = form_name.phone_deal_won.value + "";
	if ( check_num == "") {
		alert("°Å·¡±Ý¾×À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.phone_deal_won.focus()
		return;
	}
	for ( var i = 0; i < check_num.length; i++ ){
		if ( check_num.charAt(i) < "0" || check_num.charAt(i) >  "9") {
			alert("°áÁ¦±Ý¾×Àº ¼ýÀÚ¸¸À¸·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			return;
		}
	}

	//ÇÚµåÆù ¹øÈ£ Ã¼Å©
	if(form_name.phone_method.value == "phone_hp"){
		if( form_name.phone_num_02.value == "" ) {
				 alert("ÇÚµåÆù ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.phone_num_02.focus()
				 return;
		}

		if( form_name.phone_num_03.value == "" ) {
				 alert("ÇÚµåÆù ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.phone_num_03.focus()
				 return;
		}
		form_name.phone_num.value = form_name.phone_num_01.value + form_name.phone_num_02.value + form_name.phone_num_03.value;
	}else{
		if( form_name.ars_num_01.value == "" ) {
				 alert("À¯¼± ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.ars_num_01.focus()
				 return;
		}

		if( form_name.ars_num_02.value == "" ) {
				 alert("À¯¼± ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.ars_num_02.focus()
				 return;
		}

		if( form_name.ars_num_03.value == "" ) {
				 alert("À¯¼± ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.ars_num_03.focus()
				 return;
		}
		form_name.ars_num.value = form_name.ars_num_01.value + form_name.ars_num_02.value + form_name.ars_num_03.value;
	}


	// °áÁ¦ ÀÏÀÚ Ã¼Å©
	from_y = Number(form_name.from_yy.value);
	from_m = Number(form_name.from_mm.value);
	from_d = Number(form_name.from_dd.value);
	to_y = Number(form_name.to_yy.value);
	to_m = Number(form_name.to_mm.value);
	to_d = Number(form_name.to_dd.value);

	if( (to_y - from_y) < 0 ) {
		alert("Àß¸øµÈ Á¶È¸ ±â°£ ÀÔ´Ï´Ù \n ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		return;
	} else if ( (to_y - from_y) == 0 ){
		if ( (to_m - from_m) < 0 ){
			alert("Àß¸øµÈ Á¶È¸ ±â°£ ÀÔ´Ï´Ù \n ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			return;
		} else if ( (to_m - from_m) > 1 ){
			alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return;
		} else if ( (to_m - from_m) == 0 ){ 
			if ( (to_d - from_d) < 0 ) {
				alert("Àß¸øµÈ Á¶È¸ ±â°£ ÀÔ´Ï´Ù \n ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
				return;
			}
		} else if ( (to_m - from_m) == 1 ){
			if ( from_d < to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			} else if ( from_d == to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			}
		}
	} else if ( (to_y - from_y) > 1) {
		alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
		return;
	} else {
		if( (from_m - to_m) != 11) {
			alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return;
		} else {
			if ( from_d < to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			} else if ( from_d == to_d ){
				alert("Á¶È¸±â°£Àº 1´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			}
		}
	}

	form_name.submit();
}


function sendData_escrow(form_name)
{

	if ( form_name.Escrow_Method.value == "url") {
		
		//URL Ã¼Å©
		if ( form_name.retailer_url.value == "") {
			alert("URL ÁÖ¼Ò¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			form_name.retailer_url.focus()
			return;
		}
		
	}else{

		//»ç¾÷ÀÚ ¹øÈ£ Ã¼Å©
		if( form_name.biz_no_01.value == "" ) {
				 alert("»ç¾÷ÀÚ ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.biz_no_01.focus()
				 return;
		}

		if( form_name.biz_no_02.value == "" ) {
				 alert("»ç¾÷ÀÚ ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.biz_no_02.focus()
				 return;
		}
		
		if( form_name.biz_no_03.value == "" ) {
				 alert("»ç¾÷ÀÚ ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.biz_no_03.focus()
				 return;
		}
		form_name.biz_no.value = form_name.biz_no_01.value + form_name.biz_no_02.value + form_name.biz_no_03.value;
	}

	form_name.submit();
}

function sendData_mpay(form_name)
{

	if ( form_name.mpay_method.value == "mpay_card") {
		
		//Ä«µå¹øÈ£ Ã¼Å©
		if( form_name.mpaycardno1.value.length < 4 ) {
			 alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.mpaycardno1.focus()
			 return;
		}
		if( form_name.mpaycardno2.value.length < 4 ) {
			 alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.mpaycardno2.focus()
			 return;
		}
		if( form_name.mpaycardno3.value.length < 4 ) {
			 alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.mpaycardno3.focus()
			 return;
		}
		if( form_name.mpaycardno4.value.length < 2 ) {
			 alert("Ä«µå¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			 form_name.mpaycardno4.focus()
			 return;
		}
		form_name.mpaycardno.value = form_name.mpaycardno1.value + form_name.mpaycardno2.value + form_name.mpaycardno3.value + form_name.mpaycardno4.value;
		if( form_name.mpaycardno.value.length < 14) {
			alert("Ä«µå¹øÈ£ 14ÀÚ¸® ¶Ç´Â 16ÀÚ¸®¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			return;
		}

		//°áÁ¦ ±Ý¾× Ã¼Å©
		var check_num = form_name.mpaycarddealwon.value + "";
		if ( check_num == "") {
			alert("°Å·¡±Ý¾×À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			return;
		}
		for ( var i = 0; i < check_num.length; i++ ){
			if ( check_num.charAt(i) < "0" || check_num.charAt(i) >  "9") {
				alert("°áÁ¦±Ý¾×Àº ¼ýÀÚ¸¸À¸·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				return;
			}
		}

		form_name.submit();

	}else if( form_name.mpay_method.value == "mpay_hp") {

		//ÇÚµåÆù ¹øÈ£ Ã¼Å©
		if( form_name.mpayhpno2.value == "" ) {
				 alert("ÇÚµåÆù ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.mpayhpno2.focus()
				 return;
		}

		if( form_name.mpayhpno3.value == "" ) {
				 alert("ÇÚµåÆù ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.mpayhpno3.focus()
				 return;
		}
		form_name.mpayhpno.value = form_name.mpayhpno1.value + form_name.mpayhpno2.value + form_name.mpayhpno3.value;

		//ÁÖ¹®ÀÚ¸í Ã¼Å©
		if( form_name.mpayhpdealwon.value == "" ) {
				 alert("ÁÖ¹®ÀÚ¸íÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.mpayhpdealwon.focus()
				 return;
		}

		form_name.submit();
	
	}else if( form_name.mpay_method.value == "mpay_ars") {

		//ÇÚµåÆù ¹øÈ£ Ã¼Å©
		if( form_name.mpayarsno2.value == "" ) {
				 alert("ÇÚµåÆù ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.mpayarsno2.focus()
				 return;
		}

		if( form_name.mpayarsno3.value == "" ) {
				 alert("ÇÚµåÆù ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.mpayarsno3.focus()
				 return;
		}
		form_name.mpayarsno.value = form_name.mpayarsno1.value + form_name.mpayarsno2.value + form_name.mpayarsno3.value;

		//ÁÖ¹®ÀÚ¸í Ã¼Å©
		if( form_name.mpayarsdealwon.value == "" ) {
				 alert("ÁÖ¹®ÀÚ¸íÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				 form_name.mpayarsdealwon.focus()
				 return;
		}

		form_name.submit();
	
	}
}

/*********************************
ing_login.jsp ¿¡¼­ »ç¿ëÇÏ´Â ½ºÅ©¸³Æ®
*********************************/
function ing_go(){
	if(document.form.service_id.value == ""){
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		document.form.service_id.focus();
		return;
	}
	if(document.form.service_pw.value == ""){
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		document.form.service_pw.focus();
		return;
	}
	document.form.submit();
}

/*********************************
ing.jsp ¿¡¼­ »ç¿ëÇÏ´Â ½ºÅ©¸³Æ®
*********************************/
function status_check(i){
	if(i == "05"){
		alert("¼­ºñ½º ÇØÁö »óÁ¡ÀÔ´Ï´Ù.\n¿Ã´õ°ÔÀÌÆ® ¼­ºñ½º ±â°£ÀÌ ¸¸·áµÇ¾ú°Å³ª, °è¾àÀÌ ÇØÁöµÇ¾ú½À´Ï´Ù.\nÀç°è¾àÀ» ¿øÇÏ½Ã¸é ¿µ¾÷ÆÀÀ¸·Î ¹®ÀÇÇÏ½Ã±â ¹Ù¶ø´Ï´Ù."); 
		location.href = "ing_login.jsp";
	}else if(i == "06"){
		alert("°è¾àºÒ°¡ »óÁ¡ÀÔ´Ï´Ù.\n¿Ã´õ°ÔÀÌÆ® ¿µ¾÷ ¹× ¸®½ºÅ© Á¤Ã¥¿¡ µû¶ó °è¾àºÒ°¡»óÅÂÀÔ´Ï´Ù.\nÀÚ¼¼ÇÑ »çÇ×Àº ¿µ¾÷ÆÀ(02-510-0960)¿¡ ¹®ÀÇÇÏ½Ã±â ¹Ù¶ø´Ï´Ù."); 
		location.href = "ing_login.jsp";
	}else if(i == "07"){
		alert("¹Ì»ç¿ë »óÁ¡ÀÔ´Ï´Ù.\n3°³¿ùÀÌ»ó °Å·¡°¡ ¾ø¾î ¼­ºñ½º°¡ ÁßÁöµÇ¾ú½À´Ï´Ù. \n¼­ºñ½º ÀÌ¿ëÀ» ¿øÇÏ½Ã¸é ÀÚ·á½ÇÀÇ  '¼­ºñ½ºÀç°³¿äÃ»¼­'¸¦ º¸³»ÁÖ½Ã±â\n ¹Ù¶ø´Ï´Ù.\n\n±¹¹ÎÄ«µåÀÇ °æ¿ì ¼­ºñ½º Àç°³±îÁö ¾à 10ÀÏÀÇ ½Ã°£ÀÌ ¼Ò¿äµË´Ï´Ù.\n¼­ºñ½º°¡ ÁßÁöµÈ »óÅÂ·Î °è¾à±â°£ÀÌ ¸¸·áµÈ °æ¿ì Àç°è¾àÀÌ ÇÊ¿äÇÕ´Ï´Ù."); 
		location.href = "ing_login.jsp";
	}else if(i == ""){
		alert("»óÁ¡Á¤º¸°¡ ¾ø½À´Ï´Ù. ¾ÆÀÌµð ¶Ç´Â ºñ¹Ð¹øÈ£¸¦ È®ÀÎÇÏ¼¼¿ä.");
		location.href = "ing_login.jsp";
	}
}
