function vacancy()
{
	var dd1,mm1,yy1,date1;
	dd1 = formva.cmbDay2.value;
	mm1 = formva.cmbMonth2.value;
	yy1 = formva.cmbYear2.value;

	 date1=new Date();
	 date1.setYear(yy1);
	 date1.setMonth(mm1-1);
	 date1.setDate(dd1);	 
	 
	 if((date1.getDate()!=dd1) || ((date1.getMonth())!=(mm1-1)) || (date1.getFullYear()!=yy1))
	  {
		 alert("Invalid Date.");
		 return false;
	  }
}
function validateInfo()
{
	var reEmailId =	/^([a-z]|[A-Z])\w*@([a-z]|[A-Z]|\d)*\.((([a-z]|[A-Z]|\d){2,3})|(([a-z]|[A-Z]|\d)*\.([a-z]|[A-Z]|\d){2,3}))$/
	var cemail=document.addhotelform.txtEmail.value;
	if(document.addhotelform.txtHotelName.value == "")
	{
		alert("Hotel Name cannot be empty");
		document.addhotelform.txtHotelName.focus();
		return false;
	}
	if(document.addhotelform.txtAddress.value == "")
	{
		alert("Address cannot be empty");
		document.addhotelform.txtAddress.focus();
		return false;
	}
	if(document.addhotelform.txtCity.value == "")
	{
		alert("City cannot be empty");
		document.addhotelform.txtCity.focus();
		return false;
	}
	if(document.addhotelform.txtState.value == "")
	{
		alert("State cannot be empty");
		document.addhotelform.txtState.focus();
		return false;
	}
	if(document.addhotelform.txtCountry.value == "")
	{
		alert("Country cannot be empty");
		document.addhotelform.txtCountry.focus();
		return false;
	}
	if(document.addhotelform.txtZip.value == "")
	{
		alert("Zip cannot be empty");
		document.addhotelform.txtZip.focus();
		return false;	
	}
	if(isNaN(document.addhotelform.txtZip.value))
	{
		alert(" Zip code must be a numeric");
		document.addhotelform.txtZip.value ="";
		document.addhotelform.txtZip.focus();
		return false;	
	}
	if (document.addhotelform.txtEmail.value == "")
    {
		  alert("Please enter your email-ID");
		  document.addhotelform.txtEmail.focus();
		  return false;
	}
	if(!(reEmailId.test(cemail)))
	{	
			alert("Invalid Email Id");
			document.addhotelform.txtEmail.focus();
			return false;
	}
	if(document.addhotelform.txtPhone1.value == "")
	{
		alert("Phone1 cannot be empty");
		document.addhotelform.txtPhone1.focus();
		return false;	
	}
	if(isNaN(document.addhotelform.txtPhone1.value))
	{
		alert("Phone1 must be a number");
		document.addhotelform.txtPhone1.value ="";
		document.addhotelform.txtPhone1.focus();
		return false;	
	}
	if(document.addhotelform.txtImage.value == "")
	{
		alert("Please enter Image path");
		document.addhotelform.txtImage.value ="";
		document.addhotelform.txtImage.focus();
		return false;	
	}
	if(document.addhotelform.txtDescription.value == "")
	{
		alert("Please enter Description");
		document.addhotelform.txtDescription.value ="";
		document.addhotelform.txtDescription.focus();
		return false;	
	}
	if(document.addhotelform.txtStar.value == "")
	{
		alert("Please enter Star");
		document.addhotelform.txtStar.value ="";
		document.addhotelform.txtStar.focus();
		return false;	
	}
	return true;
}
//function to validate  Room Types
function valRoomTypes()
{
	if(document.roomtypeform.txtTitle.value == "")
	{
		alert("Room Type or Title cannot be empty.");
		document.roomtypeform.txtTitle.value ="";
		document.roomtypeform.txtTitle.focus();
		return false;
	}
	if(document.roomtypeform.txtPrice.value == "")
	{
		alert("Price cannot be empty.");
		document.roomtypeform.txtPrice.value ="";
		document.roomtypeform.txtPrice.focus();
		return false;
	}
	if(isNaN(document.roomtypeform.txtPrice.value))
	{
		alert(" Price must be a numeric");
		document.roomtypeform.txtPrice.value ="";
		document.roomtypeform.txtPrice.focus();
		return false;	
	}
	if(document.roomtypeform.txtTax.value == "")
	{
		alert("Tax cannot be empty.");
		document.roomtypeform.txtTax.value ="";
		document.roomtypeform.txtTax.focus();
		return false;
	}
	if(isNaN(document.roomtypeform.txtTax.value))
	{
		alert("Tax must be a numeric");
		document.roomtypeform.txtTax.value ="";
		document.roomtypeform.txtTax.focus();
		return false;	
	}
	if(document.roomtypeform.txtTotalRooms.value == "")
	{
		alert("Total Rooms cannot be empty.");
		document.roomtypeform.txtTotalRooms.value ="";
		document.roomtypeform.txtTotalRooms.focus();
		return false;
	}
	if(isNaN(document.roomtypeform.txtTotalRooms.value))
	{
		alert("Total Rooms must be a numeric");
		document.roomtypeform.txtTotalRooms.value ="";
		document.roomtypeform.txtTotalRooms.focus();
		return false;	
	}
	if(document.roomtypeform.txtExtraPersons.value == "")
	{
		alert("Extra Persons Amount cannot be empty.");
		document.roomtypeform.txtExtraPersons.value ="";
		document.roomtypeform.txtExtraPersons.focus();
		return false;
	}
	if(isNaN(document.roomtypeform.txtExtraPersons.value))
	{
		alert("Extra Persons Amount must be a numeric");
		document.roomtypeform.txtExtraPersons.value ="";
		document.roomtypeform.txtExtraPersons.focus();
		return false;	
	}
	if(document.roomtypeform.txtRoomDescription.value == "")
	{
		alert("Room Description cannot be empty.");
		document.roomtypeform.txtRoomDescription.value ="";
		document.roomtypeform.txtRoomDescription.focus();
		return false;
	}
	return true;
}

//function to validate Add Preferences
function valPreferences()
{
	if(document.preferenceform.txtBedType1.value == "")
	{
		alert("Atleast one Bed Type must enter.");
		document.preferenceform.txtBedType1.value ="";
		document.preferenceform.txtBedType1.focus();
		return false;
	}
	return true;
}
function validatestatdate(formstat)
{
    var dd1,mm1,yy1,date1;
	dd1 = formstat.cmbDay1.value;
	mm1 = formstat.cmbMonth1.value;
	yy1 = formstat.cmbYear1.value;

	dd2 = formstat.cmbDay2.value;
	mm2 = formstat.cmbMonth2.value;
	yy2 = formstat.cmbYear2.value;

	 date1=new Date();
	 date1.setYear(yy1);
	 date1.setMonth(mm1-1);
	 date1.setDate(dd1);	 
	 
	 if((date1.getDate()!=dd1) || ((date1.getMonth())!=(mm1-1)) || (date1.getFullYear()!=yy1))
	  {
		 alert("Invalid From Date.");
		 return false;
	  }

	 date2=new Date();
	 date2.setYear(yy2);
	 date2.setMonth(mm2-1);
	 date2.setDate(dd2);
	 
	 if((date2.getDate()!=dd2) || ((date2.getMonth())!=(mm2-1)) || (date2.getFullYear()!=yy2))
	  {
		 alert("Invalid To Date.");
		 return false;
	  }
}
function vacancy()
{
	var dd1,mm1,yy1,date1;
	dd1 = formva.cmbDay2.value;
	mm1 = formva.cmbMonth2.value;
	yy1 = formva.cmbYear2.value;

	 date1=new Date();
	 date1.setYear(yy1);
	 date1.setMonth(mm1-1);
	 date1.setDate(dd1);	 
	 
	 if((date1.getDate()!=dd1) || ((date1.getMonth())!=(mm1-1)) || (date1.getFullYear()!=yy1))
	  {
		 alert("Invalid Date.");
		 return false;
	  }
}
function status(id,email)
{
	window.open("changestatus.php?id="+id+"&email="+email,"popup","scrollbars=1,height=250,width=400,resize=1");
}
function cwin()
{	
	window.close();
	window.opener.location.reload();
}
function helpsearch(Url)
{
	window.open(Url+"help/helpsearch.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helpsearchresult(Url)
{
	window.open(Url+"help/helpsearchresult.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helproomtype(Url)
{
	window.open(Url+"help/helproomtype.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helppreference(Url)
{
	window.open(Url+"help/helppreference.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helpbooking(Url)
{
	window.open(Url+"help/helpbooking.php","popup","scrollbars=1,height=250,width=400,resize=1");
}

function helpReporting(Url)
{
	window.open(Url+"help/admin/helpreporting.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helpPayment(Url)
{
	window.open(Url+"help/admin/helppayment.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helpSearchAdmin(Url)
{
	window.open(Url+"help/admin/helpsearchadmin.php","popup","scrollbars=1,height=250,width=400,resize=1");
}

function helphotelcommission(Url)
{
	window.open(Url+"help/admin/helphotelcommission.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helpcommission(Url)
{
	window.open(Url+"help/admin/helpcommission.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helphotelcommagent(Url)
{
	window.open(Url+"help/agent/helphotelcommagent.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helpassignedhotel(Url)
{
	window.open(Url+"help/agent/helpassignedhotel.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helpPaymentagent(Url)
{
	window.open(Url+"help/agent/helppayement.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helpairlines(Url)
{
	window.open(Url+"help/admin/helpairlines.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helpagents(Url)
{
	window.open(Url+"help/admin/helpagents.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helphomemain(Url)
{
	window.open(Url+"help/helphomemain.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helpadmins(Url)
{
	window.open(Url+"help/admin/helpadmins.php","popup","scrollbars=1,height=250,width=400,resize=1");
}

function helpreserve(Url)
{
	window.open(Url+"help/helpreserve.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helpseats(Url)
{
	window.open(Url+"help/admin/helpseats.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helpairres(Url)
{
	window.open(Url+"help/agent/helpcommissionair.php","popup","scrollbars=1,height=250,width=400,resize=1");
}
function helpSearchuser(Url)
{
	window.open(Url+"help/users/helpSearchuser.php","popup","scrollbars=1,height=250,width=400,resize=1");
}