
//mootools code
window.addEvent( 'domready', function() {
	var nls_form = $('nls_form');
	if( nls_form ){
		$('nls_form').addEvent('submit', function(e) {
			/**
			 * Prevent the submit event
			 */
			new Event(e).stop();
		 
			/**
			 * This empties the log and shows the spinning indicator
			 */
			var log1 = $('nls_form_log').empty().addClass('ajax-loading');
		 
			/**
			 * send takes care of encoding and returns the Ajax instance.
			 * onComplete removes the spinner from the log.
			 */
			this.send({
				update: log1,
				onComplete: function() {
					log1.removeClass('ajax-loading');
				}
			});
		});
	}
});

