

/* Hover */

var Hover = function(navBar)
{
	var me = this;
	me.items = navBar.find("ul")[0].childNodes;
	jQuery.each(me.items, function(i, item) {me.initItem(item);});
}

Hover.prototype.initItem = function(item)
{
	var me = this;
	item.onmouseover = function() 
	{
		me.closeAllExcept(item);
		
		clearTimeout(me.closeTimeout);
		me.openTimeout = setTimeout(function() 
		{
			item.className = "over"; 
			item.style.zIndex = 9999;
		}, Hover.OPEN_TIMEOUT);
	};
	
	item.onmouseout = function() 
	{ 
		clearTimeout(me.openTimeout);
		
		me.closeTimeout = setTimeout(function()
		{
			item.className = ""; 
		}, Hover.CLOSE_TIMEOUT);
	};
}

Hover.prototype.closeAllExcept = function(exceptItem)
{
	jQuery.each(this.items, function(i, item) 
	{ 
		if (item != exceptItem)
			item.className = ""; 
	});
}

Hover.OPEN_TIMEOUT  = 200;
Hover.CLOSE_TIMEOUT = 500;

/* End Hover */

jQuery('#navGraphic').ready(function() {
	if(jQuery('#navGraphic').attr('id')) {
		new Hover(jQuery("#navGraphic"));
	}
});