new Namespace("at.steiermark.main_navigation.hover");
at.steiermark.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 () {	
		hideSelectBoxes();
		this.addClassName('sfhover');
		clearInterval(this.hide);
	},
	
	out : function () {
		this.hide = setInterval(this.myClass.removeClass.bind(this),30);
	},
	
	removeClass : function() {	
		if (this.className == "main") {
			showSelectBoxes();
			clearInterval(this.hide);
		}
		
		if(this.className.indexOf("sfhover") >= 0) {
			this.removeClassName("sfhover");
		}
	}

});


