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					
	}
function ValidateForm(){
	var emailID=document.sanFormRegistration.Fan_Email	
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false ){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
function ValidateEmail(){
	
	var emailID=document.sanFormRegistration.Fan_Email	
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false ){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
function isNumberKey(evt)
      	{
	         var charCode = (evt.which) ? evt.which : event.keyCode
	         if (charCode > 31 && (charCode < 48 || charCode > 57))
	            return false;
	         return true;
      	}
		function isValidEmail(evt)
		{
			 //allow alphabets,0-9,'.','@','-','_'
			 var charCode = (evt.which) ? evt.which : event.keyCode    
			 if ((charCode > 64 && charCode < 91)||(charCode > 96 && charCode < 123) ||charCode==64 || (charCode > 47 && charCode < 58) || charCode==46 || charCode ==45|| charCode==95 )
			 return true;
			 return false;
		}
		
	
function CheckValidPass()
 {
	 if(document.sanFormRegistration.Fan_Password.value == document.sanFormRegistration.ConfirmPwd.value){}
	 else{
		 alert("Confirm Password is incorrect.....");
		 document.sanFormRegistration.ConfirmPwd.value="";
		 document.sanFormRegistration.ConfirmPwd.focus();
		 return false
	 }
	 
 }

function CheckPassLngth()
 {
	 	var str = document.sanFormRegistration.Fan_Password.value
		 if(str.length < 6){
			 alert("Password should contain atleast 6 characters.");
			 document.sanFormRegistration.Fan_Password.focus();
			 return false
		}
		 else{
		 }
	 
 }

function checkForm()
{
			if (document.sanFormRegistration.Fan_Firstname.value == "") {alert("Please enter the required field: First Name"); document.sanFormRegistration.Fan_Firstname.focus();return false}
			if (document.sanFormRegistration.Fan_Lastname.value == "") {alert("Please enter the required field: Last Name");document.sanFormRegistration.Fan_Lastname.focus();return false}
			if (document.sanFormRegistration.Fan_Password.value == "") { alert("Please enter the required field: Account Password");document.sanFormRegistration.Fan_Password.focus();return false }
			if (document.sanFormRegistration.ConfirmPwd.value == "") { alert("Please enter the required field: Confirm the Account Password");document.sanFormRegistration.ConfirmPwd.focus();return false}
			if (document.sanFormRegistration.Fan_Email.value == "") { alert("Please enter the required field: Email");document.sanFormRegistration.Fan_Email.focus();return false}
			if (document.sanFormRegistration.verify_image.value == "") { alert("Please enter the required field: Image Verification");document.sanFormRegistration.verify_image.focus();return false}
			if(document.sanFormRegistration.act.value == "update"){ return true }else{
			if (!document.sanFormRegistration.agree.checked) { alert("Please Read the guidelines and check the box .");document.sanFormRegistration.agree.focus();return false}
			}
		}

