
//  ´ë¼ö¼Û
var bt_st_dt  = 20120120;
var bt_cls_dt = 20120125;

//  2010.05.01 ljy ¿À°­¼·Â÷Àå¿äÃ»
function chgSeatAttCd_4(obj)
{
	var strSeatAttCd4Msg = "¼öÀ¯½ÇÀÎÁ¢ ÁÂ¼®Àº KTX ÀÏ¹Ý½Ç¸¸ ¿¹¾à °¡´ÉÇÏ¸ç,\n"
						 + "KTX´Â 7~8,16~17È£Â÷, KTX»êÃµÀº 4~5,14~15È£Â÷ÀÇ ÁÂ¼®À» ¿ì¼± ¿¹¾àÇÏ¸ç\n"
						 + "ÇØ´çÈ£Â÷°¡ ¾Æ´Ñ ´Ù¸¥ ÁÂ¼®ÀÌ ¿¹¾àµÉ ¼ö ÀÖ½À´Ï´Ù";

	if( !obj )
	{
		if( document.form1.txtSeatAttCd_4[document.form1.txtSeatAttCd_4.selectedIndex].value == "31" &&
			(document.form1.selGoTrain[document.form1.selGoTrain.selectedIndex].value != "05" &&
			 document.form1.selGoTrain[document.form1.selGoTrain.selectedIndex].value != "01" &&
			 document.form1.selGoTrain[document.form1.selGoTrain.selectedIndex].value != "02" &&
			 document.form1.selGoTrain[document.form1.selGoTrain.selectedIndex].value != "04"  )      )
		{
			alert("³ëÆ®ºÏ¼®Àº »õ¸¶À»È£¿Í ´©¸®·Î, ÀÏºÎ ¹«±ÃÈ­È£ ¿­Â÷¸¸ ¿¹¾àÀÌ °¡´ÉÇÕ´Ï´Ù.");
			document.form1.selGoTrain[5].selected=true;
		}

		if( document.form1.txtSeatAttCd_4.value == "XX" &&
			document.form1.selGoTrain.value != "00"      )
		{
			alert(strSeatAttCd4Msg);
			document.form1.selGoTrain[0].selected=true;
		}
	}
	else
	{
		if( obj.name == "selGoTrain" )
		{
			if( document.form1.txtSeatAttCd_4[document.form1.txtSeatAttCd_4.selectedIndex].value == "31" &&
				(document.form1.selGoTrain[document.form1.selGoTrain.selectedIndex].value != "05" &&
				 document.form1.selGoTrain[document.form1.selGoTrain.selectedIndex].value != "01" &&
				 document.form1.selGoTrain[document.form1.selGoTrain.selectedIndex].value != "02" &&
				 document.form1.selGoTrain[document.form1.selGoTrain.selectedIndex].value != "04"  )      )
			{
				alert("³ëÆ®ºÏ¼®Àº »õ¸¶À»È£¿Í ´©¸®·Î, ÀÏºÎ ¹«±ÃÈ­È£ ¿­Â÷¸¸ ¿¹¾àÀÌ °¡´ÉÇÕ´Ï´Ù.\n"
					 +"\n"
					 +"³ëÆ®ºÏ ÁÂ¼®¼Ó¼ºÀº ±âº»À¸·Î º¯°æµË´Ï´Ù.");
				document.form1.txtSeatAttCd_4[0].selected=true;
			}

			if( document.form1.txtSeatAttCd_4.value == "XX" &&
				document.form1.selGoTrain.value != "00"      )
			{
				alert(strSeatAttCd4Msg
					 +"\n\n"
					 +"¼öÀ¯½ÇÀÎÁ¢ ÁÂ¼®¼Ó¼ºÀº ±âº»À¸·Î º¯°æµË´Ï´Ù.");
				document.form1.txtSeatAttCd_4[0].selected=true;
			}
		}
		else if( obj.name == "txtSeatAttCd_4" )
		{
			if( document.form1.txtSeatAttCd_4[document.form1.txtSeatAttCd_4.selectedIndex].value == "31" &&
				(document.form1.selGoTrain[document.form1.selGoTrain.selectedIndex].value != "05" &&
				 document.form1.selGoTrain[document.form1.selGoTrain.selectedIndex].value != "01" &&
				 document.form1.selGoTrain[document.form1.selGoTrain.selectedIndex].value != "02" &&
				 document.form1.selGoTrain[document.form1.selGoTrain.selectedIndex].value != "04"  )      )
			{
				alert("³ëÆ®ºÏ¼®Àº »õ¸¶À»È£¿Í ´©¸®·Î, ÀÏºÎ ¹«±ÃÈ­È£ ¿­Â÷¸¸ ¿¹¾àÀÌ °¡´ÉÇÕ´Ï´Ù.\n"
					 +"\n"
					 +"¿­Â÷Á¾º°Àº ÀüÃ¼·Î º¯°æµË´Ï´Ù.");
				document.form1.selGoTrain[5].selected=true;
			}

			if( document.form1.txtSeatAttCd_4.value == "XX" &&
				document.form1.selGoTrain.value != "00"      )
			{
				alert(strSeatAttCd4Msg
					 +"\n\n"
					 +"¿­Â÷Á¾º°Àº KTX·Î º¯°æµË´Ï´Ù.");
				document.form1.selGoTrain[0].selected=true;
			}
		}
	}
}

//  ¾Ë¶ãÂù½º´Â ³ëÆ®ºÏ¼® ºÒ°¡
function chgSeatAttCd_4_2()
{
	if( document.form1.txtSeatAttCd_4[document.form1.txtSeatAttCd_4.selectedIndex].value == "31" )
	{
		alert('³ëÆ®ºÏ¼®Àº »õ¸¶À»È£¿Í ´©¸®·Î, ÀÏºÎ ¹«±ÃÈ­È£ ¿­Â÷¸¸ ¿¹¾àÀÌ °¡´ÉÇÕ´Ï´Ù.');
		document.form1.txtSeatAttCd_4[0].selected=true;
	}
}


var chknum = 0;  //¾È³» ¸Þ½ÃÁö°ü·Ã º¯¼ö

function fn_abrd_alert()
{
	// ¿¹¸ÅÀÏº¯°æ. 2010.06.11 ljy ¿©°´¸¶ÄÉÆÃÆÀ-1299(2010.05.14)
	if( document.form1.txtMenuId.value == '11' //ÀÏ¹Ý
	&&  (document.form1.selGoTrain.value == '00' || document.form1.selGoTrain.value == '05') //ktx or ÀüÃ¼
	&&  chknum < 1
	&&  !(bt_st_dt <= abrddate && abrddate <= bt_cls_dt ) // ´ë¼ö¼Û
	&&  sAfter15Dt && sAfter15Dt <= abrddate )
	{
		alert('15ÀÏÀÌÈÄ Ãâ¹ßÇÏ´Â ¿­Â÷¸¦ ¿¹¾à/¿¹¸Å ÇÏ½Ã´Â °æ¿ì\n\n'
			 +'ÇÒÀÎ»óÇ° -> ¾Ë¶ãÂù½º(±¸.¿¹¸ÅÇÒÀÎ) ¸Þ´º¸¦ ÀÌ¿ëÇÏ½Ã¸é ¿îÀÓÇÒÀÎÀ» ¹ÞÀ» ¼ö ÀÖ½À´Ï´Ù.\n\n'
			 +'´Ü, ÇöÀç´Â KTX ¿­Â÷ÀÇ °æ¿ì¸¸ ¿îÀÓÇÒÀÎÀ» ¹ÞÀ» ¼ö ÀÖÀ¸´Ï Âü°íÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.');
		chknum++;
	}
}

var abrddate = '';

function isValidDateSetting(objYear, objMonth, objDay, objHour)
{
	yy = parseInt(objYear.value, 10);
	mm = parseInt(objMonth.options[objMonth.selectedIndex].value, 10);

	var x = objYear .options[objYear .selectedIndex].value;
	var y = objMonth.options[objMonth.selectedIndex].value;
	var z = objDay  .options[objDay  .selectedIndex].value;


	var ddd = x+y+z;
	abrddate = parseInt(ddd,10);

	fn_abrd_alert();

	if(mm == 1)
	{
		max_days = 31;
	}
	else if(mm == 2)
	{
		if(((yy % 4 == 0) && (yy % 100 != 0)) || (yy % 400 == 0))
		{
			max_days = 29;
		}
		else
		{
			max_days = 28;
		}
	}
	else if (mm == 3)  { max_days = 31; }
	else if (mm == 4)  { max_days = 30; }
	else if (mm == 5)  { max_days = 31; }
	else if (mm == 6)  { max_days = 30; }
	else if (mm == 7)  { max_days = 31; }
	else if (mm == 8)  { max_days = 31; }
	else if (mm == 9)  { max_days = 30; }
	else if (mm == 10) { max_days = 31; }
	else if (mm == 11) { max_days = 30; }
	else if (mm == 12) { max_days = 31; }
	else               { max_days = 31; }

	//¹ÚÁÖ¿À ¼öÁ¤ 20050126 1¿ù 31ÀÏ Á¶È¸ÈÄ 2¿ù ¼±ÅÃ½Ã 2¿ù31ÀÏÀº ¾ø´Ù. °í·Î ÀÏÀÚ¸¦ 1·Î ¼¼ÆÃ
	if (z > max_days)
	{
		z = 1;
	}

	for(i = 0; i < objDay.length; i++)
	{
		//objDay.options[i].value = "";
		objDay.options[i].text  = "";
	}

	objDay.length = max_days;


	// ÀÚ·á Setting
	for(i = 0 ; i < objDay.length; i++)
	{
		if(i < 9)
		{
			objDay.options[i].value = '0'+(i+1);
			objDay.options[i].text  = (i+1);
		}
		else
		{
			objDay.options[i].value = (i+1);
			objDay.options[i].text  = (i+1);
		}
	}

	//alert(ddd);

	// ´Ù¸¥ÀÏÀÚ´Â 00À¸·Î ¿À´ÃÀº ÇöÀç½Ã°¢À¸·Î
	if(sNowDate == ddd)
	{
		objHour.options[parseInt(sHour,10)].selected = true;
	}
	else
	{
		objHour.options[0].selected = true;
	}

	////////////////////////////////////////////////////////////////////////////
	if(y=="01")
	   var anydays = new Date(monName[0]+z+","+x);
	if(y=="02")
	   var anydays = new Date(monName[1]+z+","+x);
	if(y=="03")
	   var anydays = new Date(monName[2]+z+","+x);
	if(y=="04")
	   var anydays = new Date(monName[3]+z+","+x);
	if(y=="05")
	   var anydays = new Date(monName[4]+z+","+x);
	if(y=="06")
	   var anydays = new Date(monName[5]+z+","+x);
	if(y=="07")
	   var anydays = new Date(monName[6]+z+","+x);
	if(y=="08")
	   var anydays = new Date(monName[7]+z+","+x);
	if(y=="09")
	   var anydays = new Date(monName[8]+z+","+x);
	if(y=="10")
	   var anydays = new Date(monName[9]+z+","+x);
	if(y=="11")
	   var anydays = new Date(monName[10]+z+","+x);
	if(y=="12")
	   var anydays = new Date(monName[11]+z+","+x);
	var dw = anydays.getDay();
	document.form1.txtGoYoil.value=objects[dw];

	////////////////////////////////////////////////////////////////////////////

	return;
}

//  ¿ªÁ¶È¸ ÆË¾÷
function btnPopWin(inx, name)
{
	if(inx==1)
	{
		var pop  = window.open('','popWin1',"width=530,height=570,scrollbars=yes");
		pop.location = '/servlets/pr.pr11100.sw_pr11111_f1Svt?hidOpener=' + name;
	}
	else if(inx==2)
	{
		var pop  = window.open('','popWin2',"width=510,height=280,scrollbars=no");
		pop.location = '/pr/pr21100/w_pr21190.jsp?hidOpener=' + name;
	}
}


function fn_kyeungchun(formname)
{
	var frm=eval("document."+formname);
	var GoStart=removeChar(frm.txtGoStart," ");
	var GoEnd  =removeChar(frm.txtGoEnd," ");

	// 2010.01.27 ljy ¿©°´¸¶ÄÉÆÃÆÀ-3050(09.12.21)
	// Áß¾Ó/°æÃá¼± Ãâ¹ß¿ªÀÌ Ã»·®¸®¿ªÀ¸·Î º¯°æµÇµµ·Ï ¾È³»
	if ( GoStart == "¼­¿ï" || GoEnd == "¼­¿ï" )
	{
		for(var w=0; w<=kyeungchun.length; w++)
		{
			if( GoStart==kyeungchun[w] || GoEnd==kyeungchun[w] )
			{
				// 2011.11.29 KCC.AHN °æÃá¼± iTX-Ã»Ãá ¿ì¼±¿ª º¯°æ(Ã»·®¸®->¿ë»ê)
				//if(confirm('¿äÃ»ÇÏ½Å ±¸°£Àº Ã»·®¸®¿ªÀ¸·Î ¿ì¼± ¾È³» µÇ¾îÁý´Ï´Ù. Ã»·®¸®¿ªÀ¸·Î º¯°æÇÏ½Ã°Ú½À´Ï±î?'))
				if(confirm('¿äÃ»ÇÏ½Å ±¸°£Àº ¿ë»ê¿ªÀ¸·Î ¿ì¼± ¾È³» µÇ¾îÁý´Ï´Ù. ¿ë»ê¿ªÀ¸·Î º¯°æÇÏ½Ã°Ú½À´Ï±î?'))
				{
					if(GoEnd=="¼­¿ï")
						//frm.txtGoEnd.value = "Ã»·®¸®";
						frm.txtGoEnd.value = "¿ë»ê";
					else
						//frm.txtGoStart.value = "Ã»·®¸®";
						frm.txtGoStart.value = "¿ë»ê";
				}
			}
		}
	}
}

//  °æÃá¼± ¿îÇàÁßÁö 2010.12.08 ljy
function chkJrny()
{
	fn_kyeungchun2('form1');
}

//  °æÃá¼± ¿îÇàÁßÁö 2010.12.08 ljy
function fn_kyeungchun2(formname)
{
	var frm=eval("document."+formname);
	var abrddate  = parseInt(frm.txtGoAbrdDt.value,10);

	var chkflg1 = "N";
	var chkflg2 = "N";

	for(var w=0; w<=kyeungchun.length; w++)
	{
		if( frm.txtGoStart.value==kyeungchun[w] )
		{
			chkflg1 = "Y";
		}

		if( frm.txtGoEnd.value==kyeungchun[w] )
		{
			chkflg2 = "Y";
		}
	}

	if( chkflg1 == "Y" && chkflg2 == "Y" )
	{
		alert("12¿ù21ÀÏºÎÅÍ º¹¼±ÀüÃ¶(»óºÀ-ÃáÃµ)ÀÌ °³ÅëµÇ¾î °æÃá¼± ¹«±ÃÈ­¿­Â÷´Â ¿îÇàÇÏÁö ¾Ê½À´Ï´Ù.");
	}
}

//  Ãâ¹ß¿ª µµÂø¿ª ÀÌ¸§ ±³È¯
function sta_chg(formname)
{
	var frm=eval("document."+formname);
	var sta_tmp = "";

	sta_tmp = frm.txtGoEnd.value;
	frm.txtGoEnd  .value = frm.txtGoStart.value;
	frm.txtGoStart.value = sta_tmp;
}


// ½ºÄÉÁÙÃ¼Å© °øÅëÇÔ¼ö 2010.12.24 ljy
function fn_chkSchedule(formname)
{
	// °øÇ×Á÷Åë
	//if( fn_chkAirportStn(formname) == "stop" ) return "move";

	// ´ë¼ö¼Û 2010.12.30 ljy
	if( fn_chkBt(formname) == "stop" ) return "move";
}

function fn_chkSchedule2(formname)
{
	// 2nd¿©Á¤ 2011.08.16 ljy
	fn_2ndJrny(formname);
	
	// °øÇ×Á÷Åë
	//if( fn_chkAirportStn(formname) == "stop" ) return "stop";

	// ¿ª¸í Ã¼Å© 2011.08.01 ljy
	if( fn_chkStnName(formname) == "stop" ) return "stop";

	// ´ë¼ö¼Û 2010.12.30 ljy
	if( fn_chkBt(formname) == "stop" ) return "stop";

	// ¾Ë¸²(ÅÂÈ­°­,°æÁÖ)
	fn_notice(formname);

	// È£³²¼± ÃßÃµ°æ·Î
	fn_RecPath(formname);

	// °æÃá¼± ÃßÃµ°æ·Î
	//fn_kyeungchun(formname);

	// °æÃá¼± ¿îÇàÁßÁö 2010.12.08 ljy
	// 2011.11.29 KCC.AHN °æÃá¼± iTX-Ã»Ãá ¿îÇàÀç°³
	//fn_kyeungchun2(formname);

	// ±âÅ¸ 2011.02.11
	//fn_etc_notice(formname);
}


function fn_chkSchedule3(formname)
{
	// 2nd¿©Á¤ 2011.08.16 ljy
	fn_2ndJrny(formname);
}

function fn_2ndJrny(formname)
{
	var frm=eval("document."+formname);
	var abrddate = parseInt(frm.txtGoAbrdDt.value,10);
	var GoStart=removeChar(frm.txtGoStart," ");
	var GoEnd  =removeChar(frm.txtGoEnd," ");

	//alert("abrddate="+abrddate);

	if( frm.txtMenuId.value != '11' || typeof(frm.txtGoStartCode2) == 'undefined' || typeof(frm.txtGoEndCode2) == 'undefined' )
		return;

	frm.txtGoStartCode2.value = "";
	frm.txtGoEndCode2  .value = "";
	frm.SeandYo        .value = "";

	if( typeof(gyeongbu2) == 'undefined' ) return;

	for(var w=0; w<=gyeongbu2.length; w++)
	{
		if(GoStart==gyeongbu2[w])
		{
			if(GoEnd=="¼­¿ï")
			{
				frm.txtGoStartCode2.value = GoStart;
				frm.txtGoEndCode2  .value = "¿ë»ê";
				//alert("txtGoStartCode2="+frm.txtGoStartCode2.value+"\n"
				//	 +"txtGoEndCode2  ="+frm.txtGoEndCode2  .value);
			}
		}
	}

	/*
	for(var w=0; w<=gyeongbu2.length; w++)
	{
		if(GoEnd==gyeongbu2[w])
		{
			if(GoStart=="¼­¿ï")
			{
				frm.txtGoStartCode2.value = "¿ë»ê";
				frm.txtGoEndCode2  .value = GoEnd;
				alert("2txtGoStartCode2="+frm.txtGoStartCode2.value+"\n"
					 +"txtGoEndCode2  ="+frm.txtGoEndCode2  .value);
			}
		}
	}
	*/
}

function fn_chkRsv(formname)
{
	var frm=eval("document."+formname);
	var abrddate = parseInt(frm.txtGoAbrdDt.value,10);

	//alert("abrddate="+abrddate);

	// ¸®¸ðµ¨¸µ¾È³» 2011.05.18 ljy À¯¸í¼÷
	if( abrddate <= 20110519
	&& (((frm.txtGoStart.value == "´ëÀü" ||
		  frm.txtGoEnd  .value == "´ëÀü"  )  ) ||

		((frm.txtMenuId.value == "13" || frm.txtMenuId.value == "23" || frm.txtMenuId.value == "33" ) &&
		 (frm.txtComeStart.value == "´ëÀü" ||
		  frm.txtComeEnd  .value == "´ëÀü"  ) ) ) )
	{
		alert("´ëÀü¿ª ¸â¹ö½Ê¶ó¿îÁö´Â ¸®¸ðµ¨¸µ °ø»ç·Î ÀÌ¿ëÀÌ ÀÏ½Ã ÁßÁöµË´Ï´Ù.");
	}
}

//  ±âÅ¸
function fn_etc_notice(formname)
{
	var frm=eval("document."+formname);
	var abrddate = parseInt(frm.txtGoAbrdDt.value,10);

	if( 20110213 <= abrddate ) return;

	if( frm.selGoTrain.value != "00" && frm.selGoTrain.value != "05" ) return;

	// ±¤¸í 20110211 ljy
	if( ((frm.txtMenuId.value != "13" && frm.txtMenuId.value != "23" && frm.txtMenuId.value != "33" ) &&
		 (frm.txtGoStart  .value == "±¤¸í" ||
		  frm.txtGoEnd    .value == "±¤¸í"  )  ) ||

		((frm.txtMenuId.value == "13" || frm.txtMenuId.value == "23" || frm.txtMenuId.value == "33" ) &&
		 (frm.txtGoStart  .value == "±¤¸í" ||
		  frm.txtGoEnd    .value == "±¤¸í" ||
		  frm.txtComeStart.value == "±¤¸í" ||
		  frm.txtComeEnd  .value == "±¤¸í"  )  )  )
	{
		alert("»ç°í·Î KTX°¡ ±¤¸í¿ªÀ¸·Î ¿îÇàÇÏÁö ¾Ê°í ¼ö¿ø¿ªÀ» °æÀ¯ÇÏ¿© ¿îÇàµË´Ï´Ù.");
	}

	// Ãµ¾È¾Æ»ê
	if( ((frm.txtMenuId.value != "13" && frm.txtMenuId.value != "23" && frm.txtMenuId.value != "33" ) &&
		 (frm.txtGoStart  .value == "Ãµ¾È¾Æ»ê" ||
		  frm.txtGoEnd    .value == "Ãµ¾È¾Æ»ê"  )  ) ||

		((frm.txtMenuId.value == "13" || frm.txtMenuId.value == "23" || frm.txtMenuId.value == "33" ) &&
		 (frm.txtGoStart  .value == "Ãµ¾È¾Æ»ê" ||
		  frm.txtGoEnd    .value == "Ãµ¾È¾Æ»ê" ||
		  frm.txtComeStart.value == "Ãµ¾È¾Æ»ê" ||
		  frm.txtComeEnd  .value == "Ãµ¾È¾Æ»ê"  )  )  )
	{
		alert("»ç°í·Î KTX°¡ Ãµ¾È¾Æ»ê¿ªÀ¸·Î ¿îÇàÇÏÁö ¾Ê°í Ãµ¾È¿ªÀ» °æÀ¯ÇÏ¿© ¿îÇàµË´Ï´Ù.");
	}

	// ¿À¼Û
	if( ((frm.txtMenuId.value != "13" && frm.txtMenuId.value != "23" && frm.txtMenuId.value != "33" ) &&
		 (frm.txtGoStart  .value == "¿À¼Û" ||
		  frm.txtGoEnd    .value == "¿À¼Û"  )  ) ||

		((frm.txtMenuId.value == "13" || frm.txtMenuId.value == "23" || frm.txtMenuId.value == "33" ) &&
		 (frm.txtGoStart  .value == "¿À¼Û" ||
		  frm.txtGoEnd    .value == "¿À¼Û" ||
		  frm.txtComeStart.value == "¿À¼Û" ||
		  frm.txtComeEnd  .value == "¿À¼Û"  )  )  )
	{
		alert("»ç°í·Î KTX°¡ ¿À¼Û¿ªÀ¸·Î ¿îÇàÇÏÁö ¾Ê°í Ãµ¾È-´ëÀüÀ¸·Î ¿îÇàµË´Ï´Ù.");
	}

}


function fn_RecPath(formname)
{
	var frm=eval("document."+formname);

	if( frm.txtMenuId.value != "11" ) //ÀÏ¹Ý¸Þ´º¸¸ Çã¿ë
	{
		return;
	}


	//////////////////////////////////////// ¼­¿ï ¿ë»ê Ç¥Ãâ Ãß°¡ 20060112 ¹ÚÁÖ¿À
	var GoStart=removeChar(frm.txtGoStart," ");
	var GoEnd  =removeChar(frm.txtGoEnd," ");

	frm.txtGoStart.value=GoStart;
	frm.txtGoEnd.value=GoEnd;

	var CheckBit=0;
	var Gubun=0;

	if( !((GoStart == "¼­¿ï"   && GoEnd == "¼­¿ï"  ) ||
		  (GoStart == "¼­¿ï"   && GoEnd == "¿ë»ê"  ) ||
		  (GoStart == "¿ë»ê"   && GoEnd == "¼­¿ï"  ) ||
		  (GoStart == "´ëÀü"   && GoEnd == "¼­´ëÀü") ||
		  (GoStart == "¼­´ëÀü" && GoEnd == "´ëÀü"  )  )  )
	{
		if(GoStart == "¼­¿ï" || GoStart == "´ëÀü")
		{
			for(var w=0; w<=honam.length; w++)
			{
				if(GoEnd==honam[w])
				{
					/* 2009.06.04 nkh ¼öÁ¤*/
					if(GoEnd=="¿ë»ê")
					{
						if(confirm('¿äÃ»ÇÏ½Å ±¸°£Àº ¼­¿ï¿ªÀ¸·Î ¿ì¼± ¾È³» µÇ¾îÁý´Ï´Ù. ¼­¿ï¿ªÀ¸·Î º¯°æÇÏ½Ã°Ú½À´Ï±î?'))
							frm.txtGoEnd.value = "¼­¿ï";
					}
					else
					{
						if(confirm('¿äÃ»ÇÏ½Å ±¸°£Àº '+((GoStart=="¼­¿ï")?"¿ë»ê":"¼­´ëÀü")+'¿ªÀ¸·Î ¿ì¼± ¾È³» µÇ¾îÁý´Ï´Ù. '+((GoStart=="¼­¿ï")?"¿ë»ê":"¼­´ëÀü")+'¿ªÀ¸·Î º¯°æÇÏ½Ã°Ú½À´Ï±î?'))
							frm.txtGoStart.value = (GoStart=="¼­¿ï")?"¿ë»ê":"¼­´ëÀü";
					}
				}
			}
			if(frm.radJobId[0].checked == true) // Á÷Åë
			{
				if(frm.selGoTrain.value != "04") // ´©¸®·Î Á¦¿Ü
				{
					for(w=0; w<=janghang.length; w++)
					{
						if(GoEnd==janghang[w])
						{
							if(confirm('¿äÃ»ÇÏ½Å ±¸°£Àº '+((GoStart=="´ëÀü")?"¼­´ëÀü":"¿ë»ê")+'¿ªÀ¸·Î ¿ì¼± ¾È³» µÇ¾îÁý´Ï´Ù. '+((GoStart=="´ëÀü")?"¼­´ëÀü":"¿ë»ê")+'¿ªÀ¸·Î º¯°æÇÏ½Ã°Ú½À´Ï±î?'))
								frm.txtGoStart.value=(GoStart=="´ëÀü")?"¼­´ëÀü":"¿ë»ê";
						}
					}
				}
			}
			Gubun++;
		}

		if(Gubun == 0)
		{
			if(GoEnd == "¼­¿ï" || GoEnd == "´ëÀü")
			{
				for(var w=0; w<=honam.length; w++)
				{
					if(GoStart==honam[w])
					{
						if(confirm('¿äÃ»ÇÏ½Å ±¸°£Àº '+((GoEnd=="¼­¿ï")?"¿ë»ê":"¼­´ëÀü")+'¿ªÀ¸·Î ¿ì¼± ¾È³» µÇ¾îÁý´Ï´Ù. ' +((GoEnd=="¼­¿ï")?"¿ë»ê":"¼­´ëÀü")+'¿ªÀ¸·Î º¯°æÇÏ½Ã°Ú½À´Ï±î?'))
							frm.txtGoEnd.value=(GoEnd=="¼­¿ï")?"¿ë»ê":"¼­´ëÀü";
					}
				}
				if(frm.radJobId[0].checked == true) // Á÷Åë
				{
					if(frm.selGoTrain.value != "04") // ´©¸®·Î Á¦¿Ü
					{
						for(w=0; w<=janghang.length; w++)
						{
							if(GoStart==janghang[w])
							{
								if(confirm('¿äÃ»ÇÏ½Å ±¸°£Àº '+((GoEnd=="¼­¿ï")?"¿ë»ê":"¼­´ëÀü")+'¿ªÀ¸·Î ¿ì¼± ¾È³» µÇ¾îÁý´Ï´Ù. '+((GoEnd=="¼­¿ï")?"¿ë»ê":"¼­´ëÀü")+'¿ªÀ¸·Î º¯°æÇÏ½Ã°Ú½À´Ï±î?'))
									frm.txtGoEnd.value=(GoEnd=="¼­¿ï")?"¿ë»ê":"¼­´ëÀü";
							}
						}
					}
				}
			}
		}
	}
	//////////////////////////////////////// ¼­¿ï ¿ë»ê Ç¥Ãâ Ãß°¡ 20060112 ¹ÚÁÖ¿À
}



//  ¾Ë¸²
function fn_notice(formname)
{
	var frm=eval("document."+formname);
	var abrddate = parseInt(frm.txtGoAbrdDt.value,10);

	/* ÅÂÈ­°­¾È³» »èÁ¦. 2011.05.27 ljy ¿©°´¸¶ÄÉÆÃÃ³ µµÇöÃ¶ºÎÀå ¿äÃ»(0526vocÀÏÀÏÇöÈ²)
	// ÅÂÈ­°­ 2010.09.30 ljy
	if( ( frm.txtMenuId.value == "11" &&
		 (frm.txtGoStart  .value == "¿ï»ê" ||
		  frm.txtGoEnd    .value == "¿ï»ê"  )  ) ||

		((frm.txtMenuId.value == "13" || frm.txtMenuId.value == "23" || frm.txtMenuId.value == "33" ) &&
		 (frm.txtGoStart  .value == "¿ï»ê" ||
		  frm.txtGoEnd    .value == "¿ï»ê" ||
		  frm.txtComeStart.value == "¿ï»ê" ||
		  frm.txtComeEnd  .value == "¿ï»ê"  )  )  )
	{
		alert("2010³â 11¿ù 1ÀÏºÎÅÍ (±¸)¿ï»ê¿ªÀÌ \'ÅÂÈ­°­¿ª\'À¸·Î º¯°æµÇ°í\n"
			 +"KTX ½Å¼³¿ªÀÌ \'¿ï»ê¿ª\'ÀÌ µË´Ï´Ù.");
	}
	*/

	// ½Å°æÁÖ 2010.10.13 ljy
	// È²ÇØ·æ ¿äÃ»À¸·Î »èÁ¦ 2011.11.23 ljy
	/*
	if( frm.txtMenuId.value == "11" && //ÀÏ¹Ý¸Þ´º¿¡¼­¸¸
	   (frm.txtGoStart.value == "°æÁÖ" || frm.txtGoEnd.value == "°æÁÖ") )
	{
		alert("KTX½Å¼³¿ª \'½Å°æÁÖ¿ª\'ÀÌ µ¿½Ã¿¡ Á¶È¸µË´Ï´Ù.");
	}
	*/
}

function fn_chkStnName(formname)
{
	var frm=eval("document."+formname);
	var abrddate = parseInt(frm.txtGoAbrdDt.value,10);

	if( frm.txtGoStart.value == "°øÇ×¼­¿ï" )
	{
		alert("°øÇ×¼­¿ï¿ªÀÌ ¼­¿ï¿ªÀ¸·Î ÅëÇÕµÇ¾ú½À´Ï´Ù.\n\n"
			 +"È®ÀÎÀ» ´©¸£½Ã¸é ¼­¿ï¿ªÀ¸·Î Á¶È¸µË´Ï´Ù.");
		frm.txtGoStart.value = "¼­¿ï";
	}

	if( frm.txtGoEnd.value == "°øÇ×¼­¿ï" )
	{
		alert("°øÇ×¼­¿ï¿ªÀÌ ¼­¿ï¿ªÀ¸·Î ÅëÇÕµÇ¾ú½À´Ï´Ù.\n\n"
			 +"È®ÀÎÀ» ´©¸£½Ã¸é ¼­¿ï¿ªÀ¸·Î Á¶È¸µË´Ï´Ù.");
		frm.txtGoEnd.value = "¼­¿ï";
	}
	
	if( abrddate < 20111001 )
	{
		if( frm.txtGoStart.value.toUpperCase() == "¿©¼öEXPO"
		||  frm.txtGoStart.value == "¿©¼ö¿¢½ºÆ÷" )
			frm.txtGoStart.value = "¿©¼ö";

		if( frm.txtGoEnd.value.toUpperCase() == "¿©¼öEXPO"
		||  frm.txtGoEnd.value == "¿©¼ö¿¢½ºÆ÷" )
			frm.txtGoEnd.value = "¿©¼ö";
	}
}



function fn_chkAirportStn(formname)
{
	var frm=eval("document."+formname);
	var abrddate = parseInt(frm.txtGoAbrdDt.value,10);

	if( frm.txtMenuId.value == "91" )
	{
		if( abrddate >= 20110801 )
		{
			//alert("'°øÇ×Á÷Åë'¿­Â÷¿Í KTX(ÀÏ¹Ý¿­Â÷ Æ÷ÇÔ)¿­Â÷¸¦\n"
			//	 +"ÇÏ³ªÀÇ ½ÂÂ÷±ÇÀ¸·Î ¿¹¾àÇÒ ¼ö ÀÖµµ·Ï ÁØºñÁßÀÔ´Ï´Ù.\n\n"
			//	 +"ÀÌ¿¡ µû¶ó, 2011³â8¿ù1ÀÏ ÀÌÈÄ ½ÂÂ÷±ÇÀº ¿¹¾àÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.\n\n"
			//	 +"ÀÌ¿ë¿¡ ºÒÆíÀ» µå·Á ÁË¼ÛÇÕ´Ï´Ù");
			alert("2011³â 8¿ù 1ÀÏºÎÅÍ KTX(ÀÏ¹Ý¿­Â÷ Æ÷ÇÔ) ¿­Â÷¿Í °øÇ×Á÷Åë ¿­Â÷¸¦\n"
				 +"ÇÏ³ªÀÇ ½ÂÂ÷±ÇÀ¸·Î ¿¹¾àÇÒ ¼ö ÀÖµµ·Ï ÁØºñÁßÀÔ´Ï´Ù.\n\n"
				 +"2011³â 8¿ù 1ÀÏÀÌÈÄÀÇ °øÇ×Á÷Åë½ÂÂ÷±ÇÀº ½Ã½ºÅÛ º¯°æÀ¸·Î ÀÎÇØ\n"
				 +"8¿ù 1ÀÏºÎÅÍ ¿¹¾àÀÌ °¡´ÉÇÕ´Ï´Ù.\n\n"
				 +"º¸´Ù ³ªÀº ¼­ºñ½º¸¦ À§ÇØ ÃÖ¼±À» ´ÙÇÏ°Ú½À´Ï´Ù.");
			return "stop";
		}

		//if( frm.txtGoStart.value == "¼­¿ï" )
		//{
		//  alert("Á¶È¸½Ã ¼­¿ï ´ë½Å¿¡ °øÇ×¼­¿ï·Î ÀÔ·ÂÇÏ¿© ÁÖ¼¼¿ä.");
		//  frm.txtGoStart.value = "°øÇ×¼­¿ï";
		//}
		//
		//if( frm.txtGoEnd  .value == "¼­¿ï" )
		//{
		//  alert("Á¶È¸½Ã ¼­¿ï ´ë½Å¿¡ °øÇ×¼­¿ï·Î ÀÔ·ÂÇÏ¿© ÁÖ¼¼¿ä.");
		//  frm.txtGoEnd.value = "°øÇ×¼­¿ï";
		//}
		//
		//if( (frm.txtGoStart.value != "°øÇ×¼­¿ï" && frm.txtGoStart.value != "ÀÎÃµ°øÇ×") ||
		//  (frm.txtGoEnd  .value != "°øÇ×¼­¿ï" && frm.txtGoEnd  .value != "ÀÎÃµ°øÇ×")  )
		//{
		//  alert("ÃâµµÂø¿ª¿¡´Â °øÇ×¼­¿ï ¶Ç´Â ÀÎÃµ°øÇ×À¸·Î ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		//  return "stop";
		//}
	}
	else
	{
		if( frm.txtGoStart.value == "°øÇ×¼­¿ï" || frm.txtGoEnd.value == "°øÇ×¼­¿ï" ||
			frm.txtGoStart.value == "ÀÎÃµ°øÇ×" || frm.txtGoEnd.value == "ÀÎÃµ°øÇ×"  )
		{
			if( confirm("°øÇ×Á÷ÅëÁ¶È¸´Â Á¦ÈÞ»óÇ°¡¤°øÇ×Á÷Åë¸Þ´º¿¡¼­ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.\n\n°øÇ×Á÷ÅëÈ­¸éÀ¸·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?") )
			{
				document.location.href = adv01_0403;//pub2+"/pr/pr12600/w_pr12610.jsp";
				return "stop";
			}
		}
	}
}

function fn_chkBt(formname)
{
	var frm=eval("document."+formname);

	var abrddate = parseInt(frm.txtGoAbrdDt.value,10);

	if( sNowDate == null || sHour == null )  return;

	//alert("yyyymmddhh="+(sNowDate+sHour));
	// ¿¹¸Å±â°£µ¿¾È¸¸
	if( (sNowDate+sHour) <= 2011122000 || 2011122108 <= (sNowDate+sHour) ) return;


	if( bt_st_dt <= abrddate && abrddate <= bt_cls_dt )
	{
		//ÀÎÃµ°øÇ×Á¦¿Ü 2011.08.05 ljy
		if( frm.txtGoStart.value == "ÀÎÃµ°øÇ×" || frm.txtGoEnd.value == "ÀÎÃµ°øÇ×" )
		{
			return;
		}

		alert("¸íÀý´ë¼ö¼Û ±â°£¿¡ ´ëÇÑ ¿­Â÷ Á¶È¸ ¹× ¿¹¾àÀº ¸íÀýÈ¨ÆäÀÌÁö(www.korail.com)¿¡¼­ ÀÌ¿ë°¡´ÉÇÕ´Ï´Ù.");
		//return "stop";
	}


	/*
	if( frm.txtMenuId.value == "11" && //ÀÏ¹Ý¸Þ´º¿¡¼­¸¸
		sNowDate != null && bt_st_dt <= sNowDate && sNowDate <= bt_cls_dt )
	{
		alert("¸íÀý ½ÂÂ÷±ÇÀÇ ÀÜ¿©¼® Á¶È¸ ÀÌ¿ëÀÚ°¡ ¸¹¾Æ Á¶È¸°¡ Áö¿¬µÇ°í ÀÖ½À´Ï´Ù.\n"
			 +"\n"
			 +"[È®ÀÎ]À» Å¬¸¯ÇÏ½Ã¸é ÀÜ¿©¼® Á¶È¸½Ã±îÁö ¼öºÐÀÌ ¼Ò¿äµË´Ï´Ù.\n"
			 +"\n"
			 +"ÀÌ¿ë¿¡ Âü°íÇÏ¿© ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
	}
	*/
}

function fn_chkPeople(a,b,c,d,e,f)
{
	/* Ç×»ó ÀÎ¿øÁ¤º¸ ¾È³» pop-upÀ» ¶ç¿î´Ù.
	   ´Ü, ¾î¸¥¸¸À¸·Î ±¸¼ºµÅ ÀÖÀ» °æ¿ì¿¡´Â Á¦¿ÜÇÑ´Ù 2010.06.18 */
	var msg = 0;

	if ( b+c+d+e > 0 )
	{
		//alert('¾î¸¥1¸íÀÌ ¼±ÅÃµÇ¾î ÀÖ½À´Ï´Ù.');

		if ( a > 0 )
		{
			msg = "¾î       ¸¥ : " + a + "¸í";
		}

		if ( b > 0 )
		{
			if ( a > 0 )
			{
				msg = msg + "\n\n";
				msg = msg + "¾î  ¸°  ÀÌ : " + b + "¸í";
			}
			else
			{
				msg = "¾î  ¸°  ÀÌ : " + b + "¸í";
			}
		}

		if ( c > 0 )
		{
			if ( a + b > 0 )
			{
				msg = msg + "\n\n";
				msg = msg + "°æ       ·Î : " + c + "¸í";
			}
			else
			{
				msg = "°æ       ·Î : " + c + "¸í";
			}
		}

		if ( d > 0 )
		{
			if ( a + b + c > 0 )
			{
				msg = msg + "\n\n";
				msg = msg + "Àå¾Ö1-3±Þ : " + d + "¸í";
			}
			else
			{
				msg = "Àå¾Ö1-3±Þ : " + d + "¸í";
			}
		}

		if ( e > 0 )
		{
			if ( a + b + c + d > 0 )
			{
				msg = msg + "\n\n";
				msg = msg + "Àå¾Ö4-6±Þ : " + e + "¸í";
			}
			else
			{
				msg = "Àå¾Ö4-6±Þ : " + e + "¸í";
			}
		}

		if ( f > 0 )
		{
			if ( a + b + c + d + e > 0 )
			{
				msg = msg + "\n\n";
				msg = msg + "Ã»  ¼Ò  ³â : " + f + "¸í";
			}
			else
			{
				msg = "Ã»  ¼Ò  ³â : " + f + "¸í";
			}
		}

		msg = msg + "\n\n¸Â½À´Ï±î?";

		if (confirm(msg) == false)
		{
			return "stop";
		}
	}
}

function hideResult()
{
	//alert(document.getElementById("divResult"));
	if( document.getElementById("divResult") != null && document.getElementById("divResult").style.display != 'none')
		document.getElementById("divResult").style.display = 'none';
}

//  KTX001¿­Â÷ ¾È³» 2011.12.19 ljy
function chkDtourFlg(h_dtour_flg)
{
	var result = true;
	var sDtourTxt = "¼±ÅÃÇÏ½Å ¿­Â÷´Â ´Ù¸¥ ¿­Â÷¿¡ ºñÇØ Á¤Â÷¿ª ¼ö°¡ Àû¾î °¡°ÝÀÌ ÃÖ´ë 0.6% ³ô½À´Ï´Ù.\n"
				  + "\n"
				  + "°è¼Ó ÁøÇàÇÏ½Ã°Ú½À´Ï±î?";

	if( h_dtour_flg == "S" )
	{
		if( confirm(sDtourTxt) )
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	
	return true;
}

