/**************************************
* ÆÄ  ÀÏ  ¸í : dt-booking.xsl
* ±â      ´É : ¿¹¾à°ü·Ã js
* ÀÛ  ¼º  ÀÚ : ¾Èº´È£
* ÀÛ  ¼º  ÀÏ : 2008.03
**************************************/  

var validator = new Validate();
var frm = document.frm;




//-- DAYTOUR °Ë»ö
function goSearch() {
	var targetCnt = 0;	
	//if(frm.city_code.value ==""){
		if(validator.isAllSpace(frm.areaCode.value) == true) {
			alert("°Ë»öÇÒ Áö¿ªÀ» ¼±ÅÃÇÏ¼¼¿ä.") ;
			frm.areaCode.focus();
			return ;
		}	
	//}

	if (validator.isOnlyNumeric(frm.adtAaleCnt.value) == false || validator.isOnlyNumeric(frm.chdAaleCnt.value) == false || validator.isOnlyNumeric(frm.infAaleCnt.value) == false ) {
		alert("Å¾½ÂÀÎ¿øÀº ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä.") ;
		frm.adtAaleCnt.focus();
		return ;
	}
	
	if (validator.isAllSpace(frm.adtAaleCnt.value) == true) {
		targetCnt = targetCnt + 0;
		frm.adtAaleCnt.value=0;
	}
	else {
		targetCnt = targetCnt + frm.adtAaleCnt.value;
	}
	
	if (validator.isAllSpace(frm.chdAaleCnt.value) == true) {
		targetCnt = targetCnt + 0;
		frm.chdAaleCnt.value=0;
	}
	else {
		targetCnt = targetCnt + frm.chdAaleCnt.value;
	}
	
	if (validator.isAllSpace(frm.infAaleCnt.value) == true) {
		targetCnt = targetCnt + 0;
		frm.infAaleCnt.value=0;
	}
	else {
		targetCnt = targetCnt + frm.infAaleCnt.value;
	}
	
	if (targetCnt == 0) {
		alert("Çà»çÀÎ¿øÀº 1¸íÀÌ»ó ÀÔ·ÂÇÏ¼¼¿ä.") ;
		frm.adtAaleCnt.select();
		frm.adtAaleCnt.focus();
		return ;		
	}		
	
	if(validator.isAllSpace(frm.applyDate.value) == true) {
		alert("Çà»çÀÏÀ» ¼±ÅÃÇÏ¼¼¿ä.") ;
		frm.applyDate.focus();
		return ;
	}
	/*
	if(validator.isAllSpace(frm.city_search.value) == true) {
		frm.city_code.value="";
		frm.city_name.value="";
		frm.country_name.value="";
	}
	*/
	frm.match_areaCode.value="";
	frm.target ="";
	frm.action = "dt-10000.asp";
	frm.searchYN.value="Y";
	frm.submit();


}


//ÀÏÁ¤Ç¥ÀÌµ¿
function go_Itinerary(compCode,dayCode,applyDate, adtAaleCnt, chdAaleCnt,infAaleCnt, gubn){
//
	//p_applyDate = '<xsl:value-of select="$p_applyDate" />';
	p_applyDate = applyDate;
	if(gubn =="opener"){
		opener.window.name="hanaopener";
		//opener.window.focus();
		//opener.location.href="dt-30000.asp?dayCode="+dayCode+"&applyDate="+p_applyDate+"&typeCode="+gubn+"&compCode="+compCode+"&adtAaleCnt="+adtAaleCnt+"&chdAaleCnt="+chdAaleCnt+"&infAaleCnt="+infAaleCnt;
		var tmp = opener.window.open("dt-30000.asp?dayCode="+dayCode+"&applyDate="+p_applyDate+"&typeCode="+gubn+"&compCode="+compCode+"&adtAaleCnt="+adtAaleCnt+"&chdAaleCnt="+chdAaleCnt+"&infAaleCnt="+infAaleCnt,"hanaopener");
		opener.focus();
		
	}else{
		location.href="dt-30000.asp?dayCode="+dayCode+"&applyDate="+p_applyDate+"&typeCode="+gubn+"&compCode="+compCode+"&adtAaleCnt="+adtAaleCnt+"&chdAaleCnt="+chdAaleCnt+"&infAaleCnt="+infAaleCnt;
	}
	
}



//-- µ¥ÀÌÅõ¾î ¿¹¾à°Ë»ö
function goBookingSearch(compCode, dayCode,cancelEndDate,xtoday, xapplyDate, gubn) {
	if(gubn =="opener"){
		opener.window.name="hanaopener";
		frmBooking.target = "hanaopener";
	}
	if(parseInt(frmBooking.adultCnt.value) + parseInt(frmBooking.childCnt.value) + parseInt(frmBooking.infantCnt.value) ==0){
		alert("¿¹¾à ÀÎ¿ø¼ö°¡ ¾ø½À´Ï´Ù.\n\n¿¹¾àÀÎ¿øÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		return;
	}
	
	if(frmBooking.bookingNo.value != ""){
		//frmBooking.compCode.value= compCode;
		//frmBooking.dayCode.value= dayCode;
		//frmBooking.action = "https://manager.hanatour.com/wsv/product/daytour/dt-4000.asp";
		//frmBooking.submit();
		if(confirm("¼±ÅÃÇÏ½Å »óÇ°À¸·Î ¿¹¾àÀÌ º¯°æµË´Ï´Ù. º¯°æÇÏ½Ã°Ú½À´Ï±î?")){
			document.location.href="dt-42000.asp?bookingCode="+ frm.bookingNo.value +"&new_day_code="+dayCode+"&new_compCode="+compCode+"&new_applyDate="+xapplyDate;
		}
	}else{
		if(parseInt(xtoday)  > parseInt(cancelEndDate) ){
			if(confirm("Ãë¼Ò¸¶°¨ÀÏÀÌ Áö³­ ¿¹¾à¿äÃ»ÀÌ¹Ç·Î ¿¹¾àÁøÇàÁß¿¡ Ãë¼Ò½Ã Ãë¼Ò·á°¡ ºÎ°úµÉ¼ö ÀÖ½À´Ï´Ù. ¿¹¾àÇÏ½Ã°Ú½À´Ï±î?")){
				frmBooking.compCode.value= compCode;
				frmBooking.dayCode.value= dayCode;
				frmBooking.action = "dt-40000.asp";
				frmBooking.submit();
			}
			
		}else{
			frmBooking.compCode.value= compCode;
			frmBooking.dayCode.value= dayCode;
			frmBooking.action = "dt-40000.asp";
			frmBooking.submit();
		}
	}
	
}

//SMS
function sendSMS(){
	var d_win = window.open("https://manager.hanatour.com/asp/tnb/sms/sm-10000.asp","manager_schd_sms","menubar=0,resizable=1,width=60,height=60,status=0,location=0,toolbar=0,scrollbars=1");
}

//ÀÎ¼â ·¹ÀÌ¾î
function showPrintItinerary(obj) {
	var left, top;
	if(obj.offsetParent==null) {
		left=0;
		top=0;
	}
	else{
		left=getAbsLeft(obj) - 120;  
		top=getAbsTop(obj)+obj.height+1;
	}
	if(document.all['LayerPrintItinerary'].style.visibility=="visible") 
	{ 
		hideLayer('LayerPrintItinerary');
	}
	else
	{	
		showLayer('LayerPrintItinerary', left, top);
	}
}

//ÀÎ¼âÇÏ±â¹öÆ°
function goPopPrint(pk,xdiv1,xdiv2) {

	window.open ('','popPrintItinerary','menubar=0,resizable=1,width=740,height=600,status=0,location=0,toolbar=0,scrollbars=1,menubar=1');
	
	document.frmPrint.action="dt-31000.asp";
	document.frmPrint.target="popPrintItinerary";
	//document.frmPrint.pkg_code.value=pk;
	document.frmPrint.top_print.value = xdiv1.innerHTML; //»ó´ÜHTML
	document.frmPrint.bottom_print.value = xdiv2.innerHTML; //ÇÏ´ÜHTML
	document.frmPrint.submit();
	//hideLayer('LayerPrintItinerary');
}

function goPhone(cd) {
	window.open ('https://manager.hanatour.com/wsv/product/daytour/dt-60000.asp?pkg_code='+cd,'popPhone','menubar=0,resizable=1,width=650,height=510,scrollbars=0');
}

//ÀÏÁ¤Ç¥ ¸ÞÀÏÀü¼Û
function sendMail(paramStr){
window.open ('','popMailItinerary','menubar=0,resizable=1,width=600,height=500,status=0,location=0,toolbar=0,scrollbars=1,menubar=0');
	document.frmPrint.action="dt-34000.asp";
	document.frmPrint.target="popMailItinerary";
	document.frmPrint.submit();
	//var d_win = window.open("pk-34000.asp?pkg_code="+paramStr,"manager_schd_mail","menubar=0,resizable=1,width=600,height=500,status=0,location=0,toolbar=0,scrollbars=1");
}

//ÀÏÁ¤Ç¥ ÆÑ½ºÀü¼Û
function sendFax(paramStr){
	window.open ('','popFaxItinerary','menubar=0,resizable=1,width=600,height=500,status=0,location=0,toolbar=0,scrollbars=1,menubar=0');
	document.frmPrint.action="dt-35300.asp";
	document.frmPrint.target="popFaxItinerary";
	document.frmPrint.submit();
	//var d_win = window.open("dt-35300.asp?pkg_code="+paramStr,"manager_schd_fax","menubar=0,resizable=1,width=600,height=500,status=0,location=0,toolbar=0,scrollbars=1");
}


//<!-- µµ½ÃÃ£±â 1 -->
function searchCityList1(){
	if(event.keyCode==13 || event.keyCode==9) {
	//alert('<xsl:text>&&</xsl:text> ');
		if(validator.isAllSpace(frm.city_search.value) == false ){
		if(validator.isCheckSearchCode(frm.city_search.value)) {	
		
			SearchCity1.location.href="/include/inc/searchcode.inc.asp?search_type=13&search_word=" + frm.city_search.value + "&search_layer=SearchCity1";		
		}
		}
	}
}

// µµ½Ã°Ë»ö iframe ³»¿¡¼­ ºÎ¸£´Â ÇÔ¼ö
function ttlsetCityCode(city_code, city_ename, city_kname, country_code, country_ename, country_kname, state_code, state_ename, state_kname){	
	frm.city_code.value = city_code;		
	frm.city_name.value = city_kname;	
	frm.country_name.value = country_kname;	
	setLayerHeightDefault("SearchCity1");		
	//·£µå¸¶Å©´Â µµ½ÃÄÚµå°¡ º¯°æµÉ¶§¸¶´Ù ¸®·ÎµåÇÑ´Ù.
	//fraSearchLodgeLandmark.location.href="/wsv/product/lodge/lg-30000-iframe.asp?search_type=4&search_word=" + city_code;
	
}





//-- °í°´Á¤º¸ ÃÊ±âÈ­
function resetCust(num) {				
	if (num == "0") { // ¿¹¾àÀÚ	
		frmBooking.bookerMid.value = "";		
		frmBooking.bookerSiteCode.value = "";		
		frmBooking.bookerId.value = "";							
		frmBooking.bookerOnlineYn.value = "";			
		frmBooking.bookerKname.value = "";				
		frmBooking.bookerEfname.value = "";		
		frmBooking.bookerElname.value = "";		
		frmBooking.bookerSex.value = "";		
		frmBooking.bookerJuminNo1.value = "";		
		frmBooking.bookerJuminNo2.value = "";		

		frmBooking.bookerTelType[0].checked = false;		
		frmBooking.bookerTelType[1].checked = false;							
		frmBooking.bookerTelType[2].checked = false;		
		
		frmBooking.bookerTel.value = "";		
		frmBooking.bookerEmail.value = "";		
		
		//Ãß°¡»çÇ×
		frmBooking.bookerPassportNo.value = "";		
	}  else { // ¿©ÇàÀÚ
		frmBooking.elements["custMid_"+num].value = "";
		frmBooking.elements["custSiteCode_"+num].value = "";
		frmBooking.elements["custId_"+num].value = "";
		frmBooking.elements["custOnlineYn_"+num].value = "";
		frmBooking.elements["custKname_"+num].value = "";
		frmBooking.elements["custEfname_"+num].value = "";
		frmBooking.elements["custElname_"+num].value = "";
				
		frmBooking.elements["custSex_"+num].selectedIndex = 0;								
				
		frmBooking.elements["custJuminNo1_"+num].value = "";
		frmBooking.elements["custJuminNo2_"+num].value = "";
		
		frmBooking.elements["custTelType_"+num].selectedIndex = 0;			
			
		frmBooking.elements["custTel_"+num].value = "";
		frmBooking.elements["custEmail_"+num].value = "";
		
		// Ãß°¡»çÇ×
		frmBooking.elements["custBirthDay_"+num].value = "";
		//frmBooking.elements["custType_"+num].value = "";
		//frmBooking.elements["custPassportNo_"+num].value = "";
	}
}


//-- ¿©ÇàÀÚ Á¤º¸ °Ë»ö
function getCustomerInfo(keycode, num) {		
	var salSiteCode = frmBooking.SAL_SITE_CODE.value.split('/')[0];	
	custtype = num; 
	if (salSiteCode != 'C00002S001') {				
		if(num == 0) { // ¿¹¾àÀÚ		
			if((keycode == 9 || keycode==13) && validator.isAllSpace(frmBooking.bookerKeyword.value) == false && frmBooking.bookerKeyword.value.length >= 2) {					
				frames["fraBookerInfo"].location.href='https://manager.hanatour.com/include/inc/customer.inc.asp?salSiteCode=' + salSiteCode + '&search_word=' + frmBooking.bookerKeyword.value + '&search_layer=fraBookerInfo';
			}
		} else { // ¿©ÇàÀÚ	
			if((keycode == 9 || keycode==13) && validator.isAllSpace(frmBooking.elements["custKeyword_"+custtype].value) == false && frmBooking.elements["custKeyword_"+custtype].value.length >= 2) {															
				frames["fraCustInfo_"+num].location.href='https://manager.hanatour.com/include/inc/customer.inc.asp?salSiteCode=' + salSiteCode + '&search_word=' + frmBooking.elements["custKeyword_"+num].value + '&search_layer=fraCustInfo_' + num;
			}
		}	
	}
}

//-- °í°´Á¤º¸ °¡Á®¿À±â (customer.inc.asp Á¦°øÇÏ´Â function )
function ttlsetCustomerInfo(mappingId, siteCode, siteName, memberId, onlineYn, kname, efname, elname, sex, juminNo, telType, tel, email, homeZipcode, homeAddr, companyZipcode, companyAddr, companyFax, passportNo, passportExpireDate){
	var juminNo1, juminNo2 ;
	
	if(juminNo.length == 13) {
		juminNo1 = juminNo.substring(0,6) ;
		juminNo2 = juminNo.substring(6,13) ;
	} else {
		juminNo1 = '' ;
		juminNo2 = '' ;
	}
	
	// ¿¹¾àÀÚÁ¤º¸
	var num = custtype;
	if(custtype=='0'){				
		frmBooking.bookerMid.value = mappingId;		
		frmBooking.bookerSiteCode.value = siteCode;
		frmBooking.bookerId.value = memberId;							
		frmBooking.bookerOnlineYn.value = onlineYn;			
		frmBooking.bookerKname.value = kname;		
		frmBooking.bookerEfname.value = efname;		
		frmBooking.bookerElname.value = elname;
		frmBooking.bookerSex.value = sex;
		frmBooking.bookerJuminNo1.value = juminNo1;
		frmBooking.bookerJuminNo2.value = juminNo2;		

		if (telType=='C') frmBooking.bookerTelType[0].checked = true;					
		else if (telType=='H') frmBooking.bookerTelType[1].checked = true;						
		else if (telType=='O') frmBooking.bookerTelType[2].checked = true;						
		
		frmBooking.bookerTel.value = tel;
		frmBooking.bookerEmail.value = email;
		
		//Ãß°¡»çÇ×
		//frmBooking.bookerPassportNo.value = passportNo;		
					
		setLayerHeightDefault("fraBookerInfo");
		
	// ¿©ÇàÀÚÁ¤º¸
	}else{		
		frmBooking.elements["custMid_"+num].value = mappingId;
		frmBooking.elements["custSiteCode_"+num].value = siteCode;
		frmBooking.elements["custId_"+num].value = memberId;						
		frmBooking.elements["custOnlineYn_"+num].value = onlineYn;					
		frmBooking.elements["custKname_"+num].value = kname;			
		frmBooking.elements["custEfname_"+num].value = efname;
		frmBooking.elements["custElname_"+num].value = elname;							
		
		if(sex == 'M') frmBooking.elements["custSex_"+num].selectedIndex = 1;						
		else if(sex == 'F') frmBooking.elements["custSex_"+num].selectedIndex = 2;								
				
		frmBooking.elements["custJuminNo1_"+num].value = juminNo1;
		frmBooking.elements["custJuminNo2_"+num].value = juminNo2;
		
		if (telType=='C') frmBooking.elements["custTelType_"+num].selectedIndex = 1;						
		else if (telType=='H') frmBooking.elements["custTelType_"+num].selectedIndex = 2;					
		else if (telType=='O') frmBooking.elements["custTelType_"+num].selectedIndex = 3;					
			
		frmBooking.elements["custTel_"+num].value = tel;
		frmBooking.elements["custEmail_"+num].value = email;				
	
		//Ãß°¡»çÇ×
		frmBooking.elements["custBirthDay_"+num].value = juminNo1;
		//frmBooking.elements["custType_"+num].value = "";
		//frmBooking.elements["custPassportNo_"+num].value = passportNo;							
		
		if (num==1) frmBooking.elements["includeBookerYn"][1].checked = true;				
		
		setLayerHeightDefault("fraCustInfo_"+custtype);
	}	
}

//-- 1¹øÂ° ¿©ÇàÀÚ Á¤º¸°¡ ¿¹¾àÀÚ Á¤º¸¿Í µ¿ÀÏÀÎ °æ¿ì 
function setCustFromBooker(num) {		
	var readOnlyYn ;
	
	if(frmBooking.includeBookerYn[0].checked) {
		frmBooking.elements["custMid_"+num].value = frmBooking.bookerMid.value;
		//frmBooking.elements["custSiteCode_"+num].value = frmBooking.bookerSiteCode.value;
		frmBooking.elements["custId_"+num].value = frmBooking.bookerId.value;	
		frmBooking.elements["custOnlineYn_"+num].value = frmBooking.bookerOnlineYn.value;			
		frmBooking.elements["custKname_"+num].value = frmBooking.bookerKname.value;
		if(frmBooking.bookerSex.value == 'M') frmBooking.elements["custSex_"+num].selectedIndex = 1;						
		else if(frmBooking.bookerSex.value == 'F') frmBooking.elements["custSex_"+num].selectedIndex = 2;								
				
		frmBooking.elements["custJuminNo1_"+num].value = frmBooking.bookerJuminNo1.value;				
		frmBooking.elements["custJuminNo2_"+num].value = frmBooking.bookerJuminNo2.value;				
		
		if (frmBooking.bookerTelType[1].selected) frmBooking.elements["custTelType_"+num].selectedIndex = 1;						
		else if (frmBooking.bookerTelType[2].selected) frmBooking.elements["custTelType_"+num].selectedIndex = 2;					
		else if (frmBooking.bookerTelType[3].selected) frmBooking.elements["custTelType_"+num].selectedIndex = 3;					
			
		frmBooking.elements["custTel_"+num].value = frmBooking.bookerTel.value;				
		frmBooking.elements["custEmail_"+num].value = frmBooking.bookerEmail.value;						
		
		// Ãß°¡»çÇ×
		//frmBooking.elements["custBirthDay_"+num].value = frmBooking.bookerJuminNo1.value;			
		
		
		//frmBooking.elements["custType_"+num].value = "";
		//frmBooking.elements["custPassportNo_"+num].value = frmBooking.bookerPassportNo.value;					
		
		readOnlyYn = true ;
	} else {	
		resetCust(num);		
		
		readOnlyYn = false ;
	}
	
	frmBooking.elements["custKname_"+num].readOnly = readOnlyYn ;						
	frmBooking.elements["custTelType_"+num].readOnly = readOnlyYn ;					
	frmBooking.elements["custTel_"+num].readOnly = readOnlyYn ;				
	frmBooking.elements["custEmail_"+num].readOnly = readOnlyYn ;							
}


//-- ¿¹¾àÇÏ±â
function goBooking() {	
	var adultCnt = 0, childCnt = 0, infantCnt = 0 ;
	var custCnt = parseInt(frmBooking.adultCnt.value) + parseInt(frmBooking.childCnt.value) + parseInt(frmBooking.infantCnt.value)
	
var RegExp1 =/[^a-zA-Z]/i;
var RegExp2 =/[^0-9]/i;
var isValid1=false;
var isValid2=false;

	//¿¹¾àÀÚ Ã¼Å© #####################################################
	/*
	if(validator.isAllSpace(frmBooking.bookerKname.value)) {
		alert("¿¹¾àÀÚ ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.") ;
		frmBooking.bookerKname.focus() ;
		return ;
	}
	if (validator.isAllSpace(frmBooking.bookerJuminNo1.value + frmBooking.bookerJuminNo2.value)) {
		alert("¿¹¾àÀÚ ÁÖ¹Î¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.") ;
		frmBooking.bookerJuminNo1.focus() ;			
		return ;
	} else  {
		switch(validator.isJuminNo(frmBooking.bookerJuminNo1.value, frmBooking.bookerJuminNo2.value)) {
		case 0 :		//Á¤»óÀÎÁõ
			if(frmBooking.bookerJuminNo1.value.substring(0,1) == "1" || frmBooking.bookerJuminNo2.value.substring(0,1) == "3")  frmBooking.bookerSex.value = "M" ;
			else  frmBooking.bookerSex.value = "F" ;			
			break ;
		case 1 :		//¾ÕÀÚ¸® ¿¡·¯
			alert("¿¹¾àÀÚ ÁÖ¹Î¹øÈ£ ¾ÕÀÚ¸®¸¦ ¼ýÀÚ 6ÀÚ¸®·Î ÀÔ·ÂÇÏ¼¼¿ä.") ;
			frmBooking.bookerJuminNo1.focus() ;			
			return ;
		case 2 :		//µÞÀÚ¸® ¿¡·¯
			alert("¿¹¾àÀÚ ÁÖ¹Î¹øÈ£ µÞÀÚ¸®¸¦ ¼ýÀÚ 7ÀÚ¸®·Î ÀÔ·ÂÇÏ¼¼¿ä.") ;
			frmBooking.bookerJuminNo2.focus() ;			
			return ;
			
		case 3 :		//ÁÖ¹Î¹øÈ£ Çü½Ä À§¹è ¿¡·¯
			alert("¿¹¾àÀÚ ÁÖ¹Î¹øÈ£°¡ À¯È¿ÇÏÁö ¾ÊÀº ¹øÈ£ÀÔ´Ï´Ù. È®ÀÎÈÄ ´Ù½ÃÀÔ·ÂÇÏ¼¼¿ä.") ;
			frmBooking.bookerJuminNo1.focus() ;			
			return ;
		}		
	}	
	if(frmBooking.bookerTelType[0].checked == false && frmBooking.bookerTelType[1].checked == false && frmBooking.bookerTelType[2].checked == false ) {
		alert("¿¹¾àÀÚ ÀüÈ­¹øÈ£ ±¸ºÐÀ» ¼±ÅÃÇÏ¼¼¿ä.") ;
		frmBooking.bookerTelType[0].focus() ;			
		return ;
	} else if(validator.isAllSpace(frmBooking.bookerTel.value)) {
		alert("¿¹¾àÀÚ ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.") ;
		frmBooking.bookerTel.focus() ;			
		return ;
	} else if(!IsNumber(frmBooking.bookerTel.value)) {
		alert("ÀüÈ­¹øÈ£´Â ÇÏÀÌÇÂµîÀÇ Æ¯¼ö±âÈ£¸¦ Á¦¿ÜÇÑ ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä.") ;
		frmBooking.bookerTel.focus() ;			
		return ;
	}	

	if(validator.isAllSpace(frmBooking.bookerEmail.value)) {
		alert("¿¹¾àÀÚ ÀÌ¸ÞÀÏÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ¼¼¿ä.") ;
		frmBooking.bookerEmail.focus() ;			
		return ;
	} else if(validator.isValidEmail(frmBooking.bookerEmail.value) == false) {
		alert("¿¹¾àÀÚÀÇ ÀÌ¸ÞÀÏÁÖ¼Ò°¡ À¯È¿ÇÏÁö ¾ÊÀº ÁÖ¼ÒÀÔ´Ï´Ù. È®ÀÎÈÄ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.") ;
		frmBooking.bookerEmail.focus() ;			
		return ;
	}
		*/
		
	// °³ÀÎÁ¤º¸º¸È£Á¤Ã¥µ¿ÀÇ check
	
	if (document.getElementById("approve_yn1") == "[object]") {		
		// ±¹¿Ü¿©Çà Ç¥ÁØ¾à°ü
		if(frmBooking.approve_yn1[0].checked == false) {
			alert("±¹¿Ü¿©Çà Ç¥ÁØ¾à°ü¿¡ µ¿ÀÇÇÏ¿© ÁÖ½Ê½Ã¿À.") ;
			frmBooking.approve_yn1[0].focus() ;
			return ;
		}
		
		// °³ÀÎÁ¤º¸ ¼öÁý ¹× ÀÌ¿ë¿¡ ´ëÇÑ ¾È³»
		if(frmBooking.approve_yn2[0].checked == false) {
			alert("°³ÀÎÁ¤º¸ ¼öÁý ¹× ÀÌ¿ë¿¡ ´ëÇÑ ¾È³»¿¡ µ¿ÀÇÇÏ¿© ÁÖ½Ê½Ã¿À.") ;
			frmBooking.approve_yn2[0].focus() ;
			return ;
		}
		
		// °³ÀÎÁ¤º¸ Á¦°ø ¹× °øÀ¯¥°
		if(frmBooking.approve_yn3[0].checked == false) {
			alert("°³ÀÎÁ¤º¸ Á¦°ø ¹× °øÀ¯ I¿¡ µ¿ÀÇÇÏ¿© ÁÖ½Ê½Ã¿À.") ;
			frmBooking.approve_yn3[0].focus() ;
			return ;
		}
		
		// °³ÀÎÁ¤º¸ Á¦°ø ¹× °øÀ¯ II
		if(!(frmBooking.approve_add_yn[0].checked == true || frmBooking.approve_add_yn[1].checked == true)) {
			alert("°³ÀÎÁ¤º¸ Á¦°ø ¹× °øÀ¯ II¸¦ ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿À.") ;
			frmBooking.approve_add_yn[0].focus() ;
			return ;
		}
	}
	
	// ¿©ÇàÀÚ Á¤º¸ È®ÀÎ	
	//######################### ¿©ÇàÀÚ Áßº¹ ÀÔ·Â Ã¼Å©#######################
	JuminString = new Array(custCnt);
	EmailString = new Array(custCnt);
	
	for (var j=0;j<custCnt;j++) {
		JuminString[j]="";
		EmailString[j]="";
	}
	//###########################################################################
	var juminNoInputCnt = 0;
	for (num=1;num<=custCnt;num++) {				
		//######################### ¿©ÇàÀÚ Áßº¹ ÀÔ·Â Ã¼Å©#######################
		
		if(num==custCnt){
			var Booker_Customer= 0;
			for(var j=1;j<=num;j++){
				if (trim(frmBooking.elements["custJuminNo1_"+j].value+frmBooking.elements["custJuminNo2_"+j].value).length > 0 ){
					if(frmBooking.elements["custJuminNo1_"+j].value+frmBooking.elements["custJuminNo2_"+j].value==frmBooking.elements["bookerJuminNo1"].value+frmBooking.elements["bookerJuminNo2"].value){
						if(frmBooking.elements["custKname_"+j].value==frmBooking.elements["bookerKname"].value&&frmBooking.elements["custEmail_"+j].value==frmBooking.elements["bookerEmail"].value){
							Booker_Customer= Booker_Customer+1;
						}else{
							if(frmBooking.elements["custKname_"+j].value!=frmBooking.elements["bookerKname"].value){
								alert("¿¹¾àÀÚ¿Í ÁÖ¹Îµî·Ï¹øÈ£°¡ µ¿ÀÏÇÏ³ª ÀÌ¸§ÀÌ ´Ù¸§´Ï´Ù. \nÀÌ¸§À» È®ÀÎÇØ ÁÖ¼¼¿ä.");
								frmBooking.elements["custKname_"+j].focus(); return;
							}else{
								alert("¿¹¾àÀÚ¿Í ÁÖ¹Îµî·Ï¹øÈ£°¡ µ¿ÀÏÇÏ³ª ÀÌ¸ÞÀÏÀÌ ´Ù¸§´Ï´Ù. \nÀÌ¸ÞÀÏÀ» È®ÀÎÇØ ÁÖ¼¼¿ä.");
								frmBooking.elements["custEmail_"+j].focus(); return;	
							}
						}
					}
				}
			}	
		}
		
		for(var j=0;j<num;j++){
			if (trim(frmBooking.elements["custJuminNo1_"+num].value+frmBooking.elements["custJuminNo2_"+num].value).length > 0 ){
				if(frmBooking.elements["custJuminNo1_"+num].value+frmBooking.elements["custJuminNo2_"+num].value==JuminString[j]){
					alert("¿©ÇàÀÚÀÇ ÁÖ¹Îµî·Ï¹øÈ£°¡ Áßº¹ µË´Ï´Ù.");
					frmBooking.elements["custJuminNo1_"+num].focus(); return;
				}
			}
			
			if (trim(frmBooking.elements["custEmail_"+num].value).length > 0 ){
				if(frmBooking.elements["custEmail_"+num].value==EmailString[j]){
					alert("¿©ÇàÀÚÀÇ ¸ÞÀÏ ÁÖ¼Ò°¡ Áßº¹ µË´Ï´Ù.");
					frmBooking.elements["custEmail_"+num].focus(); return;
				}
			}
		}	
		JuminString[num-1]=frmBooking.elements["custJuminNo1_"+num].value+frmBooking.elements["custJuminNo2_"+num].value;
		EmailString[num-1]=frmBooking.elements["custEmail_"+num].value;		
		//###########################################################################		
		
		if(validator.isAllSpace(frmBooking.elements["custKname_"+num].value)) {
			alert("¿©ÇàÀÚ ÇÑ±ÛÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.") ;
			frmBooking.elements["custKname_"+num].focus();
			return ;
		}
					
		if(validator.isAllSpace(frmBooking.elements["custElname_"+num].value)) {
			alert("¿©ÇàÀÚ ¿µ¹®¼ºÀ» ÀÔ·ÂÇÏ¼¼¿ä.") ;
			frmBooking.elements["custElname_"+num].focus();
			return ;
		}
		
		if(validator.isAllSpace(frmBooking.elements["custEfname_"+num].value)) {
			alert("¿©ÇàÀÚ ¿µ¹®ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.") ;
			frmBooking.elements["custEfname_"+num].focus();
			return ;
		}
		
		
		if (frmBooking.elements["custJuminNo1_"+num].value.length == "6" && frmBooking.elements["custJuminNo2_"+num].value.length == "7") {
			switch(validator.isJuminNo(frmBooking.elements["custJuminNo1_"+num].value, frmBooking.elements["custJuminNo2_"+num].value)) {
			case 0 :		//Á¤»óÀÎÁõ
				//if(frmBooking.elements["custJuminNo2_"+num].value.substring(0,1) == "1" || frmBooking.elements["custJuminNo2_"+num].value.substring(0,1) == "3")  frmBooking.elements["custSex_"+num].value = "M" ;						
				//else frmBooking.elements["custSex_"+num].value = "F" ;								
				break ;
			case 1 :		//¾ÕÀÚ¸® ¿¡·¯
				alert("¿©ÇàÀÚ ÁÖ¹Î¹øÈ£ ¾ÕÀÚ¸®¸¦ ¼ýÀÚ 6ÀÚ¸®·Î ÀÔ·ÂÇÏ¼¼¿ä.") ;
				frmBooking.elements["custJuminNo1_"+num].focus() ;			
				return ;
			case 2 :		//µÞÀÚ¸® ¿¡·¯
				alert("¿©ÇàÀÚ ÁÖ¹Î¹øÈ£ µÞÀÚ¸®¸¦ ¼ýÀÚ 7ÀÚ¸®·Î ÀÔ·ÂÇÏ¼¼¿ä.") ;
				frmBooking.elements["custJuminNo2_"+num].focus() ;			
				return ;
				
			case 3 :		//ÁÖ¹Î¹øÈ£ Çü½Ä À§¹è ¿¡·¯
				alert("¿©ÇàÀÚ ÁÖ¹Î¹øÈ£°¡ À¯È¿ÇÏÁö ¾ÊÀº ¹øÈ£ÀÔ´Ï´Ù. È®ÀÎÈÄ ´Ù½ÃÀÔ·ÂÇÏ¼¼¿ä.") ;
				frmBooking.elements["custJuminNo1_"+num].focus() ;			
				return ;
			}	
			juminNoInputCnt = juminNoInputCnt + 1
		} else {
			if(validator.isAllSpace(frmBooking.elements["custJuminNo1_"+num].value) && !IsNumber(frmBooking.elements["custJuminNo1_"+num].value)) {
				alert("¿©ÇàÀÚ ÁÖ¹Î¹øÈ£´Â ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä.") ;
				frmBooking.elements["custJuminNo1_"+num].focus() ;			
				return ;
			}	
			if(validator.isAllSpace(frmBooking.elements["custJuminNo2_"+num].value) && !IsNumber(frmBooking.elements["custJuminNo2_"+num].value)) {
				alert("¿©ÇàÀÚ ÁÖ¹Î¹øÈ£´Â ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä.") ;
				frmBooking.elements["custJuminNo2_"+num].focus() ;			
				return ;
			}				
		}							
		
		//¿©±ÇÀ¯È¿¼º Ã¼Å© AA12345678
		/*
		if(validator.isAllSpace(frmBooking.elements["passport_no_"+num].value)) {
			alert("¿©±Ç¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.") ;
			frmBooking.elements["passport_no_"+num].focus();
			return ;
		}else{
		}
		*/
		
		if(frmBooking.elements["passport_no_"+num].value.length > 0){
			/*
			if(frmBooking.elements["passport_no_"+num].value.length != 10){
					alert("¿©±Ç¹øÈ£°¡ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù. ") ;
					frmBooking.elements["passport_no_"+num].focus() ;
					return ;
			}
			isValid1 = ! (RegExp1.test(frmBooking.elements["passport_no_"+num].value.substring(0,2)));
			isValid2 = ! (RegExp2.test(frmBooking.elements["passport_no_"+num].value.substring(2,10)));
			
			if (isValid1){
				if (!isValid2){
					alert("¿©±Ç¹øÈ£°¡ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù. ") ;
					frmBooking.elements["passport_no_"+num].focus() ;
					return ;
				}
				
			}else{
				alert("¿©±Ç¹øÈ£°¡ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù. ") ;
				frmBooking.elements["passport_no_"+num].focus() ;
				return ;
			}
			*/
		}else{
			alert("¿©±Ç¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			frmBooking.elements["passport_no_"+num].focus() ;
			return ;
		}	
			
				
		if(validator.isAllSpace(frmBooking.elements["custSex_"+num].value)) {
			alert("¿©ÇàÀÚ ¼ºº°¸¦ ÀÔ·ÂÇÏ¼¼¿ä.") ;
			frmBooking.elements["custSex_"+num].focus();
			return ;
		}				
		
		if (num ==1) { // Ã¹¹øÂ° ¿©ÇàÀÚ¸¸ ÇÊ¼ö
			if(validator.isAllSpace(frmBooking.elements["custTelType_"+num].value)) {			
				alert("¿©ÇàÀÚ ÀüÈ­¹øÈ£ ±¸ºÐÀ» ¼±ÅÃÇÏ¼¼¿ä.") ;
				frmBooking.elements["custTelType_"+num].focus();
				return ;
			} else if(validator.isAllSpace(frmBooking.elements["custTel_"+num].value)) {
				alert("¿©ÇàÀÚ ¿¬¶ôÃ³¸¦ ÀÔ·ÂÇÏ¼¼¿ä.") ;
				frmBooking.elements["custTel_"+num].focus();
				return ;
			} else if(!IsNumber(frmBooking.elements["custTel_"+num].value)) {
				alert("¿©ÇàÀÚ ¿¬¶ôÃ³´ÂÇÏÀÌÇÂµîÀÇ Æ¯¼ö±âÈ£¸¦ Á¦¿ÜÇÑ ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä.") ;
				frmBooking.elements["custTel_"+num].focus();
				return ;
			}
			
			//±âÅ¸ ¿äÃ»»çÇ×
			if(validator.isAllSpace(frmBooking.elements["departureDate_"+num].value)) {
				alert("Ãâ±¹¿¹Á¤ÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä.") ;
				frmBooking.elements["departureDate_"+num].focus();
				return ;
			}
			if(validator.isAllSpace(frmBooking.elements["lodgingInfo_"+num].value)) {
				alert("ÇöÁöÅõ¼÷È£ÅÚÀ» ÀÔ·ÂÇÏ¼¼¿ä.") ;
				frmBooking.elements["lodgingInfo_"+num].focus();
				return ;
			}	
			if(validator.isAllSpace(frmBooking.elements["localContact_"+num].value)) {
				alert("ÇöÁö¿¬¶ôÃ³¸¦ ÀÔ·ÂÇÏ¼¼¿ä.") ;
				frmBooking.elements["localContact_"+num].focus();
				return ;
			}
			if(validator.isAllSpace(frmBooking.elements["custEmail_"+num].value) == false) { 
				if(validator.isValidEmail(frmBooking.elements["custEmail_"+num].value) == false) {
					alert("¿©ÇàÀÚÀÇ ÀÌ¸ÞÀÏÁÖ¼Ò°¡ À¯È¿ÇÏÁö ¾ÊÀº ÁÖ¼ÒÀÔ´Ï´Ù. È®ÀÎÈÄ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.") ;
					frmBooking.elements["custEmail_"+num].focus() ;			
					return ;
				}
			}	
		} 

		if (frmBooking.elements["custSex_"+num].value == "M" || frmBooking.elements["custSex_"+num].value == "F") adultCnt = adultCnt + 1;
			else if (frmBooking.elements["custSex_"+num].value == "C") childCnt = childCnt + 1;
			else if (frmBooking.elements["custSex_"+num].value == "I") infantCnt = infantCnt + 1;	
		
			
	}
	
	if(xcnt == undefined){
		if(frmBooking.jsMEET_CNT.value == "1" ){
			if(frmBooking.jsMEET_TIME.value =="2500"){
				if(validator.isAllSpace(frmBooking.CUST_MEET_AREA.value)) {
					if(frmBooking.prdCodeChg2.value =="Y"){
						frmBooking.CUST_MEET_AREA.value =" ";
					}else{
						alert("ÇöÁö¹ÌÆÃÀå¼Ò¸¦ ÀÔ·ÂÇÏ¼¼¿ä.") ;
						frmBooking.CUST_MEET_AREA.focus() ;
						return ;
					}
				}	
			}
		}
	}
	
	if (frmBooking.departureDate_1.value > frmBooking.startDate.value) {
		if(!confirm("¼±ÅÃÇà»çÀÏº¸´Ù Ãâ±¹¿¹Á¤ÀÏÀÌ ´Ê½À´Ï´Ù. ¿¹¾àÁøÇàÁß¿¡ Ãë¼Ò½Ã Ãë¼Ò·á°¡ ºÎ°úµÉ¼ö ÀÖ½À´Ï´Ù. ¿¹¾àÇÏ½Ã°Ú½À´Ï±î?")){
			return ;
		}
	}
	
	if (frmBooking.adultCnt.value != adultCnt) {
		alert("¼ºÀÎ ÀÎ¿øÀÌ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.");
		return ;
		
	} else if (frmBooking.childCnt.value != childCnt) {
		alert("¾Æµ¿ ÀÎ¿øÀÌ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.");
		return ;
	
	} else if (frmBooking.infantCnt.value != infantCnt) {
		alert("À¯¾Æ ÀÎ¿øÀÌ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.");		
		return ;
	}
			
	if (frmBooking.bookingNo.value == "") { //¿¹¾àµî·Ï
	
		frmBooking.action = frmBooking.https_url.value + "dt-41000.asp";
	}else { //¿¹¾à¼öÁ¤
		frmBooking.action = frmBooking.https_url.value + "dt-43100.asp"; 
	}
	
	divBookingButton.innerHTML	= "<br/><font><b>¿äÃ»ÇÏ½Å ¿¹¾àÀ» Ã³¸®ÁßÀÔ´Ï´Ù.</b></font>";			
	frmBooking.submit();	
}




//-- salSiteCode º¯°æ½Ã
function chkSalSiteCode() {
	
	var salSiteCode;
	salSiteCode =  frmBooking.SAL_SITE_CODE.value.split('/')[0];
	
	// µµ¿ì¹Ì ¼±ÅÃ½Ã ¿¹¾à µî·Ï ºÒ°¡. µµ¿ì¹Ì ¿¹¾àÀº ´åÄÄÀ» ÅëÇØ µî·ÏÇÔ.	
	if (salSiteCode == 'C00002S001') {
		alert("µµ¿ì¹Ì ¿¹¾àÀº ´åÄÄÀ» ÅëÇØ µî·ÏÇØ¾ß ÇÕ´Ï´Ù.");
		return;
	}
	
	// ¿¹¾àÀÚ Á¤º¸ ÃÊ±âÈ­
	resetCust(0);
	
	// ¿©ÇàÀÚ Á¤º¸ ÃÊ±âÈ­
	var custCnt = parseInt(frmBooking.adultCnt.value) + parseInt(frmBooking.childCnt.value) + parseInt(frmBooking.infantCnt.value) ;					
	for (i=1;i<=custCnt;i++) {									
		resetCust(i);
	}		
}


//-- ¿¹¾àÀÎ¿ø Ãß°¡
function addPerson(){
		if( validator.isOnlyNumeric(document.frmBooking.add_cnt.value)==false){
		alert("Ãß°¡ÇÒ ÀÎ¿øÀ» ¼ýÀÚ·Î¸¸ ÀÔ·ÂÇÏ¼¼¿ä");
		document.frmBooking.add_cnt.focus();
		return;
	}
	var add_cnt		= parseInt(document.frmBooking.add_cnt.value);

	if (isNaN(add_cnt)) add_cnt	= 0;
	if (add_cnt == 0) {
		alert("Ãß°¡ÀÎ¿øÀ» 0º¸´Ù Å« °ªÀ¸·Î ÀÔ·ÂÇÏ¼¼¿ä");
		return;
	}
	opener.frmBooking.addcnt.value=document.frmBooking.add_cnt.value;
	opener.goBookingChg(3);
	window.close();
}
//-- ¿¹¾àÀÎ¿øÃß°¡ ÀÌµ¿
function popBookingChg(chgType){	
	if (!chkAuth("01")) return ;	
	if (chgType == 9) {
		alert('Ãë¼Ò¸¶°¨ÀÏÀÌ Áö³µÀ¸¹Ç·Î º¯°æ ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
		return;
	}
	WindowOpener("","popBookingChg","400","320","no","yes");
	frmBooking.action = "dt-45000.asp";		
	frmBooking.target="popBookingChg";
	frmBooking.submit();
	

	
	//goBookingChg(chgType);
}
//-- ¿¹¾à¼öÁ¤ ÀÌµ¿
function goBookingChg(chgType){		
	if (!chkAuth("01")) return ;	
	if (chgType == 9) {
		alert('Ãë¼Ò¸¶°¨ÀÏÀÌ Áö³µÀ¸¹Ç·Î ¼öÁ¤ ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
		return;
	}
	
	//»óÇ°º¯°æ
	if (chgType == 4) {
		/*
		WindowOpener("","popPkgChg","450","270","no","yes");
		frmBooking.action = "dt-44000.asp";		
		frmBooking.target = "popPkgChg";		
		frmBooking.submit();
		*/
		
	}else{
		frmBooking.target = "";
		if (chgType == 1) { // ±Ý¾×º¯°æ½Ã : »óÇ°º¯°æ, ¿©ÇàÀÚ ½Â°´±¸ºÐ/ÀÎ¿ø º¯°æ)
			if(confirm("»óÇ°º¯°æ½Ã »óÇ°À» Àç°Ë»öÈÄ ¼±ÅÃÇÏ½Ã¸é µË´Ï´Ù. °è¼ÓÇÏ½Ã°Ú½À´Ï±î?")){
				frmBooking.dayCode.value = "";
				frmBooking.action = "http://manager.hanatour.com/wsv/product/daytour/dt-10000.asp";		
				frmBooking.submit();
			}
			
		}else if(chgType == 3) {
			//frmBooking.addcnt.value="1";
			frmBooking.action = "https://manager.hanatour.com/wsv/product/daytour/dt-43000.asp";		
			frmBooking.submit();
		} else { // Á¤º¸º¯°æ½Ã
			frmBooking.addcnt.value="0";
			frmBooking.action = "https://manager.hanatour.com/wsv/product/daytour/dt-43000.asp";		
			frmBooking.submit();
		}
		
	}
}

//-- ¸ÅÃâÇÒÀÎº¯°æ ÆË¾÷
function popTaxIssueChg(){	
	if (!chkAuth("01")) return ;
	
	//fileName,windowName,theWidth,theHeight,theScrollBar,theResizable
	WindowOpener("","popTaxIssueChg","450","270","no","yes");
	frmBooking.action = "dt-42100.asp";		
	frmBooking.target="popTaxIssueChg";		
	frmBooking.submit();
}

//-- ¸ÅÃâÇÒÀÎº¯°æ
function goTaxIssueChg(){	
	var cnt;
	if (frmBooking.taxIssue.length == undefined) {
		cnt = 1;			
	}	
	else {
		cnt = frmBooking.taxIssue.length;									
	}		
		
	for (var i=0;i<cnt;i++) {
		if (frmBooking.taxIssue[i].checked) {
			if (frmBooking.taxIssue[i].value == frmBooking.oldTaxIssue.value){
				alert("¸ÅÃâÇÒÀÎ¿©ºÎ°¡ º¯°æµÇÁö ¾Ê¾Ò½À´Ï´Ù.");
				return;
			}
		}			
	}	
	frmBooking.action = "DT-42110.asp";		
	frmBooking.submit();
}


//-- ¿¹¾à´ã´çÀÚº¯°æ ÆË¾÷(´ë¸®Á¡)
function popSalBkgMgrChg(){	

	//fileName,windowName,theWidth,theHeight,theScrollBar,theResizable
	WindowOpener("","popSalBkgMgrChg","400","240","no","yes");
	frmBooking.action = "dt-42300.asp";		
	frmBooking.target="popSalBkgMgrChg";
	frmBooking.submit();
	
}

//-- ¿¹¾à´ã´çÀÚº¯°æ(´ë¸®Á¡)
function goSalBkgMgrChg(){
	var index;	
	index = frmBooking.salBkgMgrMid.selectedIndex;
	if(index != 0){
		if(frmBooking.salBkgMgrMid[index].value == frmBooking.oldSalBkgMgrMid.value){
			alert("¿¹¾à´ã´çÀÚ°¡ º¯°æµÇÁö ¾Ê¾Ò½À´Ï´Ù.");
			frmBooking.salBkgMgrMid.focus();
			return;
		}
	}else{
		if (frmBooking.salBkgMgrMid[index].value == '') {
			alert("¿¹¾à´ã´çÀÚÁß ÇÑ¸íÀ» ¼±ÅÃÇØÁÖ¼¼¿ä.");
			frmBooking.salBkgMgrMid.focus();
			return;
		}
	}	
	frmBooking.action = "DT-42310.asp";		
	frmBooking.submit();	
}


//-- ¿¹¾àº¯°æ³»¿ª ÆË¾÷
function popBookingLogInfo(){	
if (!chkAuth("01")) return ;	
	//fileName,windowName,theWidth,theHeight,theScrollBar,theResizable
	WindowOpener("","popBookingLogInfo","680","400","yes","yes");
	frmBooking.action = "../pass/ps-42400.asp";		
	frmBooking.target="popBookingLogInfo";
	frmBooking.submit();
}


//-- ¿¹¾àÃë¼Ò ÆË¾÷
function popBookingCancel(xtype,chgType){	
if (!chkAuth("01")) return ;
	if (chgType == 9) {
		alert('Ãë¼Ò¸¶°¨ÀÏÀÌ Áö³µÀ¸¹Ç·Î Ãë¼Ò ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
		return;
	}
	if(confirm("¿¹¾àÃë¼Ò¸¦ ¼±ÅÃÇÏ¼Ì½À´Ï´Ù.\nÁö±Ý ¿¹¾àÀ» Ãë¼ÒÇÏ½Ã°Ú½À´Ï±î?")) {
		//divButton.innerHTML	= "<font><b>¿¹¾àÃë¼ÒÁßÀÔ´Ï´Ù.</b></font>";			
		frmCencel.action = frmCencel.https_url.value + "dt-46100.asp";
		frmCencel.submit();
	}	
}

//-- ¿¹¾àÃë¼Ò
function goBookingCancel(xCancelName){
		
	//if (!chkAuth("01")) return ;
	if(xCancelName ==""){
		if(confirm("ÀüÃ¼¿¹¾àÀ» Ãë¼ÒÇÏ½Ã°Ú½À´Ï±î?.")){
			//divCancelButton.innerHTML	= "Ãë¼ÒÃ³¸®ÁßÀÔ´Ï´Ù";
			frmBooking.action = frmBooking.https_url.value + "dt-46100.asp";
			frmBooking.submit();
		}
		
	}else{
		if(confirm(xCancelName + " ´ÔÀÇ ¿¹¾àÀ» Ãë¼ÒÇÏ½Ã°Ú½À´Ï±î?.")){
			//divCancelButton.innerHTML	= "Ãë¼ÒÃ³¸®ÁßÀÔ´Ï´Ù";
			frmBooking.action = frmBooking.https_url.value + "dt-46100.asp";
			frmBooking.submit();
		
		}
	}
}

//°Ë»öÆäÀÌÁö·Î
function goSearchInfo(areaCode, country_code, city_code, applyDate, adtAaleCnt, chdAaleCnt, infAaleCnt){	
	location.href="dt-10000.asp?areaCode="+areaCode+"&pub_country="+country_code+"&pub_city="+city_code+"&applyDate="+applyDate+"&adtAaleCnt="+adtAaleCnt+"&chdAaleCnt="+chdAaleCnt+"&infAaleCnt="+infAaleCnt+"&searchYN=Y";
	//location.href="dt-10000.asp?bookingCode="+bookingNo+"&resBeginning="+resBeginning;	
}

//-- ¿¹¾àÁ¶È¸
function goBookingInfo(bookingNo, successYn, popWindowYn, resBeginning){	
	if (successYn == 'Y') {
		if (popWindowYn == 'Y') {
			opener.location.href="dt-42000.asp?booking_no="+bookingNo+"&resBeginning="+resBeginning;	
			window.close();
		}
		else {
			location.href="dt-42000.asp?booking_no="+bookingNo+"&resBeginning="+resBeginning;	
		}
	}
}

//-- ¿¹¾àÁ¶È¸
function goBookingInfo2(bookingNo, successYn, popWindowYn){	
	if (successYn == 'Y') {
		if (popWindowYn == 'Y') {
			opener.location.href="dt-10000.asp";	
			window.close();
		}
		else {
			location.href="dt-10000.asp";	
		}
	}
}

//-- ´ë¸®Á¡ºñ±³º¯°æ ÆË¾÷/º¯°æ¿Ï·á
function popAgentRemarksChg(chgType){		
	if (!chkAuth("02")) return ;
	if (chgType == 9) {
		alert('Ãë¼Ò¸¶°¨ÀÏÀÌ Áö³µÀ¸¹Ç·Î ¼öÁ¤ ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
		return;
	}
	if (frmBooking.agentRemarks.value == "") {
		alert("¿©Çà»ç ºñ°í°¡ ÀÔ·ÂµÇÁö ¾Ê¾Ò½À´Ï´Ù.");
		return;
	}

	//WindowOpener("","popAgentRemarksChg","450","400","no","yes");
	frmBooking.action = "dt-42510.asp";		
	frmBooking.target="ifraAgentRemarksChg";
	frmBooking.submit();
}

//-- ±ÇÇÑÀÎÁõ
function chkAuth(auth) {
	if (frmBooking.bookingStatus.value == 'CX') {
		alert("ÀÌ¹Ì Ãë¼ÒµÈ ¿¹¾àÀÔ´Ï´Ù.");
		return 0;
	} else if (frmBooking.bookingStatus.value == frmBooking.inpMid.value) {
		alert("¿¹¾à´ã´çÀÚ¸¸ Ã³¸®°¡ °¡´ÉÇÕ´Ï´Ù.");
		return 0;
	}	
	
	// 01 : ¿¹¾àÃë¼Ò, ¿¹¾àº¯°æ, ¿©ÇàÀÚ Á¤º¸º¯°æ (°ü¸®ÀÚ¸¶°¨¿©ºÎ, Á¤»ê¿©ºÎ, Æ¼°Ù¹ß±Ç(¹Ù¿ìÃ³¹ßÇà)¿©ºÎ check)
	if (auth == "01") { 
		if (frmBooking.updateYn.value == 'Y') {
			alert("ÀÌ¹Ì ¸¶°¨Ã³¸®µÇ¾î Ã³¸®°¡ ºÒ°¡´ÉÇÕ´Ï´Ù.");
			return 0;
		} else if (frmBooking.settleCloseYn.value == 'Y') {
			alert("ÀÌ¹Ì Á¤»êµÇ¾î Ã³¸®°¡ ºÒ°¡´ÉÇÕ´Ï´Ù.");
			return 0;
		}
		/*
		 else if (frmBooking.printStatus.value == '002' || frmBooking.printStatus.value == '006') {
			alert("ÀÌ¹Ì Æ¼ÄÏ¹ß±Ç¶Ç´Â ¹Ù¿ìÃ³°¡ ¹ßÇàµÇ¾î Ã³¸®°¡ ºÒ°¡´ÉÇÕ´Ï´Ù.");
			return 0;
		} 
		*/
	} 
	// 02 : ºñ°í¼öÁ¤ (°ü¸®ÀÚ¸¶°¨¿©ºÎ, Á¤»ê¿©ºÎ check)
	else if (auth == "02") { 
		if (frmBooking.updateYn.value == 'Y') {
			alert("ÀÌ¹Ì ¸¶°¨Ã³¸®µÇ¾î Ã³¸®°¡ ºÒ°¡´ÉÇÕ´Ï´Ù.");
			return 0;
		} else if (frmBooking.settleCloseYn.value == 'Y') {
			alert("ÀÌ¹Ì Á¤»êµÇ¾î Ã³¸®°¡ ºÒ°¡´ÉÇÕ´Ï´Ù.");
			return 0;
		} 
	}
	return 1;
}	


//´Þ·Â
function showCalendar(layername) {
	if(layername=="ID_CALENDAR1"){
		show(layername); dtype=1;
	}else if(layername=="ID_CALENDAR2"){
		show(layername); dtype=2;
	}
}
//´Þ·ÂÆäÀÌÁö¿¡¼­ È£Ãâ
function ttlsetDate(sdate){
	if(dtype==2){
		frm.applyDate.value=sdate;
		hide("ID_CALENDAR2");
	}else{
		frm.applyDate.value=sdate;
		hide("ID_CALENDAR1");
	}
}


//-- ÀÌ¿ë±¹°¡ ¼±ÅÃ
function setUseCountry(obj){		
	var objName = obj.name;	
	var num = parseInt(objName.replace("useCountry",""));	
	var i, useCountryCnt;
	var useCountryGroupCodeList = "";
	
	if (obj.value != "") {
		useCountryCnt = frmBooking.useCountryCnt.value;
															
		for (i=1;i<=num;i++) {
			if (frmBooking.elements["useCountry"+i].value != "") {									
				useCountryGroupCodeList = useCountryGroupCodeList + "," + frmBooking.elements["useCountry"+i].value;		
			}
		}			
		useCountryGroupCodeList = useCountryGroupCodeList.substring(1,useCountryGroupCodeList.length);			
		
		if (num+1 <= useCountryCnt) {			
			for (i=num+1;i<=useCountryCnt;i++) {	
				if (i==num+1) {
					fraUseCountry.location.href="/wsv/product/pass/ps-10001.asp?codeType=5&codeObjName=useCountry"+i+"&codeObjDesc=±¹°¡¼±ÅÃ&compCode=" + frmBooking.compCode.value + "&prdMstCode=" + frmBooking.prdMstCode.value + "&countryGroupCodeList=" + useCountryGroupCodeList+"&frmObjName=frmBooking";					
				}		
				else {
					frmBooking.elements["useCountry"+i].options.length = 1 ;
					frmBooking.elements["useCountry"+i].options[0]=new Option("::: ±¹°¡¼±ÅÃ :::", "",  false, false);		
				}
			}
			
		}		
	}
}

//-- Ã³À½ size·Î reset
function setLayerHeightDefault(layername){
	setLayerheight(layername, 20);
}

//-- ·¹ÀÌ¾îÀÇ size º¯°æ
function setLayerHeightResize(layername, height){
	setLayerheight(layername, height);
}


function fc_match_cntchk(xthis){

	var xfrm = document.all;
	var xcnt=0;
	if(parseInt(xfrm.chk_DAY_CODE.length)>1){
			for(i=0; i< xfrm.chk_DAY_CODE.length; i++){
				if(xfrm.chk_DAY_CODE[i].checked==true){
					xcnt++;
					if(xcnt>3){
						alert("3°³ÀÌ»óÀÇ »óÇ°À» ºñ±³ÇÒ¼ö ¾ø½À´Ï´Ù.\n\n¸¶Áö¸·¿¡ ¼±ÅÃÇÑ »óÇ°Ã¼Å©°¡ ÇØÁ¦µË´Ï´Ù.");
					}
				}
			}
			
			//¸¶Áö¸· ¼±ÅÃ Ã¼Å©ÇØÁ¦
			for(i=0; i< xfrm.chk_DAY_CODE.length; i++){
				if(xcnt>3 && xthis.value == xfrm.chk_DAY_CODE[i].value){
					xfrm.chk_DAY_CODE[i].checked=false;
					return;
				}
			}
		}
}

//ºñ±³ÇÏ±â
function fc_match(){

	var xfrm = document.all;
	var xcnt=0;
	var str_areaCode="";
	if(parseInt(xfrm.chk_DAY_CODE.length)==1){
		alert("1°³ÀÇ »óÇ°Àº ºñ±³ÇÒ¼ö ¾ø½À´Ï´Ù.");
		return;
	}else{
		for(i=0; i< xfrm.chk_DAY_CODE.length; i++){
			if(xfrm.chk_DAY_CODE[i].checked==true){
				
				if(xcnt>0){
					str_areaCode += ",'"+ xfrm.chk_DAY_CODE[i].value +"'";
				}else{
					str_areaCode  = "'"+ xfrm.chk_DAY_CODE[i].value +"'";
				}
				
				xcnt++;
			}
		}
		if(xcnt<2){
			alert("2~3°³ÀÇ »óÇ°À» Å¬¸¯ÇØÁÖ¼¼¿ä.");
			return;
		}else{
			if(xcnt>3){
				alert("3°³ÀÌ»óÀÇ »óÇ°À» ºñ±³ÇÒ¼ö ¾ø½À´Ï´Ù.\n\n2~3°³ÀÇ »óÇ°À» Å¬¸¯ÇØÁÖ¼¼¿ä.");
				return;
			}else{
				xfrm.match_areaCode.value=str_areaCode;
			}	
		}
	}
	window.open("","match_window","menubar=0,resizable=1,width=740,height=650,status=0,location=0,toolbar=0,scrollbars=1");
	document.frm.target="match_window";
	document.frm.submit();
}

//¸ÞÀÎ µµ½Ã¹Ù·Î°Ë»ö
function fc_CityDirectLink(areaCode,xcountryCode,xcityCode){
	document.frmCity.areaCode.value=document.frm.areaCode.value;
	document.frmCity.adtAaleCnt.value=document.frm.adtAaleCnt.value;
	document.frmCity.chdAaleCnt.value=document.frm.chdAaleCnt.value;
	document.frmCity.infAaleCnt.value=document.frm.infAaleCnt.value;
	document.frmCity.applyDate.value=document.frm.applyDate.value;
	document.frmCity.areaCode.value=areaCode;
	document.frmCity.pub_country.value=xcountryCode;
	document.frmCity.pub_city.value=xcityCode;
	document.frmCity.action="dt-10000.asp";
	document.frmCity.submit();
	
}

//ÇöÁöÅõ¾î ÃßÃµ»óÇ°
function fc_RecomLink(xhanaMstCode, xweekNum){
	document.frmCity.adtAaleCnt.value=document.frm.adtAaleCnt.value;
	document.frmCity.chdAaleCnt.value=document.frm.chdAaleCnt.value;
	document.frmCity.infAaleCnt.value=document.frm.infAaleCnt.value;
	document.frmCity.applyDate.value=document.frm.applyDate.value;
	document.frmCity.hanaMstCode.value=xhanaMstCode;
	document.frmCity.weekNum.value=xweekNum;
	document.frmCity.action="dt-10000.asp";
	document.frmCity.submit();
}
