<!--
function verify(form)
{
	var passed = false;  
	//alert("use function verify");
    var blnRetval, intAtSign, intDot, intComma, intSpace, intLastDot, intDomain, intStrLen;                                                                   
    var dis = document.getElementById('email_error');                                                                                                         
    if (form.Email)                                                                                                                                           
    {                                                                                                                                                         
        intAtSign=form.Email.value.indexOf("@");                                                                                                               
        intDot=form.Email.value.indexOf(".",intAtSign);                                                                                                       
        intComma=form.Email.value.indexOf(",");                                                                                                               
        intSpace=form.Email.value.indexOf(" ");                                                                                                               
        intLastDot=form.Email.value.lastIndexOf(".");                                                                                                         
        intDomain=intDot-intAtSign;                                                                                                                           
        intStrLen=form.Email.value.length;                                                                                                                    
            // *** CHECK FOR BLANK EMAIL VALUE                                                                                                                
        if (form.Email.value == "" )                                                                                                                      
        {        
        	dis.innerHTML="<span style=\"color:red\"><b>Error: </b>You have not entered an email address.</span>";                                   	
			dis.style.display='';                                                                                                                                         
        	//alert("You have not entered an email address.");                                                                                              
            form.Email.focus();                                                                                                                           
           	passed = false;                                                                                                                               
        }                                                                                                                                                                                                                                                            
        else if (intAtSign == -1)                                                                                                                         
        {                                                                                                                                                 
                                                                                                                                                              
			dis.innerHTML="<span style=\"color:red\"><b>Error: <b>Your email address is missing the \"@\".</span>";                                   	
			dis.style.display='';                                                                                                                     	
           // alert("Your email address is missing the \"@\".");                                                                                              
            form.Email.focus();                                                                                                                       
            passed = false;                                                                                                                                                                                                                                                                                         
        }  // **** Check for commas ****                                                                                                                                                                                                                                                                       
        else if (intComma != -1)                                                                                                                          
        {                                                                                                                                                 
            dis.innerHTML = "<span style=\"color:red\"><b>Error: </b>Email address cannot contain a comma.</span>";                                        
        	dis.style.display ='';                                                                                                                        
        //    alert("Email address cannot contain a comma.");                                                                                                 
            form.Email.focus();                                                                                                                           
            passed = false;                                                                                                                               
        }// **** Check for a space ****                                                                                                                                                                                                                                                                      
        else if (intSpace != -1)                                                                                                                          
        {                                                                                                                                                 
            dis.innerHTML = "<span style=\"color:red\"><b>Error: </b>Email address cannot contain spaces.</span>";                                         
         	dis.style.display ='';                                                                                                                        
          //  alert("Email address cannot contain spaces.");                                                                                                  
            form.Email.focus();                                                                                                                           
            passed = false;                                                                                                                               
        } // **** Check for char between the @ and dot, chars between dots, and at least 1 char after the last dot ****                                     
        else if ((intDot <= 2) || (intDomain <= 1)  || (intStrLen-(intLastDot+1) < 2))                                                                    
        {                                                                                                                                                 
            dis.innerHTML = "<span style=\"color:red\"><b>Error: </b>Please enter a valid Email address.\n" + form.Email.value + " is invalid.</span>";    
         	dis.style.display ='';                                                                                                                        
         //   alert("Please enter a valid Email address.\n" + form.Email.value + " is invalid.");                                                             
            form.Email.focus();                                                                                                                           
            passed = false;                                                                                                                               
        }                                                                                                                                                 
        else                                                                                                                                              
        {                                                                                                                                                 
            passed = true;                                                                                                                                
        }                                                                                                                                                 
    }                                                                                                                                                         
    else                                                                                                                                                      
    {                
    	                                                                                                                                         
    	passed = true;                                                                                                                               
    }                                                                                                                                                         
    return passed;                                                                                                                                            
}

/*

*/

//<- chang by huangrx   2010-1-8  ->

function verify_email()
{
	var passed = false;  
	//alert("use function verify");
    var blnRetval, intAtSign, intDot, intComma, intSpace, intLastDot, intDomain, intStrLen;
	var email= document.getElementById('Email');
	//alert(email.value);
    var dis = document.getElementById('email_result');                                                                                                         
    if (email)                                                                                                                                           
    {                                                                                                                                                         
        intAtSign=email.value.indexOf("@");                                                                                                               
        intDot=email.value.indexOf(".",intAtSign);                                                                                                       
        intComma=email.value.indexOf(",");                                                                                                               
        intSpace=email.value.indexOf(" ");                                                                                                               
        intLastDot=email.value.lastIndexOf(".");                                                                                                         
        intDomain=intDot-intAtSign;                                                                                                                           
        intStrLen=email.value.length;                                                                                                                    
            // *** CHECK FOR BLANK EMAIL VALUE                                                                                                                
        if (email.value == "" )                                                                                                                      
        {        
        	dis.innerHTML="<span style=\"color:red\"><b>Error: </b>You have not entered an email address.</span>";                                   	
			dis.style.display='';                                                                                                                                         
        	//alert("You have not entered an email address.");                                                                                              
            email.focus();                                                                                                                           
           	passed = false;                                                                                                                               
        }                                                                                                                                                                                                                                                            
        else if (intAtSign == -1)                                                                                                                         
        {                                                                                                                                                 
                                                                                                                                                              
			dis.innerHTML="<span style=\"color:red\"><b>Error: <b>Your email address is missing the \"@\".</span>";                                   	
			dis.style.display='';                                                                                                                     	
           // alert("Your email address is missing the \"@\".");                                                                                              
            email.focus();                                                                                                                       
            passed = false;                                                                                                                                                                                                                                                                                         
        }  // **** Check for commas ****                                                                                                                                                                                                                                                                       
        else if (intComma != -1)                                                                                                                          
        {                                                                                                                                                 
            dis.innerHTML = "<span style=\"color:red\"><b>Error: </b>Email address cannot contain a comma.</span>";                                        
        	dis.style.display ='';                                                                                                                        
        //    alert("Email address cannot contain a comma.");                                                                                                 
            email.focus();                                                                                                                           
            passed = false;                                                                                                                               
        }// **** Check for a space ****                                                                                                                                                                                                                                                                      
        else if (intSpace != -1)                                                                                                                          
        {                                                                                                                                                 
            dis.innerHTML = "<span style=\"color:red\"><b>Error: </b>Email address cannot contain spaces.</span>";                                         
         	dis.style.display ='';                                                                                                                        
          //  alert("Email address cannot contain spaces.");                                                                                                  
            email.focus();                                                                                                                           
            passed = false;                                                                                                                               
        }else if(intDot==-1)
		{
			dis.innerHTML = "<span style=\"color:red\"><b>Error: </b>Email address is missing the \".\"</span>";                                         
         	dis.style.display ='';                                                                                                                        
          //  alert("Email address is missing the \".\");                                                                                                  
            email.focus();                                                                                                                           
            passed = false;    

		}// **** Check for char between the @ and dot, chars between dots, and at least 1 char after the last dot ****                                     
        else if ((intDot <= 2) || (intDomain <= 1)  || (intStrLen-(intLastDot+1) < 2))                                                                    
        {                                                                                                                                                 
            dis.innerHTML = "<span style=\"color:red\"><b>Error: </b>Please enter a valid Email address.\n" + email.value + " is invalid.</span>";    
         	dis.style.display ='';                                                                                                                        
         //   alert("Please enter a valid Email address.\n" + form.Email.value + " is invalid.");                                                             
            email.focus();                                                                                                                           
            passed = false;                                                                                                                               
        }                                                                                                                                                 
        else                                                                                                                                              
        {                                                                                                                    
            passed = true;                                                                                                                                
        }                                                                                                                                                 
    }                                                                                                                                                         
    else                                                                                                                                                      
    {                
    	                                                                                                                                         
    	passed = false;                                                                                                                               
    }                                                                                                                                                         
   // return passed; 
   /*
	if(passed==true){
		//alert(passed);
		img=document.getElementById("submit");
		dis.innerHTML = "<span style=\"color:blue\"><b>success: </b>welcome.\n" + email.value + " </span>";
		img.innerHTML ="";
		img.innerHTML= "<img src='http://localhost/wholesalej/templates/Original1_B2B/images/subscribe.gif' style='cursor:hand;' onclick=submit(); />";
	}*/
	return passed;
}


