function Validate_Form(theForm)
	{
	  
	  	  if(theForm.customerName.value == "")
		  {
			alert("Please enter your name.");
			theForm.customerName.focus();
			return false;
		  }
		  
		  if(theForm.companyName.value == "")
		  {
			alert("Please enter company name.");
			theForm.companyName.focus();
			return false;
		  }
		   if(theForm.phone.value == "")
		  {
			alert("Please  enter your phone number.");
			theForm.phone.focus();
			return false;
		  }
		 
		  if(theForm.email.value == "")
		  {
			alert("Please enter your email address.");
			theForm.email.focus();
			return false;
		  }
		  if(!IsEmail(theForm.email,'Please enter valid email'))
		  {
			return false;
		  }
		  if(theForm.comments.value == "")
		  {
			alert("Please write your comments.");
			theForm.comments.focus();
			return false;
		  }
		  
	}


	function res(t,v)
	{
	
		var w = "";
		for (i=0; i < t.value.length; i++) {
		x = t.value.charAt(i);
		if (v.indexOf(x,0) != -1)
		w += x;
		}
		t.value = w;
	}	
		
	function IsEmail(fld,msg)
	{
		var regex = /^[\w]+(\.[\w]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
		if(!regex.test(fld.value))
		{
			alert(msg);
			fld.focus();
			return false;
		}
		return true;
	}
	

