//auto www.dilingling.net
//document.location.href="http://www.dilingling.net";
//var href=document.location.href;
//if(href.indexOf("union.dilingling.net")>0){
//   document.location.href="http://www.dilingling.net";
//}
function reloadVImg() {
    var v=$("vimage");
	v.src = v.src + "?date" + new Date();
}
function userLogin() {
	clearMsg();
	var command;
	command = new Command("UserLoginCmd");
	command.setParameters("userForm");
	command.setForword("/home/");
	command.setError(loginError);
	command.execute();
}
function clearMsg() {
	DWRUtil.setValue("userMsg", "");
	DWRUtil.setValue("vcodeMsg", "");
	DWRUtil.setValue("loginMsg", "");
}
function loginError(errors) {
	for (var p in errors) {
	alert(errors[p]);
		//DWRUtil.setValue(p, errors[p] || "*");
		if(p=="vcodeMsg"){
		   reloadVImg();
		}
	}
	DWRUtil.setValues("user", {userId:"", userPass:"", vcode:""});
}
function alreadLoad() {
	DWRAction.getAttribute("userInfo", alreadUsr);
}
function alreadUsr(data) {
	if (data) {
		var alText = "\u5df2\u7ecf\u767b\u9646\u5e10\u6237[<a href=\"./home/\" target=\"_self\">" + data.userName + "</a>]";
		DWRUtil.byId("alreadMsg").innerHTML = alText;
	}
}
function registerWeb() {
	document.location.href = "/register/web_register.html";
}
function registerAd() {
    document.location.href = "/register/ad_register.html";
}
function registerPerson() {
    document.location.href = "/register/person_register.html";
}

