var Stats =	{
	getMostViewed		: function(element,span)	{
		if($(element).is('.active'))
			return;
	
		$('#viewed-loader').show();
		$('.most-viewed h2 a').removeClass('active');
		$(element).addClass('active');
		
		$.ajax({
			type: "POST",
			url: "include/ajax.php",
			data: "fn=getMostViewed&span="+span,
			success: function(msg){
				$('#most-viewed').hide().fadeOut(100);
				$('#viewed-loader').hide();	
				$('#most-viewed').html(msg).show().fadeIn(1000);
			}
		});
	},
	
	getMostCommented	: function(element,span)	{
		if($(element).is('.active'))
			return;
	
		$('#commented-loader').show();
		$('.most-commented h2 a').removeClass('active');
		$(element).addClass('active');
		
		$.ajax({
			type: "POST",
			url: "include/ajax.php",
			data: "fn=getMostCommented&span="+span,
			success: function(msg){
				$('#most-commented').hide().fadeOut(100);	
				$('#commented-loader').hide();
				$('#most-commented').html(msg).show().fadeIn(1000);
			}
		});
	},
	
	getLatest			: function()			{
		$('#latest-reload').html('<img src="/include/css/img/ajax-loading.gif"/>');
	
		$.ajax({
			type: "POST",
			url: "include/ajax.php",
			data: "fn=getLatest",
			success: function(msg){
				$('#latest').hide().fadeOut(100);	
				$('#latest-reload').html('<img src="/include/css/img/arrow_refresh.gif"/>');
				$('#latest').html(msg).show().fadeIn(1000);
			}
		});
	}
};

$(document).ready(function()	{

});