
function CheckOK() {
	var strURL;
	var f = document.form1;
	var screenW = 800, screenH = 600;

	if (parseInt(navigator.appVersion)>3) {
		screenW = screen.width;
		screenH = screen.height;
	}
	else if (navigator.appName == "Netscape" 
		&& parseInt(navigator.appVersion)==3
		&& navigator.javaEnabled()
	   ) 
	{
		var jToolkit = java.awt.Toolkit.getDefaultToolkit();
		var jScreenSize = jToolkit.getScreenSize();
		screenW = jScreenSize.width;
		screenH = jScreenSize.height;
	}


	if (f.txtDepCity.value=="xxx") {
		alert("Bitte geben Sie den Abflugort ein.");
		return;
    }

	if (f.txtArrCity.value=="xxx") {
		alert("Bitte geben Sie den Ankunftsort ein.");
		return;
    }

	if (f.IstAirlineCode.value!="TG") {
		alert("Der Fluggesellschaft-Code muss Thaiairways(TG) lauten."); 
		return;
    }


	if (f.IstFlightNo.value=="") {
		alert("Bitte geben Sie die Flugnummer ein.");
		return;
    }

	strURL='http://wftc3.e-travel.com/PL/xthai5/en/FlifoInfoServlet'	
	strURL=strURL+'?LANGUAGE=GB&SITE=TG5'; 
	strURL=strURL+'&TRIP_FLOW=YES&SESSION_ID=';
	
	f.txtDepDate.value=f.lstDepMonth.value+f.lstDepDay.value+f.IstDepTime.value
		
	strURL=strURL+'&B_DATE='+f.txtDepDate.value;
	strURL=strURL+'&B_LOCATION='+f.txtDepCity.value;
	strURL=strURL+'&E_LOCATION='+f.txtArrCity.value;
	strURL=strURL+'&AIRLINE_CODE='+f.IstAirlineCode.value;
	strURL=strURL+'&FLIGHT_NUMBER='+f.IstFlightNo.value;
	
	
	var NowDate=new Date();
	var NowYear=""+NowDate.getYear();
						
	var NowMonth=setTo2Digits(""+(NowDate.getMonth()+1));
	var NowDay=setTo2Digits(""+NowDate.getDate());
	var NowPLDate=NowYear+NowMonth+NowDay+"0000";	

	//	if (f.txtDepDate.value<NowPLDate)
	//	{
	//		alert("Date already passed.");
	//		return;
	//	}

	strURL = strURL.replace(/LANGUAGE=GB/, g_Param_LANGUAGE);  //Kaew add code

	//alert(strURL);
	//window.navigate(strURL);
   	//window.open(strURL,'1ARES','location,menubar,resizable,dependent,status,Width=800,Height=600,location,toolbar');
    screenW=screenW-10;
    screenH=screenH-160;

	//window.open(strURL,'1ARES', ' menubar,resizable,status,location,scrollbars,toolbar,left=0,top=0,width=' +  screenW + ',height=' +  screenH + '');
	window.open(strURL,"1ARES","toolbar,status,resizable,scrollbars,top=0,left=0,width="+(screen.width*0.99)+",height="+(screen.height*0.88))

}




window.onload = function() {
	var f = document.form1;
	setTimeDropDown(f.IstDepTime);
	setCityDropDown(f.txtDepCity, g_Inter_CityList['full']);
	setCityDropDown(f.txtArrCity, g_Inter_CityList['full']);
		
	setDateMonthDropDown(f.lstDepDay, f.lstDepMonth);
}
