(function ($) {
    $.fn.extend({
        Scroll: function (options) {
            var defaults = { line: 1, count: 1, speed: 1200, timer: 5000 };
            var options = $.extend(defaults, options);

            return this.each(function () {
                var opt = options;
                var _this = $(this).find("ul:first");
                var lineH = _this.find("li:first").height();
                var upHeight = 0 - opt.line * lineH;
                _this.mouseOver = false;
                _this.mouseover(function () {_this.mouseOver = true;}).mouseout(function () { _this.mouseOver = false; });
                window.setInterval(function () {if (_this.mouseOver)
                return; _this.animate({ marginTop: upHeight }, opt.speed, function () { for (i = 1; i <= opt.count; i++) { _this.find("li:first").appendTo(_this); } _this.css({ marginTop: 0 }); });}, opt.timer);
            });
        }
    });
})(jQuery);

(function ($) {
    $.fn.mytab = function (options) {
        var defaults = {
            event: "mousemove", //click,mousemove
            sedcss: "on",
            nosedcss: ""
        }
        var options = $.extend(defaults, options);
        this.each(function () {
            var tab = $(this);
            $(tab).find("li").bind(options.event, function () {
                tab.find("li").attr("class", options.nosedcss);
                $(this).attr("class", options.sedcss);
                $("#" + tab.attr("id") + "info>div").css("display", "none");
                $("#" + $(this).attr("id") + "info").css("display", "block");
            });
        });
    };
})(jQuery);

$(document).ready(function () {
    $("#scrollDiv").Scroll({ line: 2, count: 12, speed: 1200, timer: 6000 });
});
