// JavaScript Document

/*window.addEvent('domready', function(){
	$('mailForm').addEvent('submit', function(e) {

	new Event(e).stop();
	var log = $('log_res').empty().addClass('ajax-loading');
	this.send({
		update: log,
		onComplete: function() {
			log.removeClass('ajax-loading');
		}
	});
	});
});*/


// $('mailForm').send();


$('mailForm').addEvent('submit', function(e) {	
	/**
	 * Prevent the submit event
	 */
	new Event(e).stop();		
	/**
	 * This empties the log and shows the spinning indicator
	 */
	var log = $('log_res').empty().addClass('ajax-loading');
	/**
	 * send takes care of encoding and returns the Ajax instance.
	 * onComplete removes the spinner from the log.
	 */
 this.set('send', {
		url: this.action,
		method: 'post',
		onSuccess: function(responseText, responseXML) {
			log.removeClass('ajax-loading');
			log.set('html',responseText);
			}
	})
	this.send();
});
