/*
 * mbSlider v1.1.1 - for jQuery 1.3.2 +
 * http://codecanyon.net/item/mbslider/89466
 *
 * Copyright 2010, Michael Barrett
 * You need to buy a license if you want use this script.
 * http://codecanyon.net/wiki/buying/howto-buying/licensing/
 *
 * Date: 13/3/2010
 *
 * For API documentation, FAQ's, Examples and other useful information visit http://www.mb-tools.co.uk/mbslider
 *
 */ (function ($) {
    $.fn.mbSlider = function (o) {
        var p = {
            autoplay: false,
            showControls: {
                next: true,
                prev: true,
                play: true,
                pause: true,
                first: true,
                last: true
            },
            playPauseButtonSeperate: false,
            controlsText: {
                next: "Next",
                prev: "Previous",
                play: "Play",
                pause: "Pause",
                first: "First",
                last: "Last"
            },
            controlsLocation: "external",
            slideDuration: 5000,
            slideSpeed: 800,
            backToStart: true,
            backToStartSpeed: 200,
            backToEnd: true,
            backToEndSpeed: 200,
            startSlide: 1,
            pagination: true,
            paginationLocation: "external",
            pauseOnHover: true,
            orientation: "horizontal",
            playDirection: "right",
            continuous: false,
            easing: "swing",
            mousewheelsupport: true,
            callbacks: {
                movenext: false,
                moveprev: false,
                movefirst: false,
                movelast: false,
                play: false,
                pause: false,
                movestart: false,
                moveend: false,
                mousewheelup: false,
                mousewheeldown: false,
                hoveron: false,
                hoverout: false,
                controlsclick: false,
                controlshoveron: false,
                controlshoverout: false,
                paginationclick: false,
                paginationhoveron: false,
                paginationhoverout: false
            }
        };
        var q = $.extend(true, p, o);
        return this.each(function () {
            $(this).addClass("mbSlider");
            $(this).find("ul:first").addClass("mbSlider_Slides");
            $(this).find("ul:first > li").addClass("mbSlider_Slide");
            var c = $(this).find("li.mbSlider_Slide").length;
            var d = $(this).find("li.mbSlider_Slide").width();
            var e = $(this).find("li.mbSlider_Slide").height();
            var f = true;
            var g = q.startSlide;
            var h;
            var j;
            var k;
            var l = this;
            var m = $(this).attr("id");

            function movenext() {
                if (q.callbacks.movenext) {
                    q.callbacks.movenext()
                }
                if (g == c) {
                    if (q.callbacks.movestart) {
                        q.callbacks.movestart()
                    }
                    if (q.backToStart) {
                        if (q.continuous) {
                            if (f) {
                                f = false;
                                if (q.orientation == "horizontal") {
                                    $(l).find("ul.mbSlider_Slides").css("width", (c * d) + d + "px");
                                    $(l).find("li.mbSlider_Slide:first").clone().appendTo($(l).find("ul.mbSlider_Slides"));
                                    $(l).find("ul.mbSlider_Slides").animate({
                                        marginLeft: 0 - (((c + 1) * d) - d)
                                    }, {
                                        duration: q.slideSpeed,
                                        easing: q.easing,
                                        complete: function () {
                                            $(l).find("ul.mbSlider_Slides").css("margin-left", "0px");
                                            $(l).find("li.mbSlider_Slide:last").remove();
                                            $(l).find("ul.mbSlider_Slides").css("width", c * d);
                                            f = true;
                                            g = 1;
                                            paginationCurrentSlide();
                                            if (q.callbacks.moveend) {
                                                q.callbacks.moveend()
                                            }
                                        }
                                    })
                                }
                                if (q.orientation == "vertical") {
                                    $(l).find("ul.mbSlider_Slides").css("height", (c * e) + e + "px");
                                    $(l).find("li.mbSlider_Slide:first").clone().appendTo($(l).find("ul.mbSlider_Slides"));
                                    $(l).find("ul.mbSlider_Slides").animate({
                                        marginTop: 0 - (((c + 1) * e) - e)
                                    }, {
                                        duration: q.slideSpeed,
                                        easing: q.easing,
                                        complete: function () {
                                            $(l).find("ul.mbSlider_Slides").css("margin-top", "0px");
                                            $(l).find("li.mbSlider_Slide:last").remove();
                                            $(l).find("ul.mbSlider_Slides").css("height", c * e);
                                            f = true;
                                            g = 1;
                                            paginationCurrentSlide();
                                            if (q.callbacks.moveend) {
                                                q.callbacks.moveend()
                                            }
                                        }
                                    })
                                }
                            }
                        } else {
                            goto(1)
                        }
                    }
                } else {
                    animate(1)
                }
            }
            function moveprev() {
                if (q.callbacks.moveprev) {
                    q.callbacks.moveprev()
                }
                if (g == 1) {
                    if (q.callbacks.movestart) {
                        q.callbacks.movestart()
                    }
                    if (q.backToEnd) {
                        if (q.continuous) {
                            if (f) {
                                f = false;
                                if (q.orientation == "horizontal") {
                                    $(l).find("ul.mbSlider_Slides").css("width", (c * d) + d + "px");
                                    $(l).find("li.mbSlider_Slide:last").clone().prependTo($(l).find("ul.mbSlider_Slides"));
                                    $(l).find("ul.mbSlider_Slides").css("margin-left", "-" + d + "px");
                                    $(l).find("ul.mbSlider_Slides").animate({
                                        marginLeft: 0
                                    }, {
                                        duration: q.slideSpeed,
                                        easing: q.easing,
                                        complete: function () {
                                            $(l).find("li.mbSlider_Slide:first").remove();
                                            $(l).find("ul.mbSlider_Slides").css("margin-left", 0 - ((c * d) - d));
                                            f = true;
                                            g = c;
                                            paginationCurrentSlide();
                                            if (q.callbacks.moveend) {
                                                q.callbacks.moveend()
                                            }
                                        }
                                    })
                                }
                                if (q.orientation == "vertical") {
                                    $(l).find("ul.mbSlider_Slides").css("height", (c * e) + e + "px");
                                    $(l).find("li.mbSlider_Slide:last").clone().prependTo($(l).find("ul.mbSlider_Slides"));
                                    $(l).find("ul.mbSlider_Slides").css("margin-top", "-" + e + "px");
                                    $(l).find("ul.mbSlider_Slides").animate({
                                        marginTop: 0
                                    }, {
                                        duration: q.slideSpeed,
                                        easing: q.easing,
                                        complete: function () {
                                            $(l).find("li.mbSlider_Slide:first").remove();
                                            $(l).find("ul.mbSlider_Slides").css("margin-top", 0 - ((c * e) - e));
                                            f = true;
                                            g = c;
                                            paginationCurrentSlide();
                                            if (q.callbacks.moveend) {
                                                q.callbacks.moveend()
                                            }
                                        }
                                    })
                                }
                            }
                        } else {
                            goto(c)
                        }
                    }
                } else {
                    animate(-1)
                }
            }
            function pause() {
                if (q.callbacks.pause) {
                    q.callbacks.pause()
                }
                h = 0;
                clearTimeout(j)
            }
            function play() {
                if (q.callbacks.play) {
                    q.callbacks.play()
                }
                h = 1;
                switch (q.playDirection) {
                case "right":
                    movenext();
                    break;
                case "left":
                    moveprev();
                    break;
                case "up":
                    movenext();
                    break;
                case "down":
                    moveprev();
                    break
                }
                clearTimeout(j);
                j = setTimeout(function () {
                    play()
                }, q.slideDuration)
            }
            function goto(a) {
                if (q.callbacks.movestart) {
                    q.callbacks.movestart()
                }
                if (a == 1 && q.callbacks.movefirst) {
                    q.callbacks.movefirst()
                }
                if (a == c && q.callbacks.movelast) {
                    q.callbacks.movelast()
                }
                if (f) {
                    f = false;
                    if (q.orientation == "horizontal") {
                        $(l).find("ul.mbSlider_Slides").animate({
                            marginLeft: 0 - ((a * d) - d)
                        }, {
                            duration: q.slideSpeed,
                            easing: q.easing,
                            complete: function () {
                                f = true;
                                g = a;
                                paginationCurrentSlide();
                                if (q.callbacks.moveend) {
                                    q.callbacks.moveend()
                                }
                            }
                        })
                    }
                    if (q.orientation == "vertical") {
                        $(l).find("ul.mbSlider_Slides").animate({
                            marginTop: 0 - ((a * e) - e)
                        }, {
                            duration: q.slideSpeed,
                            easing: q.easing,
                            complete: function () {
                                f = true;
                                g = a;
                                paginationCurrentSlide();
                                if (q.callbacks.moveend) {
                                    q.callbacks.moveend()
                                }
                            }
                        })
                    }
                }
            }
            function animate(a) {
                if (q.callbacks.movestart) {
                    q.callbacks.movestart()
                }
                if (f) {
                    f = false;
                    if (q.orientation == "horizontal") {
                        if (a == 1) {
                            $(l).find("ul.mbSlider_Slides").animate({
                                marginLeft: 0 - (g * d)
                            }, {
                                duration: q.slideSpeed,
                                easing: q.easing,
                                complete: function () {
                                    f = true;
                                    g++;
                                    paginationCurrentSlide();
                                    if (q.callbacks.moveend) {
                                        q.callbacks.moveend()
                                    }
                                }
                            })
                        }
                        if (a == -1) {
                            g--;
                            $(l).find("ul.mbSlider_Slides").animate({
                                marginLeft: 0 - ((g * d) - d)
                            }, {
                                duration: q.slideSpeed,
                                easing: q.easing,
                                complete: function () {
                                    f = true;
                                    paginationCurrentSlide();
                                    if (q.callbacks.moveend) {
                                        q.callbacks.moveend()
                                    }
                                }
                            })
                        }
                    }
                    if (q.orientation == "vertical") {
                        if (a == 1) {
                            $(l).find("ul.mbSlider_Slides").animate({
                                marginTop: 0 - (g * e)
                            }, {
                                duration: q.slideSpeed,
                                easing: q.easing,
                                complete: function () {
                                    f = true;
                                    g++;
                                    paginationCurrentSlide();
                                    if (q.callbacks.moveend) {
                                        q.callbacks.moveend()
                                    }
                                }
                            })
                        }
                        if (a == -1) {
                            g--;
                            $(l).find("ul.mbSlider_Slides").animate({
                                marginTop: 0 - ((g * e) - e)
                            }, {
                                duration: q.slideSpeed,
                                easing: q.easing,
                                complete: function () {
                                    f = true;
                                    paginationCurrentSlide();
                                    if (q.callbacks.moveend) {
                                        q.callbacks.moveend()
                                    }
                                }
                            })
                        }
                    }
                }
            }
            function paginationCurrentSlide() {
                if (q.pagination) {
                    $("#" + m + "_pagination").find("a._current-slide").removeClass("_current-slide");
                    $("#" + m + "_pagination").find("a").eq(g - 1).addClass("_current-slide")
                }
                $("._active-slide").removeClass("_active-slide");
                $(".mbSlider_Slide").eq(g - 1).addClass("_active-slide")
            }
            if (q.showControls) {
                var n = "<div id='" + m + "_controls'>";
                if (q.showControls.next) {
                    n += "<a href='javascript:void(0);' id='" + m + "_movenext'>" + q.controlsText.next + "</a>"
                }
                if (q.showControls.prev) {
                    n += "<a href='javascript:void(0);' id='" + m + "_moveprev'>" + q.controlsText.prev + "</a>"
                }
                if (q.showControls.play) {
                    n += "<a href='javascript:void(0);' id='" + m + "_play'>" + q.controlsText.play + "</a>"
                }
                if (q.showControls.pause) {
                    n += "<a href='javascript:void(0);' id='" + m + "_pause'>" + q.controlsText.pause + "</a>"
                }
                if (q.showControls.first) {
                    n += "<a href='javascript:void(0);' id='" + m + "_movefirst'>" + q.controlsText.first + "</a>"
                }
                if (q.showControls.last) {
                    n += "<a href='javascript:void(0);' id='" + m + "_movelast'>" + q.controlsText.last + "</a>"
                }
                n += "</div>";
                if (q.controlsLocation == "external") {
                    $(this).after(n)
                }
                if (q.controlsLocation == "internal") {
                    $(this).append(n)
                }
                $("#" + m + "_controls a").click(function () {
                    if (q.callbacks.controlsclick) {
                        q.callbacks.controlsclick()
                    }
                });
                $("#" + m + "_controls").hover(function () {
                    if (q.callbacks.controlshoveron) {
                        q.callbacks.controlshoveron()
                    }
                }, function () {
                    if (q.callbacks.controlshoverout) {
                        q.callbacks.controlshoverout()
                    }
                });
                $("#" + m + "_movenext").click(function () {
                    movenext()
                });
                $("#" + m + "_moveprev").click(function () {
                    moveprev()
                });
                $("#" + m + "_play").click(function () {
                    if (h != 1) {
                        play()
                    }
                });
                $("#" + m + "_pause").click(function () {
                    if (h !== 0) {
                        pause()
                    }
                });
                $("#" + m + "_movefirst").click(function () {
                    goto(1)
                });
                $("#" + m + "_movelast").click(function () {
                    goto(c)
                });
                if (!q.playPauseButtonSeperate) {
                    $("#" + m + "_play,#" + m + "_pause").wrapAll("<div id='temp'></div>");
                    $("#temp").replaceWith("<a id='" + m + "_playpause' href='javascript:void(0);'></a>");
                    $("#" + m + "_playpause").click(function () {
                        if (h == 1) {
                            clearTimeout(j);
                            pause();
                            $(this).html(q.controlsText.play).removeClass("playing").addClass("paused")
                        } else {
                            h = 1;
                            clearTimeout(j);
                            j = setTimeout(function () {
                                play()
                            }, q.slideDuration);
                            $(this).html(q.controlsText.pause).removeClass("paused").addClass("playing")
                        }
                    })
                }
            }
            $("." + m + "_movenext").click(function () {
                movenext()
            });
            $("." + m + "_moveprev").click(function () {
                moveprev()
            });
            $("." + m + "_play").click(function () {
                if (h != 1) {
                    play()
                }
            });
            $("." + m + "_pause").click(function () {
                if (h !== 0) {
                    pause()
                }
            });
            $("." + m + "_movefirst").click(function () {
                goto(1)
            });
            $("." + m + "_movelast").click(function () {
                goto(c)
            });
            $("[class*='" + m + "_goto']").click(function () {
                var a;
                var b = $(this).attr("class").split(" ");
                for (var i = 0; i <= b.length - 1; i++) {
                    if (b[i].search(m + "_gotoSlide") >= 0) {
                        a = b[i].substring(b[i].indexOf("[") + 1, b[i].indexOf("]"))
                    }
                }
                goto(a)
            });
            if (q.pagination) {
                paginationStructure = "<div id='" + m + "_pagination'>";
                for (var i = 1; i <= c; i++) {
                    if (i == q.startSlide) {
                        paginationStructure += "<a href='javascript:void(0);' class='_current-slide'>" + i + "</a>"
                    } else {
                        paginationStructure += "<a href='javascript:void(0);'>" + i + "</a>"
                    }
                }
                paginationStructure += "</div>";
                if (q.paginationLocation == "external") {
                    $(this).after(paginationStructure)
                }
                if (q.paginationLocation == "internal") {
                    $(this).append(paginationStructure)
                }
                $("#" + m + "_pagination a").click(function () {
                    goto($(this).html())
                });
                $("#" + m + "_pagination a").click(function () {
                    if (q.callbacks.paginationclick) {
                        q.callbacks.paginationclick()
                    }
                });
                $("#" + m + "_pagination").hover(function () {
                    if (q.callbacks.paginationhoveron) {
                        q.callbacks.paginationhoveron()
                    }
                }, function () {
                    if (q.callbacks.paginationhoverout) {
                        q.callbacks.paginationhoverout()
                    }
                })
            }
            if (q.autoplay) {
                j = setTimeout(function () {
                    play()
                }, q.slideDuration);
                h = 1
            } else {
                h = 0
            }
            if (h == 1) {
                $("#" + m + "_playpause").html(q.controlsText.pause).addClass("playing")
            } else {
                $("#" + m + "_playpause").html(q.controlsText.play).addClass("paused")
            }
            if (q.pauseOnHover) {
                $(this).find("li.mbSlider_Slide").hover(function () {
                    if (h == 1) {
                        pause();
                        k = 1
                    }
                }, function () {
                    if (k == 1) {
                        j = setTimeout(function () {
                            play()
                        }, q.slideDuration);
                        k = 0
                    }
                })
            }
            $(this).find("ul.mbSlider_Slides").css({
                "list-style": "none",
                "margin-left": "0px",
                "padding-left": "0px"
            });
            if (q.orientation == "vertical") {
                $(this).find("ul.mbSlider_Slides").css("height", c * e + "px");
                $(this).find("ul.mbSlider_Slides").css("margin-top", 0 - ((g * e) - e))
            }
            if (q.orientation == "horizontal") {
                $(this).find("ul.mbSlider_Slides").css("width", c * d + "px");
                $(this).find("ul.mbSlider_Slides").css("margin-left", 0 - ((g * d) - d))
            }
            $(".mbSlider_Slide").eq(g - 1).addClass("_active-slide");
            $(this).css({
                "overflow": "hidden",
                "height": e + "px",
                "width": d + "px",
                "position": "relative"
            });
            $(this).find("li.mbSlider_Slide").css("float", "left");
            if (q.mousewheelsupport == true) {
                $(this).mousewheel(function (a, b) {
                    if (b > 0) {
                        movenext();
                        if (q.callbacks.mousewheelup) {
                            q.callbacks.mousewheelup()
                        }
                        return false
                    }
                    if (b < 0) {
                        moveprev();
                        if (q.callbacks.mousewheeldown) {
                            q.callbacks.mousewheeldown()
                        }
                        return false
                    }
                })
            }
            $(this).find("li.mbSlider_Slide").hover(function () {
                if (q.callbacks.hoveron) {
                    q.callbacks.hoveron()
                }
            }, function () {
                if (q.callbacks.hoverout) {
                    q.callbacks.hoverout()
                }
            })
        })
    }
})(jQuery);
jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend(jQuery.easing, {
    def: 'easeOutQuad',
    swing: function (x, t, b, c, d) {
        return jQuery.easing[jQuery.easing.def](x, t, b, c, d)
    },
    easeInQuad: function (x, t, b, c, d) {
        return c * (t /= d) * t + b
    },
    easeOutQuad: function (x, t, b, c, d) {
        return -c * (t /= d) * (t - 2) + b
    },
    easeInOutQuad: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t + b;
        return -c / 2 * ((--t) * (t - 2) - 1) + b
    },
    easeInCubic: function (x, t, b, c, d) {
        return c * (t /= d) * t * t + b
    },
    easeOutCubic: function (x, t, b, c, d) {
        return c * ((t = t / d - 1) * t * t + 1) + b
    },
    easeInOutCubic: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;
        return c / 2 * ((t -= 2) * t * t + 2) + b
    },
    easeInQuart: function (x, t, b, c, d) {
        return c * (t /= d) * t * t * t + b
    },
    easeOutQuart: function (x, t, b, c, d) {
        return -c * ((t = t / d - 1) * t * t * t - 1) + b
    },
    easeInOutQuart: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;
        return -c / 2 * ((t -= 2) * t * t * t - 2) + b
    },
    easeInQuint: function (x, t, b, c, d) {
        return c * (t /= d) * t * t * t * t + b
    },
    easeOutQuint: function (x, t, b, c, d) {
        return c * ((t = t / d - 1) * t * t * t * t + 1) + b
    },
    easeInOutQuint: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b;
        return c / 2 * ((t -= 2) * t * t * t * t + 2) + b
    },
    easeInSine: function (x, t, b, c, d) {
        return -c * Math.cos(t / d * (Math.PI / 2)) + c + b
    },
    easeOutSine: function (x, t, b, c, d) {
        return c * Math.sin(t / d * (Math.PI / 2)) + b
    },
    easeInOutSine: function (x, t, b, c, d) {
        return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b
    },
    easeInExpo: function (x, t, b, c, d) {
        return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b
    },
    easeOutExpo: function (x, t, b, c, d) {
        return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b
    },
    easeInOutExpo: function (x, t, b, c, d) {
        if (t == 0) return b;
        if (t == d) return b + c;
        if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
        return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b
    },
    easeInCirc: function (x, t, b, c, d) {
        return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b
    },
    easeOutCirc: function (x, t, b, c, d) {
        return c * Math.sqrt(1 - (t = t / d - 1) * t) + b
    },
    easeInOutCirc: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
        return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b
    },
    easeInElastic: function (x, t, b, c, d) {
        var s = 1.70158;
        var p = 0;
        var a = c;
        if (t == 0) return b;
        if ((t /= d) == 1) return b + c;
        if (!p) p = d * .3;
        if (a < Math.abs(c)) {
            a = c;
            var s = p / 4
        } else var s = p / (2 * Math.PI) * Math.asin(c / a);
        return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b
    },
    easeOutElastic: function (x, t, b, c, d) {
        var s = 1.70158;
        var p = 0;
        var a = c;
        if (t == 0) return b;
        if ((t /= d) == 1) return b + c;
        if (!p) p = d * .3;
        if (a < Math.abs(c)) {
            a = c;
            var s = p / 4
        } else var s = p / (2 * Math.PI) * Math.asin(c / a);
        return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b
    },
    easeInOutElastic: function (x, t, b, c, d) {
        var s = 1.70158;
        var p = 0;
        var a = c;
        if (t == 0) return b;
        if ((t /= d / 2) == 2) return b + c;
        if (!p) p = d * (.3 * 1.5);
        if (a < Math.abs(c)) {
            a = c;
            var s = p / 4
        } else var s = p / (2 * Math.PI) * Math.asin(c / a);
        if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
        return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b
    },
    easeInBack: function (x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        return c * (t /= d) * t * ((s + 1) * t - s) + b
    },
    easeOutBack: function (x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b
    },
    easeInOutBack: function (x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
        return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b
    },
    easeInBounce: function (x, t, b, c, d) {
        return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b
    },
    easeOutBounce: function (x, t, b, c, d) {
        if ((t /= d) < (1 / 2.75)) {
            return c * (7.5625 * t * t) + b
        } else if (t < (2 / 2.75)) {
            return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b
        } else if (t < (2.5 / 2.75)) {
            return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b
        } else {
            return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b
        }
    },
    easeInOutBounce: function (x, t, b, c, d) {
        if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b;
        return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b
    }
});
(function ($) {
    var c = ['DOMMouseScroll', 'mousewheel'];
    $.event.special.mousewheel = {
        setup: function () {
            if (this.addEventListener) for (var i = c.length; i;) this.addEventListener(c[--i], handler, false);
            else this.onmousewheel = handler
        },
        teardown: function () {
            if (this.removeEventListener) for (var i = c.length; i;) this.removeEventListener(c[--i], handler, false);
            else this.onmousewheel = null
        }
    };
    $.fn.extend({
        mousewheel: function (a) {
            return a ? this.bind("mousewheel", a) : this.trigger("mousewheel")
        },
        unmousewheel: function (a) {
            return this.unbind("mousewheel", a)
        }
    });

    function handler(a) {
        var b = [].slice.call(arguments, 1),
            delta = 0,
            returnValue = true;
        a = $.event.fix(a || window.event);
        a.type = "mousewheel";
        if (a.wheelDelta) delta = a.wheelDelta / 120;
        if (a.detail) delta = -a.detail / 3;
        b.unshift(a, delta);
        return $.event.handle.apply(this, b)
    }
})(jQuery);
