var HMUser={
	getForm:function(p0,p1){
		HMrequestText(p0,null,function(t){t==9999?window.location=HMSITEROOT+"user/index.asp":p1.innerHTML=t},1)
	},
	root:HMSITEROOT+"user/module/"
}
HMUser.login={
	getForm:function(p0){
		this.layer=HMgetElement(p0);
		HMUser.getForm(HMUser.root+"UserLogin.asp?"+Math.random(),this.layer)
	},
	submit:function(p0,p1){
		var f=new HMForm(p0,true),obj=HMgetElement(p1),sObj=this.layer;
		var d="code="+f.getValue("UserCode")+"&username="+f.getValue("UserName")+"&password="+f.getValue("Password")+"&save="+f.getValue("Cookie");
		var _r=function(t){
			var success="<div><b>登录成功?\/b>　",lu=HMGetQuery("turn");
			if(HMisNone(lu))lu=document.referrer.toString();
			if(!HMisNone(lu))success+="<a href=\""+lu+"\">返回上一?/a>　";
			success+="<a href=\""+HMSITEROOT+"user/index.asp\">进入管理中心</a></div>";
			HMisNone(t)?sObj.innerHTML=success:(obj.innerHTML=t,HMLoadCode())
		};
		f.getForm().onsubmit=function(){return false};
		HMrequestText(HMUser.root+"UserLogin.asp?action=dispose&"+Math.random(),d,_r,1)
	},
	layer:null 
}
HMUser.Clogin={
	getForm:function(p0){
		this.layer=HMgetElement(p0);
		HMUser.getForm(HMUser.root+"UserLogin.asp?"+Math.random(),this.layer)
	},
	submit:function(p0,p1){
		var f=new HMForm(p0,true),obj=HMgetElement(p1),sObj=this.layer;
		var d="code="+f.getValue("UserCode")+"&username="+f.getValue("UserName")+"&password="+f.getValue("Password")+"&save="+f.getValue("Cookie");
		var _r=function(t){
			HMisNone(t)?HMUserInit():(obj.innerHTML=t,HMLoadCode())
		};
		f.getForm().onsubmit=function(){return false};
		HMrequestText(HMUser.root+"UserLogin.asp?action=dispose&"+Math.random(),d,_r,1)
	},
	layer:null 
}
HMUser.join={
	getForm:function(p0){
		this.layer=HMgetElement(p0);
		HMUser.getForm(this.getUrl(""),this.layer)
	},
	submit:function(p0,p1){
		var pjt=["Name","Password","CheckPassword","Question","Answer","Mail","Type","RealName","Sex","Company"];
		var f=new HMForm(p0,true),obj=HMgetElement(p1);
		f.getForm().onsubmit=function(){return false};
		var d="code="+f.getValue("UserCode");
		for(var i=0;i<pjt.length;i++)d+="&User"+pjt[i]+"="+f.getValue("User"+pjt[i]);
		obj.innerHTML="正在提交注册信息...";
		HMrequestText(this.getUrl("action=dispose&"),d,function(text){obj.innerHTML=text;HMLoadCode()},1)
	},
	checkName:function(p0,p1){this.checkInfo("checkName&username=",p0,p1)},
	checkPassword:function(p0,p1){this.checkInfo("checkPassword&password=",p0,p1)},
	checkMail:function(p0,p1){this.checkInfo("checkMail&email=",p0,p1)},
	checkInfo:function(p0,p1,p2){HMrequestText(this.getUrl("action="+p0+encodeURIComponent(p1)+"&"),null,p2,0)},
	getUrl:function(p0){return HMUser.root+"UserJoin.asp?"+p0+Math.random()},
	layer:null
}
HMUser.resendMail={
	getForm:function(p0){HMUser.getForm(HMUser.root+"UserResendMail.asp?"+Math.random(),HMgetElement(p0))},
	submit:function(p0,p1){
		var f=new HMForm(p0,true),o=HMgetElement(p1),gv=f.getValue;
		f.getForm().onsubmit=function(){return false};
		var d="UserName="+gv("UserName")+"&UserMail="+gv("UserMail")+"&code="+gv("UserCode");
		HMrequestText(HMUser.root+"UserResendMail.asp?action=dispose&"+Math.random(),d,function(t){o.innerHTML=t;HMLoadCode()},1)
	}
}
HMUser.takePassword={
	getForm:function(p0){
		this.layer=HMgetElement(p0);
		HMUser.getForm(this.getUrl(""),this.layer)
	},
	getQuestion:function(p0,p1){
		var f=new HMForm(p0,true) ;
		f.getForm().onsubmit=function(){return false};
		var d="UserName="+f.getValue("UserName")+"&code="+f.getValue("UserCode");
		this.submit("requestQuestion",p1,"getQuestion",d)
	},
	getNewForm:function(p0,p1){
		var f=new HMForm(p0,true),gv=f.getValue;
		f.getForm().onsubmit=function(){return false};
		var d="UserId="+gv("UserId")+"&UserAnswer="+gv("UserAnswer")+"&code="+gv("UserCode");
		this.submit("sumitAnswer",p1,"getNewForm",d)
	},
	setPassword:function(p0,p1){
		var f=new HMForm(p0,true),gv=f.getValue;
		f.getForm().onsubmit=function(){return false};
		var d="UserNewPassword="+gv("UserNewPassword")+"&UserCheckPassword="+gv("UserCheckPassword")+"&UserId="+gv("UserId")+"&code="+gv("UserCode");
		this.submit("resetPassword",p1,"getGreeting",d)
	},
	submit:function(p0,p1,p2,p3){
		var o=HMgetElement(p1),_u=this.getUrl("action="+p2+"&"),_o=this.layer;
		HMrequestText(this.getUrl("action="+p0+"&"),p3,function(text){HMisNone(text)?HMUser.getForm(_u,_o):(o.innerHTML=text,HMLoadCode())},1)
	} ,
	getUrl:function(p0){return HMUser.root+"UserTakePassword.asp?"+p0+Math.random()},
	layer:null
} 









