//刷新验证码
function reloadVerifyCode(){ 

                            var timenow = new Date().getTime();                        

                            document.getElementById("safecode").src="ImageServlet?d="+timenow; 
                    } 

 function next()
   {
   if(event.keyCode==13)
   	event.keyCode=9;
  }
  function checkform()
{
var fm= document.forms[0];
if(document.getElementById("uid").value=="")
	{
		alert("请输入会员名");
		fm.uid.focus();
		return false;
	}
if(document.getElementById("pwd").value=="")
	{
		alert("登录密码不能为空");
		fm.pwd.focus();
		return  false;
	}
  	if($("txtcheckcode").value=="")
	{
		alert("请输入验证码");
		fm.txtcheckcode.focus(); 
		return false;
	}else{
  
     var code=null;
     DWREngine.setAsync(false);
     DwrContent.getObjectFromSession("validateCode",function(cd)
	  {
	     code=cd;
	  })
      if(document.getElementById("txtcheckcode").value!=code){
			alert("验证码不正确");
			return false;
		}
	}
	return true;
	}
	   
function showSeccondCode(root){

	var ruifSecondCode=document.getElementById("ruifSecondCode");
	ruifSecondCode.innerHTML='<img id="safecode" title="看不清换一张" src="'+root+'/ImageServlet?s=' + "'" +Math.random() + "'" + ' onerror="this.onerror=null;this.src=' + 'ImageServlet?s=' + "'" +Math.random() + "'" + '/>';
	if(ruifSecondCode.innerHTML!="验证码")
	{
		ruifSecondCode.style.cursor="hand";
	}
}


function changeSafeImage()
{
   document.getElementById("txtcheckcode").focus();
}


function showInSeccondCode(root){
var ruifSecondCode =document.getElementById("ruifSecondCode");
ruifSecondCode.innerHTML='<img id="safecode" src="'+root+'/ImageServlet?s=' + "'" +Math.random() + "'" + ' onerror="this.onerror=null;this.src=' + 'ImageServlet?s=' + "'" +Math.random() + "'" + '" alt="验证码" title="看不清楚?换一张" style="margin-right:40px;cursor:pointer;width:40px;height:18px;margin-bottom:-4px;margin-top:3px;" onclick="showInSeccondCode()"/>';

}
