///******************************************************??? 
///	FileName: Change.js
///	Action: 前台修改密码判断处理页面
///	Copyright(c)? 2004-2008 网胜科技公司技术开发部
///	Writer: XYF
///	Create Date: 2008-12-24
///	Rewriter:
///	Rewrite Date:
///******************************************************
var rightIcon="../../../images/websen.gif"
var rightIcons="../../images/icon_nothing.gif";
var txtjbo=new Array("ctl00_ContInfo_txtOldPassword","ctl00_ContInfo_txtNewPassword","ctl00_ContInfo_txtNewPassword1")
//得到焦点
for(var i=0;i<txtjbo.length;i++){ $(txtjbo[i]).onfocus =function ()
{for (var j=0;j<txtjbo.length;j++)
{if (txtjbo[j]==event.srcElement.id){postobj(j);}}}}
function postobj(num)
{
var obj = "txt"+num;
document.getElementById(obj).innerHTML =Change[num];
}
function oo(){$("yc").style.display="none"}
//失去焦点



for(var i=0;i<txtjbo.length;i++){ $(txtjbo[i]).onblur =function ()
{for (var j=0;j<txtjbo.length;j++)
{if (txtjbo[j]==event.srcElement.id){postobjs(j);}}}}
function postobjs(num)
{
  var obj="txt"+num;
if ($(obj).innerHTML!="")
  {$(obj).innerHTML=""}
else 
  {$(obj).innerHTML=ok;}
}

$("ctl00_ContInfo_btnUpdate").onclick=function()
{
var Ch=new Array()
Ch[0]=Time(0)
Ch[1]=Time(1)
Ch[2]=Time(2)
var flag=1;
for (i=0;i<txtjbo.length;i++)
{
   if (Ch[i]==false)
   {
      flag=0;
      break;
   }
  
} 
if(flag==0)
  return false;
else
 return true;


}
//方法
function Time(num)
{
 var obj="txt"+num
 if($(txtjbo[num]).value.replace(/\s/g,'')=="")
  {
   $(obj).innerHTML=Changes[num];
   return false;
  }
  else if ($(txtjbo[1]).value.replace(/\s/g,'') !=$(txtjbo[2]).value.replace(/\s/g,''))
  {
   $("txt1").innerHTML=Changes[3];
   return false
  }
  else
  {
   $(obj).innerHTML=ok;
   return true;
  }
}
//提示信息
var ok="<font color=#999999>输入符合规范</font>";
var title="<p>";
var titles="</p>"
var Change=new Array()
Change[0]=title+"请输入你的旧密码"+titles
Change[1]=title+"请输入你的新密码"+titles
Change[2]=title+"请输入你的确认密码"+titles
var since="<img src="+rightIcon+" align=\"absmiddle\"> <font color=#FF0000>"
var Changes=new Array()
Changes[0]=since+"旧密码不能为空,请重新设置你的旧密码!</font>"
Changes[1]=since+"新密码不能为空,请重新设置你的新密码!</font>"
Changes[2]=since+"确认密码不能为空,请重新设置你的的确认密码!</font>"
Changes[3]=since+"新密码与确认密码不一致,请重新设置新密码!</font>"