Lifetype.UI.Pages.Default = function() {}

Lifetype.UI.Pages.Default.submitHook = function()
{
	var formObject = document.getElementById( 'loginForm' ); 
	YAHOO.util.Connect.setForm(formObject); 
	var cObj = YAHOO.util.Connect.asyncRequest('POST', '?op=Login&output=json',
		callback = {
			success: function( o ) {
				// decode the JSon response from the server
				response = Lifetype.JSon.decode( o.responseText );
				
				Lifetype.Dom.hide( "FormInfo" );
				Lifetype.Dom.hide( "FormError" );
				
				if( response.success ) {
					Lifetype.Dom.setContent( "FormInfoMessage", response.message );
					Lifetype.Dom.show( "FormInfo" );

					// move to the blog selection
					window.location.href = '?op=blogSelectLogin';
				}
				else {
					Lifetype.Dom.setContent( "FormErrorMessage", response.message );
					Lifetype.Dom.show( "FormError" );
				}
			}
		}
	);		
}
