function validatePreference(f)
{
	if(f.chkNoPre.checked == true)
	{
		f.cmbBedType.disabled = true;
		f.radSmoking[0].disabled = true;
		f.radSmoking[1].disabled = true;
		f.chkAccessible.disabled = true;
	}
	else
	{
		f.cmbBedType.disabled = false;
		f.radSmoking[0].disabled = false;
		f.radSmoking[1].disabled = false;
		f.chkAccessible.disabled = false;
	}
}
function validateHotelSearch()
{
	dd = frmSearch.cmbCheckInDay.value;
	mm = frmSearch.cmbCheckInMonth.value;
	yy = frmSearch.cmbCheckInYear.value;

	date1 = new Date(); 
	date1.setMonth(mm-1);
	date1.setDate(dd);
	date1.setYear(yy);
	if((date1.getDate()!=dd) || ((date1.getMonth())!=(mm-1)) || (date1.getFullYear()!=yy))
	{
		alert("Invalid date.");
		frmSearch.cmbCheckInMonth.focus();
		 return false;	
	}

	dd = frmSearch.cmbCheckOutDay.value;
	mm = frmSearch.cmbCheckOutMonth.value;
	yy = frmSearch.cmbCheckOutYear.value;

	date2 = new Date(); 
	date2.setMonth(mm-1);
	date2.setDate(dd);
	date2.setYear(yy);
	if((date2.getDate()!=dd) || ((date2.getMonth())!=(mm-1)) || (date2.getFullYear()!=yy))
	{
		alert("Invalid date.");
		frmSearch.cmbCheckOutMonth.focus();
		 return false;	
	}

	if(date1>date2)
	{ 
		alert ("Check in date should be less than checkout date");
		return false;
	}
}

function openImage(src,id)
{
	window.open("../hotels/showimage.php?id="+id+"&src="+src,"popup","scrollbars=1,height=400,width=450,resizable=1");
}

function openRoomImage(src,hid,rid)
{
	window.open("showroomimage.php?hid="+hid+"&rid="+rid+"&src="+src,"popup","scrollbars=1,height=400,width=450,resizable=1");
}