(function (A) {
    A.extend(window, {
        TrendTip: {
            clearScrollInterval: function () {
                clearInterval(this.data("interval"))
            },
            setScrollInterval: function (B) {
                if (this.data("interval")) {
                    this.clearScrollInterval()
                }
                this.data("interval", setInterval(B, 30))
            },
            duplicateContent: function (B) {
                var C = 0;
                B.children().each(function () {
                    C += A(this).text().length + 10;
                    B.append(A(this).clone())
                });
                return C
            },
            initScroller: function () {
                var C = this;
                var E = 0;

                while (E < 700) {
                    E += this.duplicateContent(C);
                }

                var B = 0;
                var D = function () {
                    B = (B % E) - 1;
                    C.css({
                        left: B
                    })
                };
                C.setScrollInterval(D);

                A(this).mouseenter(function () {
                    C.clearScrollInterval()
                });
                A(this).mouseleave(function () {
                    C.setScrollInterval(D)
                });
            }
        }
    });
    A.extend(A.fn, {
        trendTip: function () {
            var B = false;
            var C = A(this);
            A.extend(C, TrendTip);
            C.initScroller();
            return this
        }
    })
})(jQuery);
