/**
*			=======================登陆验证JS==========================
*
**/
var isShow=false;
/**删除字符串中的空格*/
function Trim(sText) 
{ 
    return sText.replace(new RegExp("(^[\\s]*)|([\\s]*$)", "g"), ""); 
}
function login_onsubmit()
{							
	if(Trim(window.document.formLogin.username.value)=="")
	{				
		alert("请输入用户名！");
		window.document.formLogin.username.focus();
	}else if(Trim(window.document.formLogin.password.value)=="")
	{
		alert("请输入密码！");
		window.document.formLogin.password.focus();
	}else if(Trim(window.document.formLogin.checkcode.value)=="")
	{
		alert("请输入验证码！");
		window.document.formLogin.checkcode.focus();
	}else
	{		
		if($('trButton')!=null)					//如果是内嵌登录框
		{
			$('trButton').style.display = "none";
			$('trLoading').style.display = "inline";
		}		
		window.document.formLogin.submit();
	}
}
document.onkeydown=function()		//键盘事件 回车键		
{
	if(event!=null&&event.keyCode==13)
	{
		login_onsubmit();
	}
}
function setPlay()						//收件箱文字跳动
{
	setInterval('play()',350);
}
function $(id)
{
	return document.getElementById(id);
}
function play()
{
	if(document.getElementById("message").style.visibility == "hidden")
	{
		document.getElementById("message").style.visibility = "visible";
	}else
	{
		document.getElementById("message").style.visibility = "hidden";
	}
}
function showCheckCode(){
	if(isShow) return;
	var strHTML = "<img id='imgCode' width='65' height='20'  src='RandomCodeCtrl' style='cursor:pointer' onclick='javascript:window.document.getElementById(\"imgCode\").src=\"RandomCodeCtrl?id=\"+Math.floor(Math.random()*99999+10000)+\"&timestamp=\"+new Date().getTime();'>";
	document.getElementById("divImg").innerHTML=strHTML;
	isShow = true;
}
