window.addEvent('domready', function(){
	if($('resform')){
		var setupform = $('resform').removeClass('hidden');
		var resultlist1 = $('resultcontent').empty().addClass('ajax-loading');
		var special = $('hiddendivision').getValue() + 0;
		
		if(special > 0){
			var url = "http://www.guernseyhockey.com/ajaxresults.php?special=" + special;
		}else{
			var url = "http://www.guernseyhockey.com/ajaxresults.php";	
		}
		
		
		
				/**
				 * 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: $('resultcontent'),
					onComplete: function() {
				resultlist1.removeClass('ajax-loading');
					}
					}).request();
		$('divselect').addEvent('change', function(e) {
	/**
	 * Prevent the submit event
	 */
	new Event(e).stop();
 
	/**
	 * This empties the log and shows the spinning indicator
	 */
	var resultlist = $('resultcontent').empty().addClass('ajax-loading');
 
	/**
	 * send takes care of encoding and returns the Ajax instance.
	 * onComplete removes the spinner from the log.
	 */
	$('resultForm').send({
		update: resultlist,
		onComplete: function() {
			resultlist.removeClass('ajax-loading');
			$('resultForm').reset();
		}
	});
});
}
			});
	
