var login_path = "http://" + location.host + "/tech/front/agent/membercenter/";

function login() {
	var username = document.all["username"].value;
  var password = document.all["password"].value;
	if(IsEmpty(username)) {
    	alert("用户名不能为空！");
        return;
    }
    if(IsEmpty(password)) {
        alert("密码不能为空！");
        return;
    }
	var url = login_path + "login.jsp?username=" + username + "&password=" + password + "&jtime=" + (new Date()).getTime();
        XmlHttpPool.GetRemoteData(url, getLoginResult);
}

function getLoginResult(data) {
	/*if (trim(data) == "true") {
		alert("登录成功！");
	}else {
		alert("登录失败！请检查用户名和密码是否正确。");
	}*/
	
	if (data.indexOf("true")>=0) {
        /*
		new dialog().init();
		setCopy('http://www.tech110.cn');
		new dialog().event('　　登录成功！','void 0');
        */
                alert("登录成功！");
		//刷新页面 Added by Evanl 2007-12-20
                window.location.reload();
	}
	else {
        /*
		new dialog().init();
		setCopy('http://www.tech110.net:8080/tech/default.jsp');
		new dialog().event('　　登录失败！请检查用户名和密码是否正确。','void 0');
	*/
                alert("登录失败！请检查用户名和密码是否正确。");	
	}
	
}