﻿/*----------------------------------------------------------------
// Copyright (C) 2008 PHOOK
// 版权所有。 
//         
// 文件名：SearchProduct.aspx
// 文件功能描述：密码找回	
//
// 
// 创建标识：赵志强   080508
// 
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
//密码找回
function userFindPassword()
{
    var txtEmail = document.getElementById('txtEmail');
	var txtCode = document.getElementById('txtCode');
          document.getElementById('successes').innerHTML=document.getElementById('txtEmail').value; 
          document.getElementById('errors').innerHTML=document.getElementById('txtEmail').value; 
	phookFindPassword(txtEmail.value,txtCode.value,userFindPasswordBack);
}
// 密码找回-回调函数
function userFindPasswordBack(o)
{
	if(o.isError)
	{
	    var imgCode = document.getElementById('imgCode');
		var txtCode = document.getElementById('txtCode');
		txtCode.value = '';
	}
	else
	{
	     var ddd=o.data
	    
	       
	     if(o.data=="成功")
	    {
	          
	         document.getElementById('divSuccess').style.display="block";
	         document.getElementById('divFindPassword').style.display="none"; 
	    }
	    else
	    {
	        document.getElementById('divError').style.display="block";
	       document.getElementById('divFindPassword').style.display="none"; 
	    } 
	}
}
function phookFindPassword(userName,codeNum,callBack)
{
	userName = userName.trim();
	codeNum = codeNum.trim();
	
	if(userName.length == 0){
	    alert('请输入您的注册邮箱！');
	    return;
	}
	if(!userName.isEmail()){
		alert('邮箱格式不正确！');
		return;
	}
	if(codeNum.length != 4){
		alert('验证码必须为4位数字！');
		return;
	}
	ajax({type:"phook_findpassword",email:userName,code:codeNum},callBack);
}





