var r1={
   'notnumbers':/[^\d\-]/g
}
function valid(o,w){
  o.value = o.value.replace(r1[w],'');
}



function trim(str){
   return str.replace(/^\s*|\s*$/g,"");
}
function chkform()
{

	frminfo=document.frmcontact;
	if(trim(frminfo.name.value)=='')
	{
		alert('Please specify name');
		frminfo.name.focus();
		return false
	}
	if(trim(frminfo.address.value)=='')
	{
		alert('Please specify address');
		frminfo.address.focus();
		return false
	}
	if(trim(frminfo.postcode.value)=='')
	{
		alert('Please specify postcode');
		frminfo.postcode.focus();
		return false
	}
	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(trim(frminfo.email.value))))
	{
		alert('Please specify Valid Email Address');
		frminfo.email.focus();
		return false;
	}
	if(trim(frminfo.telephone.value)=='')
	{
		alert('Please specify telephone');
		frminfo.telephone.focus();
		return false
	}
	if(trim(frminfo.enquiry.value)=='')
	{
		alert('Please fill your enquiry');
		frminfo.enquiry.focus();
		return false
	}
	return true;
}


 function booking_validation()
 {
 
	   function isEmailValid(sEmail2) {
			if (sEmail2.value == '' || sEmail2.indexOf('.') == 0 || sEmail2.indexOf('.') == -1 || sEmail2.indexOf('@') == 0 || sEmail2.indexOf('@') == -1 || sEmail2.indexOf('.') == sEmail2.length - 1 || sEmail2.indexOf(',') >= 0) {
				return false;
			} else {
				return true;
			}
		}
  
		if(document.bookingform.booking_name.value=='')
		{
		alert('Please Enter Booking Name');
		document.bookingform.booking_name.focus();
		return false;
		}
		
		if(document.bookingform.booking_email.value == '')
		{
			alert("Please Enter Booking Email");
			document.bookingform.booking_email.focus();
			return false;
		}
		else
		{
			if(!isEmailValid(document.bookingform.booking_email.value))
			{
				  alert("Please Enter Booking Valid Email");
		     		document.bookingform.booking_email.focus();
				  return false;
			}
		}	
		
		if(document.bookingform.booking_phone.value=='')
		{
			alert('Please Enter Booking Phone');
			document.bookingform.booking_phone.focus();
			return false;
		}

		if(document.bookingform.no_persons.value=='')
		{
			alert('Please Enter Number of Persons');
			document.bookingform.no_persons.focus();
			return false;
		}
		
		if(document.bookingform.booking_date.value=='')
		{
			alert('Please Enter Booking Date');
			document.bookingform.booking_date.focus();
			return false;
		}

		return true;
 }



 function contact_validation()
 {
 
	   function isEmailValid(sEmail2) {
			if (sEmail2.value == '' || sEmail2.indexOf('.') == 0 || sEmail2.indexOf('.') == -1 || sEmail2.indexOf('@') == 0 || sEmail2.indexOf('@') == -1 || sEmail2.indexOf('.') == sEmail2.length - 1 || sEmail2.indexOf(',') >= 0) {
				return false;
			} else {
				return true;
			}
		}
  
		if(document.ContactUs.name.value=='')
		{
		alert('Please Enter Name');
		document.ContactUs.name.focus();
		return false;
		}
		
		if(document.ContactUs.email.value == '')
		{
			alert("Please Enter Email");
			document.ContactUs.email.focus();
			return false;
		}
		else
		{
			if(!isEmailValid(document.ContactUs.email.value))
			{
				  alert("Please Enter Valid Email");
		     		document.ContactUs.email.focus();
				  return false;
			}
		}	
		
		if(document.ContactUs.phone.value=='')
		{
		alert('Please Enter Phone');
		document.ContactUs.phone.focus();
		return false;
		}
		
		if(document.ContactUs.address.value=='')
		{
		alert('Please Enter Address');
		document.ContactUs.address.focus();
		return false;
		}
		return true;
 }



