if (!window.Varien)
    var Varien = new Object();

Varien.Promos = Class.create();
Varien.Promos.prototype = {
    initialize: function(selector,hover,item,hoverable) {
        var self=this;
        this.selector = selector;
        this.hoverable = hoverable;
        this.hoverClass = hover;
        this.itemClass = item;
        this.duration = 300;
        $$('.'+selector).each(function(el){
            if(el.hasClassName(self.hoverable)){
                var promo = el;
                var item = el.up('.'+self.itemClass);
                var hover = el.next('.'+self.hoverClass);
                hover.style.display = 'none';
                $jQ(function($){
                    $(item).hoverIntent({
                         sensitivity: 3,
                         interval: 0,
                         over: mouseover,
                         timeout: 0,
                         out: mouseout
                    });
                    function mouseover( ) {
                        $(promo).fadeOut(self.duration);
                        $(hover).fadeIn(self.duration);
                    }
                    function mouseout( ) {
                        $(promo).fadeIn(self.duration);
                        $(hover).fadeOut(self.duration);
                    }
                });
            }
        });
    }
}
