function valforms()
{

 var fname=trim(document.frm.fname.value); 	   
	  if (fname=="")
	   {
	      alert('Please enter First Name.');
		  document.frm.fname.focus();
		  return false
	   }
	if(fname.length>0 && fname.search("[<>]") >= 0)
	{

		msg = "Specials characters(< >) are not allowed!";
		window.alert(msg);
		document.frm.fname.focus();
		return false;
    }
	
	 var lname=trim(document.frm.lname.value);
        
	  if (lname=="")
	   {
	      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 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 user1=trim(document.frm.user1.value);
        
	  if (user1=="")
	   {
	      alert('Please enter Mobile No.');
		  document.frm.user1.focus();
		  return false
	   }
	if(user1.length>0 && user1.search("[^-)+( 0-9]") >= 0)
	{

		msg = "Please enter valid Phone Number!";
		window.alert(msg);
		document.frm.user1.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					
	}

