// JavaScript Document
Header = function()
{
	var toolbarComponents;
	
	this.init = function()
	{
		toolbarComponents = new Array();
		var toolbar = document.getElementById('toolbar');
		for(var i=0;i<toolbar.childNodes.length;i++)
		{
			if(toolbar.childNodes[i].nodeType == 1)
			{
				toolbarComponents.push(toolbar.childNodes[i]);
				EventUtil.addEventHandler(toolbar.childNodes[i],"mouseup",selected);
				EventUtil.addEventHandler(toolbar.childNodes[i],"mouseover",hover);
				EventUtil.addEventHandler(toolbar.childNodes[i],"mouseout",mouseout);
			}
		}
	};
	
	selected = function()
	{
		for(var i=0;i<toolbarComponents.length;i++)
		{
			toolbarComponents[i].className = "";	
		}
		EventUtil.getEvent().target.className = "selected";
	};
	
	hover = function()
	{
		if(EventUtil.getEvent().target.className == "")
		{
			
			EventUtil.getEvent().target.className = "hover";	
		}

	};
	
	mouseout = function()
	{
		if(EventUtil.getEvent().target.className != "selected")
		{		
			EventUtil.getEvent().target.className = "";
		}

	};
};
