function val_chkcs(){

          var name=trim(document.frm1.name.value);
		  if(name=="")

		{

	       alert("Please Enter  Name.");

	       document.frm1.name.focus();

	       return false;

	 	 }
		if(document.frm1.name.value.search("[<>]") >=0) 
		
		 {
		 alert("Specials characters(< >) are not allowed!");
		  document.frm1.name.focus();

	       return false;
		   }

         var email=trim(document.frm1.email.value);
		 if(email=="")

		{

	       alert("Please Enter Email.");

	       document.frm1.email.focus();

	       return false;

	 	 }
		

       if (echeck(document.frm1.email.value)==false){
		document.frm1.email.value="";
		document.frm1.email.focus();
		return false;
	}
	  var csusername=trim(document.frm1.csusername.value);
		if(csusername=="")

		{

			alert("Please Enter Username.");

			document.frm1.csusername.focus();

			return false;

		}
		
		if(document.frm1.csusername.value.search("[<>]") >=0) 
		
		 {
		 alert("Specials characters(< >) are not allowed!");
		  document.frm1.csusername.focus();

	       return false;
		   }
		
		 if(trim(document.frm1.password.value)=="")

		{

			alert("Please enter your chosen password.(Blank space not allowed)");

			document.frm1.password.focus();

			return false;

		}
		
	  if(document.frm1.password.value.length < 4)

		{

			alert("Please enter your chosen password. It should be at-least 4 characters.");

			document.frm1.password.focus();

			return false;

		}
if(document.frm1.cpassword.value.length < 4)

		{

			alert("Please Retype Your Password");

			document.frm1.cpassword.focus();

			return false;

		}



	  if(document.frm1.password.value!=document.frm1.cpassword.value)

	  	{

		    alert("Your passwords do not match.");

		    document.frm1.password.value="";

			document.frm1.cpassword.value="";

			document.frm1.cpassword.focus();

			return false;

		}


else
{
document.frm1.submit();
}

	}

	
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					
	}
	

	

	

