// JavaScript Document
window.addEvent('domready', function() {
	if ($('ajaxform')) {
		$('ajaxform').addEvent('submit', function(e) {
			/**
			 * Prevent the submit event
			 */
			e.stop();
		 
			/**
			 * This empties the log and shows the spinning indicator
			 */
			var log = $('ajaxformresult');
			if (log) {
				log=log.empty().addClass('ajax-loading');
			}
	
	
			//Set the options of the form's Request handler. 
			//("this" refers to the $('myForm') element).
			this.set('send', {onComplete: function(response) { 
				log.removeClass('ajax-loading');
				log.set('html', response);
			}});
			//Send the form.
			this.send();
		});
	}
});


