function fnGetExhiHotels() {
	chkOnlineProds();
	document.eventHotelsSearchForm.onlineProdcutsOnly.value = document.getElementById('onlineProdcutsOnly').value;
	document.eventHotelsSearchForm.city.value = document.getElementById("hidCity").value;
	document.eventHotelsSearchForm.country.value = document.getElementById("hidCountry").value;
	document.eventHotelsSearchForm.eventRef.value = document.getElementById("hidEventRef").value;
	document.eventHotelsSearchForm.eventName.value = document.getElementById("hidEventName").value;
	document.eventHotelsSearchForm.roomsSelectBox.value = document.getElementById("sltRooms").value;
	document.eventHotelsSearchForm.nightsSelectBox.value = document.getElementById("sltNights").value;
	var dd = document.getElementById("arrival_dsd").options[document.getElementById("arrival_dsd").selectedIndex].value;
	var mm = eval(document.getElementById("arrival_dsm").options[document.getElementById("arrival_dsm").selectedIndex].value)+1;
	var yy = document.getElementById("arrival_dsy").options[document.getElementById("arrival_dsy").selectedIndex].value;
	var strEvtEndDate = document.getElementById('hidEventEndDate').value;
	var strEvtStartDate = document.getElementById('hidEventStartDate').value;
	

	/*If condition Added on 1July2005 to fix CR of moving date validation to Book Now button on click event */
	if(dd == "" || mm == "" || yy == "") {
		alert(jsSltValidDateOfArrival);
		document.getElementById("arrival_dsd").focus();
		return;
	}
	if(!validateDate(dd,mm-1,yy))
	{
		document.getElementById("arrival_dsd").focus();
		return;
	}
	//0006100: Date validation - Exhibition 07-Aug-2006
	if(isLessThanCurrentDate(dd,mm,yy)) {
		alert(jsLessThanCurrentDate);
		document.getElementById("arrival_dsd").focus();
		return;
	}
	if(!isValidArrivalDate(dd,mm-1,yy)) {
		alert(jsSltInValidDateOfArrival);
		document.getElementById("arrival_dsd").focus();
		return;
	}
		else
		{
			if(fnValidateCurDate(dd,mm,yy))
			{
				//Dilip Commented not to validate selected date against the event start date and end date
				//as of feed back given by rick
				
				/*if(!fnValidateBtStartEndDate(dd,mm,yy,strEvtEndDate,strEvtStartDate) )
				{
					alert(jsArrivalDateNotBetweenExhiStartEndDate);
					document.getElementById("arrival_dsd").focus();
				}*/
				if(false) {
				} else { 
					document.eventHotelsSearchForm.arrival_dsd.value = document.getElementById("arrival_dsd").options[document.getElementById("arrival_dsd").selectedIndex].value;
					document.eventHotelsSearchForm.arrival_dsm.value = eval(document.getElementById("arrival_dsm").options[document.getElementById("arrival_dsm").selectedIndex].value)+1;
					document.eventHotelsSearchForm.arrival_dsy.value = document.getElementById("arrival_dsy").options[document.getElementById("arrival_dsy").selectedIndex].value;
					document.eventHotelsSearchForm.rooms.value = document.getElementById("sltRooms").value;	
					document.eventHotelsSearchForm.nights.value = document.getElementById("sltNights").value;
					document.eventHotelsSearchForm.country_name.value = document.getElementById("hidCountryName").value;
					document.eventHotelsSearchForm.submit();
				}	
			}
			else
			{
				alert(jsInvalidArrivalDate);
			}	
		}
}
/*
//Function used to validate the user inputs
// Called when the user clicks the Search button from the validate function
*/
function validateDate(day,month,year){
		var	monthDays = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
		if(isNaN(day) || isNaN(month))
			return false;

		if(isNaN(year))
			year=4;

		if(year%4 == 0)
			monthDays[1] = 29;

		if(day > monthDays[month])
			return false;

		return true;
}

//Function to Hide the select Menu's that gets displayed though the Date Picker value is displayed
//This function is introduced as the Z-index value for select menu's are infinity
	function fnElegantHide(dt,obj)
	{
		if(document.getElementById("sltNights").style.visibility == "hidden")
			document.getElementById("sltNights").style.visibility = "visible";
		else
			document.getElementById("sltNights").style.visibility = "hidden";
			
		if(document.getElementById("sltRooms").style.visibility == "hidden")
			document.getElementById("sltRooms").style.visibility = "visible";
		else
			document.getElementById("sltRooms").style.visibility = "hidden";
			
			//Now call the javascript Date Picker code	
			DPPopUp(dt, obj);
	}

/*
//Function to Show  the select Menu's ===== after they are hidden by fnElegantHide ==== that gets displayed though the Date Picker value is displayed
//This function is introduced as the Z-index value for select menu's are infinity
*/
function fnTempDirty()
{	
			if(document.getElementById("arrival_dsm").value == "" && document.getElementById("sltNights").style.visibility =="hidden")
			document.getElementById("arrival_dsm").value = "0";
						  
			document.getElementById("sltNights").style.visibility = "visible";
			document.getElementById("sltRooms").style.visibility = "visible";
}
function fnValidateCurDate(d,m,y)
{
	/*Date: 01-08-06 MantisCase:0005330: Event Search Action- Exhibition page - Date of arrival
	  Date of arrival should not be validated for event search*/
	  return true;

				m = eval(m); //to adjust the incompatibility in month of the date picker

				var curr_date = getServerCurDay();
				var curr_month = getServerCurMM();
				var curr_year = getServerCurYYYY();
				
				if(y < curr_year)
				{
					return false;
				}
				if((m < curr_month) && (y == curr_year))
				{
					return false;
				}
				if((d < curr_date) && (m == curr_month) && (y == curr_year))
				{
					return false;
				}
				return true;
}
/*
	//Function to validate whether the arrival date is between the selected events 
	//startdate and enddate
*/
function fnValidateBtStartEndDate(arrivalDD,arrivalMM,arrivalYY,strEvtEndDate,strEvtStartDate)
{
//Checking for Event End date
	var arTmpEnd = strEvtEndDate.split(" ");
	var iMax = arTmpEnd.length;
	var arMon = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
	
				var evtEndDD = eval(arTmpEnd[iMax-3]);
				var evtEndMM = arTmpEnd[iMax-2];
				var evtEndYY = eval(arTmpEnd[iMax-1]);


				for(i=0;i<12;i++)
				{
					if(arMon[i] == evtEndMM)
					evtEndMM = i+1;
				}

				if(arrivalYY > evtEndYY)
				{
					return false;
				}
				if((arrivalMM > evtEndMM) && (arrivalYY == evtEndYY))
				{
					return false;
				}
				if((arrivalDD > evtEndDD) && (arrivalMM == evtEndMM) && (arrivalYY == evtEndYY))
				{
					return false;
				}
				return true;
}

