
if (THC == undefined) 
{
		var THC = {}; 
} 

//see http://javascript.crockford.com/private.html for description of javascript
//public, private and privileged functions
THC.NewsLetterController = 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.createNewsLetter = function ()
	{
		
		var email = dojo.byId("email").value;
		var pwdDiv = dojo.byId("newsLetterDiv");
		var msg;
		if(email)
		{
			var request = dojo.xhrGet(
	 		{
	   	 		url:"newsLetter.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)
			{				
				pwdDiv.innerHTML = "<span class='star'>" + msg.msg + "</span>";
				dojo.byId("email").value ="";
			}
		
		}
		else
		{
			pwdDiv.innerHTML = "<span class='star'>Please enter valid email address.</span>";
			
		}
		
		
	}
	
};

//============================================================================
//							PUBLIC FUNCTIONS 
//============================================================================	
//The prototype mechanism is used for inheritance. It also conserves memory
//as all objects use one definition of the function.
THC.NewsLetterController.prototype =
{	

};
//============================================================================
//							END PUBLIC FUNCTIONS 
//============================================================================	