try {
    document.execCommand("BackgroundImageCache", false, true);
} catch (_$0) { } (function ($) {
    jQuery.fn.extend({
        d_imagechange: function (_) {
            var A = $.extend({
                bg: false,
                title: false,
                desc: false,
                btn: true,
                repeat: "no-repeat",
                bgColor: "#000",
                bgOpacity: 0.5,
                bgHeight: 22,
                titleSize: 14,
                titleFont: "Verdana,\u5b8b\u4f53",
                titleColor: "#FFF",
                titleTop: 4,
                titleLeft: 4,
                descSize: 12,
                descFont: "Verdana,\u5b8b\u4f53",
                descColor: "#FFF",
                descTop: 2,
                descLeft: 4,
                btnColor: "#FFF",
                btnOpacity: 0.8,
                btnFont: "Verdana",
                btnFontSize: 12,
                btnFontColor: "#000",
                btnText: true,
                btnWidth: 15,
                btnHeight: 15,
                btnMargin: 4,
                btnTop: 4,
                playTime: 2000,
                animateTime: 500,
                animateStyle: "o",
                width: 300,
                height: 200
            },
            _);
            return $(this).each(function () {
                var K = $(this),
                I = A.width || K.width(),
                _ = A.height || K.height(),
                D = A.data.length,
                C = 0;
                K.empty().css("overflow", "hidden").width(I).height(_);
                if (A.bg) {
                      $("<div />").appendTo(K).width(I).height(A.bgHeight).css("background-color", A.bgColor).css({"opacity":A.bgOpacity,"filter":"Alpha(opacity="+A.bgOpacity*100+")","-moz-opacity":A.bgOpacity}).css("position", "absolute").css("marginTop", _ - A.bgHeight).css("zIndex", 3333);
                }
                var L = $("<div />").appendTo(K).width(I).height(A.bgHeight).css("position", "absolute").css("marginTop", _ - A.bgHeight).css("zIndex", 6666),
                J = $("<div />").appendTo(K).width(A.data.length * (A.btnWidth + A.btnMargin)).height(A.bgHeight).css("position", "absolute").css("marginTop", _ - A.bgHeight).css("marginLeft", I - (A.btnWidth + A.btnMargin) * D).css("zIndex", 9999).css("display", A.btn ? "block" : "none");
                $("<div />").appendTo(K);
                var H = $("<div />").appendTo(K).width("x,show-x".indexOf(A.animateStyle) != -1 ? I * D : I).height("y,show-y".indexOf(A.animateStyle) != -1 ? _ * D : _);
                $.each(A.data,
                function (C, B) {
                    $("<a />").appendTo(H).width(I).height(_).attr("href", B.href ? B.href : "").attr("target", B.target ? B.target : "").css("display", "block").css("background-repeat", A.repeat).css("display", "block").css("float", "x,show-x".indexOf(A.animateStyle) != -1 ? "left" : "").html("<img src='"+B.src+"' style='width:100%;height:100%;border:0'/>");
                    if (A.title) {
                        $("<b />").appendTo(L).html(B.title ? B.title : "").css("display", C == 0 ? "block" : "none").css("fontSize", A.titleSize).css("fontFamily", A.titleFont).css("color", A.titleColor).css("marginTop", A.titleTop).css("marginLeft", A.titleLeft);
                    }
                    if (A.desc) {
                        $("<p />").appendTo(L).html(B.desc ? B.desc : "").css("display", C == 0 ? "block" : "none").css("fontSize", A.descSize).css("fontFamily", A.descFont).css("color", A.descColor).css("marginTop", A.descTop).css("marginLeft", A.descLeft);
                    }
                    $("<a />").appendTo(J).width(A.btnWidth).height(A.btnHeight).html(A.btnText ? C + 1 : "").css("fontSize", A.btnFontSize).css("fontFamily", A.btnFont).css("textAlign", "center").css("display", "block").css("float", "left").css("overflow", "hidden").css("marginTop", A.btnTop).css("marginRight", A.btnMargin).css("background-color", A.btnColor).css("opacity", C == 0 ? 1 : A.btnOpacity).css("filter","Alpha(Opacity="+A.btnOpacity*100+")").css("color", A.btnFontColor).css("cursor", "pointer");
                });
                var F = J.children("a"),
                N = L.children("b"),
                G = L.children("p"),
                B = H.children("a");
                if ("o,show,none".indexOf(A.animateStyle) != -1) {
                    B.not(":first").hide();
                    B.css("position", "absolute");
                }
                F.click(function () {
                    var $ = F.index(this);
                    if ($ == C) {
                        return;
                    }
                    N.eq(C).css("display", "none");
                    N.eq($).css("display", "block");
                    G.eq(C).css("display", "none");
                    G.eq($).css("display", "block");
                    F.eq(C).css("opacity", A.bgOpacity);
                    F.eq($).css("opacity", 1);
                    switch (A.animateStyle) {
                        case "o":
                            B.eq(C).fadeOut(A.animateTime);
                            B.eq($).fadeIn(A.animateTime);
                            break;
                        case "x":
                            H.animate({
                                marginLeft:
                            -$ * I
                            },
                        A.animateTime);
                            break;
                        case "y":
                            H.animate({
                                marginTop:
                            -$ * _
                            },
                        A.animateTime);
                            break;
                        case "show":
                        case "show-x":
                        case "show-y":
                            B.eq(C).hide(A.animateTime);
                            B.eq($).show(A.animateTime);
                            break;
                        case "none":
                            B.eq(C).hide();
                            B.eq($).show();
                            break;
                    }
                    C = $;
                });
                var M = setInterval(E, A.playTime);
                function E() {
                    F.eq((C + 1) % D).click();
                }
                K.mouseover(function () {
                    clearInterval(M);
                });
                K.mouseout(function () {
                    M = setInterval(E, A.playTime);
                });
            });
        }
    });
})(jQuery);
