﻿function QuickSearch_Onload(countryId,cityId){
	document.asiatravel.var_country.value = countryId;	
	document.asiatravel.var_city.value = cityId;	
	countryMakeOnchange(countryId,cityId);
}

function qs_window_en()
{
	if (document.asiatravel.var_country.selectedIndex == 0)
	{
		alert("Please Select Destination.");
		return false;
	}
	if (document.asiatravel.var_city.selectedIndex == 0)
	{
		alert("Please Select City.");
		return false;
	}

	var in_day   = document.asiatravel.var_inday.options[document.asiatravel.var_inday.selectedIndex].value;
	var in_mon   = document.asiatravel.var_inmonth.options[document.asiatravel.var_inmonth.selectedIndex].value;
	var in_yr    = document.asiatravel.var_inyear.options[document.asiatravel.var_inyear.selectedIndex].value;
	var rooms    = document.asiatravel.var_numrooms.options[document.asiatravel.var_numrooms.selectedIndex].value;	

	var dateStr = in_mon+"/"+in_day+"/"+in_yr
	var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/; 
	var matchArray = dateStr.match(datePat);

	var currDate       = new Date();
	var currDay        = currDate.getDate();
	var currMonth      = currDate.getMonth()+1;
	var currYear       = currDate.getFullYear();
	var currdateStr    = currMonth+"/"+currDay+"/"+currYear
	var currdatePat    = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/;

	if (matchArray == null)
	{ 
		alert("Date is not in a valid format.") 
		return false; 
	} 

	month = matchArray[1];
	day = matchArray[3]; 
	year = matchArray[4]; 

	if ((month==4 || month==6 || month==9 || month==11) && day==31)
	{
		if (month == 4)
		{
			alert("April doesn't have 31st day!")
			document.asiatravel.var_inday.focus();
			return false;
		}
		if (month == 6)
		{
			alert("June doesn't have 31st day!")
			document.asiatravel.var_inday.focus();
			return false;
		}

		if (month == 9)
		{
			alert("September doesn't have 31st day!") 
			document.asiatravel.var_inday.focus();
			return false;
		}

		if (month == 11)
		{
			alert("November doesn't have 31st day!") 
			document.asiatravel.var_inday.focus();
			return false;
		}
	}

	if (month == 2)
	{
		var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); 

		if (day>29 || (day==29 && !isleap))
		{ 
			alert("February " + year + " doesn't have " + day + " days!");
			document.asiatravel.var_inday.focus();
			return false; 
		} 
	} 	

	if (Date.parse(currdateStr) > Date.parse(dateStr))
	{
		alert("Check In Date must be today or after.");
		document.asiatravel.var_inday.focus();
		return false;
	}
			else if  ((((Date.parse(dateStr))-(Date.parse(currdateStr)))/(24*60*60*1000)).toFixed(0)<= 1)
		{
		var ret; 
		//alert(document.asiatravel.var_country.selectedIndex)

		//start country redirect 

		ctrid = document.asiatravel.var_country.options[document.asiatravel.var_country.selectedIndex].value
		cityid = document.asiatravel.var_city.options[document.asiatravel.var_city.selectedIndex].value

		//alert(ctrid);
		//alert(cityid);
		if (ctrid==150)//malaysia
		{

			if (cityid==341)//langkawi
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/langkawi.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/langkawi.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==342)//malacca
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/malacca.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/malacca.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==344)//penang
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/penang.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/penang.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}
			else if (cityid==345 )//port dickson
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/portdickson.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/portdickson.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==347) //sabah
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/sabah.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/sabah.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}
			else{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/kualalumpur.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/kualalumpur.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}

			}
		}else if (ctrid==1) // singapore
		{
			ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/singapore.html");

			if (ret == true)
			{
				 top.location.href ="http://www.fnetravel.com/instantbook/singapore.html"
			//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

				return false;
			}
			else
			{
				document.asiatravel.var_inday.focus();
				return false;
			}

		}else if (ctrid==17) //thailand
		{
			if (cityid==151) //pattaya
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/pattaya.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/pattaya.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==294) //chiang mai
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chiangmai.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/chiangmai.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==290)//krabi
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/krabi.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/krabi.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==293 || cityid==292)//huahin or  cha am
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/huahin.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/huahin.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==150) //phuket
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/phuket.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/phuket.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==734) //koh samui
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/kohsamui.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/kohsamui.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}
			else{
				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/bangkok.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/bangkok.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}

		}else if (ctrid==144) //philippines
		{
			if (cityid==327)//cebu
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/cebu.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/cebu.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==329)//bohol
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/bohol.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/bohol.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==328)//boracay
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/boracay.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/boracay.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else{
				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/manila.html");

				if (ret == true)
				{
					 top.location.href ="http://www.fnetravel.com/instantbook/manila.html"
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}

		}else if (ctrid==175) //korea
		{
			ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.instantroom.com/reservation/frmSearchHotel.aspx?CNID=175&CTID=619&SID=1012&trck=");

			if (ret == true)
			{
				 top.location.href ="http://www.instantroom.com/reservation/frmSearchHotel.aspx?CNID=175&CTID=619&SID=1012&trck="
			//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

				return false;
			}
			else
			{
				document.asiatravel.var_inday.focus();
				return false;
			}

		}
		else if (ctrid==176)//Japan
		{
			ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.instantroom.com/reservation/frmSearchHotel.aspx?CNID=176&CTID=611&SID=1012&trck=");

			if (ret == true)
			{
				 top.location.href ="http://www.instantroom.com/reservation/frmSearchHotel.aspx?CNID=176&CTID=611&SID=1012&trck="
			//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

				return false;
			}
			else
			{
				document.asiatravel.var_inday.focus();
				return false;
			}
		}else if (ctrid==227) // poland
		{
			ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://hotel.asiatravel.com/reservation/frmSearchHotel.aspx?var_country=PL&var_city=WAW&SID=1012");

			if (ret == true)
			{
				 top.location.href ="http://hotel.asiatravel.com/reservation/frmSearchHotel.aspx?var_country=PL&var_city=WAW&SID=1012"
			//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

				return false;
			}
			else
			{
				document.asiatravel.var_inday.focus();
				return false;
			}
		}else if (ctrid==147)//UAE
		{
			ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/dubai.html");

			if (ret == true)
			{
				 top.location.href ="http://www.fnetravel.com/instantbook/dubai.html"
			//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

				return false;
			}
			else
			{
				document.asiatravel.var_inday.focus();
				return false;
			}		
		}
		else{
			ret=confirm("For booking less than 2 days pior to check in date, kindly book at www.fnetravel.com/lastminute.html");
			if (ret == true)
			{
				//top.location.href ="http://www.fnetravel.com/lastminute.html"
				window.open("http://www.fnetravel.com/lastminute.html","_blank","");

				return false;
			}
			else
			{
				document.asiatravel.var_inday.focus();
				return false;
			}
		  }
		}
	document.asiatravel.action = "http://www.fnetravel.com/reservation/frmSearchHotel.aspx";
	document.asiatravel.submit();
}

function qs_window_ch()
{
	if (document.asiatravel.var_country.selectedIndex == 0)
	{
		alert("请选择目的地.");
		return false;
	}
	if (document.asiatravel.var_city.selectedIndex == 0)
	{
		alert("请选择城市.");
		return false;
	}
	
	var in_day   = document.asiatravel.var_inday.options[document.asiatravel.var_inday.selectedIndex].value;
	var in_mon   = document.asiatravel.var_inmonth.options[document.asiatravel.var_inmonth.selectedIndex].value;
	var in_yr    = document.asiatravel.var_inyear.options[document.asiatravel.var_inyear.selectedIndex].value;
	var rooms    = document.asiatravel.var_numrooms.options[document.asiatravel.var_numrooms.selectedIndex].value;	

	var dateStr = in_mon+"/"+in_day+"/"+in_yr
	var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/; 
	var matchArray = dateStr.match(datePat);

	var currDate       = new Date();
	var currDay        = currDate.getDate();
	var currMonth      = currDate.getMonth()+1;
	var currYear       = currDate.getFullYear();
	var currdateStr    = currMonth+"/"+currDay+"/"+currYear
	var currdatePat    = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/;

	if (matchArray == null)
	{ 
		alert("日期错误.") 
		return false; 
	} 

	month = matchArray[1];
	day = matchArray[3]; 
	year = matchArray[4]; 

	if ((month==4 || month==6 || month==9 || month==11) && day==31)
	{
		if (month == 4)
		{
			alert("April doesn't have 31st day!")
			document.asiatravel.var_inday.focus();
			return false;
		}
		if (month == 6)
		{
			alert("June doesn't have 31st day!")
			document.asiatravel.var_inday.focus();
			return false;
		}

		if (month == 9)
		{
			alert("September doesn't have 31st day!") 
			document.asiatravel.var_inday.focus();
			return false;
		}

		if (month == 11)
		{
			alert("November doesn't have 31st day!") 
			document.asiatravel.var_inday.focus();
			return false;
		}
	} 

	if (month == 2)
	{
		var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); 

		if (day>29 || (day==29 && !isleap))
		{ 
			alert("February " + year + " doesn't have " + day + " days!");
			document.asiatravel.var_inday.focus();
			return false; 
		} 
	} 	

	if (Date.parse(currdateStr) > Date.parse(dateStr))
	{
		alert("Check In Date must be today or after.");
		document.asiatravel.var_inday.focus();
		return false;
	}
	else if  ((((Date.parse(dateStr))-(Date.parse(currdateStr)))/(24*60*60*1000)).toFixed(0)<= 1)
	{
		ctrid = document.asiatravel.var_country.options[document.asiatravel.var_country.selectedIndex].value;
		cityid = document.asiatravel.var_city.options[document.asiatravel.var_city.selectedIndex].value;

		//alert(ctrid)
		//malaysia
		if (ctrid==150)//malaysia
		{
			if (cityid==341)//langkawi
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_langkawi.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_langkawi.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==342)//malacca
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_malacca.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_malacca.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==344)//penang
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_penang.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_penang.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}
			else if (cityid==345 )//port dickson
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_portdickson.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_portdickson.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==347) //sabah
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_sabah.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_sabah.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_kualalumpur.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_kualalumpur.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}

			}

		}else if (ctrid==1) // singapore
		{
			ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_singapore.html");

			if (ret == true)
			{
				 top.location.href = "http://www.fnetravel.com/instantbook/chinese_singapore.html";
			//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

				return false;
			}
			else
			{
				document.asiatravel.var_inday.focus();
				return false;
			}

		}else if (ctrid==17) //thailand
		{
			if (cityid==151) //pattaya
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_pattaya.html");

				if (ret == true)
				{
					top.location.href = "http://www.fnetravel.com/instantbook/chinese_pattaya.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==294) //chiang mai
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_chiangmai.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_chiangmai.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==290)//krabi
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_krabi.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_krabi.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==293 || cityid==292)//huahin or  cha am
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_huahin.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_huahin.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==150) //phuket
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_phuket.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_phuket.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==734) //koh samui
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_kohsamui.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_kohsamui.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}
			else{
				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_bangkok.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_bangkok.html";				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}

		}else if (ctrid==144) //philippines
		{
			if (cityid==327)//cebu
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_cebu.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_cebu.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==329)//bohol
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_bohol.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_bohol.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else if (cityid==328)//boracay
			{

				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_boracay.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_boracay.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}else{
				ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_manila.html");

				if (ret == true)
				{
					 top.location.href = "http://www.fnetravel.com/instantbook/chinese_manila.html";
				//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

					return false;
				}
				else
				{
					document.asiatravel.var_inday.focus();
					return false;
				}
			}

		}else if (ctrid==175) //korea
		{
			ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.instantroom.com/reservation/frmSearchHotel.aspx?CNID=175&CTID=619&SID=1012&trck=");

			if (ret == true)
			{
				 top.location.href = "http://www.instantroom.com/reservation/frmSearchHotel.aspx?CNID=175&CTID=619&SID=1012&trck=";
			//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

				return false;
			}
			else
			{
				document.asiatravel.var_inday.focus();
				return false;
			}

		}else if (ctrid==176)//Japan
		{
			ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.instantroom.com/reservation/frmSearchHotel.aspx?CNID=176&CTID=611&SID=1012&trck=");

			if (ret == true)
			{
				 top.location.href = "http://www.instantroom.com/reservation/frmSearchHotel.aspx?CNID=176&CTID=611&SID=1012&trck=";
			//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

				return false;
			}
			else
			{
				document.asiatravel.var_inday.focus();
				return false;
			}
		}else if (ctrid==227) // poland
		{
			ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://hotel.asiatravel.com/reservation/frmSearchHotel.aspx?var_country=PL&var_city=WAW&SID=1012");

			if (ret == true)
			{
				 top.location.href ="http://hotel.asiatravel.com/reservation/frmSearchHotel.aspx?var_country=PL&var_city=WAW&SID=1012"
			//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

				return false;
			}
			else
			{
				document.asiatravel.var_inday.focus();
				return false;
			}
		}else if (ctrid==147)//UAE
		{
			ret=confirm("For booking less than 2 days pior to check in date, kindly book at http://www.fnetravel.com/instantbook/chinese_dubai.html");

			if (ret == true)
			{
				 top.location.href = "http://www.fnetravel.com/instantbook/chinese_dubai.html";
			//	window.open("http://www.fnetravel.com/lastminute.html","_blank","");

				return false;
			}
			else
			{
				document.asiatravel.var_inday.focus();
				return false;
			}

		}

		else{
			ret=confirm("For booking less than 2 days pior to check in date, kindly book at www.fnetravel.com/lastminute.html");
			if (ret == true)
			{
			// top.location.href ="www.fnetravel.com/lastminute.html"
				window.open("http://www.fnetravel.com/lastminute.html","_blank","");

				return false;
			}
			else
			{
				document.asiatravel.var_inday.focus();
				return false;
			}
		  }
		}							
	//return true;
	document.asiatravel.action = "http://www.fnetravel.com/reservation/frmSearchHotel_cn.aspx";
	document.asiatravel.submit();
}