// JavaScript Document

var permit2=0;
var permit3=0;

function  change_email_valid()
      {
              
			   if (document.form1.email.value.length==0)
			   {
				   alert("[软件提示]：请输入电子邮件");
				   document.form1.email.focus();
				   return false;
			   }
			  
			   if (document.form1.qq.value.length==0)
			   {
				   alert("[软件提示]：请输入QQ号"); 
				   document.form1.oldpass.focus();
				   return false;
			   }
			  
			     if  (permit2==1) 
			   {
				   alert("[软件提示]：Email格式不正确，请正确填写 ");
				   document.form1.email.focus();
				   return false
			   }
			   
			   
			    if  (permit3==1) 
			   {
				   alert("[软件提示]：QQ号码字符不正确，请正确填写 ");
				   document.form1.qq.focus();
				   return false
			   }
				
               else  if  (permit2==0 && permit3==0) 
               {
                   //alert("^-^ OK");
				   document.form1.action='user_email_process.php';
				   document.form1.submit();
               }
			   
			   
       
        }
		
		
		
function jscheck_mail(strEmail)
{
	  
	  
				
         var   sReg=/[_a-zA-Z\d\-\.]+@[_a-zA-Z\d\-]+(\.[_a-zA-Z\d\-]+)+$/;   
          if  (!sReg.test(strEmail) ){   
            document.getElementById("info2").innerHTML=display_info1(strEmail+'   格式不正确'); 
			permit2=1; 
            return   false;
			}   
		 else
		 {
			document.getElementById("info2").innerHTML=display_info2(strEmail+'   格式正确');  
			permit2=0;
			return   false;
		 }
       

}


function jscheck_qq(qq) 
{ 
  
     var Letters='1234567890'; 
     var i; 
     var c; 
	 c=0;
	 var flag=0;
      for( i=0; i<qq.length; i++ ) 
     { 
          // c=String.charAt(i); 
		   c=Letters.indexOf(qq.charAt(i));
	
           if (c==-1) 
          { 
			   flag=1;
			   break;
           } 
		
     } 
	 
      if  (flag==1)
	  {
		   document.getElementById("info3").innerHTML=display_info1('QQ号码字符不正确'); 
		   permit3=1; 
		   return false;
	  }
	  else
	  {
		   document.getElementById("info3").innerHTML=display_info2('QQ号码字符正确');  
		   permit3=0; 
		   return false;
	  }
   
} 

		
		
function display_info1(info)
{
	
	   
	            var   dis1;
				
		        dis1='<table width=98% border=0 cellspacing=0 cellpadding=0>';
                dis1=dis1+'  <tr>';
                dis1=dis1+' <td width=60% height=20 bgcolor=#FFFF99><font color=red>'+info+'</font></td>';
                dis1=dis1+' <td width=40% bgcolor=#FFFFFF>&nbsp;</td>';
                dis1=dis1+' </tr>';
                dis1=dis1+' </table>';
				
				return  dis1;
	
}



function display_info2(info)
{
	
	   
	            var   dis1;
				
		        dis1='<table width=98% border=0 cellspacing=0 cellpadding=0>';
                dis1=dis1+'  <tr>';
                dis1=dis1+' <td width=60% height=20 bgcolor=#FFFF99><font color=green>'+info+'</font></td>';
                dis1=dis1+' <td width=40% bgcolor=#FFFFFF>&nbsp;</td>';
                dis1=dis1+' </tr>';
                dis1=dis1+' </table>';
				
				return  dis1;
	
}


		
		
		
		
		
		
		
		
		
		
		
				