(function (a)
{
    function b(b, c)
    {
        var d = a.extend(
        {}, {
            banner_width: "",
            banner_height: "",
            image_sprite: "fmslideshow_assets/sprite.png",
            image_background: "",
            image_topShadow: "",
            image_bottomShadow: "",
            image_loader: "fmslideshow_assets/loader_img.png",
            background_fullScreen: false,
            background_move: false,
            background_moveDistance: 1250,
            buttons_type: 0,
            buttons_autoHide: false,
            buttons_align: "BC",
            buttons_spacing: "15,0",
            button_nextPrevious_type: 0,
            button_nextPrevious_autoHide: true,
            button_next_align: "RC",
            button_next_spacing: "20,0",
            button_previous_align: "LC",
            button_previous_spacing: "20,0",
            slideShow: true,
            slideShow_delayTime: 2,
            default_data_align: "LC",
            default_data_spacing: "70,0",
            default_data_inOutDirection: "LR",
            default_data_inOutDistance: "60"
        }, c);
        var e = a.browser.msie && parseInt(a.browser.version, 10) == 8 ? true : false;
        var f = a.browser.msie && parseInt(a.browser.version, 10) == 7 ? true : false;
        var g = a.browser.msie && parseInt(a.browser.version, 10) == 6 ? true : false;
        var h = a(b);
        var i;
        a(h.children()).each(function ()
        {
            if (a(this).attr("id") == "fmslideshow")
            {
                i = a(this)
            }
        });
        var j = d.image_sprite;
        var k = 0;
        var l = 0;
        var m = d.banner_width;
        var n = 0;
        var o = 0;
        var p = 0;
        var q = 0;
        var r = false;
        var s = false;
        var t = false;
        var u = [];
        var v = [];
        var w = 400;
        var x = 500;
        var y = 200;
        var z = 200;
        var A = 100;
        var B = d.background_moveDistance;
        var C = d.background_move;
        var D = "easeOutSine";
        var E = "easeInQuad";
        var F = "easeInOutQuad";
        var G = [];
        var H = 0;
        var I = 0;
        var J = -1;
        var K;
        var L;
        var M;
        var N = [];
        var O;
        var P = d.slideShow;
        var Q = P;
        var R = Number(d.slideShow_delayTime) * 2500;
        var S;
        var T = Number(d.buttons_type) ? Number(d.buttons_type) > 0 && Number(d.buttons_type) < 3 ? Number(d.buttons_type) : 0 : 0;
        var U = T == 0 ? 24 : T == 1 ? 22 : 25;
        var V = T == 0 ? 24 : T == 1 ? 30 : 44;
        var W = T == 0 ? 0 : T == 1 ? 39 : 80;
        var X = T == 1 ? 15 : T == 2 ? 7 : 0;
        var Y;
        var Z;
        var _ = Number(d.button_nextPrevious_type) ? Number(d.button_nextPrevious_type) : 0;
        var ba = _ == 2 ? 36 : _ == 0 ? 29 : 40;
        var bb = _ == 2 ? 0 : _ == 0 ? 43 : 80;
        var bc = d.buttons_align.toUpperCase();
        var bd = d.buttons_spacing.split(",");
        var be = d.button_next_align.toUpperCase();
        var bf = d.button_next_spacing.split(",");
        var bg = d.button_previous_align.toUpperCase();
        var bh = d.button_previous_spacing.split(",");
        var bi = d.button_nextPrevious_autoHide || d.buttons_autoHide;
        var bj = d.button_nextPrevious_autoHide;
        var bk = [];
        var bl = d.buttons_autoHide;
        var bm;
        var bn = d.image_loader;
        if (g)
        {
            var bo = j.split(".");
            j = bo[0] + "_ie6.gif"
        }
        var bp = [];
        var bq = -1;
        h.css(
        {
            "background-position": "0px 0px",
            visibility: "hidden"
        });
        if (d.banner_height != "")
        {
            i.css(
            {
                height: d.banner_height
            })
        }
        i.css(
        {
            position: "relative",
            margin: "0 auto",
            overflow: "hidden",
            visibility: "hidden"
        });
        a(i.children()).each(function ()
        {
            bq = bq + 1;
            v[bq] = [];
            bp[bq] = false;
            u[bq] = a(this);
            var b = -1;
            a(this).children().each(function ()
            {
                var c = a(this);
                b = b + 1;
                if (c.get(0).nodeName.toUpperCase() == "A")
                {
                    c = c.children()
                }
                c.wrap("<div />");
                c.css(
                {
                    position: "absolute"
                });
                if (c.attr("data-align"))
                {
                    c.parent().data("data-align", c.attr("data-align").toUpperCase())
                }
                else
                {
                    c.parent().data("data-align", d.default_data_align.toUpperCase());
                    c.removeAttr("data-align")
                }
                if (c.attr("data-spacing"))
                {
                    c.parent().data("spacingObj", c.attr("data-spacing"))
                }
                else
                {
                    c.parent().data("spacingObj", d.default_data_spacing);
                    c.removeAttr("data-spacing")
                }
                if (c.attr("data-inOutDirection"))
                {
                    c.parent().data("inOutDirection", c.attr("data-inOutDirection").toUpperCase())
                }
                else
                {
                    c.parent().data("inOutDirection", d.default_data_inOutDirection.toUpperCase());
                    c.removeAttr("data-inOutDirection")
                }
                if (c.attr("data-inOutDirection"))
                {
                    c.parent().data("inOutDistance", c.attr("data-inOutDistance"))
                }
                else
                {
                    c.parent().data("inOutDistance", d.default_data_inOutDistance);
                    c.removeAttr("data-inOutDistance")
                }
                if (c.children().length > 1)
                {
                    var e;
                    var f = false;
                    var h;
                    c.children().each(function ()
                    {
                        h = a(this);
                        if (h.attr("id") == "bg")
                        {
                            e = h;
                            f = true
                        }
                        else
                        {
                            if (f)
                            {
                                h.css(
                                {
                                    position: "relative"
                                })
                            }
                        }
                    });
                    if (f)
                    {
                        if (!g)
                        {
                            e.css(
                            {
                                width: "100%",
                                height: "100%",
                                position: "absolute"
                            })
                        }
                        else
                        {
                            e.css(
                            {
                                width: "100%",
                                height: h.height() + 12 + "px",
                                position: "absolute"
                            })
                        }
                    }
                }
                if (c.html() == "")
                {
                    c.parent().data("img-src", c.attr("src"));
                    c.attr("src", "");
                    c.parent().css(
                    {
                        overflow: "hidden",
                        "background-repeat": "no-repeat",
                        position: "absolute",
                        visibility: "hidden"
                    });
                    c.parent().append("<div />");
                    v[bq][b] = c.parent()
                }
                else
                {
                    c.parent().css(
                    {
                        width: c.width(),
                        height: c.height(),
                        position: "absolute"
                    })
                }
                v[bq][b] = c.parent();
                if (c.html() == "")
                {
                    c.remove()
                }
                v[bq][b].css(
                {
                    visibility: "hidden"
                })
            })
        });
        if (!d.background_fullScreen)
        {
            h.css(
            {
                width: m + "px"
            })
        }
        if (d.image_background != "")
        {
            G.push(d.image_background)
        }
        if (d.image_topShadow != "")
        {
            G.push(d.image_topShadow)
        }
        if (d.image_bottomShadow != "")
        {
            G.push(d.image_bottomShadow)
        }
        if (bn != "")
        {
            G.push(bn)
        }
        G.push(j);
        var br = 0;
        var bs = 0;
        var bt = function ()
            {
                if (H < G.length)
                {
                    var b = a("<img />");
                    b.hide();
                    b.bind("load", function ()
                    {
                        if (G[H] == d.image_topShadow)
                        {
                            br = b.height()
                        }
                        if (G[H] == d.image_bottomShadow)
                        {
                            bs = b.height()
                        }
                        if (G[H] == j)
                        {
                            k = b.width();
                            l = b.height()
                        }
                        a(this).remove();
                        H++;
                        bt()
                    }).error(function ()
                    {
                        a(this).remove();
                        H++;
                        bt()
                    });
                    i.append(b);
                    b.attr("src", G[H])
                }
                else
                {
                    h.css(
                    {
                        visibility: "hidden"
                    });
                    h.css(
                    {
                        display: "none"
                    });
                    h.prepend("<div ></div>");
                    K = h.children(":first-child");
                    K.css(
                    {
                        width: "100%",
                        height: br + "px",
                        position: "absolute",
                        top: "0px",
                        left: "0px",
                        "background-repeat": "repeat-x"
                    });
                    h.prepend("<div ></div>");
                    L = h.children(":first-child");
                    L.css(
                    {
                        width: "100%",
                        height: bs + "px",
                        position: "absolute",
                        bottom: "0px",
                        left: "0px",
                        "background-repeat": "repeat-x"
                    });
                    if (g)
                    {
                        L.css(
                        {
                            bottom: -bs + "px"
                        })
                    }
                    if (d.image_background != "")
                    {
                        h.css(
                        {
                            "background-image": "url(" + d.image_background + ")",
                            "background-position": "0px"
                        })
                    }
                    if (d.image_topShadow != "")
                    {
                        K.css(
                        {
                            "background-image": "url(" + d.image_topShadow + ")"
                        })
                    }
                    if (d.image_bottomShadow != "")
                    {
                        L.css(
                        {
                            "background-image": "url(" + d.image_bottomShadow + ")"
                        })
                    }
                    h.css(
                    {
                        visibility: "visible"
                    });
                    h.fadeIn(w);
                    bu();
                    bT(U, V, u.length);
                    bA();
                    var c;
                    a(window).resize(function ()
                    {
                        clearInterval(c);
                        c = setInterval(function ()
                        {
                            clearInterval(c);
                            bv()
                        }, 200)
                    })
                }
            };
        var bu = function ()
            {
                if ((h.css("width") == "0px" || h.css("width") == "auto") && m == 0)
                {
                    m = parseInt(h.css("width"))
                }
                if (m > a(window).width())
                {
                    i.css("width", "100%")
                }
                else
                {
                    i.css("width", m + "px")
                }
                if (!s)
                {
                    s = true;
                    if (parseInt(i.css("height")) == 0)
                    {
                        r = true;
                        i.css("height", a(window).height() + "px")
                    }
                }
                var b = v.length;
                for (var c = 0; c < v.length; c++)
                {
                    a(v[c]).css("z-index", b);
                    for (var d = 0; d < v[c].length; d++)
                    {
                        v[c][d].css(
                        {
                            width: "auto",
                            height: "auto"
                        });
                        bD(c, d)
                    }
                }
                K.css("z-index", b + 1);
                L.css("z-index", b + 2);
                i.prepend("<div />");
                M = i.children(":first-child");
                M.css(
                {
                    position: "absolute",
                    "z-index": 2
                });
                M.append("<div />");
                O = a(M.children(":first-child"));
                M.css(
                {
                    display: "none"
                });
                i.prepend("<div />");
                bm = i.children(":first-child");
                bm.css(
                {
                    position: "absolute",
                    height: "18px",
                    "z-index": b + 6,
                    visibility: "visible",
                    display: "none"
                });
                bm.prepend("<div />");
                var e = bm.children(":first-child");
                e.css(
                {
                    position: "absolute",
                    width: "22px",
                    height: "18px",
                    overflow: "hidden"
                });
                e.prepend("<div />");
                var f = e.children(":first-child");
                f.css(
                {
                    position: "absolute",
                    width: "22px",
                    height: "200px",
                    top: "0px",
                    left: "0px"
                });
                if (a.browser.msie)
                {
                    f.css(
                    {
                        filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + bn + ", sizingMethod='noscale')"
                    })
                }
                else
                {
                    f.css(
                    {
                        "background-image": "url(" + bn + ")"
                    })
                }
                bF(bm, "C", [0, 0], parseInt(i.width()) - parseInt(bm.width()), parseInt(i.height()) - parseInt(bm.height()));
                bm.fadeIn(500);
                bw(f)
            };
        var bv = function ()
            {
                if (r)
                {
                    if (m > a(window).width())
                    {
                        i.css("width", "100%")
                    }
                    else
                    {
                        i.css("width", m + "px")
                    }
                }
                if (t)
                {
                    M.css(
                    {
                        left: Math.round((parseInt(i.width()) - parseInt(M.width())) / 2) + "px"
                    })
                }
                for (var b = 0; b < v[bJ].length; b++)
                {
                    bD(bJ, b)
                }
                if (Y && Z)
                {
                    bF(Y, be, bf, parseInt(i.width()) - parseInt(Y.width()), parseInt(i.height()) - parseInt(Y.height()));
                    bF(Z, bg, bh, parseInt(i.width()) - parseInt(Z.width()), parseInt(i.height()) - parseInt(Z.height()))
                }
                if (M)
                {
                    bF(M, bc, bd, parseInt(i.width()) - parseInt(M.width()), parseInt(i.height()) - parseInt(M.height()))
                }
                if (bm)
                {
                    bF(bm, "C", [0, 0], parseInt(i.width()) - parseInt(bm.width()), parseInt(i.height()) - parseInt(bm.height()))
                }
            };
        var bw = function (a)
            {
                bx = setInterval(function ()
                {
                    bz(a)
                }, 30)
            };
        var bx;
        var by = 0;
        var bz = function (a)
            {
                by = by < 162 ? by + 18 : 0;
                a.css(
                {
                    top: -by + "px"
                })
            };
        var bA = function ()
            {
                J++;
                if (J >= v[I].length)
                {
                    J = 0;
                    bp[I] = true;
                    I++
                }
                if (I == 1 && J == 0)
                {
                    bm.fadeOut(300);
                    i.css(
                    {
                        display: "show"
                    });
                    i.fadeIn(w, function ()
                    {
                        bC(0, true)
                    });
                    for (var a = 0; a < bk.length; a++)
                    {
                        bk[a].show();
                        bk[a].fadeTo("fast", 1)
                    }
                    if (!bj)
                    {
                        Z.fadeTo("fast", .1)
                    }
                    M.css(
                    {
                        visibility: "visible"
                    });
                    for (a = 0; a < bk.length; a++)
                    {
                        bk[a].fadeTo("slow", 0)
                    }
                    bR()
                }
                if (I < v.length)
                {
                    bB()
                }
                else
                {
                    bm.fadeOut(300, function ()
                    {
                        bm.remove()
                    })
                }
            };
        var bB = function ()
            {
                var b = v[I][J];
                var c = b.children();
                if (b.text() == "")
                {
                    var d = a("<img>");
                    d.hide();
                    d.bind("load", function ()
                    {
                        b.css(
                        {
                            width: d.width() + "px",
                            height: d.height() + "px"
                        });
                        c.css(
                        {
                            width: d.width() + "px",
                            height: d.height() + "px"
                        });
                        if (a.browser.msie)
                        {
                            c.css(
                            {
                                filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + b.data("img-src") + ", sizingMethod='noscale')"
                            })
                        }
                        else
                        {
                            c.css(
                            {
                                "background-image": "url(" + b.data("img-src") + ")"
                            })
                        }
                        a(this).remove();
                        bA()
                    }).error(function ()
                    {
                        b.css(
                        {
                            width: d.width() + "px",
                            height: d.height() + "px"
                        });
                        c.css(
                        {
                            width: d.width() + "px",
                            height: d.height() + "px"
                        });
                        a(this).remove();
                        bA()
                    });
                    i.append(d);
                    d.attr("src", b.data("img-src"))
                }
                else
                {
                    bA()
                }
            };
        var bC = function (b, c)
            {
                for (var d = 0; d < bG.length; d++)
                {
                    clearInterval(bG[d])
                }
                for (var e = 0; e < bH.length; e++)
                {
                    clearInterval(bH[e])
                }
                if (c)
                {
                    for (var f = 0; f < v[n].length; f++)
                    {
                        bK(f)
                    }
                }
                else
                {
                    if (C)
                    {
                        if (a.browser.msie)
                        {
                            if (p > b)
                            {
                                h.animate(
                                {
                                    "background-position-x": "+=1000" + "px"
                                }, {
                                    queue: false,
                                    duration: B,
                                    easing: F
                                })
                            }
                            else
                            {
                                h.animate(
                                {
                                    "background-position-x": "-=1000" + "px"
                                }, {
                                    queue: false,
                                    duration: B,
                                    easing: F
                                })
                            }
                        }
                        else
                        {
                            if (p > b)
                            {
                                h.animate(
                                {
                                    "background-position": "+=1000" + "px"
                                }, {
                                    queue: false,
                                    duration: B,
                                    easing: F
                                })
                            }
                            else
                            {
                                h.animate(
                                {
                                    "background-position": "-=1000" + "px"
                                }, {
                                    queue: false,
                                    duration: B,
                                    easing: F
                                })
                            }
                        }
                    }
                    p = b;
                    for (var g = 0; g < v[n].length; g++)
                    {
                        bL(g)
                    }
                }
            };
        var bD = function (b, c)
            {
                var d = a(v[b][c]);
                var e = a(v[b][c - 1]);
                d.css(
                {
                    left: "auto",
                    right: "auto",
                    top: "auto",
                    bottom: "auto"
                });
                var f = String(d.data("data-align"));
                var g = [];
                g[0] = g[1] = 0;
                if (String(d.data("spacingObj")) != "undefined")
                {
                    g = d.data("spacingObj").split(",");
                    g[0] = isNaN(g[0]) ? 0 : g[0];
                    g[1] = isNaN(g[1]) ? 0 : g[1]
                }
                d.show();
                bF(d, f, g, parseInt(i.width()) - parseInt(d.width()), parseInt(i.height()) - parseInt(d.height()));
                if (d.children(":first-child").text() != "")
                {
                    d.children(":first-child").css(
                    {
                        position: ""
                    })
                }
                if (d.data("data-align") == e.data("data-align"))
                {
                    if (d.children(":first-child").html() != "")
                    {
                        if (f.substring(0, 1) == "B")
                        {
                            d.css(
                            {
                                bottom: Number(e.data("pB")) - Number(d.height()) - Number(g[0]) + "px"
                            })
                        }
                        else
                        {
                            if (!isNaN(e.height()))
                            {
                                if (f == "LC" || f == "RC")
                                {
                                    d.css(
                                    {
                                        top: Number(e.data("pT")) + Number(e.height()) + Number(g[1]) + "px"
                                    })
                                }
                                else
                                {
                                    d.css(
                                    {
                                        top: Number(e.data("pT")) + Number(e.height()) + Number(g[0]) + "px"
                                    })
                                }
                            }
                        }
                    }
                    else
                    {
                        if (d.children(":first-child").html() == "")
                        {
                            if (f.substring(0, 1) == "L")
                            {
                                d.css(
                                {
                                    left: Number(e.data("pL")) + Number(e.width()) + Number(g[0]) + "px"
                                })
                            }
                            else
                            {
                                d.css(
                                {
                                    right: Number(e.data("pR")) - Number(d.width()) - Number(g[0]) + "px"
                                })
                            }
                        }
                    }
                }
                if (d.children(":first-child").html() != "")
                {
                    d.data(
                    {
                        pT: parseInt(d.css("top"))
                    });
                    d.data(
                    {
                        pB: parseInt(d.css("bottom"))
                    })
                }
                if (d.children(":first-child").html() == "")
                {
                    d.data(
                    {
                        pL: parseInt(d.css("left"))
                    });
                    d.data(
                    {
                        pR: parseInt(d.css("right"))
                    })
                }
            };
        var bE = function (b, c)
            {
                var d = a(v[n][b]);
                var g = isNaN(d.data("inOutDistance")) ? 50 : Number(d.data("inOutDistance"));
                var h = String(d.data("inOutDirection"));
                var i = 0;
                bD(n, b);
                if (c)
                {
                    u[n].css(
                    {
                        visibility: "visible",
                        display: "show"
                    });
                    if (h.substring(0, 1) == "T" || h.substring(0, 1) == "B")
                    {
                        if (d.css("top") != "auto")
                        {
                            i = parseInt(d.css("top"));
                            if (h.substring(0, 1) == "T")
                            {
                                d.css(
                                {
                                    top: i - Number(g) + "px"
                                })
                            }
                            else
                            {
                                d.css(
                                {
                                    top: i + Number(g) + "px"
                                })
                            }
                            d.animate(
                            {
                                top: i + "px"
                            }, {
                                queue: false,
                                duration: w,
                                easing: D
                            })
                        }
                        else
                        {
                            i = parseInt(d.css("bottom"));
                            if (h.substring(0, 1) == "T")
                            {
                                d.css(
                                {
                                    bottom: i + Number(g) + "px"
                                })
                            }
                            else
                            {
                                d.css(
                                {
                                    bottom: i - Number(g) + "px"
                                })
                            }
                            d.animate(
                            {
                                bottom: i + "px"
                            }, {
                                queue: false,
                                duration: w,
                                easing: D
                            })
                        }
                    }
                    i = 0;
                    if (h.substring(0, 1) == "L" || h.substring(0, 1) == "R")
                    {
                        if (d.css("left") != "auto")
                        {
                            i = parseInt(d.css("left"));
                            if (h.substring(0, 1) == "L")
                            {
                                d.css(
                                {
                                    left: i - Number(g) + "px"
                                })
                            }
                            else
                            {
                                d.css(
                                {
                                    left: i + Number(g) + "px"
                                })
                            }
                            d.animate(
                            {
                                left: i + "px"
                            }, {
                                queue: false,
                                duration: w,
                                easing: D
                            })
                        }
                        else
                        {
                            i = parseInt(d.css("right"));
                            if (h.substring(0, 1) == "R")
                            {
                                d.css(
                                {
                                    right: i - Number(g) + "px"
                                })
                            }
                            else
                            {
                                d.css(
                                {
                                    right: i + Number(g) + "px"
                                })
                            }
                            d.animate(
                            {
                                right: i + "px"
                            }, {
                                queue: false,
                                duration: w,
                                easing: D
                            })
                        }
                    }
                    if (!e || d.text() == "")
                    {
                        d.css(
                        {
                            display: "none"
                        });
                        d.css(
                        {
                            visibility: "visible"
                        });
                        j = f ? 200 : x;
                        d.fadeIn(j)
                    }
                    else
                    {
                        d.css(
                        {
                            display: "show"
                        });
                        d.css(
                        {
                            visibility: "hidden"
                        });
                        bU(d.get(0))
                    }
                    if (n != p)
                    {
                        if (q >= v[n].length)
                        {
                            q = 0;
                            n = p;
                            bC(n, false)
                        }
                    }
                    else
                    {
                        q++
                    }
                }
                else
                {
                    if (h.substring(1, 2) == "T" || h.substring(1, 2) == "B")
                    {
                        if (d.css("top") != "auto")
                        {
                            i = parseInt(d.css("top"));
                            if (h.substring(1, 2) == "T")
                            {
                                d.animate(
                                {
                                    top: i - Number(g) + "px"
                                }, {
                                    queue: false,
                                    duration: w,
                                    easing: E
                                })
                            }
                            else
                            {
                                d.animate(
                                {
                                    top: i + Number(g) + "px"
                                }, {
                                    queue: false,
                                    duration: w,
                                    easing: E
                                })
                            }
                        }
                        else
                        {
                            i = parseInt(d.css("bottom"));
                            if (h.substring(1, 2) == "T")
                            {
                                d.animate(
                                {
                                    bottom: i + Number(g) + "px"
                                }, {
                                    queue: false,
                                    duration: w,
                                    easing: E
                                })
                            }
                            else
                            {
                                d.animate(
                                {
                                    bottom: i - Number(g) + "px"
                                }, {
                                    queue: false,
                                    duration: w,
                                    easing: E
                                })
                            }
                        }
                    }
                    if (h.substring(1, 2) == "L" || h.substring(1, 2) == "R")
                    {
                        if (d.css("left") != "auto")
                        {
                            i = parseInt(d.css("left"));
                            if (h.substring(1, 2) == "L")
                            {
                                d.animate(
                                {
                                    left: i - Number(g) + "px"
                                }, {
                                    queue: false,
                                    duration: w,
                                    easing: E
                                })
                            }
                            else
                            {
                                d.animate(
                                {
                                    left: i + Number(g) + "px"
                                }, {
                                    queue: false,
                                    duration: w,
                                    easing: E
                                })
                            }
                        }
                        else
                        {
                            i = parseInt(d.css("right"));
                            if (h.substring(1, 2) == "R")
                            {
                                d.animate(
                                {
                                    right: i - Number(g) + "px"
                                }, {
                                    queue: false,
                                    duration: w,
                                    easing: E
                                })
                            }
                            else
                            {
                                d.animate(
                                {
                                    right: i + Number(g) + "px"
                                }, {
                                    queue: false,
                                    duration: w,
                                    easing: E
                                })
                            }
                        }
                    }
                    var j = !e || d.text() == "" ? y : 300;
                    d.fadeOut(j, function ()
                    {
                        d.css(
                        {
                            display: "show"
                        });
                        d.css(
                        {
                            visibility: "hidden"
                        });
                        o++;
                        if (o >= v[n].length)
                        {
                            o = 0;
                            n = p;
                            for (var a = 0; a < u.length; a++)
                            {
                                for (var b = 0; b < v[a].length; b++)
                                {
                                    v[a][b].css(
                                    {
                                        visibility: "hidden",
                                        display: "none"
                                    })
                                }
                            }
                            u[n].css(
                            {
                                visibility: "visible"
                            });
                            bC(n, true)
                        }
                    })
                }
            };
        var bF = function (a, b, c, d, e)
            {
                if (b == "TL")
                {
                    a.css(
                    {
                        top: c[0] + "px"
                    });
                    a.css(
                    {
                        left: c[1] + "px"
                    })
                }
                if (b == "TC")
                {
                    a.css(
                    {
                        top: c[0] + "px"
                    });
                    a.css(
                    {
                        left: Number(d / 2) + Number(c[1]) + "px"
                    })
                }
                if (b == "TR")
                {
                    a.css(
                    {
                        top: c[0] + "px"
                    });
                    a.css(
                    {
                        right: c[1] + "px"
                    })
                }
                if (b == "LC")
                {
                    a.css(
                    {
                        left: c[0] + "px"
                    });
                    a.css(
                    {
                        top: Number(e / 2) + Number(c[1]) + "px"
                    })
                }
                if (b == "C")
                {
                    a.css(
                    {
                        top: Number(e / 2) + Number(c[0]) + "px"
                    });
                    a.css(
                    {
                        left: Number(d / 2) + Number(c[1]) + "px"
                    })
                }
                if (b == "RC")
                {
                    a.css(
                    {
                        right: c[0] + "px"
                    });
                    a.css(
                    {
                        top: Number(e / 2) + Number(c[1]) + "px"
                    })
                }
                if (b == "BL")
                {
                    a.css(
                    {
                        bottom: c[0] + "px"
                    });
                    a.css(
                    {
                        left: c[1] + "px"
                    })
                }
                if (b == "BC")
                {
                    a.css(
                    {
                        bottom: c[0] + "px"
                    });
                    a.css(
                    {
                        left: Number(d / 2) + Number(c[1]) + "px"
                    })
                }
                if (b == "BR")
                {
                    a.css(
                    {
                        bottom: c[0] + "px"
                    });
                    a.css(
                    {
                        right: c[1] + "px"
                    })
                }
            };
        var bG = [];
        var bH = [];
        var bI;
        var bJ = 0;
        var bK = function (a)
            {
                bG[a] = setInterval(function ()
                {
                    bM(a)
                }, z * a)
            };
        var bL = function (a)
            {
                bH[a] = setInterval(function ()
                {
                    bN(a)
                }, A * a)
            };
        var bM = function (a)
            {
                clearInterval(bG[a]);
                bE(a, true)
            };
        var bN = function (a)
            {
                clearInterval(bH[a]);
                bE(a, false)
            };
        var bO = function ()
            {
                clearInterval(S);
                if (n != bJ && bp[bJ])
                {
                    q = 0;
                    clearInterval(bI);
                    bC(bJ, false);
                    if (bm)
                    {
                        bm.fadeOut(300)
                    }
                    if (Q)
                    {
                        clearInterval(S);
                        S = setInterval(function ()
                        {
                            bP()
                        }, R)
                    }
                }
                if (!bp[bJ])
                {
                    if (bm)
                    {
                        bm.fadeIn(300)
                    }
                }
            };
        var bP = function ()
            {
                var a = Number(bJ) < v.length - 1 ? Number(bJ) + 1 : 0;
                bQ(a)
            };
        var bQ = function (a)
            {
                N[bJ].css(
                {
                    "background-position": 0 + "px " + -W + "px"
                });
                bJ = a;
                N[bJ].css(
                {
                    "background-position": -(U * 2) + "px " + -W + "px"
                });
                Y.data("hid", false);
                Z.data("hid", false);
                Y.css(
                {
                    cursor: "pointer"
                });
                Z.css(
                {
                    cursor: "pointer"
                });
                if (!(Number(bJ) > v.length - 2 && Number(bJ) < 1) && !Q || !bj)
                {
                    Y.fadeTo("fast", 1);
                    Z.fadeTo("fast", 1)
                }
                if (Number(bJ) > v.length - 2)
                {
                    Y.children(":first-child").css(
                    {
                        right: 0 + "px ",
                        bottom: -bb + "px"
                    });
                    Y.data("hid", true);
                    Y.css(
                    {
                        cursor: ""
                    });
                    if (!Q || !bj)
                    {
                        Y.fadeTo("fast", .2);
                        Z.fadeTo("fast", 1)
                    }
                }
                if (Number(bJ) < 1)
                {
                    Z.data("hid", true);
                    Z.children(":first-child").css(
                    {
                        left: 0 + "px ",
                        bottom: -bb + "px"
                    });
                    Z.css(
                    {
                        cursor: ""
                    });
                    if (!Q || !bj)
                    {
                        Z.fadeTo("fast", .2);
                        Y.fadeTo("fast", 1)
                    }
                }
                clearInterval(S);
                bI = setInterval(function ()
                {
                    bO()
                }, 27)
            };
        var bR = function ()
            {
                clearInterval(S);
                if (P)
                {
                    S = setInterval(function ()
                    {
                        bP()
                    }, R)
                }
                if (!bl)
                {
                    if (a.browser.msie)
                    {
                        M.show()
                    }
                    else
                    {
                        M.fadeIn()
                    }
                }
                if (!bj)
                {
                    if (a.browser.msie)
                    {
                        Y.show()
                    }
                    else
                    {
                        Y.fadeIn()
                    }
                }
                if (P || bi)
                {
                    h.bind("mouseover mouseleave", function (a)
                    {
                        bS(String(a.type))
                    })
                }
            };
        var bS = function (b)
            {
                if (b == "mouseover" || b == "touchstart")
                {
                    if (P)
                    {
                        Q = false;
                        clearInterval(S)
                    }
                    if (bi)
                    {
                        if (a.browser.msie)
                        {
                            M.fadeIn(100)
                        }
                        for (var c = 0; c < bk.length; c++)
                        {
                            if (!bk[c].data("hid"))
                            {
                                bk[c].fadeTo("fast", 1);
                                bk[c].show()
                            }
                            else
                            {
                                bk[c].fadeTo("fast", .2)
                            }
                        }
                    }
                }
                else
                {
                    if (a.browser.msie && bl)
                    {
                        M.fadeOut(100)
                    }
                    if (P)
                    {
                        Q = true;
                        clearInterval(S);
                        S = setInterval(function ()
                        {
                            bP()
                        }, R)
                    }
                    if (bi)
                    {
                        for (c = 0; c < bk.length; c++)
                        {
                            bk[c].fadeTo("fast", 0)
                        }
                    }
                }
            };
        var bT = function (b, c, d)
            {
                O.css(
                {
                    top: "0px",
                    left: "0"
                });
                O.prepend("<div />");
                O.children(":first-child").css(
                {
                    width: X + "px",
                    height: V + 1 + "px",
                    "background-image": "url(" + j + ")",
                    position: "absolute",
                    top: "0px",
                    left: "0",
                    "background-repeat": "no-repeat"
                });
                if (T == 1)
                {
                    O.children(":first-child").css(
                    {
                        "background-position": -65 + "px " + -W + "px",
                        left: "0px"
                    })
                }
                if (T == 2)
                {
                    O.children(":first-child").css(
                    {
                        "background-position": -77 + "px " + -W + "px",
                        left: "0px"
                    })
                }
                for (var e = 0; e < d; e++)
                {
                    O.append("<div ></div>");
                    O.children(":last-child").css(
                    {
                        left: (b - 1) * e + X + "px",
                        position: "absolute",
                        width: b - 1,
                        height: c,
                        top: "0px",
                        cursor: "pointer",
                        "background-image": "url(" + j + ")",
                        "background-position": "0px " + -W + "px"
                    });
                    N[e] = O.children(":last-child");
                    N[e].data("nam", e);
                    if (T == 2)
                    {
                        N[e].append("<div />");
                        N[e].children(":last-child").text(e + 1);
                        N[e].css(
                        {
                            "padding-top": N[e].height() / 2 - 2 + "px"
                        })
                    }
                    N[e].addClass("buttonText");
                    bV(N[e]);
                    O.css(
                    {
                        height: c + "px"
                    })
                }
                O.prepend("<div />");
                O.children(":first-child").css(
                {
                    width: X + "px",
                    height: V + 1 + "px",
                    left: (b - 1) * e + X + "px",
                    "background-image": "url(" + j + ")",
                    position: "absolute",
                    "background-repeat": "no-repeat"
                });
                if (T == 1)
                {
                    O.children(":first-child").css(
                    {
                        "background-position": -87 + "px " + -W + "px"
                    })
                }
                if (T == 2)
                {
                    O.children(":first-child").css(
                    {
                        "background-position": -103 + "px " + -W + "px"
                    })
                }
                O.css(
                {
                    visibility: "visible"
                });
                M.css(
                {
                    width: parseInt(b * e) + X * 2 + "px"
                });
                bF(M, bc, bd, parseInt(i.width()) - parseInt(M.width()), parseInt(i.height()) - parseInt(M.height()));
                O.fadeTo("fast", 1);
                N[0].css(
                {
                    "background-position": -(U * 2) + "px " + -W + "px"
                });
                i.prepend("<div  />");
                Y = i.children(":first-child");
                Y.css(
                {
                    width: ba + "px",
                    height: ba + "px",
                    position: "absolute",
                    "z-index": v.length + 2,
                    visibility: "visible",
                    overflow: "hidden",
                    cursor: "pointer"
                });
                Y.prepend("<div />");
                rightBt = Y.children(":first-child");
                rightBt.css(
                {
                    position: "absolute",
                    visibility: "visible",
                    width: k + "px",
                    height: l + "px",
                    right: "0px",
                    bottom: -bb + "px"
                });
                if (a.browser.msie)
                {
                    rightBt.css(
                    {
                        filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + j + ", sizingMethod='noscale')"
                    })
                }
                else
                {
                    rightBt.css(
                    {
                        "background-image": "url(" + j + ")"
                    })
                }
                Y.data(
                {
                    nam: "rBtn",
                    hid: false
                });
                bV(Y);
                Y.show();
                bF(Y, be, bf, parseInt(i.width()) - parseInt(Y.width()), parseInt(i.height()) - parseInt(Y.height()));
                i.prepend("<div  />");
                Z = i.children(":first-child");
                Z.css(
                {
                    position: "absolute",
                    width: ba - 1 + "px",
                    height: ba + "px",
                    "z-index": v.length + 3,
                    visibility: "visible",
                    overflow: "hidden",
                    cursor: "pointer"
                });
                Z.prepend("<div />");
                leftBt = Z.children(":first-child");
                leftBt.css(
                {
                    position: "absolute",
                    width: k + "px",
                    height: l + "px",
                    visibility: "visible",
                    left: "0px",
                    bottom: -bb + "px"
                });
                if (a.browser.msie)
                {
                    leftBt.css(
                    {
                        filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + j + ", sizingMethod='noscale')"
                    })
                }
                else
                {
                    leftBt.css(
                    {
                        "background-image": "url(" + j + ")"
                    })
                }
                Z.data(
                {
                    nam: "lBtn",
                    hid: true
                });
                bV(Z);
                Y.hide();
                Z.hide();
                leftBt.fadeTo("fast", 1);
                rightBt.fadeTo("fast", 1);
                Z.css(
                {
                    cursor: ""
                });
                bF(Z, bg, bh, parseInt(i.width()) - parseInt(Z.width()), parseInt(i.height()) - parseInt(Z.height()));
                if (bj)
                {
                    bk = [Z, Y]
                }
                if (!a.browser.msie)
                {
                    if (bl)
                    {
                        bk.push(M)
                    }
                }
            };
        var bU = function (a)
            {
                a.style.filter = "blendTrans(duration=.2)";
                if (a.filters.blendTrans.status != 2)
                {
                    a.filters.blendTrans.apply();
                    a.style.visibility = "visible";
                    a.filters.blendTrans.play()
                }
            };
        var bV = function (a)
            {
                a.bind("mouseover mouseup mouseleave", function ()
                {
                    if (P)
                    {
                        clearInterval(S)
                    }
                    if (a.data("nam") != "rBtn" && a.data("nam") != "lBtn")
                    {
                        if (bJ != a.data("nam"))
                        {
                            a.css(
                            {
                                "background-position": -U + "px " + -W + "px"
                            })
                        }
                    }
                    else
                    {
                        if (!a.data("hid"))
                        {
                            if (a.data("nam") == "rBtn")
                            {
                                a.children(":first-child").css(
                                {
                                    right: -ba + "px ",
                                    bottom: -bb + "px"
                                })
                            }
                            else
                            {
                                a.children(":first-child").css(
                                {
                                    left: -ba + "px ",
                                    bottom: -bb + "px"
                                })
                            }
                        }
                    }
                });
                a.bind("mouseout", function ()
                {
                    if (a.data("nam") != "rBtn" && a.data("nam") != "lBtn")
                    {
                        if (bJ != a.data("nam"))
                        {
                            a.css(
                            {
                                "background-position": "0px " + -W + "px"
                            })
                        }
                    }
                    else
                    {
                        if (!a.data("hid"))
                        {
                            if (a.data("nam") == "rBtn")
                            {
                                a.children(":first-child").css(
                                {
                                    right: 0 + "px ",
                                    bottom: -bb + "px"
                                })
                            }
                            else
                            {
                                a.children(":first-child").css(
                                {
                                    left: 0 + "px ",
                                    bottom: -bb + "px"
                                })
                            }
                        }
                    }
                });
                a.bind("mousedown", function ()
                {
                    if (P)
                    {
                        clearInterval(S)
                    }
                    if (a.data("nam") != "rBtn" && a.data("nam") != "lBtn")
                    {
                        if (bJ != a.data("nam"))
                        {
                            a.css(
                            {
                                "background-position": -(U * 2) + "px " + -W + "px"
                            })
                        }
                    }
                    else
                    {
                        if (!a.data("hid"))
                        {
                            if (a.data("nam") == "rBtn")
                            {
                                a.children(":first-child").css(
                                {
                                    right: -ba * 2 + "px ",
                                    bottom: -bb + "px"
                                })
                            }
                            else
                            {
                                a.children(":first-child").css(
                                {
                                    left: -ba * 2 + "px ",
                                    bottom: -bb + "px"
                                })
                            }
                        }
                    }
                });
                a.bind("click", function ()
                {
                    if (P)
                    {
                        clearInterval(S)
                    }
                    if (a.data("nam") != "rBtn" && a.data("nam") != "lBtn")
                    {
                        if (bJ != a.data("nam"))
                        {
                            bQ(a.data("nam"))
                        }
                    }
                    else
                    {
                        if (a.data("nam") == "rBtn")
                        {
                            if (bJ < v.length - 1)
                            {
                                a.children(":first-child").css(
                                {
                                    right: -ba + "px ",
                                    bottom: -bb + "px"
                                });
                                var b = Number(bJ) + 1;
                                bQ(b)
                            }
                        }
                        else
                        {
                            if (bJ > 0)
                            {
                                a.children(":first-child").css(
                                {
                                    left: -ba + "px ",
                                    bottom: -bb + "px"
                                });
                                var c = Number(bJ) - 1;
                                bQ(c)
                            }
                        }
                    }
                })
            };
        bt()
    }
    a.fn.fmslideshow = function (c)
    {
        return this.each(function ()
        {
            var d = a(this);
            var e = d.data("GBInstance");
            if (!e)
            {
                d.data("GBInstance", new b(this, c))
            }
        })
    }
})(jQuery);
jQuery.easing["jswing"] = jQuery.easing["swing"];
jQuery.extend(jQuery.easing, {
    def: "easeOutQuad",
    swing: function (a, b, c, d, e)
    {
        return jQuery.easing[jQuery.easing.def](a, b, c, d, e)
    },
    easeInQuad: function (a, b, c, d, e)
    {
        return d * (b /= e) * b + c
    },
    easeOutQuad: function (a, b, c, d, e)
    {
        return -d * (b /= e) * (b - 2) + c
    },
    easeInOutQuad: function (a, b, c, d, e)
    {
        if ((b /= e / 2) < 1) return d / 2 * b * b + c;
        return -d / 2 * (--b * (b - 2) - 1) + c
    },
    easeInCubic: function (a, b, c, d, e)
    {
        return d * (b /= e) * b * b + c
    },
    easeOutCubic: function (a, b, c, d, e)
    {
        return d * ((b = b / e - 1) * b * b + 1) + c
    },
    easeInOutCubic: function (a, b, c, d, e)
    {
        if ((b /= e / 2) < 1) return d / 2 * b * b * b + c;
        return d / 2 * ((b -= 2) * b * b + 2) + c
    },
    easeInQuart: function (a, b, c, d, e)
    {
        return d * (b /= e) * b * b * b + c
    },
    easeOutQuart: function (a, b, c, d, e)
    {
        return -d * ((b = b / e - 1) * b * b * b - 1) + c
    },
    easeInOutQuart: function (a, b, c, d, e)
    {
        if ((b /= e / 2) < 1) return d / 2 * b * b * b * b + c;
        return -d / 2 * ((b -= 2) * b * b * b - 2) + c
    },
    easeInQuint: function (a, b, c, d, e)
    {
        return d * (b /= e) * b * b * b * b + c
    },
    easeOutQuint: function (a, b, c, d, e)
    {
        return d * ((b = b / e - 1) * b * b * b * b + 1) + c
    },
    easeInOutQuint: function (a, b, c, d, e)
    {
        if ((b /= e / 2) < 1) return d / 2 * b * b * b * b * b + c;
        return d / 2 * ((b -= 2) * b * b * b * b + 2) + c
    },
    easeInSine: function (a, b, c, d, e)
    {
        return -d * Math.cos(b / e * (Math.PI / 2)) + d + c
    },
    easeOutSine: function (a, b, c, d, e)
    {
        return d * Math.sin(b / e * (Math.PI / 2)) + c
    },
    easeInOutSine: function (a, b, c, d, e)
    {
        return -d / 2 * (Math.cos(Math.PI * b / e) - 1) + c
    },
    easeInExpo: function (a, b, c, d, e)
    {
        return b == 0 ? c : d * Math.pow(2, 10 * (b / e - 1)) + c
    },
    easeOutExpo: function (a, b, c, d, e)
    {
        return b == e ? c + d : d * (-Math.pow(2, -10 * b / e) + 1) + c
    },
    easeInOutExpo: function (a, b, c, d, e)
    {
        if (b == 0) return c;
        if (b == e) return c + d;
        if ((b /= e / 2) < 1) return d / 2 * Math.pow(2, 10 * (b - 1)) + c;
        return d / 2 * (-Math.pow(2, -10 * --b) + 2) + c
    },
    easeInCirc: function (a, b, c, d, e)
    {
        return -d * (Math.sqrt(1 - (b /= e) * b) - 1) + c
    },
    easeOutCirc: function (a, b, c, d, e)
    {
        return d * Math.sqrt(1 - (b = b / e - 1) * b) + c
    },
    easeInOutCirc: function (a, b, c, d, e)
    {
        if ((b /= e / 2) < 1) return -d / 2 * (Math.sqrt(1 - b * b) - 1) + c;
        return d / 2 * (Math.sqrt(1 - (b -= 2) * b) + 1) + c
    },
    easeInElastic: function (a, b, c, d, e)
    {
        var f = 1.70158;
        var g = 0;
        var h = d;
        if (b == 0) return c;
        if ((b /= e) == 1) return c + d;
        if (!g) g = e * .3;
        if (h < Math.abs(d))
        {
            h = d;
            var f = g / 4
        }
        else var f = g / (2 * Math.PI) * Math.asin(d / h);
        return -(h * Math.pow(2, 10 * (b -= 1)) * Math.sin((b * e - f) * 2 * Math.PI / g)) + c
    },
    easeOutElastic: function (a, b, c, d, e)
    {
        var f = 1.70158;
        var g = 0;
        var h = d;
        if (b == 0) return c;
        if ((b /= e) == 1) return c + d;
        if (!g) g = e * .3;
        if (h < Math.abs(d))
        {
            h = d;
            var f = g / 4
        }
        else var f = g / (2 * Math.PI) * Math.asin(d / h);
        return h * Math.pow(2, -10 * b) * Math.sin((b * e - f) * 2 * Math.PI / g) + d + c
    },
    easeInOutElastic: function (a, b, c, d, e)
    {
        var f = 1.70158;
        var g = 0;
        var h = d;
        if (b == 0) return c;
        if ((b /= e / 2) == 2) return c + d;
        if (!g) g = e * .3 * 1.5;
        if (h < Math.abs(d))
        {
            h = d;
            var f = g / 4
        }
        else var f = g / (2 * Math.PI) * Math.asin(d / h);
        if (b < 1) return -.5 * h * Math.pow(2, 10 * (b -= 1)) * Math.sin((b * e - f) * 2 * Math.PI / g) + c;
        return h * Math.pow(2, -10 * (b -= 1)) * Math.sin((b * e - f) * 2 * Math.PI / g) * .5 + d + c
    },
    easeInBack: function (a, b, c, d, e, f)
    {
        if (f == undefined) f = 1.70158;
        return d * (b /= e) * b * ((f + 1) * b - f) + c
    },
    easeOutBack: function (a, b, c, d, e, f)
    {
        if (f == undefined) f = 1.70158;
        return d * ((b = b / e - 1) * b * ((f + 1) * b + f) + 1) + c
    },
    easeInOutBack: function (a, b, c, d, e, f)
    {
        if (f == undefined) f = 1.70158;
        if ((b /= e / 2) < 1) return d / 2 * b * b * (((f *= 1.525) + 1) * b - f) + c;
        return d / 2 * ((b -= 2) * b * (((f *= 1.525) + 1) * b + f) + 2) + c
    },
    easeInBounce: function (a, b, c, d, e)
    {
        return d - jQuery.easing.easeOutBounce(a, e - b, 0, d, e) + c
    },
    easeOutBounce: function (a, b, c, d, e)
    {
        if ((b /= e) < 1 / 2.75)
        {
            return d * 7.5625 * b * b + c
        }
        else if (b < 2 / 2.75)
        {
            return d * (7.5625 * (b -= 1.5 / 2.75) * b + .75) + c
        }
        else if (b < 2.5 / 2.75)
        {
            return d * (7.5625 * (b -= 2.25 / 2.75) * b + .9375) + c
        }
        else
        {
            return d * (7.5625 * (b -= 2.625 / 2.75) * b + .984375) + c
        }
    },
    easeInOutBounce: function (a, b, c, d, e)
    {
        if (b < e / 2) return jQuery.easing.easeInBounce(a, b * 2, 0, d, e) * .5 + c;
        return jQuery.easing.easeOutBounce(a, b * 2 - e, 0, d, e) * .5 + d * .5 + c
    }
})
