function ChkOriginalTimeTable()
{
	if (document.form3.State.value==1)
	{
		document.form3.BackYYYY.disabled = true;
	    document.form3.BackMM.disabled = true;
	    document.form3.BackDD.disabled = true;
	}
}

function SubmitCheckTimeTable()
{
 	var	sErrmsg	= "";
	var	sDep,sArr;
	var	errflag	= false;
	var	goYYYY,goMM,goDD,backYYYY,backMM,backDD;
	sDep	 = document.form3.GoDep.options[document.form3.GoDep.selectedIndex].value; 
	sArr	 = document.form3.GoArr.options[document.form3.GoArr.selectedIndex].value; 	
	goYYYY	 = document.form3.GoYYYY.options[document.form3.GoYYYY.selectedIndex].value; 
	goMM	 = document.form3.GoMM.options[document.form3.GoMM.selectedIndex].value; 
	goDD	 = document.form3.GoDD.options[document.form3.GoDD.selectedIndex].value; 
	backYYYY = document.form3.BackYYYY.options[document.form3.BackYYYY.selectedIndex].value;
	backMM	 = document.form3.BackMM.options[document.form3.BackMM.selectedIndex].value;
	backDD	 = document.form3.BackDD.options[document.form3.BackDD.selectedIndex].value;
	if(sDep=="GoDep"|| sArr=="GoArr") 
 	{
 		sErrmsg += "กด Please check Departure City and Destination City!\n";
		document.form3.GoDep.focus();
		errflag = true; 	
 	}
 	else
 	{
 		sDep=sDep.substring(3,6)
 		sArr=sArr.substring(3,6)	
 	}
 
 	var dGoDate = new Date (goYYYY + '/' + goMM + '/' + goDD);
	var dBackDate = new Date (backYYYY + '/' + backMM + '/' + backDD);
 	
 	if (!check_validdate("departure",goYYYY,goMM,goDD)) {
 		errflag = true;			
	}				
	if (!check_validdate("return",backYYYY,backMM,backDD)) {
 		errflag = true;			
	}			
	
 	if (document.form3.Segment[1].checked)
	{				
		if (dBackDate < dGoDate)
		{	sErrmsg += "กด The return date should be no earlier than the departure date.\n";
			document.form3.BackMM.focus();
			errflag = true; 		
		} 	
	}
	if (sDep == sArr)
	{	sErrmsg +="กด The destination city should not be the same as the departure city.\n";
		document.form3.GoArr.focus();
  		errflag = true;		
  	}
	if (errflag)
	{	
	    if (sErrmsg!="") alert(sErrmsg); 
		return false;
	}
	else
	{
		document.form3.hidarr.value=document.form3.GoArr.options[document.form3.GoArr.selectedIndex].value
		document.form3.hiddep.value=document.form3.GoDep.options[document.form3.GoDep.selectedIndex].value
		return true;
		
	}	
}

function setStateTimeTable(trip){
	  if(trip.value == "1"){
	    document.form3.BackYYYY.disabled = true;
	    document.form3.BackMM.disabled = true;
	    document.form3.BackDD.disabled = true;
	    document.form3.State.value=1;
	  }
	  else{
	    document.form3.BackYYYY.disabled = false;
	    document.form3.BackMM.disabled = false;
	    document.form3.BackDD.disabled = false;
	    document.form3.State.value=2;
	  }
}
function winopen(strurl)	{
						xx=event.clientX;
						yy=event.clientY-100;
						strinfo="location=no,menubar=no,status=no,titlebar=no,height=160,width=158,left="+xx+",top="+yy;
						window.open(strurl, 'cl1', strinfo);
						}
function openwin() {window.open("/html/b2c/japanese/Right.html","win2","toolbar=no,menubar=no,scrollbars=yes,width=600,height=402,resizable=no");}
function openwin2(){window.open("/html/b2c/japanese/Privacy.html","win3","toolbar=no,menubar=no,scrollbars=yes,width=600,height=402,resizable=no");}
function openwin4(){window.open("/html/b2c/japanese/planitgo_note.html","win4","toolbar=no,menubar=no,scrollbars=yes,width=600,height=402,resizable=no");}
function openwin5(){window.open("http://www.evasion.aero","win5","toolbar=1,location=1,status=1,menubar=1,scrollbars=1,resizable=1,width=800,height=600");}
function openwin6(){window.open("http://eservice.evaair.com/preorder/default.aspx?len=en_US&WT.mc_id=409130&WT.mc_t=Banner","win6","toolbar=1,location=1,status=1,menubar=1,scrollbars=1,resizable=1,width=800,height=600");}
function openwin7(){window.open("/html/b2c/japanese/Customer_online_security.html","win7","toolbar=no,menubar=no,scrollbars=yes,width=600,height=402,resizable=no");}
function openwin20(){window.open("/html/b2c/japanese/Conditions.html","win20","toolbar=no,menubar=no,scrollbars=yes,width=600,height=402,resizable=no");}