// Toolbar object manages highlighting and other stuff
// for the toolbar icons.

var gInfoDiv;

toolbar = function(info_div)
{
	this.buttons = new Object();
	gInfoDiv = $("#" + info_div);
	
	this.addButton = function(id, hover_text)
	{
		this.buttons[id] = new Object();
		this.buttons[id].hover_text = hover_text;
		this.enableHover(id);
	}
	
	this.disableHover = function(id)
	{
        $("#" + id).unbind('mouseover').unbind('mouseout');
	}
	
	this.enableHover = function(id)
	{
		var hover_text = this.buttons[id].hover_text;
		
        $("#" + id).mouseover(function()
        {
            $("#info").html(hover_text);
        });
        
        $("#" + id).mouseout(function()
        {
            $("#info").empty();
        });
	}
}