// Track info
function init_user_regen()
{
	// IE caches the url, need to add a timestamp on the end to change the url every time
	var buster = "buster=" + new Date().getTime(); // IE caches the url, need to add a timestamp on the end to change the url every time
	$.getJSON('/user/a_regen.php?'+buster, load_user_regen_done);
}
function load_user_regen_done(data)
{
	$('#user_regen').html(data.html); 
	init_regen_list();
	do_regen(true); // true for reset timers.js
}
// Init the list
function init_regen_list()
{
	var elmts = $('#user_regen div');
	for(var i = 0, len = elmts.length; i < len; i++)
	{
		if(elmts[i].getAttribute('mouse_action'))
		{
			$(elmts[i]).hover(request_point_info_display, request_point_info_hide);
			$(elmts[i]).bind('mousemove', tooltip_info_move);
		}
	}
}

function request_point_info_display()
{
	highlight($(this), 1, 'regen_border_on');
	var elmts = this.getElementsByTagName('div');
	var html = elmts[0];
	
	tool_tip['text'].html(html.innerHTML); 
	tool_tip['elmt'].show();
	tool_tip['type'] = "regen_info"; // Set this type to regen_info so we can hide it if the regen is full.
  
}
function request_point_info_hide(e)
{
	highlight($(this), 0, 'regen_border_on');
	tool_tip['elmt'].hide()
	tool_tip['type'] = null; // Set this type to null because we're not using it
}



