function ResidentHubLogin() {

	var LOCATION = new Array();
	LOCATION['default'] = String(window.location);//Default Location Url

	//States
	var HAS_REQUEST = (LOCATION['default'].indexOf('?') >= 0) ? true : false;
	var LOGIN_FAILED = (LOCATION['default'].indexOf("rh_login_failed")  >= 0) ? true : false;
	var LOGIN_FORGOT_SUCCESS = (LOCATION['default'].indexOf("rh_forgot_success") >= 0) ? true : false;
	var LOGIN_FORGOT_FAILED_1 = (LOCATION['default'].indexOf("rh_forgot_failed_1") >= 0) ? true : false;
	var LOGIN_FORGOT_FAILED_2 = (LOCATION['default'].indexOf("rh_forgot_failed_2") >= 0) ? true : false;
	var LOGIN_FORGOT_FAILED_3 = (LOCATION['default'].indexOf("rh_forgot_failed_3") >= 0) ? true : false;
	var LOGIN_FORGOT_PASSWORD = (LOCATION['default'].indexOf("rh_forgot_password") >= 0) ? true : false;
	
	//Messages
	var LOGIN_FORGOT_SUCCESS_MESSAGE = '<li class="alert">Your login information has been sent</li>';
	var LOGIN_FORGOT_FAILED_MESSAGE_1 = '<li class="alert">The email address entered is invalid</li>';
	var LOGIN_FORGOT_FAILED_MESSAGE_2 = '<li class="alert">An account was not found with the email address entered</li>';
	var LOGIN_FORGOT_FAILED_MESSAGE_3 = '<li class="alert">Failed sending email.  Please contact the leasing office.</li>';
	var LOGIN_FAILED_MESSAGE = '<li class="alert">Sorry, Login Failed</li>';
		
	//OUTPUT
	var OUTPUT = new Array();
	
	//Builds the OUTPUT
	this.build = function() 
	{
	    //HTML Display Stuff
	    OUTPUT['head'] = '<div class="rh-login-box"><h4>ResidentHub<sup style=\'font-size: 8px;\'>SM</sup></h4><ul>';
	    OUTPUT['loginForm'] = '<form action="https://secure.resiteit.com/forgot.php" method="post" enctype="application/x-www-form-urlencoded" onSubmit="return R_doSubmit(this)"><input type="hidden" name="return" value="' + LOCATION['default'] + '" /><li class="help">Please enter your email address. Your login information will then be sent to you.</li><li class="email"><label for="email">Email:</label><input name="email" type="text" /></li><li class="buttons"><input name="send" class="button" type="submit" value="Send" /></li></form>';
 	    OUTPUT['forgotForm'] = '<form action="https://secure.resiteit.com/login.php" method="post" enctype="application/x-www-form-urlencoded" onSubmit="return R_doSubmit(this)"><input type="hidden" name="success" value="https://secure.resiteit.com/" /><input type="hidden" name="fail" value="' + document.location + '"><li><label for="r_username">Username:</label><input name="username" id="r_username" type="text" /></li><li><label for="r_password">Password:</label><input name="password" id="r_password" type="password" /></li><li class="buttons"><input name="login" class="button" type="submit" value="Secure Login" /></li><li class="links"><a href="' + LOCATION['forgot'] + '">Forgot your password?</a></li></form>';
	    OUTPUT['foot'] = '</ul></div>';

	    //Build the output message.
		if(LOGIN_FAILED) {
		    OUTPUT['message'] = LOGIN_FAILED_MESSAGE;
		} else if(LOGIN_FORGOT_SUCCESS) {
		    OUTPUT['message'] = LOGIN_FORGOT_SUCCESS_MESSAGE;
		} else if(LOGIN_FORGOT_FAILED_1) {
		    OUTPUT['message'] = LOGIN_FORGOT_FAILED_MESSAGE_1;
		} else if(LOGIN_FORGOT_FAILED_2) {
		    OUTPUT['message'] = LOGIN_FORGOT_FAILED_MESSAGE_2;
		} else if(LOGIN_FORGOT_FAILED_3) {
		    OUTPUT['message'] = LOGIN_FORGOT_FAILED_MESSAGE_3;
		}
		
		//Location for forgotten password.	
	    LOCATION['forgot'] = (HAS_REQUEST) ? LOCATION['default'] + '&rh_forgot_password' : LOCATION['default'] + '?rh_forgot_password';

		//Return this so we can command chain.
	    return this;
		
	}
	
	//Returns the form to display.
	this.getOutput = function()
	{
		return OUTPUT;
	}

}