
(function (a)
{
    var b;
    a.fn.updateTransition = function (c)
    {
        b.updateTransition(c)
    };
    a.fn.updateTextEffect = function (c)
    {
        b.updateTextEffect(c)
    };
    a.fn.updateCpAlign = function (c)
    {
        b.updateCPanel(c)
    };
    a.fn.displayThumbs = function (c)
    {
        b.showThumbs(c)
    };
    a.fn.displayDButtons = function (c)
    {
        b.showDButtons(c)
    };
    a.fn.displayPlayButton = function (c)
    {
        b.showPlayButton(c)
    };
    a.fn.displayTooltip = function (c)
    {
        b.setTooltip(c)
    };
    a.fn.displayTimerBar = function (c)
    {
        b.setTimerBar(c)
    };
    a.fn.updateMouseoverPause = function (c)
    {
        b.setMouseoverPause(c)
    };
    a.fn.updateMouseoverCP = function (c)
    {
        b.setMouseoverCP(c)
    };
    a.fn.updateMouseoverDesc = function (c)
    {
        b.setMouseoverDesc(c)
    };
    a.fn.wtRotator = function (B)
    {
        var y = "TL";
        var f = "TR";
        var w = "TC";
        var u = "BL";
        var g = "BR";
        var n = "BC";
        var k = new Array(42);
        k.fade = 0;
        k["block.top"] = 1;
        k["block.right"] = 2;
        k["block.bottom"] = 3;
        k["block.left"] = 4;
        k["block.drop"] = 5;
        k["diag.fade"] = 6;
        k["diag.exp"] = 7;
        k["rev.diag.fade"] = 8;
        k["rev.diag.exp"] = 9;
        k["block.fade"] = 10;
        k["block.exp"] = 11;
        k["block.top.zz"] = 12;
        k["block.bottom.zz"] = 13;
        k["block.left.zz"] = 14;
        k["block.right.zz"] = 15;
        k["spiral.in"] = 16;
        k["spiral.out"] = 17;
        k["vert.tl"] = 18;
        k["vert.tr"] = 19;
        k["vert.bl"] = 20;
        k["vert.br"] = 21;
        k["fade.left"] = 22;
        k["fade.right"] = 23;
        k["alt.left"] = 24;
        k["alt.right"] = 25;
        k["blinds.left"] = 26;
        k["blinds.right"] = 27;
        k["vert.random.fade"] = 28;
        k["horz.tl"] = 29;
        k["horz.tr"] = 30;
        k["horz.bl"] = 31;
        k["horz.br"] = 32;
        k["fade.top"] = 33;
        k["fade.bottom"] = 34;
        k["alt.top"] = 35;
        k["alt.bottom"] = 36;
        k["blinds.top"] = 37;
        k["blinds.bottom"] = 38;
        k["horz.random.fade"] = 39;
        k.none = 40;
        k.random = 41;
        var z = new Array(4);
        z.fade = 0;
        z.down = 1;
        z.right = 2;
        z.none = 3;
        var q = 5000;
        var x = 800;
        var v = 600;
        var m = 600;
        var h = 0.5;
        var c = 0.75;
        var p = "update_text";
        function d(G, P, N, R, M, H, I)
        {
            var J;
            var E;
            var L;
            var Q = null;
            var S = function ()
            {
                L = Math.ceil(P / R);
                var U = "";
                for (var T = 0; T < L; T++) {
                    U += "<div class='vpiece' id='" + T + "'></div>"
                }
                G.addToScreen(U);
                J = a("div.vpiece", G.$el);
                E = new Array(L);
                J.each(function (V)
                {
                    a(this).css({
                        left : (V * R), height : N
                    });
                    E[V] = a(this);
                })
            };
            this.clear = function ()
            {
                clearInterval(Q);
                J.stop(true).css({
                    "z-index" : 2, opacity : 0
                })
            };
            this.displayContent = function (T, U)
            {
                D(T, U);
                if (U == k["vert.random.fade"]) {
                    O(T)
                }
                else {
                    F(T, U)
                }
            };
            var D = function (T, U)
            {
                switch (U)
                {
                    case k["vert.tl"]:
                    case k["vert.tr"]:
                        K(T, - N, 1, R, false);
                        break;
                    case k["vert.bl"]:
                    case k["vert.br"]:
                        K(T, N, 1, R, false);
                        break;
                    case k["alt.left"]:
                    case k["alt.right"]:
                        K(T, 0, 1, R, true);
                        break;
                    case k["blinds.left"]:
                    case k["blinds.right"]:
                        K(T, 0, 1, 0, false);
                        break;
                    default:
                        K(T, 0, 0, R, false)
                }
            };
            var K = function (T, Z, aa, V, Y)
            {
                var ac = T.attr("src");
                var ab = (N - T.height()) / 2;
                var U = (P - T.width()) / 2;
                for (var W = 0; W < L; W++)
                {
                    var X = ((-W * R) + U);
                    if (Y) {
                        Z = (W % 2) == 0 ?- N : N
                    }
                    a(J.get(W)).css(
                    {
                        background : M + " url('" + ac + "') no-repeat", backgroundPosition : X + "px " + ab + "px", 
                        opacity : aa, top : Z, width : V, "z-index" : 3
                    })
                }
            };
            var F = function (V, W)
            {
                var Y, U, X, T;
                switch (W)
                {
                    case k["vert.tl"]:
                    case k["vert.bl"]:
                    case k["fade.left"]:
                    case k["blinds.left"]:
                    case k["alt.left"]:
                        Y = 0;
                        U = L - 1;
                        X = 1;
                        break;
                    default:
                        Y = L - 1;
                        U = 0;
                        X =- 1
                }
                Q = setInterval(function ()
                {
                    a(J.get(Y)).animate({
                        top : 0, opacity : 1, width : R
                    },
                    H, "", function ()
                    {
                        if (a(this).attr("id") == U) {
                            G.setComplete(V)
                        }
                    });
                    if (Y == U) {
                        clearInterval(Q)
                    }
                    Y += X
                }, I)
            };
            var O = function (U)
            {
                s(E);
                var T = 0;
                var V = 0;
                Q = setInterval(function ()
                {
                    E[T++].animate({
                        opacity : 1
                    },
                    H, "", function ()
                    {
                        if (++V == L) {
                            G.setComplete(U)
                        }
                    });
                    if (T == L) {
                        clearInterval(Q)
                    }
                }, I)
            };
            S()
        }
        function t(G, P, N, R, M, H, I)
        {
            var J;
            var E;
            var L;
            var Q = null;
            var S = function ()
            {
                L = Math.ceil(N / R);
                var U = "";
                for (var T = 0; T < L; T++) {
                    U += "<div class='hpiece' id='" + T + "'></div>"
                }
                G.addToScreen(U);
                J = a("div.hpiece", G.$el);
                E = new Array(L);
                J.each(function (V)
                {
                    a(this).css({
                        top : (V * R), width : P
                    });
                    E[V] = a(this);
                })
            };
            this.clear = function ()
            {
                clearInterval(Q);
                J.stop(true).css({
                    "z-index" : 2, opacity : 0
                })
            };
            this.displayContent = function (T, U)
            {
                D(T, U);
                if (U == k["horz.random.fade"]) {
                    O(T)
                }
                else {
                    F(T, U)
                }
            };
            var D = function (T, U)
            {
                switch (U)
                {
                    case k["horz.tr"]:
                    case k["horz.br"]:
                        K(T, P, 1, R, false);
                        break;
                    case k["horz.tl"]:
                    case k["horz.bl"]:
                        K(T, - P, 1, R, false);
                        break;
                    case k["alt.top"]:
                    case k["alt.bottom"]:
                        K(T, 0, 1, R, true);
                        break;
                    case k["blinds.top"]:
                    case k["blinds.bottom"]:
                        K(T, 0, 1, 0, false);
                        break;
                    default:
                        K(T, 0, 0, R, false)
                }
            };
            var K = function (T, W, Z, ab, Y)
            {
                var ac = T.attr("src");
                var aa = (N - T.height()) / 2;
                var U = (P - T.width()) / 2;
                for (var X = 0; X < L; X++)
                {
                    var V = ((-X * R) + aa);
                    if (Y) {
                        W = (X % 2) == 0 ?- P : P
                    }
                    a(J.get(X)).css(
                    {
                        background : M + " url('" + ac + "') no-repeat", backgroundPosition : U + "px " + V + "px", 
                        opacity : Z, left : W, height : ab, "z-index" : 3
                    })
                }
            };
            var F = function (U, V)
            {
                var X, T, W;
                switch (V)
                {
                    case k["horz.tl"]:
                    case k["horz.tr"]:
                    case k["fade.top"]:
                    case k["blinds.top"]:
                    case k["alt.top"]:
                        X = 0;
                        T = L - 1;
                        W = 1;
                        break;
                    default:
                        X = L - 1;
                        T = 0;
                        W =- 1
                }
                Q = setInterval(function ()
                {
                    a(J.get(X)).animate({
                        left : 0, opacity : 1, height : R
                    },
                    H, "", function ()
                    {
                        if (a(this).attr("id") == T) {
                            G.setComplete(U)
                        }
                    });
                    if (X == T) {
                        clearInterval(Q)
                    }
                    X += W
                }, I)
            };
            var O = function (U)
            {
                s(E);
                var T = 0;
                var V = 0;
                Q = setInterval(function ()
                {
                    E[T++].animate({
                        opacity : 1
                    },
                    H, "", function ()
                    {
                        if (++V == L) {
                            G.setComplete(U)
                        }
                    });
                    if (T == L) {
                        clearInterval(Q)
                    }
                }, I)
            };
            S()
        }
        function l(N, O, J, P, M, D, W)
        {
            var L;
            var E;
            var Q;
            var I;
            var K;
            var Y;
            var X;
            var V = function ()
            {
                I = Math.ceil(J / P);
                K = Math.ceil(O / P);
                Y = I * K;
                var ac = "";
                for (var ab = 0; ab < I; ab++) {
                    for (var aa = 0; aa < K; aa++) {
                        ac += "<div class='block' id='" + ab + "-" + aa + "'></div>"
                    }
                }
                N.addToScreen(ac);
                E = a("div.block", N.$el);
                E.data({
                    tlId : "0-0", trId : "0-" + (K - 1), blId : (I - 1) + "-0", brId : (I - 1) + "-" + (K - 1)
                });
                var Z = 0;
                Q = new Array(Y);
                L = new Array(I);
                for (var ab = 0; ab < I; ab++)
                {
                    L[ab] = new Array(K);
                    for (var aa = 0; aa < K; aa++) {
                        L[ab][aa] = Q[Z++] = E.filter("#" + (ab + "-" + aa)).data("top", ab * P);
                    }
                }
            };
            this.clear = function ()
            {
                clearInterval(X);
                E.stop(true).css({
                    "z-index" : 2, opacity : 0
                })
            };
            this.displayContent = function (Z, aa)
            {
                switch (aa)
                {
                    case k["diag.fade"]:
                        S(Z, 0, P, 0);
                        T(Z, {
                            opacity : 1
                        }, false);
                        break;
                    case k["diag.exp"]:
                        S(Z, 0, 0, 0);
                        T(Z, {
                            opacity : 1, width : P, height : P
                        }, false);
                        break;
                    case k["rev.diag.fade"]:
                        S(Z, 0, P, 0);
                        T(Z, {
                            opacity : 1
                        }, true);
                        break;
                    case k["rev.diag.exp"]:
                        S(Z, 0, 0, 0);
                        T(Z, {
                            opacity : 1, width : P, height : P
                        }, true);
                        break;
                    case k["block.fade"]:
                        S(Z, 0, P, 0);
                        F(Z);
                        break;
                    case k["block.exp"]:
                        S(Z, 1, 0, 0);
                        F(Z);
                        break;
                    case k["block.drop"]:
                        S(Z, 1, P, - (I * P));
                        F(Z);
                        break;
                    case k["block.top.zz"]:
                    case k["block.bottom.zz"]:
                        S(Z, 0, P, 0);
                        H(Z, aa);
                        break;
                    case k["block.left.zz"]:
                    case k["block.right.zz"]:
                        S(Z, 0, P, 0);
                        R(Z, aa);
                        break;
                    case k["spiral.in"]:
                        S(Z, 0, P, 0);
                        U(Z, false);
                        break;
                    case k["spiral.out"]:
                        S(Z, 0, P, 0);
                        U(Z, true);
                        break;
                    default:
                        S(Z, 1, 0, 0);
                        G(Z, aa)
                }
            };
            var S = function (Z, af, aj, ae)
            {
                var ag = (J - Z.height()) / 2;
                var ab = (O - Z.width()) / 2;
                var ah = Z.attr("src");
                for (var ad = 0; ad < I; ad++)
                {
                    for (var ac = 0; ac < K; ac++)
                    {
                        var ai = ((-ad * P) + ag);
                        var aa = ((-ac * P) + ab);
                        L[ad][ac].css(
                        {

                            background : M + " url('" + ah + "') no-repeat", backgroundPosition : aa + "px " + ai + "px", 
                            opacity : af, top : (ad * P) + ae, left : (ac * P), width : aj, height : aj, 
                            "z-index" : 3
                        })
                    }
                }
            };
            var T = function (Z, ah, ae)
            {
                var ag = new Array(Y);
                var aa, ad, ab, ac;
                var ai = (I - 1) + (K - 1);
                if (ae) {
                    aa = ai;
                    ad =- 1;
                    ab =- 1;
                    ac = E.data("tlId")
                }
                else {
                    aa = 0;
                    ad = ai + 1;
                    ab = 1;
                    ac = E.data("brId")
                }
                var af = 0;
                while (aa != ad)
                {
                    i = Math.min(I - 1, aa);
                    while (i >= 0) {
                        j = Math.abs(i - aa);
                        if (j >= K) {
                            break
                        }
                        ag[af++] = L[i][j];
                        i--
                    }
                    aa += ab
                }
                af = 0;
                X = setInterval(function ()
                {
                    ag[af++].animate(ah, D, "", function ()
                    {
                        if (a(this).attr("id") == ac) {
                            N.setComplete(Z)
                        }
                    });
                    if (af == Y) {
                        clearInterval(X)
                    }
                }, W)
            };
            var R = function (ac, ad)
            {
                var ab = true;
                var aa = 0, Z, af, ae;
                if (ad == k["block.left.zz"]) {
                    ae = (K % 2 == 0) ? E.data("trId") : E.data("brId");
                    Z = 0;
                    af = 1
                }
                else {
                    ae = (K % 2 == 0) ? E.data("tlId") : E.data("blId");
                    Z = K - 1;
                    af =- 1
                }
                X = setInterval(function ()
                {
                    L[aa][Z].animate({
                        opacity : 1
                    },
                    D, "", function ()
                    {
                        if (a(this).attr("id") == ae) {
                            N.setComplete(ac)
                        }
                    });
                    if (L[aa][Z].attr("id") == ae) {
                        clearInterval(X)
                    }
                    (ab ? aa++: aa--);
                    if (aa == I || aa < 0) {
                        ab = !ab;
                        aa = (ab ? 0 : I - 1);
                        Z += af
                    }
                }, W)
            };
            var H = function (ac, ad)
            {
                var ab = true;
                var aa, Z = 0, af, ae;
                if (ad == k["block.top.zz"]) {
                    ae = (I % 2 == 0) ? E.data("blId") : E.data("brId");
                    aa = 0;
                    af = 1
                }
                else {
                    ae = (I % 2 == 0) ? E.data("tlId") : E.data("trId");
                    aa = I - 1;
                    af =- 1
                }
                X = setInterval(function ()
                {
                    L[aa][Z].animate({
                        opacity : 1
                    },
                    D, "", function ()
                    {
                        if (a(this).attr("id") == ae) {
                            N.setComplete(ac)
                        }
                    });
                    if (L[aa][Z].attr("id") == ae) {
                        clearInterval(X)
                    }
                    (ab ? Z++: Z--);
                    if (Z == K || Z < 0) {
                        ab = !ab;
                        Z = (ab ? 0 : K - 1);
                        aa += af
                    }
                }, W)
            };
            var G = function (ab, ac)
            {
                var ae = new Array(Y);
                var af;
                var ad = 0;
                switch (ac)
                {
                    case k["block.left"]:
                        af = E.data("brId");
                        for (var Z = 0; Z < K; Z++) {
                            for (var aa = 0; aa < I; aa++) {
                                ae[ad++] = L[aa][Z];
                            }
                        }
                        break;
                    case k["block.right"]:
                        af = E.data("blId");
                        for (var Z = K - 1; Z >= 0; Z--) {
                            for (var aa = 0; aa < I; aa++) {
                                ae[ad++] = L[aa][Z];
                            }
                        }
                        break;
                    case k["block.top"]:
                        af = E.data("brId");
                        for (var aa = 0; aa < I; aa++) {
                            for (var Z = 0; Z < K; Z++) {
                                ae[ad++] = L[aa][Z];
                            }
                        }
                        break;
                    default:
                        af = E.data("trId");
                        for (var aa = I - 1; aa >= 0; aa--) {
                            for (var Z = 0; Z < K; Z++) {
                                ae[ad++] = L[aa][Z];
                            }
                        }
                }
                ad = 0;
                X = setInterval(function ()
                {
                    ae[ad++].animate({
                        width : P, height : P
                    },
                    D, "", function ()
                    {
                        if (a(this).attr("id") == af) {
                            N.setComplete(ab)
                        }
                    });
                    if (ad == Y) {
                        clearInterval(X)
                    }
                }, W)
            };
            var F = function (aa)
            {
                s(Q);
                var Z = 0;
                count = 0;
                X = setInterval(function ()
                {
                    Q[Z].animate({
                        top : Q[Z].data("top"), width : P, height : P, opacity : 1
                    },
                    D, "", function ()
                    {
                        if (++count == Y) {
                            N.setComplete(aa)
                        }
                    });
                    Z++;
                    if (Z == Y) {
                        clearInterval(X)
                    }
                }, W)
            };
            var U = function (Z, ah)
            {
                var ag = 0, af = 0;
                var ak = I - 1;
                var al = K - 1;
                var ab = 0;
                var ae = al;
                var aj = new Array();
                while (ak >= 0 && al >= 0)
                {
                    var ai = 0;
                    while (true)
                    {
                        aj[aj.length] = L[ag][af];
                        if ((++ai) > ae) {
                            break
                        }
                        switch (ab) {
                            case 0:
                                af++;
                                break;
                            case 1:
                                ag++;
                                break;
                            case 2:
                                af--;
                                break;
                            case 3:

                                ag--
                        }
                    }
                    switch (ab)
                    {
                        case 0:
                            ab = 1;
                            ae = (--ak);
                            ag++;
                            break;
                        case 1:
                            ab = 2;
                            ae = (--al);
                            af--;
                            break;
                        case 2:
                            ab = 3;
                            ae = (--ak);
                            ag--;
                            break;
                        case 3:
                            ab = 0;
                            ae = (--al);
                            af++
                    }
                }
                if (aj.length > 0)
                {
                    if (ah) {
                        aj.reverse()
                    }
                    var ad = aj.length - 1;
                    var aa = aj[ad].attr("id");
                    var ac = 0;
                    X = setInterval(function ()
                    {
                        aj[ac].animate({
                            opacity : 1
                        },
                        D, "", function ()
                        {
                            if (a(this).attr("id") == aa) {
                                N.setComplete(Z)
                            }
                        });
                        if (ac == ad) {
                            clearInterval(X)
                        }
                        ac++
                    }, W)
                }
            };
            V()
        }
        function A(bb, a8)
        {
            var ai = e(a8.width, 1000);
            var a3 = e(a8.height, 307);
            var aZ = C(a8.button_margin, 4);
            var ah = a8.transition.toLowerCase();
            var am = e(a8.transition_speed, x);
            var V = e(a8.delay, q);
            var az = a8.auto_start;
            var aP = a8.cpanel_align.toUpperCase();
            var ac = e(a8.button_width, 24);
            var aJ = e(a8.button_height, 24);
            var F = a8.display_thumbs;
            var ax = a8.display_dbuttons;
            var aw = a8.display_playbutton;
            var ar = a8.display_tooltip;
            var ag = a8.display_numbers;
            var Y = a8.display_timer;
            var aq = a8.cpanel_mouseover;
            var ao = a8.text_mouseover;
            var aX = a8.mouseover_pause;
            var an = a8.text_effect.toLowerCase();
            var O = a8.shuffle;
            var ad;
            var ak;
            var H;
            var Q;
            var aB;
            var aK;
            var aU = null;
            var aQ = a(".wt-rotator", bb);
            var al = aQ.find(">a:first");
            var aE = aQ.find("div.desc");
            var E = aQ.find("div.preloader");
            var I = aQ.find("div.c-panel");
            var aM = aQ.find("div.thumbnails");
            var Z = aM.find(">ul:first>li");
            var J = aQ.find("div.buttons");
            var R = J.find("div.play-btn");
            var P = J.find("div.prev-btn");
            var aV = J.find("div.next-btn");
            var S;
            var L;
            var au;
            var X;
            this.$el = bb;
            this.init = function ()
            {
				ak = 0;
                ad = Z.size();
                au = new Array(ad);
                var bc = aQ.css("background-color");
                aQ.css({
                    width : ai, height : a3
                });
                E.css({
                    top : Math.round((a3 - E.outerHeight()) / 2), left : Math.round((ai - E.outerWidth()) / 2)
                }).show();
               
				aA();
                aN();
                aH();
                a7();
                ap(); 
                Q = new d(this, ai, a3, e(a8.vert_size, 50), bc, am, e(a8.vstripe_delay, 75));
                aB = new t(this, ai, a3, e(a8.horz_size, 50), bc, am, e(a8.hstripe_delay, 75));
                aK = new l(this, ai, a3, e(a8.block_size, 75), bc, am, e(a8.block_delay, 25));
                aS(0);
                av(ak)
            };
            this.setComplete = function (bc)
            {
                D(bc)
            };
            this.addToScreen = function (bc)
            {
                al.append(bc)
            };
            var aA = function ()
            {
                aE.append("<div class='inner-bg'></div><div class='inner-text'></div>");
                X = aE.find("div.inner-text");
                aE.find("div.inner-bg").css("opacity", c);
                if (ao) {
                    aQ.hover(ab, af)
                }
                else {
                    aQ.bind(p, aO)
                }
            };
            var a7 = function ()
            {
                if (F || ax || aw)
                {
                    I.css(
                    {
                        width : J.outerWidth(true) + aM.outerWidth(true), "margin-top" : aZ, "margin-right" : 16, 
                        "margin-bottom" : aZ+10, "margin-left" : aZ
                    });
                    var bd = I.outerWidth(true);
                    var bc = I.outerHeight(true);
                    switch (aP)
                    {
                        case y:
                            aR(0, 0, - bc, "left");
                            break;
                        case w:
                            aR(0, Math.round((ai - bd) / 2), - bc, "right");
                            break;
                        case f:
                            aR(0, (ai - bd), - bc, "right");
                            break;
                        case u:
                            aR((a3 - bc), 0, a3, "left");
                            break;
                        case n:
                            aR((a3 - bc), Math.round((ai - bd) / 2), a3, "right");
                            break;
                        default:
                            aR((a3 - bc), (ai - bd), a3, "right")
                    }
                    if (aq) {
                        aQ.hover(a9, at)
                    }
                    I.css("visibility", "visible")
                }
            };
            var aR = function (bc, be, bd, bf)
            {
                I.data({
                    offset : bd, pos : bc
                }).css({
                    top : (aq ? bd : bc), left : be
                });
                aM.css("float", bf);
                J.css("float", bf)
            };
            var aH = function ()
            {
                var bc = {
                    "margin-right" : aZ, width : ac, height : aJ
                };
                if (ax)
                {
                    P.css(bc).click(aj).mouseover(G).mouseout(aL).mousedown(ae);
                    aV.css(bc).click(K).mouseover(G).mouseout(aL).mousedown(ae)
                }
                else {
                    P.hide();
                    aV.hide()
                }
                if (aw)
                {
                    if (az) {
                        R.addClass("pause")
                    }
                    R.css(bc).click(aa).mouseover(G).mouseout(aL).mousedown(ae)
                }
                else {
                    R.hide()
                }
                if (aX) {
                    aQ.hover(aD, W)
                }
            };
            var ap = function ()
            {
                aQ.append("<div id='timer'></div>");
                S = aQ.find("#timer").data("pct", 1);
                if (Y)
                {
                    S.css({
                        opacity : h, visibility : "visible"
                    });
                    switch (aP) {
                        case y:
                        case w:
                        case f:
                            S.css("top", a3 - S.height());
                            break;
                        default:
                            S.css("top", 0)
                    }
                }
                else {
                    S.hide()
                }
            };
            var aN = function ()
            {
                var bc = X.outerHeight() - X.height();
                Z.each(function (be)
                {
                    var bd = a(this).find(">a:first");
                    a(this).data(
                    {
                        imgurl : bd.attr("href"), caption : bd.attr("title"), effect : k[a(this).attr("effect")] != undefined ? k[a(this).attr("effect")] : k[ah], 
                        delay : e(a(this).attr("delay"), V)
                    });
                    a0(a(this), bc);
                    au[be] = a(this);
                    if (ag) {
                        a(this).append(be + 1)
                    }
                });
                X.css({
                    width : "auto", height : "auto"
                }).html("");
                aE.css("visibility", "visible");
                if (O) {
                    N()
                }
                if (F)
                {
                    Z.css({
                        width : ac, height : aJ, "line-height" : aJ + "px", "margin-right" : aZ
                    }).click(aF).mouseover(a2).mouseout(U).mousedown(ae);
                    a1()
                }
                else {
                    Z.hide()
                }
            };
            var a0 = function (bc, be)
            {
                var bd = bc.find(">div:first");
                var bg = e(parseInt(bd.css("width")), 280);
                var bf = e(parseInt(bd.css("height")), 0);
                X.width(bg).html(bd.html());
                if (bf < X.height()) {
                    bf = X.height()
                }
                bc.data("textbox", {
                    x : bd.css("left"), y : bd.css("top"), w : (bg + be), h : (bf + be)
                })
            };
            var a1 = function ()
            {
                if (ar)
                {
                    L = a("<div id='tool-tip'></div>");
                    a("body").append(L);
                    switch (aP)
                    {
                        case y:
                        case w:
                        case f:
                            L.data({
                                bottom : true, yOffset : 23
                            });
                            break;
                        default:
                            L.data({
                                bottom : false, yOffset : 5
                            })
                    }
                    for (var bd = 0; bd < au.length; bd++)
                    {
                        var bc = au[bd].data("caption");
                        if (bc != "") {
                            au[bd].mouseover(a5).mouseout(aC).bind("mousemove", T)
                        }
                    }
                }
            };
            var a5 = function (bc)
            {
                var bd = L.data("bottom") ? L.data("yOffset") :- (L.outerHeight() + L.data("yOffset"));
                L.html(au[a(this).index()].data("caption")).css({
                    top : bc.pageY + bd, left : bc.pageX - 8
                }).stop(true, true).delay(m).fadeIn(300)
            };
            var aC = function ()
            {
                L.stop(true, true).fadeOut(0)
            };
            var T = function (bc)
            {
                var bd = L.data("bottom") ? L.data("yOffset") :- (L.outerHeight() + L.data("yOffset"));
                L.css({
                    top : bc.pageY + bd, left : bc.pageX - 8
                })
            };
            var a9 = function ()
            {

                I.stop(true).animate({
                    top : I.data("pos"), opacity : 1
                }, v)
            };
            var at = function ()
            {
                I.stop(true).animate({
                    top : I.data("offset"), opacity : 0
                }, v)
            };
            var aF = function ()
            {
                aW();
                ak = a(this).index();
                av(ak);
                return false;
            };
            var a2 = function ()
            {
                a(this).addClass("thumb-over")
            };
            var U = function ()
            {
                a(this).removeClass("thumb-over")
            };
            var aj = function ()
            {
                aW();
                ak = (ak > 0) ? (ak - 1) : (ad - 1);
                av(ak);
                return false;
            };
            var K = function ()
            {
                aW();
                ak = (ak < ad - 1) ? (ak + 1) : 0;
                av(ak);
                return false;
            };
            var aa = function ()
            {
                az = !az;
                a(this).toggleClass("pause", az);
                az ? aG() : M();
                return false;
            };
            var W = function ()
            {
                az = true;
                R.toggleClass("pause", az);
                aG()
            };
            var aD = function ()
            {
                az = false;
                R.toggleClass("pause", az);
                M()
            };
            var G = function ()
            {
                a(this).addClass("button-over")
            };
            var aL = function ()
            {
                a(this).removeClass("button-over")
            };
            var aO = function (bd)
            {
                if (!aE.data("visible"))
                {
                    aE.data("visible", true);
                    var be = au[ak].find(">div:first").html();
                    if (be && be.length > 0)
                    {
                        var bc = au[ak].data("textbox");
                        switch (z[an])
                        {
                            case z.fade:
                                aI(be, bc);
                                break;
                            case z.down:
                                aY(be, {
                                    opacity : 1, top : bc.y, left : bc.x, width : bc.w, height : 0
                                },
                                {
                                    height : bc.h
                                });
                                break;
                            case z.right:
                                aY(be, {
                                    opacity : 1, top : bc.y, left : bc.x, width : 0, height : bc.h
                                },
                                {
                                    width : bc.w
                                });
                                break;
                            default:
                                ba(be, bc)
                        }
                    }
                }
            };
            var a4 = function ()
            {
                aE.data("visible", false).stop(true).css({
                    opacity : 0
                })
            };
            var aY = function (be, bd, bc)
            {
                X.html("");
                aE.stop(true).css(bd).animate(bc, v, function ()
                {
                    X.html(be)
                })
            };
            var aI = function (bd, bc)
            {
                X.stop().css("opacity", 0).html(bd).animate({
                    opacity : 1
                }, v);
                aE.stop(true).css({
                    top : bc.y, left : bc.x, width : bc.w, height : bc.h
                }).animate({
                    opacity : 1
                }, v)
            };
            var ba = function (bd, bc)
            {
                aE.stop(true).css({
                    opacity : 1, top : bc.y, left : bc.x, width : bc.w, height : bc.h
                });
                X.html(bd)
            };
            var ab = function ()
            {
                aQ.unbind(p).bind(p, aO).trigger(p)
            };
            var af = function ()
            {
                aQ.unbind(p);
                a4()
            };
            var av = function (be)
            {
                Z.filter(".curr-thumb").removeClass("curr-thumb");
                a(Z.get(be)).addClass("curr-thumb");
                H = au[be].data("delay");
                a4();
                var bf = au[be].find(">a:nth-child(2)");
                var bc = bf.attr("href");
                if (bc)
                {
                    al.unbind("click").css({
                        cursor : "pointer"
                    }).attr({
                        href : bc, target : bf.attr("target")
                    })
                }
                else {
                    al.click(ae).css({
                        cursor : "default"
                    })
                }
                if (au[be].data("img")) {
                    E.hide();
                    ay(au[be].data("img"))
                }
                else
                {
                    var bd = a("<img class='main-img'/>");
                    bd.attr("src", au[be].data("imgurl"));
                    if (!bd[0].complete)
                    {
                        E.show();
                        bd.load(function ()
                        {
                            E.hide();
                            a6(au[be], a(this));
                            ay(a(this))
                        }).error(function ()
                        {
                            alert("Error loading image")
                        })
                    }
                    else {
                        E.hide();
                        a6(au[be], bd);
                        ay(bd)
                    }
                }
            };
            var ay = function (bc)
            {
                Q.clear();
                aB.clear();
                aK.clear();
                var bd = au[ak].data("effect");
                if (bd == k.none) {
                    D(bc);
                    return
                }
                if (bd == k.random) {
                    bd = Math.floor(Math.random() * (k.length - 2))
                }
                if (bd == k.fade) {
                    aT(bc)
                }
                else
                {
                    if (bd < k["vert.tl"]) {
                        aK.displayContent(bc, bd)
                    }
                    else {
                        if (bd < k["horz.tl"]) {
                            Q.displayContent(bc, bd)
                        }
                        else {
                            aB.displayContent(bc, bd)
                        }
                    }
                }
            };
            var D = function (bc)
            {
                aQ.trigger(p);
                a("img.main-img", al).removeAttr("id").hide();
                bc.attr("id", "curr-img").show();
                aG()
            };
            var aT = function (bc)
            {
                a("img#curr-img", al).stop(true, true);
                a("img.main-img", al).removeAttr("id").css("z-index", 0);
                bc.attr("id", "curr-img").css("z-index", 1).stop(true, true).fadeIn(am, function ()
                {
                    a("img.main-img:not('#curr-img')", al).hide();
                    aQ.trigger(p);
                    aG()
                })
            };
            var aS = function (bd)
            {
                var bc = au[bd];
                var be = a("<img class='main-img'/>");
                be.attr("src", bc.data("imgurl"));
                be.load(function ()
                {
                    if (!bc.data("img")) {
                        a6(bc, a(this))
                    }
                    bd++;
                    if (bd < au.length) {
                        aS(bd)
                    }
                }).error(function ()
                {
                    bd++;
                    if (bd < au.length) {
                        aS(bd)
                    }
                })
            };
            var a6 = function (be, bg)
            {
                al.append(bg);
                var bj = (a3 - bg.height()) / 2;
                var bf = (ai - bg.width()) / 2;
                var bi = 0, bh = 0, bd = 0, bc = 0;
                if (bj > 0) {
                    bd = bj
                }
                else {
                    if (bj < 0) {
                        bi = bj;
                    }
                }
                if (bf > 0) {
                    bc = bf
                }
                else {
                    if (bf < 0) {
                        bh = bf;
                    }
                }
                bg.css(
                {
                    top : bi, left : bh, "padding-top" : bd, "padding-bottom" : bd, "padding-left" : bc, 
                    "padding-right" : bc
                });
                be.data("img", bg)
            };
            var aG = function ()
            {
                if (az && aU == null)
                {
                    var bc = Math.round(S.data("pct") * H);
                    S.animate({
                        width : (ai + 2)
                    }, bc);
                    aU = setTimeout(K, bc);
                }
            };
            var aW = function ()
            {
                clearTimeout(aU);
                aU = null;
                S.stop(true).width(0).data("pct", 1)
            };
            var M = function ()
            {
                clearTimeout(aU);
                aU = null;
                var bc = 1 - (S.width() / (ai + 2));
                S.stop(true).data("pct", bc)
            };
            var N = function ()
            {
                for (var be = 0; be < au.length; be++) {
                    var bc = Math.floor(Math.random() * au.length);
                    var bd = au[be];
                    au[be] = au[bc];
                    au[bc] = bd;
                }
            };
            var ae = function ()
            {
                return false;
            };
            this.setMouseoverPause = function (bc)
            {
                aX = bc;
                if (aX) {
                    aQ.bind("mouseenter", aD).bind("mouseleave", W)
                }
                else {
                    aQ.unbind("mouseenter", aD).unbind("mouseleave", W)
                }
            };
            this.setMouseoverCP = function (bc)
            {
                aq = bc;
                if (aq) {
                    aQ.bind("mouseenter", a9).bind("mouseleave", at);
                    at()
                }
                else {
                    aQ.unbind("mouseenter", a9).unbind("mouseleave", at);
                    a9()
                }
            };
            this.setMouseoverDesc = function (bc)
            {
                descMouseover = bc;
                if (descMouseover) {
                    aQ.bind("mouseenter", ab).bind("mouseleave", af);
                    af()
                }
                else {
                    aQ.unbind("mouseenter", ab).unbind("mouseleave", af);
                    ab()
                }
            };
            this.updateTransition = function (bc)
            {
                ah = bc;
                Z.each(function (bd)
                {
                    a(this).data("effect", k[ah])
                })
            };
            this.updateTextEffect = function (bc)
            {
                an = bc;
            };
            this.showThumbs = function (bc)
            {
                F = bc;
                if (F) {
                    aM.width(240).show()
                }
                else {
                    aM.hide().width(0)
                }
                this.updateCPanel(aP)
            };
            this.showDButtons = function (bc)
            {
                ax = bc;
                if (ax)
                {
                    P.show();
                    aV.show();
                    if (aw) {
                        J.width(R.outerWidth(true) + P.outerWidth(true) + aV.outerWidth(true))
                    }
                    else {
                        J.width(P.outerWidth(true) + aV.outerWidth(true))
                    }
                }
                else {
                    P.hide();
                    aV.hide();
                    if (aw) {
                        J.width(R.outerWidth(true))
                    }
                    else {
                        J.width(0)
                    }
                }
                this.updateCPanel(aP)
            };
            this.showPlayButton = function (bc)
            {
                aw = bc;
                if (aw)
                {
                    R.show();
                    if (ax) {
                        J.width(R.outerWidth(true) + P.outerWidth(true) + aV.outerWidth(true))
                    }
                    else {
                        J.width(R.outerWidth(true))
                    }
                }
                else {
                    R.hide();
                    if (ax) {
                        J.width(P.outerWidth(true) + aV.outerWidth(true))
                    }
                    else {
                        J.width(0)
                    }
                }
                this.updateCPanel(aP)
            };
            this.setTooltip = function (bc)
            {
                ar = bc;
                if (ar) {
                    Z.bind("mouseover", a5).bind("mousemove", T).mouseout(aC)
                }
                else {
                    Z.unbind("mouseover", a5).unbind("mousemove", T).unbind("mouseout", aC)
                }
            };
            this.setTimerBar = function (bc)
            {
                Y = bc;
                if (Y) {
                    S.css({
                        visibility : "visible"
                    }).show()
                }
                else {
                    S.css({
                        visibility : "hidden"
                    }).hide()
                }
            };
            this.updateCPanel = function (bc)
            {
                aP = bc;
                I.css({
                    width : J.outerWidth(true) + aM.outerWidth(true)
                });
                switch (aP)
                {
                    case y:
                        aR(0, 0, - I.outerHeight(true), "left");
                        S.css("top", a3 - S.height());
                        L.data({
                            bottom : true, yOffset : 23
                        });
                        break;
                    case w:
                        aR(0, Math.floor((ai - I.outerWidth(true)) / 2), - I.outerHeight(true), "right");
                        S.css("top", a3 - S.height());
                        L.data({
                            bottom : true, yOffset : 23
                        });
                        break;
                    case f:
                        aR(0, ai - I.outerWidth(true), - I.outerHeight(true), "right");
                        S.css("top", a3 - S.height());
                        L.data({
                            bottom : true, yOffset : 23
                        });
                        break;
                    case u:
                        aR(a3 - I.outerHeight(true), 0, a3, "left");
                        S.css("top", 0);
                        L.data({
                            bottom : false, yOffset : 5
                        });
                        break;
                    case n:
                        aR(a3 - I.outerHeight(true), Math.floor((ai - I.outerWidth(true)) / 2), a3, "right");
                        S.css("top", 0);
                        L.data({
                            bottom : false, yOffset : 5
                        });
                        break;
                    default:
                        aR(a3 - I.outerHeight(true), ai - I.outerWidth(true), a3, "right");
                        S.css("top", 0);
                        L.data({
                            bottom : false, yOffset : 5
                        })
                }
            }
        }
        var e = function (D, E)
        {
            if (!isNaN(D) && D > 0) {
                return D
            }
            return E;
        };
        var C = function (D, E)
        {
            if (!isNaN(D) && D >= 0) {
                return D
            }
            return E;
        };
        var s = function (D)
        {
            var H = D.length;
            for (var G = 0; G < H; G++) {
                var E = Math.floor(Math.random() * H);
                var F = D[G];
                D[G] = D[E];
                D[E] = F;
            }
        };
        var o = 
        {
            width : 1000, height : 307, button_width : 24, button_height : 24, button_margin : 4, auto_start : true, 
            delay : q, transition : "fade", transition_speed : x, cpanel_align : g, display_thumbs : true, 
            display_dbuttons : true, display_playbutton : true, display_tooltip : true, display_numbers : true, 
            display_timer : true, mouseover_pause : false, cpanel_mouseover : false, text_mouseover : false, 
            text_effect : "fade", shuffle : false, block_size : 75, vert_size : 50, horz_size : 50, block_delay : 25, 
            vstripe_delay : 75, hstripe_delay : 75
        };
        var r = a.extend({}, o, B);
        return this.each(function ()
        {
            b = new A(a(this), r);
            b.init()
        })
    }
})(jQuery);

