function Login(objform, rtnamespace, rtmodule, recover)
{
	this.objform = objform;
	this.uname = getCookie('username');
	this.password = getCookie('password');
	this.passwordhash = getCookie('passwordhash');
	this.rtnamespace = rtnamespace;
	this.rtmodule = rtmodule;
	this.recover = recover;
	if (this.recover == null)
		this.recover = 'recoverpassword';
	this.rememberMe = function()
	{
		var newhref = '?'+ this.rtnamespace + '.view='+rtmodule+'.'+this.recover;
		
		if (this.objform.username.value.length > 0)
			newhref += '&' + this.rtnamespace + '.ctrl=usermgr.challengequestion&'+this.rtnamespace+'.username=' + escape(objform.username.value);
			
		window.location = newhref;
	}
	this.hasPw = function()
	{
		return (this.password != null || this.passwordhash != null);
	}
	this.checkUname = function()
	{
		if (this.uname != null)
		{
			objform.username.value = this.uname;
			if (this.hasPw() && objform.r2)
			{
				objform.r2.checked = true;
				objform.rememberme.value = objform.r2.value;
			}
			else if (objform.r1)
			{
				objform.r1.checked = true;
				objform.rememberme.value = objform.r1.value;
			}
		}
	}
}
