/**
 * IPB3 Javascript				
 * --------------------------------------------
 * ips.statisticstabjs - Statistics Tab JS
 * (c) IPS, Inc 2008				
 * --------------------------------------------- 
 * Author: Invision Modding (m4rtin)		
 **/

var _statisticsTab = window.IPBoard;

_statisticsTab.prototype.statisticsTab = 
{
	init: function()
	{
		Debug.write("Initializing ips.statisticsTab.js");
	},
 
	regenerateStats: function(div_id)
	{	

		new Ajax.Request( ipb.vars['base_url'] + 'app=members&section=load&module=ajax&member_id=' + ipb.profile.viewingProfile + '&tab=stats&regen='+escape(div_id)+'&md5check=' + ipb.vars['secure_hash'],
		{
			method: 'post',
			onSuccess: function(t)
			{
				if( t.responseText )
				{
					$('tab_stats').update( t.responseText );
				}
				else
				{
					alert( "There was an error re-generating the statistics" );
				}
			}
		});

		return false;
	}
}
ipb.statisticsTab.init();
