window.addEvent('domready', function(){
	// You can skip the following line. We need it to make sure demos
	// are runnable on MooTools demos web page.
	var demo_path = window.demo_path || '';
	// --

	//We can use one Request object many times.
	var req1 = new Request({

		url: demo_path + 'match_of_the_day.php?giorno=oggi',

		onSuccess: function(txt){
			$('result').set('text', txt);
		},

		// Our request will most likely succeed, but just in case, we'll add an
		// onFailure method which will let the user know what happened.
		onFailure: function(){
			$('result').set('text', 'The request failed.');
		}

	});
	
	var req2 = new Request({

		url: demo_path + 'match_of_the_day.php?giorno=domani',

		onSuccess: function(txt){
			$('result').set('text', txt);
		},

		// Our request will most likely succeed, but just in case, we'll add an
		// onFailure method which will let the user know what happened.
		onFailure: function(){
			$('result').set('text', 'The request failed.');
		}

	});

	$('oggi').addEvent('click', function(){
		req1.send();
	});
	
	$('domani').addEvent('click', function(){
		req2.send();
	});


});
