new Namespace("eu.mckinley.slider.dropdown");
eu.mckinley.slider.dropdown = Class.create({
    initialize : function (elems) {
        this.naventries = elems;
        this.overstat = false;

        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 () {
        try {
            this.addClassName('hover');
            clearInterval(this.hide);
            this.overstat = true;
        }
        catch (e) {
            throw e;
        }
    },

    out : function () {
        if( this.overstat = true ) {
            this.hide = setInterval(this.myClass.removeClass.bind(this), 200);
            this.overstat = false;
        }
    },

    removeClass : function() {
        if (this.className.indexOf("hover") >= 0) {
            this.removeClassName("hover");
        }
    }
});

