// JavaScript Document
function validate_signup(thisform)
{
	
	with (thisform)
	{
		if (emptyvalidation(email,"Woops! You Forgot to Fill in Your Email Address")==false) 
		{
		email.focus();
		return false;	
		}
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   		var address = thisform.email.value;
  
		if(reg.test(address) == false) 
		{ 
		  alert('Woops! You have Entered an Invalid Email Address');
		  email.focus();
		  email.select();
		  return false;
	   }	
	}thisform.submit();
}

function validate_quickcontact(thisform)
{
	with (thisform)
	{
		
	
	if (emptyvalidation(name,"Woops! You Forgot to Fill in Your Name")==false) 
		{
		name.focus();
		return false;	
		}else 
		if (emptyvalidation(lname,"Woops! You Forgot to Fill in Your Last Name")==false) 
		{
		lname.focus();
		return false;	
		}else 
		if (emptyvalidation(phone,"Woops! You Forgot to Fill in Phone Number")==false) 
		{
		phone.focus();
		return false;	
		}else
		if(IsNumeric(phone.value)==false)
		{
			alert('Please Enter a Valid Phone Number');
			phone.focus();
			phone.select();
			return false;	
			
		}else 	if (emptyvalidation(email,"Woops! You Forgot to Fill in Your Email Address")==false) 
		{
		email.focus();
		return false;	
		}
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = thisform.email.value;
  
	if(reg.test(address) == false) 
	{ 
      alert('Woops! You have Entered an Invalid Email Address');
	  email.focus();
	  email.select();
      return false;
   }else
  
	if (emptyvalidation(comments,"Woops! You Forgot to Fill in Your Comments")==false) 
		{
		comments.focus();
		return false;	
		}
		
		
	}
	thisform.submit();
}
function validate_reservation(thisform)
{
	with (thisform)
	{
		
	
	if (emptyvalidation(name,"Woops! You Forgot to Fill in Your Name")==false) 
		{
		name.focus();
		return false;	
		}else 
		if (emptyvalidation(lname,"Woops! You Forgot to Fill in Your Last Name")==false) 
		{
		lname.focus();
		return false;	
		}else 
		if (emptyvalidation(phone,"Woops! You Forgot to Fill in Phone Number")==false) 
		{
		phone.focus();
		return false;	
		}else
		if(IsNumeric(phone.value)==false)
		{
			alert('Please Enter a Valid Phone Number');
			phone.focus();
			phone.select();
			return false;	
			
		}else 	if (emptyvalidation(email,"Woops! You Forgot to Fill in Your Email Address")==false) 
		{
		email.focus();
		return false;	
		}
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = thisform.email.value;
  
	if(reg.test(address) == false) 
	{ 
      alert('Woops! You have Entered an Invalid Email Address');
	  email.focus();
	  email.select();
      return false;
   }else
  
	if (emptyvalidation(party_size,"Woops! You Forgot to Fill in Your Party Size")==false) 
		{
		party_size.focus();
		return false;	
		}
		else
  
	if (emptyvalidation(date,"Woops! You Forgot to Fill Date")==false) 
		{
		party_size.focus();
		return false;	
		}
		
	}
	thisform.submit();
}
function IsNumeric(strString)
{
   var strValidChars = "0123456789.()-";
   var strChar;
   var blnResult = true;
   //if ((strString.length == 0) || (strString.length > 16) )  return false;

   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1) 
	  blnResult = false;
      }
   return blnResult;
}

function validate(thisform)
{
	thisform.submit();
}
function emptyvalidation(entered, alertbox)
{
	with (entered)
	{
		while (value.charAt(0) == ' ')
			value = value.substring(1);
		while (value.charAt(value.length - 1) == ' ')
			value = value.substring(0, value.length - 1);
		if (value==null || value=="")
		{
			if (alertbox!="") alert(alertbox);
			return false;
		}
		else return true;
	}
}
