function valforms()
{

 var name=trim(document.frm.name.value); 	   
	  if (name=="" || name=="First Name")
	   {
	      alert('Please enter First Name.');
		  document.frm.name.focus();
		  return false
	   }
	if(name.length>0 && name.search("[<>]") >= 0)
	{

		msg = "Specials characters(< >) are not allowed!";
		window.alert(msg);
		document.frm.name.focus();
		return false;
    }
	
	 var lname=trim(document.frm.lname.value); 	   
	  if (lname=="" || lname=="Last Name")
	   {
	      alert('Please enter Last Name.');
		  document.frm.lname.focus();
		  return false
	   }
	if(lname.length>0 && lname.search("[<>]") >= 0)
	{

		msg = "Specials characters(< >) are not allowed!";
		window.alert(msg);
		document.frm.lname.focus();
		return false;
    }
	
	 var phone=trim(document.frm.phone.value); 	   
	  if (phone=="" || name=="Phone")
	   {
	      alert('Please enter phone no.');
		  document.frm.phone.focus();
		  return false
	   }
 if(phone.length>0 && phone.search("[^-)+( 0-9]") >= 0)
	{

		msg = "Please enter valid Phone Number!";
		window.alert(msg);
		document.frm.phone.focus();
		return false;
    }
	
	var email=trim(document.frm.email.value); 	   
	  if (email=="" || email=="Email")
	   {
	      alert('Please enter Email.');
		  document.frm.email.focus();
		  return false;
	   }
	   
       if (echeck(document.frm.email.value)==false){
		document.frm.email.value="";
		document.frm.email.focus();
		return false;
	}
	 var question=trim(document.frm.question.value); 	   
	  if (question=="" || question=="Question")
	   {
	      alert('Please enter Question.');
		  document.frm.question.focus();
		  return false
	   }
	if(question.length>0 && question.search("[<>]") >= 0)
	{

		msg = "Specials characters(< >) are not allowed!";
		window.alert(msg);
		document.frm.question.focus();
		return false;
    }
	}
	 function trim(str) {
       return str.replace(/(^[\s\xA0]+|[\s\xA0]+$)/g, '');
              }
			  function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}
