(function($){
    $(function(){

        if (typeof(PopScan) === 'undefined')
            PopScan = {};
        if (typeof(PopScan.UI) === 'undefined')
            PopScan.UI = {};

        $.extend(PopScan.UI, {
            updateBasketPreview: function(count, total, silent){
                var $widget = $('#basket'),
                    $totalwidget = $widget.find('.basketpreview_total'),
                    $countwidget = $widget.find('.basketpreview_count');

                $totalwidget.html(PopScan.numberFormat(total, 2, ".", "'"));
                $countwidget.html(count);

                /*
                disabling animation. Something in how the element is positioned
                causes it wo vanish the moment jQuery adds the style="filter: "
                it needs to simulate opacity under IE (strangely only 7 and 8)

                As the animation isn't important and rarely looked at, we're
                disabling it for all browsers instead of doing user agent sniffing
                which would be the only way to detect this problem.

                if (!silent && !$widget.is(':animated')){
                    $widget.effect('pulsate', {times: 4}, 350);
                }
                */
            }
        });
    });
})(jQuery);

