

	<!--  to hide script contents from old browsers
			var startDate;
			var endDate;
			var callbacks = 0;

			function resetDates() {
				startDate = endDate = null;
			}

			function compareDatesOnly(date1, date2) {
				var year1 = date1.getYear();
				var year2 = date2.getYear();
				var month1 = date1.getMonth();
				var month2 = date2.getMonth();
				var day1 = date1.getDate();
				var day2 = date2.getDate();

				if (year1 > year2) {
					return -1;
				}
				if (year2 > year1) {
					return 1;
				}

				//years are equal
				if (month1 > month2) {
					return -1;
				}
				if (month2 > month1) {
					return 1;
				}

				//years and months are equal
				if (day1 > day2) {
					return -1;
				}
				if (day2 > day1) {
					return 1;
				}

				//days are equal
				return 0;


			}

			function filterDates1(cal) {
				startDate = cal.date;
				startDate.setDate(startDate.getDate()+1)
				if (endDate == null) { 
					Zapatec.Calendar.setup({
						inputField     :    "arrivalDate",
						button         :    "button8b",  // What will trigger the popup of the calendar
						ifFormat       :    "%Y-%m-%d ",
						timeFormat     :    "24",
						date           :     startDate,
						electric       :     false,
						showsTime      :     false,          //no time
						disableFunc    :    dateInRange2, //the function to call
						onUpdate       :    filterDates2
					});
				}
			}

			function filterDates2(cal) {
				endDate = cal.date;
				endDate.setDate(endDate.getDate()-1)
			}

			
			function dateInRange1(date) {

				if (endDate != null) {

					// Disable dates after end date
					var compareEnd = compareDatesOnly(date, endDate);
					if  (compareEnd < 0) {
						return (true);
					}

					// Hilight end date with "edges" style
					if  (compareEnd == 0) {
						{return "edges";}
					}


					// Hilight inner dates with "between" style
					if (startDate != null){
						var compareStart = compareDatesOnly(date, startDate);
						if  (compareStart < 0) {
							return "between";
						} 
					} 
				}

				//disable days prior to today
				var today = new Date();
				//today.setDate(today.getDate()+2)
				var compareToday = compareDatesOnly(date, today);
				if (compareToday > 0) {
					return(true);
				}


				//all other days are enabled
				return false;
				//alert(ret + " " + today + ":" + date + ":" + compareToday + ":" + days1 + ":" + days2);
				return(ret);
			}

			

			function dateInRange2(date) {
				if (startDate != null) {
					// Disable dates before start date
					var compareDays = compareDatesOnly(startDate, date);
					if  (compareDays < 0) {
						return (true);
					}

					// Hilight end date with "edges" style
					if  (compareDays == 0) {
						{return "edges";}
					}

					// Hilight inner dates with "between" style
					if ((endDate != null) && (date > startDate) && (date < endDate)) {
						return "between";
					} 
				} 

				var now = new Date();
				//now.setDate(now.getDate()+2)
				if (compareDatesOnly(now, date) < 0) {
					return (true);
				}

				//all other days are enabled
				return false;
			}
			// end hiding contents from old browsers  -->
			// ends hiding contents from old browsers  --><br>
		
			function validate()
			{
				 document.getElementById('tableDiv').style.display = "none";


				 if (validateDates())
				 {
					document.getElementById("totalDiv").style.display = "none";
					document.getElementById("progressTable").style.visibility = "visible"
					document.getElementById("progressTable").style.height = "100%"
					fillCriterion();
			//		alert("here");
//					increment();
	//				window.setInterval(increment , 500);			
		//			alert("here too");
				/*	if (document.SearchForm.residentOfIndia.checked)
					{
						document.SearchForm.action = "searchHotels.php?residentOfIndia=Y&method=searchHotels";
					}
					else
					 {
						document.SearchForm.action = "searchHotels.php?residentOfIndia=N&method=searchHotels";
					 }
					 */
					 
					/*if(document.getElementById("tempCityName").value != "")
					{
						document.getElementById("otherCity").value = document.getElementById("tempCityName").value;
					}*/

					document.SearchForm.submit()
					//				window.setTimeout("document.SearchForm.submit()" , 500);
				 }
				 else
				 {					 
					 window.setTimeout(createArrows,1);
					 //createArrows();
					 return false;					 
				 }

			}
			
			function fillCriterion()
			{			
						
					var otherCityName = document.getElementById("tempCityName").value;					
					document.getElementById("progressDisplayCityName").innerHTML = document.getElementById("hiddenCityName").value = otherCityName;					 

					var checkInDate= document.getElementById("arrDateOway").value;
					var checkOutDate = document.getElementById("deptDateOway").value;					
					var checkInDateString = getDateString(checkInDate);
					var checkOutDateString = getDateString(checkOutDate);
					document.getElementById("progressDisplayDatesSpan").innerHTML = "Check-in Date:<br/><strong>"+checkInDateString+"</strong><br/>Check-out Date:<br/>   <strong>"+checkOutDateString+"</strong></span>"
			}




			function getDateString(dateString)
			{
				
					var	months = new Array();
							months[0] = "Jan";
							months[1] = "Feb";
							months[2] = "Mar";
							months[3] = "Apr";
							months[4] = "May";
							months[5] = "Jun";
							months[6] = "Jul";
							months[7] = "Aug";  
							months[8] = "Sep";
							months[9] = "Oct";
							months[10] = "Nov";
							months[11] = "Dec";				
					var parts = dateString.split("/");
					if (parts[1] == "09")
					{
						parts[1] = "9";
					}
					else if (parts[1]=="08")
					{
						parts[1] = "8"
					}
	//				alert(parseInt(parts[1]));
					var dateStringToReturn = parts[0] + "-" + months[ parseInt(parts[1])-1] + "-"+   parts[2];
					return dateStringToReturn;		
			}
			
			
			function validateDates()
			{
				var fromDateString = document.getElementById("arrDateOway").value;
				var toDateString = document.getElementById("deptDateOway").value;
				//isThisDate(fromDateString,"arrDateOway")
						
				if (fromDateString.length==0 && toDateString.length==0)
				{
					alert(enterDates);
					return;
				}
				if (fromDateString.length==0)
				{
					alert(enterCheckIn);
					return;
				}
				if (toDateString.length==0)
				{
					alert(enterCheckOut);
					return;
				}
				
				if(!isThisDate(fromDateString,"arrDateOway")){
					return false;
				}
				if(!isThisDate(toDateString,"deptDateOway")){
					return false;
				}		
				var fromDate = buildDate(fromDateString);
				var toDate = buildDate(toDateString);
				var todayDate = new Date();
				var todayTime = todayDate.getTime();
				//alert("The from date is:" + fromDate + " and the to date is:" + toDate);
				var fromTime = fromDate.getTime();
				var toTime = toDate.getTime();
				var now=new Date().getTime();
				//alert(toDateString);
				//alert(fromDateString);
				//alert((toTime-fromTime)/86400000);
				/*if(todayTime>fromTime){
					alert(checkInDate);
					return false;
				}*/
				if (fromTime > toTime)
				{
					alert(checkIn_CheckOut);
					return false;
				}
				else if (fromTime==toTime)
				{
					alert(same_check_in_out);
					return false;
				}
				/* Commented out for the sake of removing the check on limit on number of days of stay limit*/
/*				else if((toTime-fromTime)/86400000 >15){
					alert(days_diff);
					return false;				
				}
				else if((toTime-now)/86400000>365){
					alert(year_days);
					return false;				
				}*/
								/* Commented out Till here the sake of removing the check on limit on number of days of stay limit*/
				else
				{
					return true;
				}
			}
			

		
			function validateCity()
			{
				var cities = document.getElementsByName("cityCode");
				var otherCityCode = "otherCityCode";
				var cityCombo=document.getElementById("cityName");	
				
				for (var count=0;count<cities.length; count++)
				{
					var id = cities[count].id;
					if (id != otherCityCode)
					{
						if (cities[count].checked == true)
						{							
							return true;
						}
					}
				}
				if ( cityCombo.selectedIndex>0 && document.getElementById(otherCityCode).checked==true)
				{			
					return true;
				}
				alert(enterCity);
				cityCombo.focus();
				return false;
			}
			
			function buildDate(dateString)    // date string is in format dd/mm//yyyy
			{
				var dd = parseInt(eval(dateString.split("/")[0]),10);
				var mm = parseInt(eval(dateString.split("/")[1]),10);
				var yyyy = parseInt(eval(dateString.split("/")[2]),10);
				var date = new Date (yyyy, (mm-1) , dd, 0, 0, 0, 0)
				/*
				date.setDate(eval(dd));
				date.setMonth(mm-1);
				date.setFullYear(yyyy)
				date.setHours(0);
				date.setMinutes(0);
				date.setSeconds(0);
				date.setMilliseconds(0);
				alert(date);*/
				return date;
			}
			

