// JavaScript Document
function validate_quickcontact(thisform)
{
	with (thisform)
	{
	
	if (thisform.name.value=="Name")
		{
		alert("Woops! You forgot to fill in your Name");
		name.focus();
		return false;	
		}
		
		if (thisform.phone.value=="Phone")
		{
			alert("Woops! You forgot to fill in Phone No");
		phone.focus();
		return false;	
		}
		else if(!IsPhoneNumber(thisform.phone.value))
		 	{
				alert('Woops! You have entered an invalid phone number');
				  phone.focus();
				  phone.select();
				  return false;
			}
 	
	/*if(email.value=="Email")email.value=""; */	
	if (thisform.email.value=="Email") 
		{
		alert("Woops! You forgot to fill in your Email Address");
		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;
   }
	
  
	if (thisform.comments.value=="Comments")
		{
		alert("Woops! You forgot to fill in your Comments");
		comments.focus();
		return false;	
		}
		
		
	}
	thisform.submit();
}
function validate(thisform)
{
	thisform.submit();
}

function IsPhoneNumber(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.- []()";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
		 //alert("Enter a phone number");
         blnResult = false;
         }
      }
   return blnResult;
   }	