window.addEvent('domready', function() {
	//We can use one Request object many times.
	var newp = new Request.HTML({url:'newp.php', 
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			$('log').set('text', '');
			//Inject the new DOM elements into the results div.
			$('log').adopt(html);
		},
		//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() {
			$('log').set('text', 'The request failed.');
		}
	});
	
	$('NEWP').addEvent('click', function() {
		newp.send();
	});
	//We can use one Request object many times.
	var req = new Request.HTML({url:'sale.php', 
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			$('log').set('text', '');
			//Inject the new DOM elements into the results div.
			$('log').adopt(html);
		},
		//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() {
			$('log').set('text', 'The request failed.');
		}
	});
	
	$('SALE').addEvent('click', function() {
		req.send();
	});
	//We can use one Request object many times.
	var tten = new Request.HTML({url:'top_ten.php', 
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			$('log').set('text', '');
			//Inject the new DOM elements into the results div.
			$('log').adopt(html);
		},
		//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() {
			$('log').set('text', 'The request failed.');
		}
	});
	
	$('TTEN').addEvent('click', function() {
		tten.send();
	});
	//We can use one Request object many times.
	var mview = new Request.HTML({url:'most_viewed.php', 
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			$('log').set('text', '');
			//Inject the new DOM elements into the results div.
			$('log').adopt(html);
		},
		//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() {
			$('log').set('text', 'The request failed.');
		}
	});
	
	$('VIEW').addEvent('click', function() {
		mview.send();
	});
	//We can use one Request object many times.
	var feat = new Request.HTML({url:'featured.php', 
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			$('log').set('text', '');
			//Inject the new DOM elements into the results div.
			$('log').adopt(html);
		},
		//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() {
			$('log').set('text', 'The request failed.');
		}
	});
	
	$('FEAT').addEvent('click', function() {
		feat.send();
	});
});