YAHOO.namespace("Youniverse");

YAHOO.Youniverse.contact = function()
{
	
	/*
	* Initialise class when window dom loaded
	*/
	this.initClass = function ()
	{
	}
	
	/*
	* Ajax Failure	
	*/
	this.ajaxFailure = function (o)
	{
		if (o.status > -1)
		{
			alert(msg.translate('err01'));
		}
	}
	
	/*
	* Submit register
	* @ formID is the ID of the form
	*/
	this.submitContact = function (formID)
	{
		var formObject = document.getElementById(formID+"Form"); 
		
		YAHOO.util.Connect.setForm(formObject);
		
		var callback = 
		{ 
			success: this.onSubmitContact, 
			failure: this.ajaxFailure
		};
		
		var cObj = YAHOO.util.Connect.asyncRequest('POST', "/help/send_contact", callback);
	}
	
	/*
	* onSubmit Contact
	* @ o is the response object
	*/
	this.onSubmitContact = function (o)
	{
		eval(o.responseText);
	}
}