hotelIDs = new Array();

function clickViewCompareSort(ct,cd,url) {
	var sercalendar = new Date();
	var sercalendar2 = new Date();
	var sercal;
	var serdate;
	var sermonth;
	var serdate2;
	var sermonth2;

		//Here is the variable to change for to advance the arrival Date
	 var seradvanceArrival = 14; 
	
	//Here is the variable to change for to advance the departure Date
	 var seradvanceDeparture = 16; 

	 	//Set the arrival Days
	sercalendar.setDate(sercalendar.getDate()+ seradvanceArrival);
	serdate = sercalendar.getDate();
	sermonth = sercalendar.getMonth();
	
	
	//Set the Departure Days
	sercalendar2.setDate(sercalendar2.getDate()+seradvanceDeparture); 
	serdate2 = sercalendar2.getDate();
	sermonth2 = sercalendar2.getMonth();

if(url == "")
{
  alert("Please Select the Sorting Order");
}
else
{
window.open("http://www.travelnow.com/hotels/hotnetlist.jsp?cid=65249&"+"city="+ct+"&stateProvince=&country="+cd+"&arrivalMonth="+sermonth+"&arrivalDay="+serdate+"&departureMonth="+sermonth2+"&departureDay="+serdate2+"&"+url+"&mode=1&"+getViewCompareHotels()+"showUserHotels=true");
}
}


function getViewCompareHotels() {
var hotelQueryString = "";
for (var i=0; i < hotelIDs.length; i++) {
if (hotelIDs[i] != undefined) {
hotelQueryString += "&userHotelIDs=" + hotelIDs[i];
}
}
return hotelQueryString;
}


function MapAllHotels(murl) {
window.open(murl,'HRNMap','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=640,height=480');
}

function arrDate_deptDate(ct,st,cd,di)
{

	var sercalendar = new Date();
	var sercalendar2 = new Date();
	var sercal;
	var serdate;
	var sermonth;
	var serdate2;
	var sermonth2;

		//Here is the variable to change for to advance the arrival Date
	 var seradvanceArrival = 14; 
	
	//Here is the variable to change for to advance the departure Date
	 var seradvanceDeparture = 16; 

	 	//Set the arrival Days
	sercalendar.setDate(sercalendar.getDate()+ seradvanceArrival);
	serdate = sercalendar.getDate();
	sermonth = sercalendar.getMonth();
	
	
	//Set the Departure Days
	sercalendar2.setDate(sercalendar2.getDate()+seradvanceDeparture); 
	serdate2 = sercalendar2.getDate();
	sermonth2 = sercalendar2.getMonth();
	document.sortForm.action = 'http://www.travelnow.com/index.jsp?pageName=hotSearch&showPopUp=true&newSort=true&passThrough=true&validateCity=true&validateDates=true&submitted=true&streetAddress=&city='+ ct +'&stateProvince=' + st + '&postalCode=&country='+cd + "&arrivalMonth=" + sermonth + "&arrivalDay=" + serdate + "&departureMonth=" + sermonth2 + "&departureDay=" + serdate2 + "&destinationID=" + di + '&mode=2&cid=65249&currencyCode=USD&locale=en_US';
	document.sortForm.submit();
	}

   function hotels_list(ct,st,cd)
   {
   
	var hotcalendar = new Date();
	var hotcalendar2 = new Date();
	var hotcal;
	var hotdate;
	var hotmonth;
	var hotdate2;
	var hotmonth2;

		//Here is the variable to change for to advance the arrival Date
	 var hotadvanceArrival = 14; 
	
	//Here is the variable to change for to advance the departure Date
	 var hotadvanceDeparture = 16; 

	 	//Set the arrival Days
	hotcalendar.setDate(hotcalendar.getDate()+ hotadvanceArrival);
	hotdate = hotcalendar.getDate();
	hotmonth = hotcalendar.getMonth();
	
	
	//Set the Departure Days
	hotcalendar2.setDate(hotcalendar2.getDate()+hotadvanceDeparture); 
	hotdate2 = hotcalendar2.getDate();
	hotmonth2 = hotcalendar2.getMonth();
	var hurl;
	hurl = 'http://www.travelnow.com/index.jsp?pageName=hotSearch&additionalData=viaGuides&city=' + ct + '&stateProvince=' + st + '&country=' + cd + '&arrivalMonth=' + hotmonth + "&arrivalDay=" + hotdate + "&departureMonth=" + hotmonth2 + "&departureDay=" + hotdate2 + "&mode=2&validateCity=true&submitted=true&specials=false&showHotels=true&isHotels=true&showCondos=false&isCondos=false&netOnly=false&cid=65249";
	window.location = hurl;
   }





      function hotels_list1(ct,cd,iscity,ishotel)
   {var hurl;
   if (iscity=='true')
	 {
	hurl = 'http://www.travelnow.com/index.jsp?pageName=hotNetList&cid=65249&city=' + ct + '&country=' + cd + '&validateCity=true&submitted=true&mode=1&isCondos=false&isHotels=true&showCondos=true&showHotels=true';
	window.location = hurl;
	}
	else
	{
	hurl = 'http://www.travelnow.com/index.jsp?pageName=hotAvail&cid=65249&hotelID=' + ishotel + '&isHRN=true&hotnetrates=true&currencyCode=USD&isCondos=false&isHotels=true&mode=1&city=' + ct + '&country=' + cd + '&numberOfAdults=&numberOfChildren=&numberOfRooms=&showPopUpMap=false&arrivalMonth=&arrivalDay=&departureMonth=&departureDay=&showInfo=true&showPopUp=true&generic=true';
	window.location = hurl;
	}
   }

