String.prototype.trim = function()    // trims white space off both ends of this string
{
 return( (ar=/^\s*([\s\S]*\S+)\s*$/.exec(this)) ? ar[1] : "" ); 
}


function shouldwe(bookings) 

{
	if (bookings.contact.value.trim() == "")
		{
			alert("Please enter your name");
			bookings.contact.focus();
			return false;
		}
		
		
	else if (bookings.address.value.trim() == "")
		{
		alert("please enter an address");
		bookings.address.focus();
		return false;	
		}
		
	else if (bookings.telephone.value.trim() == "")
		{
		alert("please enter a telephone number");
		bookings.telephone.focus();
		return false;	
		}
	
	else if (bookings.email.value.trim() == "")
		{
		alert("please enter your e-mail address");
		bookings.email.focus();
		return false;	
		}
     else
	 {
		 	var EMail = bookings.email.value.trim()
			if (EMail.indexOf('@') < 1 || EMail.indexOf('.') < 1) 
			{
				alert('Please enter a valid E-mail Address in the format: emailId@domain.com');
				bookings.email.focus();
				return false;
			}
	else if (bookings.date1.value.trim() == "")
		{
		alert("please enter a date for your stay");
		bookings.date1.focus();
		return false;	
		}
else if (bookings.date2.value.trim() == "")
		{
		alert("please enter a date for your stay");
		bookings.date2.focus();
		return false;	
		}


else if (bookings.people.value.trim() == "")
		{
		alert("please select how many people will be staying");
		bookings.people.focus();
		return false;	
		}

else if (bookings.room.value.trim() == "")
		{
		alert("please select room combination");
		bookings.room.focus();
		return false;	
		}


		else
		{
			return true;
		}
	}
} 