$.fn.extend({ TKLPIC: function (options) {


    var auto = null; n = 0; var settings = { imgbox: "#tklwarp", buttonbox: "#tklwarpbox", count: 4, time: 8000, imageHeight: 350 }; options = options || {}; $.extend(settings, options); var li = $(this); li.eq(n).addClass("select"); var ul = $(settings.imgbox + " ul")
    $(settings.imgbox + " ul li img").each(function (index) { $(this).mouseover(function () { clearInterval(auto); }).mouseout(function () { auto = setInterval(nextpic, settings.time); }); }); auto = setInterval(nextpic, settings.time); return this.each(function (index) {
        $(this).mouseover(function () {
            clearInterval(auto);
            li.eq(n).removeClass("select");
            n = index;
            $(this).addClass("select");
            var height = -settings.imageHeight;

            if ($.browser.msie && ($.browser.version == "6.0" || $.browser.version == "7.0")) { height -= 4; ul.stop().animate({ top: (n * height) + "px" }, 250); }
            else if ($.browser.safari || $.browser.mozilla) { height -= 4; ul.stop().animate({ top: (n * height) + "px" }, 250); }
            else
                ul.stop().animate({ top: (n * height) + "px" }, 250);
        }).mouseout(function () { auto = setInterval(nextpic, settings.time); });
    }); function nextpic() {
        li.eq(n).removeClass("select"); n++; if (n == settings.count) n = 0; li.eq(n).addClass("select"); var height = -settings.imageHeight; if ($.browser.msie && ($.browser.version == "6.0" || $.browser.version == "7.0")) { height -= 4; ul.stop().animate({ top: (n * height) + "px" }, 250); }
        else if ($.browser.safari || $.browser.mozilla) { height -= 4; ul.stop().animate({ top: (n * height) + "px" }, 250); }
        else
            ul.stop().animate({ top: (n * height) + "px" }, 250);
    }
}
});
