// JavaScript Document

window.addEvent('domready', function() {
	// HERE IS WHAT YOU READ IN JS CODE
	
	$('awards').addEvent('click', function(e) {
		e = new Event(e).stop();
	 
		var url = "awards_sm.htm";
	 
		/**
		 * The simple way for an Ajax request, use onRequest/onComplete/onFailure
		 * to do add your own Ajax depended code.
		 */
		new Ajax(url, {
			method: 'get',
			update: $('about')
		}).request();
	});
	
	$('news').addEvent('click', function(e) {
		e = new Event(e).stop();
	 
		var url = "news_sm.htm";
	 
		/**
		 * The simple way for an Ajax request, use onRequest/onComplete/onFailure
		 * to do add your own Ajax depended code.
		 */
		new Ajax(url, {
			method: 'get',
			update: $('about')
		}).request();
	});
	
	$('newsSubmit').addEvent('click', function(e) {
		e = new Event(e).stop();
	 
		var url = "news_sm.htm";
	 
		/**
		 * The simple way for an Ajax request, use onRequest/onComplete/onFailure
		 * to do add your own Ajax depended code.
		 */
		new Ajax(url, {
			method: 'get',
			update: $('response')
		}).request();
	});
	
	$('newsletter').addEvent('submit', function(e) {
		/**
		 * Prevent the submit event
		 */
		new Event(e).stop();
	 
		/**
		 * This empties the log and shows the spinning indicator
		 */
		var log = $('response').empty().addClass('ajax-loading');
	 
		/**
		 * send takes care of encoding and returns the Ajax instance.
		 * onComplete removes the spinner from the log.
		 */
		this.send({
			update: log,
			onComplete: function() {
				log.removeClass('ajax-loading');
			}
		});
	});
});
