 
function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}
 

function assignAirportCode (field,code) {

	if ( field == 'pickup_city') {

		airportfield = eval("document.CarSearchForm."+field);

	} else {

		if ( field == 'hotel_city') {

			airportfield = eval("document.HotelSearchForm."+field);

		} else {

			if (( field == 'fromLocation') || ( field == 'toLocation'))  {

				if ( field == 'fromLocation') {

					airportfield = eval("document.NeatSearchForm_ach."+field);

				} else {

					airportfield = eval("document.NeatSearchForm_ach."+field);

					airportfield = eval("document.NeatSearchForm_ch."+field);

				}

			} else {

				if ( field == 'toLocation') {

					airportfield = eval("document.NeatSearchForm_ch."+field);

				} else {

					airportfield = eval("document.FlightSearchForm."+field);

				}

			}

		}

	}

	airportfield.value = code;

}



function newwindow(field) { 

var hostProtocol = (("https:" == document.location.protocol) ? "https://" : "http://");

window.open(hostProtocol+site_url+'/include/inc_php/AirportSearch.php?country=USA&field='+field,'mywindow','scrollbars=yes,width=550,height=485,left=200,top=120,screenX=200,screenY=120'); 

} 

 

 

function popupPage() {

var page = "message_NW.html";

windowprops = "height=500,width=600,location=no,"

+ "scrollbars=yes,menubars=no,toolbars=no,resizable=yes";

 

window.open(page, "Popup", windowprops);

}

 
 
               
    




function FormBuild(SearchType)

{

//var sid = SearchType;

 switch(SearchType)

	{

	

	case '1':

		//alert('FormBuild Function Started'); // remember to remove this #################################################################################################

		

		document.getElementById('FlightArea').style.display = 'block';

		document.getElementById('HotelArea').style.display = 'none';

		document.getElementById('CarArea').style.display = 'none';

		document.getElementById('CruiseArea').style.display = 'none';



	

		document.getElementById('RadioHotel').style.background ='url(images/search/bgnd_trans.gif)';

		document.getElementById('RadioCar').style.background ='url(images/search/bgnd_trans.gif)';

		document.getElementById('RadioCruise').style.background ='url(images/search/bgnd_trans.gif)';



		document.getElementById('SButton').innerHTML = '<a href="javascript:void(0);" onmouseover="window.status=\'Flights search\';return(true);"   onmouseout="window.status=\'The best travel deals online\';return(true);"  onClick="if (CheckAdvancePurchase()){SearchFormValidate(\'1\',\'advanced\');}"> <img SRC="images/search/search-now.png" ALT="Submit now" NAME="Submit now" border="0" VALUE="Submit now"></a>';



		document.getElementById('MOptions').innerHTML = '<font style="font-size:10px;font-family:arial"><a href="'+site_url+'travel/flights">More flight search options</a></font>';		

		

		//alert('FormBuild Function ending'); // remember to remove this #################################################################################################

	break;

	

	case '2':

		document.getElementById('FlightArea').style.display = 'none';

		document.getElementById('HotelArea').style.display = 'none';

		document.getElementById('CarArea').style.display = 'block';

		document.getElementById('CruiseArea').style.display = 'none';



		document.getElementById('RadioFlight').style.background ='url(images/bgnd_trans.png)';

		document.getElementById('RadioHotel').style.background ='url(images/bgnd_trans.png)';

		

		document.getElementById('RadioCruise').style.background ='url(images/bgnd_trans.png)';



		document.getElementById('SButton').innerHTML = '<a href="javascript:void(0);"  onmouseover="window.status=\'Rental Car search\';return(true);"   onmouseout="window.status=\'The best travel deals online\';return(true);"  onClick="SearchFormValidate(\'2\',\'advanced\');"> <img SRC="images/search/search-now.png" ALT="Submit now" NAME="Submit now" border="0" VALUE="Submit now"></a>';



		document.getElementById('MOptions').innerHTML = '<font style="font-size:11px;font-family:arial"><a href="'+site_url+'travel/car">More car search options</a></font>';



	break;



	case '3':

		document.getElementById('FlightArea').style.display = 'none';

		document.getElementById('HotelArea').style.display = 'block';

		document.getElementById('CarArea').style.display = 'none';

		document.getElementById('CruiseArea').style.display = 'none';



		document.getElementById('RadioFlight').style.background ='url(images/search/bgnd_trans.gif)';

		

		document.getElementById('RadioCar').style.background ='url(images/search/bgnd_trans.gif)';

		document.getElementById('RadioCruise').style.background ='url(images/search/bgnd_trans.gif)';



		document.getElementById('SButton').innerHTML = '<a href="javascript:void(0);"  onmouseover="window.status=\'Hotels search\';return(true);"   onmouseout="window.status=\'The best travel deals online\';return(true);"  onClick="SearchFormValidate(\'3\',\'advanced\');"> <img SRC="images/search/search-now.png" ALT="Submit now" NAME="Submit now" border="0" VALUE="Submit now"></a>';



		document.getElementById('MOptions').innerHTML = '<font style="font-size:10px;font-family:arial"><a href="'+site_url+'travel/hotels">More hotel search options</a></font>';



	break;



	case '4':

		document.getElementById('FlightArea').style.display = 'none';

		document.getElementById('HotelArea').style.display = 'none';

		document.getElementById('CarArea').style.display = 'none';

		document.getElementById('CruiseArea').style.display = 'block';



		document.getElementById('RadioFlight').style.background ='url(images/search/bgnd_trans.gif)';

		document.getElementById('RadioHotel').style.background ='url(images/search/bgnd_trans.gif)';

		document.getElementById('RadioCar').style.background ='url(images/search/bgnd_trans.gif)';

		



		document.getElementById('SButton').innerHTML = '<a href="javascript:void(0);"  onmouseover="window.status=\'Cruise search\';return(true);"   onmouseout="window.status=\'The best travel deals online\';return(true);"  onClick="SearchFormValidate(\'4\',\'advanced\');"> <img SRC="images/search/search-now.png" ALT="Submit now" NAME="Submit now" border="0" VALUE="Submit now"></a>';



		document.getElementById('MOptions').innerHTML = '<font style="font-size:11px;font-family:arial"><a href="'+site_url+'travel/cruises">More cruise search options</a></font>';



	break;



	case '5':

		

		window.location="https://"+site_url+"/index.php?id=433,424,0,0,1,0&combinationType=ACH";

	

	break;

	}

}


 


 



function FormSubmit(SubmitValue,SType)

{

	//var SType = document.getElementById('SType').value;

	switch(SubmitValue)

		{



			case '1':

			

			//alert('FormSubmit Started'); // remember to remove this #################################################################################################

			

			SearchFormValidate(SubmitValue,SType);



			break;



			case'2':

			SearchFormValidate(SubmitValue,SType);

						

			break;



			case'3':

			SearchFormValidate(SubmitValue,SType);

			

			break;

			

			case'4':

			SearchFormValidate(SubmitValue,SType);

			

			break;

		}



}



 


function addDates(thisField)

{

	var month = 0;

	var day = 0;

	var year = 0;

	var one_day = 1000*60*60*24  //Number of milliseconds in one day

	var index = thisField.value.indexOf("/");

	if (index >0) {

		var departdatevalue = thisField.value.split("/")

	} else {

		var index = thisField.value.indexOf("-");

		if (index >0) {

			var departdatevalue = thisField.value.split("-")

		} else {

			alert("Please Enter a valid date: mm/dd/yyyy");

			return;

		}

	}	



	month = departdatevalue[0] - 1;

	if (isNaN(month)) {

		alert("Please Enter a valid date: mm/dd/yyyy");

		return;

	}

	day = departdatevalue[1] - 0;

	if (isNaN(day))  {

		alert("Please Enter a valid date: mm/dd/yyyy");

		return;

	}	

	year = departdatevalue[2];

	if (isNaN(year))  {

		alert("Please Enter a valid date: mm/dd/yyyy");

		return;

	}	

	//added to account for 2 digit year abbreviation	

	if (year.length == 2) {

		year = "20" + year;

	}

	if (parseInt(year) < 2000 ) year = parseInt(year) + 2000

		

	var dep_date = new Date(year,month,day);

	

	if (day < 10) {

		day = "0" + parseInt(day);

	}

	month = month + 1;

	if (month < 10) {

		month = "0" + parseInt(month);

	}

	thisField.value = month + "/" + day + "/" + year;

		

	future_date=new Date();

	future_date = new Date(dep_date.getTime() + 7 * one_day);



	fDay = future_date.getDate();

    fMonth = future_date.getMonth() + 1;

    fYear = future_date.getFullYear();

	if (fDay <=9) {

		fDay = "0" + fDay;

	}

	if (fMonth <=9) {

		fMonth = "0" + fMonth;

	}

	if (thisField == document.FlightSearchForm.flightdepart) 

		document.FlightSearchForm.flightreturn.value = fMonth + "/" + fDay + "/" + fYear	

	if (thisField == document.CarSearchForm.carpickupdate) 

		document.CarSearchForm.cardropoffdate.value = fMonth + "/" + fDay + "/" + fYear

	if (thisField == document.HotelSearchForm.hotelcheckin) 

		document.HotelSearchForm.hotelcheckout.value = fMonth + "/" + fDay + "/" + fYear

}



function CheckAdvancePurchase()

{

	var month = 0;

	var day = 0;

	var year = 0;

	var one_day = 1000*60*60*24  //Number of milliseconds in one day

	var index = document.getElementById('flightdepart').value.indexOf("/");

	if (index >0) {

		var departdatevalue = document.getElementById('flightdepart').value.split("/")

	} else {

		var index = document.getElementById('flightdepart').value.indexOf("-");

		if (index >0) {

			var departdatevalue = document.getElementById('flightdepart').value.split("-")

		} else {

			alert("Please Enter a valid date: mm/dd/yyyy");

			return;

		}

	}	



	month = departdatevalue[0] - 1;

	day = departdatevalue[1] - 0;

	year = departdatevalue[2];

	//added to account for 2 digit year abbreviation	

	if (year.length == 2) {

		year = "20" + year;

	}	

	if (year.length != 4) {

		alert("Please Enter a valid date: mm/dd/yyyy");

		return;	

	}	

	var dep_date = new Date(year,month,day);

	

	var advance_purchase=new Date();

	advance_purchase = new Date(advance_purchase.getTime() + 2 * one_day);

	datediff = Math.ceil((dep_date.getTime() - advance_purchase)/(one_day))



	if (datediff <0) {

		alert("Advance Purchase Error!\n\nNeed at least 48 Hours Advance Purchase");

		document.getElementById('flightdepart').focus();

		return;

	}

	return true;

}



function ChangeReturnDate(thisField)

{

	var month = 0;

	var day = 0;

	var year = 0;

	var one_day = 1000*60*60*24  //Number of milliseconds in one day

	var index = thisField.value.indexOf("/");

	if (index >0) {

		var departdatevalue = thisField.value.split("/")

	} else {

		var index = thisField.value.indexOf("-");

		if (index >0) {

			var departdatevalue = thisField.value.split("-")

		} else {

			alert("Please Enter a valid date: mm/dd/yyyy");

			return;

		}

	}	



	month = departdatevalue[0] - 1;

	day = departdatevalue[1] - 0;

	year = departdatevalue[2];

	//added to account for 2 digit year abbreviation	

	if (year.length == 2) {

		year = "20" + year;

	}	

	if (parseInt(year) < 2000 ) year = parseInt(year) + 2000



	var dep_date = new Date(year,month,day);

	

	if (day < 10) {

		day = "0" + parseInt(day);

	}

	month = month + 1;

	if (month < 10) {

		month = "0" + parseInt(month);

	}

	formatted_dep_date = month + "/" + day + "/" + year;



	var month = 0;

	var day = 0;

	var year = 0;

	var one_day = 1000*60*60*24  //Number of milliseconds in one day

	var index = document.FlightSearchForm.flightreturn.value.indexOf("/");

	if (index >0) {

		var returndatevalue = document.FlightSearchForm.flightreturn.value.split("/")

	} else {

		var index = document.FlightSearchForm.flightreturn.value.indexOf("-");

		if (index >0) {

			var returndatevalue = document.FlightSearchForm.flightreturn.value.split("-")

		} else {

			alert("Please Enter a valid date: mm/dd/yyyy");

			return;

		}

	}	



	month = returndatevalue[0] - 1;

	day = returndatevalue[1] - 0;

	year = returndatevalue[2];

	if (parseInt(year) < 2000 ) year = parseInt(year) + 2000

		

	var return_date = new Date(year,month,day);

	

	datediff = Math.ceil((return_date.getTime() - dep_date.getTime())/(one_day))	

		

	if (datediff < 0) 

		document.FlightSearchForm.flightreturn.value = formatted_dep_date	

	

}



function ChangeReturnDateCar(thisField)

{

	var month = 0;

	var day = 0;

	var year = 0;

	var one_day = 1000*60*60*24  //Number of milliseconds in one day

	var index = thisField.value.indexOf("/");

	if (index >0) {

		var departdatevalue = thisField.value.split("/")

	} else {

		var index = thisField.value.indexOf("-");

		if (index >0) {

			var departdatevalue = thisField.value.split("-")

		} else {

			alert("Please Enter a valid date: mm/dd/yyyy");

			return;

		}

	}	



	month = departdatevalue[0] - 1;

	day = departdatevalue[1] - 0;

	year = departdatevalue[2];

	//added to account for 2 digit year abbreviation	

	if (year.length == 2) {

		year = "20" + year;

	}	

	if (parseInt(year) < 2000 ) year = parseInt(year) + 2000



	var dep_date = new Date(year,month,day);

	

	if (day < 10) {

		day = "0" + parseInt(day);

	}

	month = month + 1;

	if (month < 10) {

		month = "0" + parseInt(month);

	}

	formatted_dep_date = month + "/" + day + "/" + year;



	var month = 0;

	var day = 0;

	var year = 0;

	var one_day = 1000*60*60*24  //Number of milliseconds in one day

	var index = document.CarSearchForm.cardropoffdate.value.indexOf("/");

	if (index >0) {

		var returndatevalue = document.CarSearchForm.cardropoffdate.value.split("/")

	} else {

		var index = document.CarSearchForm.cardropoffdate.value.indexOf("-");

		if (index >0) {

			var returndatevalue = document.CarSearchForm.cardropoffdate.value.split("-")

		} else {

			alert("Please Enter a valid date: mm/dd/yyyy");

			return;

		}

	}	



	month = returndatevalue[0] - 1;

	day = returndatevalue[1] - 0;

	year = returndatevalue[2];

	//added to account for 2 digit year abbreviation	

	if (year.length == 2) {

		year = "20" + year;

	}	

	if (parseInt(year) < 2000 ) year = parseInt(year) + 2000

		

	var return_date = new Date(year,month,day);

	

	datediff = Math.ceil((return_date.getTime() - dep_date.getTime())/(one_day))	

		

	if (datediff < 0) 

		document.CarSearchForm.cardropoffdate.value = formatted_dep_date	

	

}



function ChangeReturnDateHotel(thisField)

{

	var month = 0;

	var day = 0;

	var year = 0;

	var one_day = 1000*60*60*24  //Number of milliseconds in one day

	var index = thisField.value.indexOf("/");

	if (index >0) {

		var departdatevalue = thisField.value.split("/")

	} else {

		var index = thisField.value.indexOf("-");

		if (index >0) {

			var departdatevalue = thisField.value.split("-")

		} else {

			alert("Please Enter a valid date: mm/dd/yyyy");

			return;


		}

	}	



	month = departdatevalue[0] - 1;

	day = departdatevalue[1] - 0;

	year = departdatevalue[2];

	//added to account for 2 digit year abbreviation	

	if (year.length == 2) {

		year = "20" + year;

	}	

	if (parseInt(year) < 2000 ) year = parseInt(year) + 2000



	var dep_date = new Date(year,month,day);

	

	if (day < 10) {

		day = "0" + parseInt(day);

	}

	month = month + 1;

	if (month < 10) {

		month = "0" + parseInt(month);

	}

	formatted_dep_date = month + "/" + day + "/" + year;



	var month = 0;

	var day = 0;

	var year = 0;

	var one_day = 1000*60*60*24  //Number of milliseconds in one day

	var index = document.HotelSearchForm.hotelcheckout.value.indexOf("/");

	if (index >0) {

		var returndatevalue = document.HotelSearchForm.hotelcheckout.value.split("/")

	} else {

		var index = document.HotelSearchForm.hotelcheckout.value.indexOf("-");

		if (index >0) {

			var returndatevalue = document.HotelSearchForm.hotelcheckout.value.split("-")

		} else {

			alert("Please Enter a valid date: mm/dd/yyyy");

			return;

		}

	}	



	month = returndatevalue[0] - 1;

	day = returndatevalue[1] - 0;

	year = returndatevalue[2];

	//added to account for 2 digit year abbreviation	

	if (year.length == 2) {

		year = "20" + year;

	}	

	if (parseInt(year) < 2000 ) year = parseInt(year) + 2000

		

	var return_date = new Date(year,month,day);

	

	datediff = Math.ceil((return_date.getTime() - dep_date.getTime())/(one_day))	

		

	if (datediff < 0) 

		document.HotelSearchForm.hotelcheckout.value = formatted_dep_date	

	

}

 

<!--

function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}

//-->



<!--

function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}

//-->


	var lwidth=document.all?document.body.clientWidth - 1:window.innerWidth; 

	var lheight=document.all?document.body.clientHeight - 1:window.innerHeight; 

lwidth = 1000;

	document.write ('<div id="Layer1" style="position:absolute; left:1px; top:1px; width:' + lwidth + 'px; height:' + lheight + 'px; visibility:hidden; ');

	document.write ('background-color:#FFFFFF; layer-background-color:#FFFFFF; border:1px #FFFFFF; z-index:4000;">');

	

	document.write ('<table width="385" height="213" align="center">');

	for (i=0;i<12;i++) {

    	document.write ('<tr>');

    	document.write ('<td>&nbsp;</td>');

    	document.write ('</tr>');

	}

 

    document.write ('<tr>');

    document.write ("<td><div align=\"center\"></div></td>");//<img src=\"https://"+site_url+"/images/PL_logos/IC99999.gif\">

    document.write ('</tr>');

    document.write ('<tr>');

    document.write ('<td>&nbsp;</td>');

    document.write ('</tr>');



    document.write ('<tr>');

	document.write ('<td width="282" align="center"> ');

	document.write ('<div id="Layer11" style="font-size:8pt;padding:2px;border:none black 1px" align="center">');

	document.write ('<span id="progress1">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress2">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress3">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress4">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress5">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress6">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress7">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress8">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress9">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress10">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress11">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress12">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress13">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress14">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress15">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress16">&nbsp; &nbsp; &nbsp;</span>&nbsp;');

	document.write ('<span id="progress17">&nbsp; &nbsp; &nbsp;</span>&nbsp;');			

	document.write ('</div></td></tr>');

  	document.write ('<tr>');

   	document.write ('<td>&nbsp;</td>');

   	document.write ('</tr>');

	document.write ('<tr>');

    document.write ('<td><div align="center"><strong><font color="#0033FF" size="3">Please ');

    document.write ('wait while we find the best options for you.</font></strong></div></td>');

	document.write ('</tr>');

	document.write ('</table></div>');	



var progressEnd = 17;

var progressColor = '#0033FF';	

var progressInterval = 200;	

var ns4 = (document.layers)? true : false;

var ie4 = (document.all)? true : false;



var progressAt = progressEnd;

var progressTimer;

function progress_clear() {

	for (var i = 1; i <= progressEnd; i++) document.getElementById('progress'+i).style.backgroundColor = 'transparent';

	progressAt = 0;

}

function progress_update() {

	window.scrollTo(0,0);

	if(ns4) {

		document.all["Layer1"].style.visibility = "show";

  	} else {

		document.getElementById("Layer1").style.visibility = "visible";

	}

	progressAt++;

	if (progressAt > progressEnd) progress_clear();

	else document.getElementById('progress'+progressAt).style.backgroundColor = progressColor;

	progressTimer = setTimeout('progress_update()',progressInterval);

}

function progress_stop() {

	clearTimeout(progressTimer);

	progress_clear();

}

function hideform(thisForm) {

	thisForm.style.visibility = 'hidden';

	HideAllForms();

}

function HideAllForms() {

	for (i=0;i<document.forms.length;i++) {

		document.forms[i].style.visibility = 'hidden';	

	}

}

 

       $(function(){ 

				$("#carpickupdate").datepicker({ dateFormat: 'mm/dd/yy'});



				$("#cardropoffdate").datepicker({ dateFormat: 'mm/dd/yy'});



				$("#flightdepart").datepicker({ dateFormat: 'mm/dd/yy'});



				$("#flightreturn").datepicker({ dateFormat: 'mm/dd/yy'});



				$("#hotelcheckin").datepicker({ dateFormat: 'mm/dd/yy'});



				$("#hotelcheckout").datepicker({ dateFormat: 'mm/dd/yy'});



		});
 

