// JavaScript Document

function  restore_check(username,a1str,a2str,a1id,a2id)
      {
              
			   var  str;
			   
			   if (document.form1.answer1.value.length==0)
			   {
				   alert("[软件提示]：请输入问题答案;"); 
				   document.form1.answer1.focus();
				   return false;
			   }
			   
			    if (document.form1.answer2.value.length==0)
			   {
				   alert("[软件提示]：请输入问题答案;"); 
				   document.form1.answer2.focus();
				   return false;
			   }
			 
			 
               else 
               {
                   //alert("^-^ OK");
				   str='restore_pass2.php?aaa1='+a1id;
				   str=str+'&aaa2='+a2id;
				   str=str+'&username='+username;
				   document.form1.action=str;
				   document.form1.submit();
               }
			   
       
        }
		


function checkmail(strEmail)
{
	  
	  
				
         var   sReg=/[_a-zA-Z\d\-\.]+@[_a-zA-Z\d\-]+(\.[_a-zA-Z\d\-]+)+$/;   
          if  (!sReg.test(strEmail) ){   
            document.getElementById("mdiv").innerHTML=display_info1(strEmail+'   格式不正确'); 
			
            return   false;
			}   
		 else
		 {
			document.getElementById("mdiv").innerHTML=display_info2(strEmail+'   格式正确');  
			
			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=#ffffe3><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=#ffffe3><font color=green>'+info+'</font></td>';
                dis1=dis1+' <td width=40% bgcolor=#FFFFFF>&nbsp;</td>';
                dis1=dis1+' </tr>';
                dis1=dis1+' </table>';
				
				return  dis1;
	
}











