
Site.Controllers.SaleTooltips = Class.create
(
    Site.Base,
    {
        initialize: function(links)
        {
            this.tooltips = {};
            
            
            links.each
            (
                function(link)
                {
                    // here we use "rel" as multiple entries could share the same tooltip
                                        
                    if (tooltip = $('sale-tooltip-' + link.rel))
                    {
                        
                        // CHANGED: 08 Feb 2008
                        this.tooltips[link.id] = new Site.Widgets.Tooltip(tooltip, link, {offsetX: 0, offsetY: 0, showOnClick: true});
                    }
                },
                this
            );
        },
        
        destroy: function()
        {
            $H(this.tooltips).each
            (
                function(pair)
                {
                    pair.value.destroy();
                }
            );
        }
    }
);