function checkEmail(val)
{
	var patt = /^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-z]{2,6}$/i;
	var result;
	
	result = patt.test(val);
	return result;
}
function checkforspecialchars(text)
{
	var iChars = "`~!@$^*()[]';{}|\"<>";
	for (var i = 0; i < text.length; i++) 
		if (iChars.indexOf(text.charAt(i)) != -1) 
			return true;
	return false;
}
function checkPhone(val)
{
	var iChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~!@#$%^&*_+=/\{}[]|;:'\",<.>?";
	for (var i = 0; i < val.length; i++) 
		if (iChars.indexOf(val.charAt(i)) != -1) 
			return true;
	return false;
}

function valid_quote(form)
{
     var err;
      if(form.First_Name.value=="")
	 {
	     alert("Please enter your First name");
		 form.First_Name.focus();
		 return false;
	  }
	  else if(checkforspecialchars(form.First_Name.value))
	  {
	   alert("Special characters `~!@$^*()[]';{}|\"<> are not allowed");
	   form.First_Name.focus();
	   return false;
	  }
	  



	 if(form.Last_Name.value=="")
	 {
	     alert("PLease enter your Last name");
		 form.Last_Name.focus();
		 return false;
	  }
	  else if(checkforspecialchars(form.Last_Name.value))
	  {
	   alert("Special characters `~!@$^*()[]';{}|\"<> are not allowed");
	   form.Last_Name.focus();
	   return false;
	  } 
	  
	  if(form.Email.value=="")
	  {
	   alert("PLease enter your Email address");
		 form.Email.focus();
		 return false;
	  }
	  else if(!checkEmail(form.Email.value))
	  {
	     alert("PLease enter valid Email address");
		 form.Email.focus();
		 return false;
	  }
	  if(form.Phone.value=="")
	  {
	     alert("PLease enter Phone number");
		 form.Phone.focus();
		 return false;
	  }
	  else if(checkPhone(form.Phone.value))
	  {
	     alert("PLease enter valid Phone number");
		 form.Phone.focus();
		 return false;
	  }
	  if(form.Mobile.value!="")
	  {
	     if(checkPhone(form.Mobile.value))
		  {
			 alert("PLease enter valid Mobile number");
			 form.Mobile.focus();
			 return false;
		  }
	  }	  
	    
	  if(form.Description.value!="")
	  {
	      if(checkforspecialchars(form.Description.value))
		  {
		   alert("special characters `~!@$^*()[]';{}|\"<> are not allowed");
		   form.Description.focus();
		   return false;
		  } 
	  }
	  
	  return true;
}	  	 

