
if (THC == undefined) 
{
		var THC = {}; 
} 

//see http://javascript.crockford.com/private.html for description of javascript
//public, private and privileged functions
THC.LoginController = function () 
{ 	
	//============================================================================
	//							CONSTRUCTOR 
	//============================================================================
	//			(must be declared after all functions to be used)

	
	var that = this;
	
	
	//============================================================================
	//							END CONSTRUCTOR
	//============================================================================
	//============================================================================
	//							PRIVATE FUNCTIONS 
    //============================================================================    	
	
	//============================================================================
	//							END PRIVATE FUNCTIONS 
    //============================================================================  	

	//============================================================================
	//							PRIVILEGED (PUBLIC) FUNCTIONS 
    //============================================================================	
	
	
	this.sendPassowrd = function ()
	{
		
		var email = dojo.byId("passwordEmail").value;
		var msg;
		var request = dojo.xhrGet(
 		{
   	 		url:"forgotPassword.html?email="+email,
		 	error: function(type, errObj)
		 	{ 
		 		alert("Error getting password");					
		 	},
		 	load: function(type, data, evt)
		 	{	
				msg = eval(data.xhr.responseText);
		 	},
		 	sync: true,
		    mimetype: "text/plain"
		});
		
		if(msg)
		{
			var pwdDiv = dojo.byId("forgotPasswordDiv");
			pwdDiv.innerHTML = "<span class='star'> " + msg.msg + "</span>";
		}
		
		
	}
	this.login = function()
	{
		var loginForm = dijit.byId("loginForm");
		loginForm.submit();
	}
};

//============================================================================
//							PUBLIC FUNCTIONS 
//============================================================================	
//The prototype mechanism is used for inheritance. It also conserves memory
//as all objects use one definition of the function.
THC.LoginController.prototype =
{	

};
//============================================================================
//							END PUBLIC FUNCTIONS 
//============================================================================	