

(function($) {
    $.fn.bsMarquee = function(stay) {
        $(this).each(function() {
            if (!$(this).is('nobr'))
                $('nobr', this).bsMarquee(stay);
            else {
                parent = $($(this).parent());
                diff = $(this).width() - parent.width();
                if (diff <= 0) return;
                /*time = diff*60;
                if ($(this).css('margin-left')=='0px')
                    $(this).animate({marginLeft: (0-diff)}, diff*100, 'swing', function() {$(this).bsMarquee();});
                else
                    $(this).animate({marginLeft: 0}, diff*100, 'swing', function() {$(this).bsMarquee();});*/
                time=500;
                $(this).data('diff', diff);
                $(this).mouseenter(function() {
                    
                    $(this).animate({marginLeft: (0-$(this).data('diff'))}, time);
                });
                $(this).mouseleave(function() {
                    $(this).animate({marginLeft: (0)}, time);
                });
            }
        });
    }
    $(function() {
       $('.bsMarquee').bsMarquee(); 
    });
})(jQuery);
