function chkHrInfo()
{
	alert("Your HappyRail Pass Number, nationality and date of birth are needed in case of payment\n\n"
		 +"and cancellation with the Pass, so please be careful not to forget them.");

	chkHrKrInfo();
}

function chkKrInfo()
{
	alert("Your KR-PASS Number, nationality and date of birth are needed in case of payment\n\n"
		 +"and cancellation with the Pass, so please be careful not to forget them.");

	chkHrKrInfo();
}

function chkHrKrInfo()
{
	var todays = new Date();
	strYear  = todays.getFullYear();
	strMonth = todays.getMonth();
	strDate  = todays.getDate();

	yy = document.form1.txtEnYear.value;
	mm = document.form1.selEnMonth.value;
	dd = document.form1.selEnDate.value;

	// ÀÔ±¹¿¹Á¤ÀÏÀº ¿À´ÃºÎÅÍ 5ÀÏÈÄºÎÅÍ °¡´É
	var strInputdate_1 = new Date(yy, eval(mm)-1, dd);
	var strInputdate_2 = new Date(strYear, strMonth, strDate);

	if ( (Math.floor(strInputdate_1)/(24*60*60*1000)) < (Math.floor(strInputdate_2)/(24*60*60*1000)) )
	{
		//alert("Date of entry can be from 5 days after today's date. ");
		alert("Date of entry is possible from today. ");
		return;
	}

	// ÀÔ±¹¿¹Á¤ÀÏÀº ÇöÀçÀÏÀ» ±âÁØÀ¸·Î 1³â ÈÄ±îÁö¸¸ ÀÔ·Â°¡´ÉÇÏ´Ù.
	// ÀÔ·Â³âµµ°¡ ÇöÀç³âµµÀÇ ÀÌÀü³âµµ¸¦ ÀÔ·ÂÇÒ ¶§
	if (yy < todays.getFullYear())
	{
		alert('Your date of entry may be up to one year after todays date.');
		document.form1.txtEnYear.focus();
		//document.form1.txtEnYear.select();
		return;
	}
	// ÀÔ·Â³âµµ°¡ ÇöÀç³âµµ¿Í °°À» ¶§
	else if (yy == todays.getFullYear())
	{
		// ÀÔ·Â¿ùÀÌ ÇöÀç¿ùÀÏ ¶§
		if (mm == todays.getMonth()+1)
		{
			// ÀÔ·ÂÀÏÀÌ ÇöÀçÀÏ ÀÌÀüÀÏ ¶§
			if (dd < todays.getDate())
			{
				alert('Your date of entry may be up to one year after todays date.');
				return;
			}
		}
		// ÀÔ·Â¿ùÀÌ ÇöÀç¿ùº¸´Ù ÀÌÀü¿ùÀÏ ¶§
		else if (mm < todays.getMonth()+1)
		{
			alert('Your date of entry may be up to one year after todays date.');
			return;
		}
	}
	// ÀÔ·Â³âµµ°¡ ³»³âÀÏ ¶§
	else if (yy == todays.getFullYear()+1)
	{
		// ÀÔ·Â¿ùÀÌ ÇöÀç¿ùº¸´Ù ÀÌÈÄ¿ùÀÏ ¶§
		if (mm > todays.getMonth()+3) // ¿ø·¡´Â 1ÀÌÁö¸¸ Á¶»ó¿ëÂ÷Àå¿äÃ» 2006.6.8 À¸·Î º¯ÁØ±Ù 3À¸·Î ¼öÁ¤
		{
			alert('Your date of entry may be up to one year after todays date.');
			return;
		}
		// ÀÔ·Â¿ùÀÌ ÇöÀç¿ù°ú °°À» ¶§  // ¿ø·¡´Â 1ÀÌÁö¸¸ Á¶»ó¿ëÂ÷Àå¿äÃ» 2006.6.8 À¸·Î º¯ÁØ±Ù ÁÖ¼®Ã³¸®·Î ¼öÁ¤
		//else if (mm == todays.getMonth()+1)
		//{
		//  // ÀÔ·ÂÀÏÀÌ ÇöÀçÀÏÀÌ°Å³ª ÀÌÈÄÀÏÀÏ ¶§
		//  if (dd > todays.getDate())
		//  {
		//      alert('Your date of entry may be up to one year after todays date.');
		//      return;
		//  }
		//}
	}
	// ÀÔ·Â³âµµ°¡ ³»³â ÀÌÈÄÀÏ ¶§
	else if (yy > todays.getFullYear()+1)
	{
		alert('Your date of entry may be up to one year after todays date.');
		document.form1.txtEnYear.focus();
		//document.form1.txtEnYear.select();
		return;
	}

	// ¼º¸íÃ¼Å© - ¿µ¹®, °ø¹é¸¸ °¡´É
	if (dw_IsAlphaSp(document.form1.txtCustNm.value) == false)
	{
		alert('Please, input name in English only.');
		document.form1.txtCustNm.focus();
		//document.form1.txtCustNm.select();
		return;
	}

	//  »ý³â¿ùÀÏÀÇ Á¤´ç¼º °Ë»ç. ¿À´Ã ÀÌÀü ÀÌ¾î¾ß ÇÏ°í ÀÔ±¹ÀÏÀÚ ÀÌÀüÀÌ¾î¾ß ÇÑ´Ù.
	var strToday = strYear;
	if (strMonth < 10)
		strToday = strToday + "0" + strMonth;
	else
		strToday = strToday + "0" + strMonth;

	if (strDate < 10)
		strToday = strToday + "0" + strDate;
	else
		strToday = strToday + strDate;

	var strEntryDay = yy;
	strEntryDay = strEntryDay + mm;
	strEntryDay = strEntryDay + dd;

	var strBirthday = document.form1.txtBrthYear.value;
	strBirthday = strBirthday + document.form1.selBrthMonth.value;
	strBirthday = strBirthday + document.form1.selBrthDate.value;

	if (strBirthday >= strEntryDay)
	{
		alert("Check your Birthday. (Must be before Date of Entry)");
		return;
	}
	if (strBirthday >= strToday)
	{
		alert("Check your Birthday. (Must be before today)");
		return;
	}

	// ¿©±Ç¹øÈ£ Ã¼Å© - ¿µ¹®, ¼ýÀÚ¸¸ °¡´É
	if (dw_IsAlphaNumeric(document.form1.txtPsptNo.value) == false)
	{
		alert('Please, input the correct your passport number.');
		document.form1.txtPsptNo.focus();
		//document.form1.txtPsptNo.select();
		return;
	}

	// ÀÌ¸ÞÀÏÁÖ¼Ò Ã¼Å©
	var strMail = document.form1.txtEmailAdr.value;
	var strAtSign = strMail.indexOf('@');
	var strPeriod = strMail.lastIndexOf('.');
	var strSpace  = strMail.indexOf(' ');
	var strLength = strMail.length - 1   // Array is from 0 to length-1

	if ((strAtSign < 1) || (strPeriod <= strAtSign + 1) || (strPeriod == strLength ) ||  (strSpace  != -1))
	{
		alert("Please, input the correct email address");
		document.form1.txtEmailAdr.focus();
		//document.form1.txtEmailAdr.select();
		return;
	}

	if (document.form1.selNatyCd.value == '00')
	{
		alert('Please select the nation.');
		return;
	}

	if ((document.form1.selKrpsPsgDvCd.value == '03') && (document.form1.selSvNo.value == '0'))
	{
		alert('Please select the number of saver');
		return;
	}

	if ((document.form1.selKrpsPsgDvCd.value == '03') && (document.form1.selSvNo.value == '1'))
	{
		if (dw_IsAlphaSp(document.form1.txtSvNm1.value) == false)
		{
			alert('Please, input name in English only.');
			document.form1.txtSvNm1.focus();
			//document.form1.txtSvNm1.select();
			return;
		}
		if ((dw_IsAlphaNumeric(document.form1.txtSvPspt1.value) == false) || (document.form1.txtPsptNo.value == document.form1.txtSvPspt1.value))
		{
			alert('Please, input the correct saver pass passenger passport number.');
			document.form1.txtSvPspt1.focus();
			//document.form1.txtSvPspt1.select();
			return;
		}
	}
	if ((document.form1.selKrpsPsgDvCd.value == '03') && (document.form1.selSvNo.value == '2'))
	{
		if (dw_IsAlphaSp(document.form1.txtSvNm1.value) == false)
		{
			alert('Please, input name in English only.');
			document.form1.txtSvNm1.focus();
			//document.form1.txtSvNm1.select();
			return;
		}
		if ((dw_IsAlphaNumeric(document.form1.txtSvPspt1.value) == false) || (document.form1.txtPsptNo.value == document.form1.txtSvPspt1.value)
			 || (document.form1.txtSvPspt1.value == document.form1.txtSvPspt2.value))
		{
			alert('Please, input the correct saver pass passenger passport number.');
			document.form1.txtSvPspt1.focus();
			//document.form1.txtSvPspt1.select();
			return;
		}
		if (dw_IsAlphaSp(document.form1.txtSvNm2.value) == false)
		{
			alert('Please, input name in English only.');
			document.form1.txtSvNm2.focus();
			//document.form1.txtSvNm2.select();
			return;
		}
		if ((dw_IsAlphaNumeric(document.form1.txtSvPspt2.value) == false) || (document.form1.txtPsptNo.value == document.form1.txtSvPspt2.value))
		{
			alert('Please, input the correct saver pass passenger passport number.');
			document.form1.txtSvPspt2.focus();
			//document.form1.txtSvPspt2.select();
			return;
		}
	}
	if ((document.form1.selKrpsPsgDvCd.value == '03') && (document.form1.selSvNo.value == '3'))
	{
		if (dw_IsAlphaSp(document.form1.txtSvNm1.value) == false)
		{
			alert('Please, input name in English only.');
			document.form1.txtSvNm1.focus();
			//document.form1.txtSvNm1.select();
			return;
		}
		if ((dw_IsAlphaNumeric(document.form1.txtSvPspt1.value) == false) || (document.form1.txtPsptNo.value == document.form1.txtSvPspt1.value)
			 || (document.form1.txtSvPspt1.value == document.form1.txtSvPspt2.value) || (document.form1.txtSvPspt1.value == document.form1.txtSvPspt3.value))
		{
			alert('Please, input the correct saver pass passenger passport number.');
			document.form1.txtSvPspt1.focus();
			//document.form1.txtSvPspt1.select();
			return;
		}
		if (dw_IsAlphaSp(document.form1.txtSvNm2.value) == false)
		{
			alert('Please, input name in English only.');
			document.form1.txtSvNm2.focus();
			//document.form1.txtSvNm2.select();
			return;
		}
		if ((dw_IsAlphaNumeric(document.form1.txtSvPspt2.value) == false) || (document.form1.txtPsptNo.value == document.form1.txtSvPspt2.value)
			 || (document.form1.txtSvPspt2.value == document.form1.txtSvPspt3.value))
		{
			alert('Please, input the correct saver pass passenger passport number.');
			document.form1.txtSvPspt2.focus();
			//document.form1.txtSvPspt2.select();
			return;
		}
		if (dw_IsAlphaSp(document.form1.txtSvNm3.value) == false)
		{
			alert('Please, input name in English only.');
			document.form1.txtSvNm3.focus();
			//document.form1.txtSvNm3.select();
			return;
		}
		if ((dw_IsAlphaNumeric(document.form1.txtSvPspt3.value) == false) || (document.form1.txtPsptNo.value == document.form1.txtSvPspt3.value))
		{
			alert('Please, input the correct saver pass passenger passport number.');
			document.form1.txtSvPspt3.focus();
			//document.form1.txtSvPspt3.select();
			return;
		}
	}
	if ((document.form1.selKrpsPsgDvCd.value == '03') && (document.form1.selSvNo.value == '4'))
	{
		if (dw_IsAlphaSp(document.form1.txtSvNm1.value) == false)
		{
			alert('Please, input name in English only.');
			document.form1.txtSvNm1.focus();
			//document.form1.txtSvNm1.select();
			return;
		}
		if ((dw_IsAlphaNumeric(document.form1.txtSvPspt1.value) == false) || (document.form1.txtPsptNo.value == document.form1.txtSvPspt1.value)
			 || (document.form1.txtSvPspt1.value == document.form1.txtSvPspt2.value)  || (document.form1.txtSvPspt1.value == document.form1.txtSvPspt3.value)
			 || (document.form1.txtSvPspt1.value == document.form1.txtSvPspt4.value))
		{
			alert('Please, input the correct saver pass passenger passport number.');
			document.form1.txtSvPspt1.focus();
			//document.form1.txtSvPspt1.select();
			return;
		}
		if (dw_IsAlphaSp(document.form1.txtSvNm2.value) == false)
		{
			alert('Please, input name in English only.');
			document.form1.txtSvNm2.focus();
			//document.form1.txtSvNm2.select();
			return;
		}
		if ((dw_IsAlphaNumeric(document.form1.txtSvPspt2.value) == false) || (document.form1.txtPsptNo.value == document.form1.txtSvPspt2.value)
			 || (document.form1.txtSvPspt2.value == document.form1.txtSvPspt3.value) || (document.form1.txtSvPspt2.value == document.form1.txtSvPspt4.value))
		{
			alert('Please, input the correct saver pass passenger passport number.');
			document.form1.txtSvPspt2.focus();
			//document.form1.txtSvPspt2.select();
			return;
		}
		if (dw_IsAlphaSp(document.form1.txtSvNm3.value) == false)
		{
			alert('Please, input name in English only.');
			document.form1.txtSvNm3.focus();
			//document.form1.txtSvNm3.select();
			return;
		}
		if ((dw_IsAlphaNumeric(document.form1.txtSvPspt3.value) == false) || (document.form1.txtPsptNo.value == document.form1.txtSvPspt3.value)
			 || (document.form1.txtSvPspt3.value == document.form1.txtSvPspt4.value))
		{
			alert('Please, input the correct saver pass passenger passport number.');
			document.form1.txtSvPspt3.focus();
			//document.form1.txtSvPspt3.select();
			return;
		}
		if (dw_IsAlphaSp(document.form1.txtSvNm4.value) == false)
		{
			alert('Please, input name in English only.');
			document.form1.txtSvNm4.focus();
			//document.form1.txtSvNm4.select();
			return;
		}
		if ((dw_IsAlphaNumeric(document.form1.txtSvPspt4.value) == false) || (document.form1.txtPsptNo.value == document.form1.txtSvPspt4.value))
		{
			alert('Please, input the correct saver pass passenger passport number.');
			document.form1.txtSvPspt4.focus();
			//document.form1.txtSvPspt4.select();
			return;
		}
	}

	document.form1.action = '/servlets/pr.pr16100.sw_pr16111_i1Svt';
	document.form1.submit();
}

