var ms,tishis,denglu,chongs;
ms="&ms=0";
function login() {
	if(document.form1.user.value!="" && document.form1.pass.value!=""){
		if (denglu!="1") {
			document.form1.user.disabled=true;
			document.form1.pass.disabled=true;
			document.form1.DropExpiration.disabled=true;
			tishis=0;denglu="1";chongs=0;
			setTimeout("coms()", 0);
			setTimeout("xianshi()", 0);
		}
	}else{
		document.getElementById("tishi").innerHTML="用户名与密码不能为空";
		document.form1.user.focus();
	}
	return false;
}
function coms() {
	var srcip = document.createElement("script");
	var scriptEle = document.getElementById("scrjs");
	scriptEle.innerHTML = "";
	srcip.type = "text/javascript"; 
	srcip.src = "login_js.asp?user=" + document.form1.user.value + "&pass=" + document.form1.pass.value + ms + "&dq=" + (new Date()).getTime();
	scriptEle.appendChild(srcip);
}
function xianshi() {
	if(denglu=="1"){ 
		setTimeout("xianshi()", 30);
		if (tishis>1000) {
			if (Math.floor(tishis/1000)!=chongs) { setTimeout("coms()", 0);chongs=chongs+1;}
			document.getElementById("tishi").innerHTML="第" + chongs + "次重试:共耗时"+(tishis/100)+"秒"; 
		}else{
			document.getElementById("tishi").innerHTML="正在登陆:耗时"+(tishis/100)+"秒"; 
		}
		
	}else{ 
		document.getElementById("tishi").innerHTML=denglu;
		document.form1.user.disabled=false;
		document.form1.pass.disabled=false;
		document.form1.DropExpiration.disabled=false;
		document.form1.user.focus();
		document.form1.pass.value="";
	}
	tishis=tishis+3;
}