//auto notification validation
function checkan(){
if(document.autonotification.anfname.value.length < 1)
	{
		alert("Please Enter Your First Name");
		document.autonotification.anfname.focus();
		return false;
	}
if(document.autonotification.anlname.value.length < 1)
	{
		alert("Please Enter Your Last Name");
		document.autonotification.anlname.focus();
		return false;
	}
	var i;
	var input = document.autonotification.anemail.value ;
	var lenth = input.length ;
	var ctr=0 ;
	if ( ( document.autonotification.anemail.value.charAt(i) == '!' ) || ( 	document.autonotification.anemail.value.charAt(i) == '#' ) )
    {
	  alert("Please enter your proper email address") ;
	  document.autonotification.anemail.focus();
      return false;
    }
	if (input =="")
	{
		alert("Please enter your email address") ;
	    document.autonotification.anemail.focus();
		return false ;
	}
	if(input.length == 40)
	{
		alert("Please enter your proper email address") ;
	    document.autonotification.anemail.focus();
		return false ;
	}

	for ( i=0; i < lenth; i++ )
	{
		var oneChar = input.charAt(i) ;
		if(oneChar == "@")
		{
			ctr = ctr+1 ;
		}
		if ( (i == 0 && oneChar == "@") || (i == 0 && oneChar == ".") || 
			( oneChar == " " ) )
		{
			alert ( "This does not seem to be a proper email address" ) ;
	        document.autonotification.anemail.focus();
			return false ;
		}
		if ( (oneChar == "@" && input.charAt(i+1) == ".") || 
			(oneChar == "." && input.charAt(i+1) == "@") ||
			(oneChar == "." && input.charAt(i+1) == ".") )
		{
			alert ( "This does not seem to be a proper email address" ) ;
	        document.autonotification.anemail.focus();
			return false ;
		}
		if( input.indexOf("@") < 2 )
		{
			alert ( "This does not seem to be a proper email address" ) ;
	        document.autonotification.anemail.focus();
			return false ;
		}
		if(input.indexOf(".")<4)
		{
			alert ( "This does not seem to be a proper email address" ) ;
	        document.autonotification.anemail.focus();
			return false ;
		}
		if (ctr > 1)
		{
			alert ( "This does not seem to be a proper email address" ) ;
	        document.autonotification.anemail.focus();
			return false ;
		}
	}	// End email Validation Script
}
//auto notification validation End