new Namespace("at.bildungswerk.main_navigation.hover");
at.bildungswerk.main_navigation.hover = Class.create({

	initialize : function (elems)
	{
		this.naventries = elems;
		
		for( i=0; i<this.naventries.length; i++ )
		{
			for( k=0; k<this.naventries[i].length; k++ )
			{
				this.naventries[i][k].myClass = this;
				this.naventries[i][k].observe('mouseover', this.over);				
				this.naventries[i][k].observe('mouseout', this.out);
			}
		}
	},

	over : function ()
	{
		this.addClassName('hover');
		clearInterval(this.hide);
	},
	
	out : function ()
	{
		this.hide = setInterval(this.myClass.removeClass.bind(this),50);
	},
	
	removeClass : function()
	{
		if(this.className.indexOf("hover") >= 0)
		{
			this.removeClassName("hover");
		}
	}


});



