window.addEvent('domready', function() {
	
	/*---Forgot Password Form---*/
	$('forgotPassForm').addEvent('submit', function(e) {
	//Prevents the default submit event from loading a new page.
	new Event(e).stop();
	//e.stop();
	//Empty the log and show the spinning indicator.
	var log = $('log_res_ModifyCategory').empty().addClass('ajax-loading');
	//Set the options of the form's Request handler. 
	//("this" refers to the $('addCatForm') element).
	this.set('send', {onComplete: function(response) { 
		log.removeClass('ajax-loading');
		//get vars
		var status = JSON.decode(response);
		//validate that all proceed as planned CODE: 1 = TRUE
		if (status.code == 1){
			//Display a message of congratulations
			log.set('html', status.message);
			//redirect
			//window.location = 'index.php?page=forgot&status=1';
		}
		else
		{
			//display the Errors
			log.set('html', status.message);
		}
		
	}});
	//Send the form.
	this.send();
	});
	
});
