﻿var $j = $;

/* 
* cacheImage: a jQuery plugin 
* 
* cacheImage is a simple jQuery plugin for pre-caching images.  The 
* plugin can be used to eliminate flashes of unstyled content (FOUC) and 
* improve perceived page load time.  Callbacks for load, error and abort 
* events are provided. * 
* For usage and examples, visit: 
* http://github.com/alexrabarts/jquery-cacheimage 
* 
* Licensed under the MIT: 
* http://www.opensource.org/licenses/mit-license.php 
* 
* Copyright (c) 2008 Stateless Systems (http://statelesssystems.com) 
* 
* @author   Alex Rabarts (alexrabarts -at- gmail -dawt- com) 
* @requires jQuery v1.2 or later 
* @version  0.2.1 
*/
(function ($) { $.extend($, { cacheImage: function (src, options) { if (typeof src === 'object') { $.each(src, function () { $.cacheImage(String(this), options); }); return; } var image = new Image(); options = options || {}; $.each(['load', 'error', 'abort'], function () { var e = String(this); if (typeof options[e] === 'function') { $(image).bind(e, options[e]); } if (typeof options.complete === 'function') { $(image).bind(e, options.complete); } }); image.src = src; return image; } }); $.extend($.fn, { cacheImage: function (options) { return this.each(function () { $.cacheImage(this.src, options); }); } }); })(jQuery);


/*
 * jScrollPane - v2.0.0beta6 - 2010-12-06
 * http://jscrollpane.kelvinluck.com/
 *
 * Copyright (c) 2010 Kelvin Luck
 * Dual licensed under the MIT and GPL licenses.
 */
(function (b, a, c) {
    b.fn.jScrollPane = function (f) {
        function d(C, L) {
            var au, N = this, V, ah, v, aj, Q, W, y, q, av, aB, ap, i, H, h, j, X, R, al, U, t, A, am, ac, ak, F, l, ao, at, x, aq, aE, g, aA, ag = true, M = true, aD = false, k = false, Z = b.fn.mwheelIntent ? "mwheelIntent.jsp" : "mousewheel.jsp"; aE = C.css("paddingTop") + " " + C.css("paddingRight") + " " + C.css("paddingBottom") + " " + C.css("paddingLeft"); g = (parseInt(C.css("paddingLeft")) || 0) + (parseInt(C.css("paddingRight")) || 0); an(L); function an(aH) { var aL, aK, aJ, aG, aF, aI; au = aH; if (V == c) { C.css({ overflow: "hidden", padding: 0 }); ah = C.innerWidth() + g; v = C.innerHeight(); C.width(ah); V = b('<div class="jspPane" />').wrap(b('<div class="jspContainer" />').css({ width: ah + "px", height: v + "px" })); C.wrapInner(V.parent()); aj = C.find(">.jspContainer"); V = aj.find(">.jspPane"); V.css("padding", aE) } else { C.css("width", ""); aI = C.outerWidth() + g != ah || C.outerHeight() != v; if (aI) { ah = C.innerWidth() + g; v = C.innerHeight(); aj.css({ width: ah + "px", height: v + "px" }) } aA = V.innerWidth(); if (!aI && V.outerWidth() == Q && V.outerHeight() == W) { if (aB || av) { V.css("width", aA + "px"); C.css("width", (aA + g) + "px") } return } V.css("width", ""); C.css("width", (ah) + "px"); aj.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end() } aL = V.clone().css("position", "absolute"); aK = b('<div style="width:1px; position: relative;" />').append(aL); b("body").append(aK); Q = Math.max(V.outerWidth(), aL.outerWidth()); aK.remove(); W = V.outerHeight(); y = Q / ah; q = W / v; av = q > 1; aB = y > 1; if (!(aB || av)) { C.removeClass("jspScrollable"); V.css({ top: 0, width: aj.width() - g }); n(); D(); O(); w(); af() } else { C.addClass("jspScrollable"); aJ = au.maintainPosition && (H || X); if (aJ) { aG = ay(); aF = aw() } aC(); z(); E(); if (aJ) { K(aG); J(aF) } I(); ad(); if (au.enableKeyboardNavigation) { P() } if (au.clickOnTrack) { p() } B(); if (au.hijackInternalLinks) { m() } } if (au.autoReinitialise && !aq) { aq = setInterval(function () { an(au) }, au.autoReinitialiseDelay) } else { if (!au.autoReinitialise && aq) { clearInterval(aq) } } C.trigger("jsp-initialised", [aB || av]) } function aC() { if (av) { aj.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'), b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'), b('<div class="jspDragBottom" />'))), b('<div class="jspCap jspCapBottom" />'))); R = aj.find(">.jspVerticalBar"); al = R.find(">.jspTrack"); ap = al.find(">.jspDrag"); if (au.showArrows) { am = b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp", az(0, -1)).bind("click.jsp", ax); ac = b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp", az(0, 1)).bind("click.jsp", ax); if (au.arrowScrollOnHover) { am.bind("mouseover.jsp", az(0, -1, am)); ac.bind("mouseover.jsp", az(0, 1, ac)) } ai(al, au.verticalArrowPositions, am, ac) } t = v; aj.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function () { t -= b(this).outerHeight() }); ap.hover(function () { ap.addClass("jspHover") }, function () { ap.removeClass("jspHover") }).bind("mousedown.jsp", function (aF) { b("html").bind("dragstart.jsp selectstart.jsp", function () { return false }); ap.addClass("jspActive"); var s = aF.pageY - ap.position().top; b("html").bind("mousemove.jsp", function (aG) { S(aG.pageY - s, false) }).bind("mouseup.jsp mouseleave.jsp", ar);/*return false*/ }); o() } } function o() { al.height(t + "px"); H = 0; U = au.verticalGutter + al.outerWidth(); V.width(ah - U - g); if (R.position().left == 0) { V.css("margin-left", U + "px") } } function z() {
                if (aB) {
                    aj.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'), b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'), b('<div class="jspDragRight" />'))), b('<div class="jspCap jspCapRight" />'))); ak = aj.find(">.jspHorizontalBar"); F = ak.find(">.jspTrack"); h = F.find(">.jspDrag"); if (au.showArrows) {
                        at = b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp", az(-1, 0)).bind("click.jsp", ax); x = b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp", az(1, 0)).bind("click.jsp", ax); if (au.arrowScrollOnHover) {
                            at.bind("mouseover.jsp", az(-1, 0, at));
                            x.bind("mouseover.jsp", az(1, 0, x))
                        } ai(F, au.horizontalArrowPositions, at, x)
                    } h.hover(function () { h.addClass("jspHover") }, function () { h.removeClass("jspHover") }).bind("mousedown.jsp", function (aF) { b("html").bind("dragstart.jsp selectstart.jsp", function () { return false }); h.addClass("jspActive"); var s = aF.pageX - h.position().left; b("html").bind("mousemove.jsp", function (aG) { T(aG.pageX - s, false) }).bind("mouseup.jsp mouseleave.jsp", ar);/*return false*/ }); l = aj.innerWidth(); ae()
                } else { }
            } function ae() { aj.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function () { l -= b(this).outerWidth() }); F.width(l + "px"); X = 0 } function E() { if (aB && av) { var aF = F.outerHeight(), s = al.outerWidth(); t -= aF; b(ak).find(">.jspCap:visible,>.jspArrow").each(function () { l += b(this).outerWidth() }); l -= s; v -= s; ah -= aF; F.parent().append(b('<div class="jspCorner" />').css("width", aF + "px")); o(); ae() } if (aB) { V.width((aj.outerWidth() - g) + "px") } W = V.outerHeight(); q = W / v; if (aB) { ao = 1 / y * l; if (ao > au.horizontalDragMaxWidth) { ao = au.horizontalDragMaxWidth } else { if (ao < au.horizontalDragMinWidth) { ao = au.horizontalDragMinWidth } } h.width(ao + "px"); j = l - ao; ab(X) } if (av) { A = 1 / q * t; if (A > au.verticalDragMaxHeight) { A = au.verticalDragMaxHeight } else { if (A < au.verticalDragMinHeight) { A = au.verticalDragMinHeight } } ap.height(A + "px"); i = t - A; aa(H) } } function ai(aG, aI, aF, s) { var aK = "before", aH = "after", aJ; if (aI == "os") { aI = /Mac/.test(navigator.platform) ? "after" : "split" } if (aI == aK) { aH = aI } else { if (aI == aH) { aK = aI; aJ = aF; aF = s; s = aJ } } aG[aK](aF)[aH](s) } function az(aF, s, aG) { return function () { G(aF, s, this, aG); this.blur(); return false } } function G(aH, aF, aK, aJ) { aK = b(aK).addClass("jspActive"); var aI, s = function () { if (aH != 0) { T(X + aH * au.arrowButtonSpeed, false) } if (aF != 0) { S(H + aF * au.arrowButtonSpeed, false) } }, aG = setInterval(s, au.arrowRepeatFreq); s(); aI = aJ == c ? "mouseup.jsp" : "mouseout.jsp"; aJ = aJ || b("html"); aJ.bind(aI, function () { aK.removeClass("jspActive"); clearInterval(aG); aJ.unbind(aI) }) } function p() { w(); if (av) { al.bind("mousedown.jsp", function (aH) { if (aH.originalTarget == c || aH.originalTarget == aH.currentTarget) { var aG = b(this), s = setInterval(function () { var aI = aG.offset(), aJ = aH.pageY - aI.top; if (H + A < aJ) { S(H + au.trackClickSpeed) } else { if (aJ < H) { S(H - au.trackClickSpeed) } else { aF() } } }, au.trackClickRepeatFreq), aF = function () { s && clearInterval(s); s = null; b(document).unbind("mouseup.jsp", aF) }; b(document).bind("mouseup.jsp", aF);/*return false*/ } }) } if (aB) { F.bind("mousedown.jsp", function (aH) { if (aH.originalTarget == c || aH.originalTarget == aH.currentTarget) { var aG = b(this), s = setInterval(function () { var aI = aG.offset(), aJ = aH.pageX - aI.left; if (X + ao < aJ) { T(X + au.trackClickSpeed) } else { if (aJ < X) { T(X - au.trackClickSpeed) } else { aF() } } }, au.trackClickRepeatFreq), aF = function () { s && clearInterval(s); s = null; b(document).unbind("mouseup.jsp", aF) }; b(document).bind("mouseup.jsp", aF);/*return false*/ } }) } } function w() { F && F.unbind("mousedown.jsp"); al && al.unbind("mousedown.jsp") } function ar() { b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp"); ap && ap.removeClass("jspActive"); h && h.removeClass("jspActive") } function S(s, aF) { if (!av) { return } if (s < 0) { s = 0 } else { if (s > i) { s = i } } if (aF == c) { aF = au.animateScroll } if (aF) { N.animate(ap, "top", s, aa) } else { ap.css("top", s); aa(s) } } function aa(aF) { if (aF == c) { aF = ap.position().top } aj.scrollTop(0); H = aF; var aI = H == 0, aG = H == i, aH = aF / i, s = -aH * (W - v); if (ag != aI || aD != aG) { ag = aI; aD = aG; C.trigger("jsp-arrow-change", [ag, aD, M, k]) } u(aI, aG); V.css("top", s); C.trigger("jsp-scroll-y", [-s, aI, aG]) } function T(aF, s) { if (!aB) { return } if (aF < 0) { aF = 0 } else { if (aF > j) { aF = j } } if (s == c) { s = au.animateScroll } if (s) { N.animate(h, "left", aF, ab) } else { h.css("left", aF); ab(aF) } } function ab(aF) { if (aF == c) { aF = h.position().left } aj.scrollTop(0); X = aF; var aI = X == 0, aH = X == j, aG = aF / j, s = -aG * (Q - ah); if (M != aI || k != aH) { M = aI; k = aH; C.trigger("jsp-arrow-change", [ag, aD, M, k]) } r(aI, aH); V.css("left", s); C.trigger("jsp-scroll-x", [-s, aI, aH]) } function u(aF, s) { if (au.showArrows) { am[aF ? "addClass" : "removeClass"]("jspDisabled"); ac[s ? "addClass" : "removeClass"]("jspDisabled") } } function r(aF, s) {
                if (au.showArrows) {
                    at[aF ? "addClass" : "removeClass"]("jspDisabled");
                    x[s ? "addClass" : "removeClass"]("jspDisabled")
                }
            } function J(s, aF) { var aG = s / (W - v); S(aG * i, aF) } function K(aF, s) { var aG = aF / (Q - ah); T(aG * j, s) } function Y(aR, aM, aG) { var aK, aH, aI, s = 0, aQ = 0, aF, aL, aO, aN, aP; try { aK = b(aR) } catch (aJ) { return } aH = aK.outerHeight(); aI = aK.outerWidth(); aj.scrollTop(0); aj.scrollLeft(0); while (!aK.is(".jspPane")) { s += aK.position().top; aQ += aK.position().left; aK = aK.offsetParent(); if (/^body|html$/i.test(aK[0].nodeName)) { return } } aF = aw(); aL = aF + v; if (s < aF || aM) { aN = s - au.verticalGutter } else { if (s + aH > aL) { aN = s - v + aH + au.verticalGutter } } if (aN) { J(aN, aG) } viewportLeft = ay(); aO = viewportLeft + ah; if (aQ < viewportLeft || aM) { aP = aQ - au.horizontalGutter } else { if (aQ + aI > aO) { aP = aQ - ah + aI + au.horizontalGutter } } if (aP) { K(aP, aG) } } function ay() { return -V.position().left } function aw() { return -V.position().top } function ad() { aj.unbind(Z).bind(Z, function (aI, aJ, aH, aF) { var aG = X, s = H; T(X + aH * au.mouseWheelSpeed * ah / (Q - ah), false); S(H - aF * au.mouseWheelSpeed * v / (W - v), false); return aG == X && s == H }) } function n() { aj.unbind(Z) } function ax() { return false } function I() { V.unbind("focusin.jsp").bind("focusin.jsp", function (s) { if (s.target === V[0]) { return } Y(s.target, false) }) } function D() { V.unbind("focusin.jsp") } function P() { var aF, s; C.attr("tabindex", 0).unbind("keydown.jsp").bind("keydown.jsp", function (aJ) { if (aJ.target !== C[0]) { return } var aH = X, aG = H, aI = aF ? 2 : 16; switch (aJ.keyCode) { case 40: S(H + aI, false); break; case 38: S(H - aI, false); break; case 34: case 32: J(aw() + Math.max(32, v) - 16); break; case 33: J(aw() - v + 16); break; case 35: J(W - v); break; case 36: J(0); break; case 39: T(X + aI, false); break; case 37: T(X - aI, false); break } if (!(aH == X && aG == H)) { aF = true; clearTimeout(s); s = setTimeout(function () { aF = false }, 260); return false } }); if (au.hideFocus) { C.css("outline", "none"); if ("hideFocus" in aj[0]) { C.attr("hideFocus", true) } } else { C.css("outline", ""); if ("hideFocus" in aj[0]) { C.attr("hideFocus", false) } } } function O() { C.attr("tabindex", "-1").removeAttr("tabindex").unbind("keydown.jsp") } function B() { if (location.hash && location.hash.length > 1) { var aG, aF; try { aG = b(location.hash) } catch (s) { return } if (aG.length && V.find(aG)) { if (aj.scrollTop() == 0) { aF = setInterval(function () { if (aj.scrollTop() > 0) { Y(location.hash, true); b(document).scrollTop(aj.position().top); clearInterval(aF) } }, 50) } else { Y(location.hash, true); b(document).scrollTop(aj.position().top) } } } } function af() { b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack") } function m() { af(); b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack", function () { var s = this.href.split("#"), aF; if (s.length > 1) { aF = s[1]; if (aF.length > 0 && V.find("#" + aF).length > 0) { Y("#" + aF, true); return false } } }) } b.extend(N, { reinitialise: function (aF) { aF = b.extend({}, aF, au); an(aF) }, scrollToElement: function (aG, aF, s) { Y(aG, aF, s) }, scrollTo: function (aG, s, aF) { K(aG, aF); J(s, aF) }, scrollToX: function (aF, s) { K(aF, s) }, scrollToY: function (s, aF) { J(s, aF) }, scrollBy: function (aF, s, aG) { N.scrollByX(aF, aG); N.scrollByY(s, aG) }, scrollByX: function (s, aG) { var aF = ay() + s, aH = aF / (Q - ah); T(aH * j, aG) }, scrollByY: function (s, aG) { var aF = aw() + s, aH = aF / (W - v); S(aH * i, aG) }, animate: function (aF, aI, s, aH) { var aG = {}; aG[aI] = s; aF.animate(aG, { duration: au.animateDuration, ease: au.animateEase, queue: false, step: aH }) }, getContentPositionX: function () { return ay() }, getContentPositionY: function () { return aw() }, getIsScrollableH: function () { return aB }, getIsScrollableV: function () { return av }, getContentPane: function () { return V }, scrollToBottom: function (s) { S(i, s) }, hijackInternalLinks: function () { m() } })
        } f = b.extend({}, b.fn.jScrollPane.defaults, f); var e; this.each(function () { var g = b(this), h = g.data("jsp"); if (h) { h.reinitialise(f) } else { h = new d(g, f); g.data("jsp", h) } e = e ? e.add(g) : g }); return e
    }; b.fn.jScrollPane.defaults = { showArrows: false, maintainPosition: true, clickOnTrack: true, autoReinitialise: false, autoReinitialiseDelay: 500, verticalDragMinHeight: 0, verticalDragMaxHeight: 99999, horizontalDragMinWidth: 0, horizontalDragMaxWidth: 99999, animateScroll: false, animateDuration: 300, animateEase: "linear", hijackInternalLinks: false, verticalGutter: 4, horizontalGutter: 4, mouseWheelSpeed: 30, arrowButtonSpeed: 30, arrowRepeatFreq: 100, arrowScrollOnHover: false, trackClickSpeed: 30, trackClickRepeatFreq: 100, verticalArrowPositions: "split", horizontalArrowPositions: "split", enableKeyboardNavigation: true, hideFocus: false }
})(jQuery, this);


/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 * Thanks to: Seamus Leahy for adding deltaX and deltaY
 *
 * Version: 3.0.4
 * 
 * Requires: 1.2.2+
 */

(function ($) {

    var types = ['DOMMouseScroll', 'mousewheel'];

    $.event.special.mousewheel = {
        setup: function () {
            if (this.addEventListener) {
                for (var i = types.length; i;) {
                    this.addEventListener(types[--i], handler, false);
                }
            } else {
                this.onmousewheel = handler;
            }
        },

        teardown: function () {
            if (this.removeEventListener) {
                for (var i = types.length; i;) {
                    this.removeEventListener(types[--i], handler, false);
                }
            } else {
                this.onmousewheel = null;
            }
        }
    };

    $.fn.extend({
        mousewheel: function (fn) {
            return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
        },

        unmousewheel: function (fn) {
            return this.unbind("mousewheel", fn);
        }
    });


    function handler(event) {
        var orgEvent = event || window.event, args = [].slice.call(arguments, 1), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
        event = $.event.fix(orgEvent);
        event.type = "mousewheel";

        // Old school scrollwheel delta
        if (event.wheelDelta) { delta = event.wheelDelta / 120; }
        if (event.detail) { delta = -event.detail / 3; }

        // New school multidimensional scroll (touchpads) deltas
        deltaY = delta;

        // Gecko
        if (orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS) {
            deltaY = 0;
            deltaX = -1 * delta;
        }

        // Webkit
        if (orgEvent.wheelDeltaY !== undefined) { deltaY = orgEvent.wheelDeltaY / 120; }
        if (orgEvent.wheelDeltaX !== undefined) { deltaX = -1 * orgEvent.wheelDeltaX / 120; }

        // Add event and delta to the front of the arguments
        args.unshift(event, delta, deltaX, deltaY);

        return $.event.handle.apply(this, args);
    }

})(jQuery);


/*
* JQZoom Evolution 1.0.1 - Javascript Image magnifier
* Modified for k-eCommerce - kZoom
*
* Copyright (c) Engineer Renzi Marco(www.mind-projects.it)
*
* $Date: 12-12-2008
*
*	ChangeLog:
*  
* $License : GPL,so any change to the code you should copy and paste this section,and would be nice to report this to me(renzi.mrc@gmail.com).
*
* http://www.mind-projects.it/projects/jqzoom/index.php#documentation
*/
(function ($) {
    $.fn.unjqzoom = function () { return this.trigger("unjqzoom"); }
    $.fn.jqzoom = function (options) {
        var settings = { zoomType: 'standard', zoomWidth: 200, zoomHeight: 200, xOffset: 10, yOffset: 0, position: "right", lens: true, lensReset: false, imageOpacity: 0.2, title: true, alwaysOn: false, showEffect: 'show', hideEffect: 'hide', fadeinSpeed: 'fast', fadeoutSpeed: 'slow', preloadImages: true, showPreload: true, preloadText: 'Loading zoom', preloadPosition: 'center' }; options = options || {}; $.extend(settings, options); return this.each(function () {
            var a = $(this); var aTitle = a.attr('title'); var aOnClick = a.attr('onclick'); $(a).removeAttr('title'); $(a).removeAttr('alt'); $(a).css('outline-style', 'none'); $(a).attr('href', ''); var img = $("img", this); var imageTitle = img.attr('title'); img.removeAttr('title'); img.removeAttr('alt'); var imageZoomHeight = img.attr('imgZoomHeight'); var imageZoomWidth = img.attr('imgZoomWidth'); var smallimage = new Smallimage(img); var smallimagedata = {}; var btop = 0; var bleft = 0; var loader = null; loader = new Loader(); var ZoomTitle = (trim(aTitle).length > 0) ? aTitle : (trim(imageTitle).length > 0) ? imageTitle : null; var ZoomTitleObj = new zoomTitle(); var largeimage = null; var lens = new Lens(); var lensdata = {}; var largeimageloaded = false; var scale = {}; var stage = null; var running = false; var mousepos = {}; var firstime = 0; var preloadshow = false; var isMouseDown = false; var dragstatus = false; smallimage.loadimage(); if ($('#oucProductPictureViewer_lnkProductFrameLargerView').css("display") == "none") { $(this).css("cursor", "default"); }
            $(this).one("unjqzoom", function () { deactivate(); $(this).unbind("mouseenter"); $(this).unbind("mouseleave"); $(this).unbind("click"); }); $(this).click(function () { return false; }); $(this).mouseenter(function (e) {
                if (!running) {
                    mousepos.x = e.pageX; mousepos.y = e.pageY; if (img.attr('imgZoomUrl') != undefined) { activate(); }
                    else { deactivate(); }
                }
            }).mouseleave(deactivate); $(window).resize(function () { if (running) { smallimagedata.pos = img.offset(); smallimagedata.pos.l = img.offset().left; smallimagedata.pos.t = img.offset().top; smallimagedata.pos.r = smallimagedata.w + smallimagedata.pos.l; smallimagedata.pos.b = smallimagedata.h + smallimagedata.pos.t; leftpos = (smallimagedata.pos.r + Math.abs(settings.xOffset) + settings.zoomWidth < screen.width) ? (smallimagedata.pos.l + smallimagedata.w + Math.abs(settings.xOffset)) : (smallimagedata.pos.l - settings.zoomWidth - Math.abs(settings.xOffset)); topwindow = smallimagedata.pos.t + settings.yOffset + settings.zoomHeight; toppos = (topwindow < screen.height && topwindow > 0) ? smallimagedata.pos.t + settings.yOffset : smallimagedata.pos.t; $('div.kZoomWindow').css('left', leftpos); $('div.kZoomWindow').css('top', toppos); } }); if (settings.alwaysOn) { setTimeout(function () { activate(); }, 150); }
            function activate() {
                if (!running) {
                    smallimage.findborder(); running = true; imageTitle = img.attr('title'); img.removeAttr('title'); img.removeAttr('alt'); aTitle = a.attr('title'); $(a).removeAttr('title').removeAttr('alt'); imageZoomHeight = img.attr('imgZoomHeight'); imageZoomWidth = img.attr('imgZoomWidth'); if (!largeimage || $.browser.safari) { largeimage = new Largeimage(img.attr('imgZoomUrl')); }
                    else { largeimage.url = img.attr('imgZoomUrl'); largeimage.loadimage(); }
                    if (!largeimageloaded || $.browser.safari) { largeimage.loadimage(); } else {
                        if (settings.zoomType != 'innerzoom') { stage = new Stage(); stage.activate(); }
                        lens = new Lens; lens.activate();
                    }
                    img[0].blur(); return false;
                }
            }; function deactivate() {
                if (settings.zoomType == 'reverse' && !settings.alwaysOn) { img.css({ 'opacity': 1 }); }
                if (largeimage != null) { largeimage.url = ""; }
                if (!settings.alwaysOn) {
                    running = false; largeimageloaded = false; $(lens.node).unbind('mousemove'); lens.remove(); if ($('div.kZoomWindow').length > 0) { stage.remove(); }
                    if ($('div.kZoomTitle').length > 0) { ZoomTitleObj.remove(); }
                    img.attr('title', imageTitle); img.attr('alt', imageTitle); a.attr('title', aTitle); a.attr('alt', aTitle); $().unbind(); a.unbind('mousemove'); firstime = 0; if (jQuery('.zoom_ieframe').length > 0) { jQuery('.zoom_ieframe').remove(); }
                } else { if (settings.lensReset) { switch (settings.zoomType) { case 'innerzoom': largeimage.setcenter(); break; default: lens.center(); break; }; } }
                if (settings.alwaysOn) { activate(); }
            }; function Smallimage(image) {
                this.node = image[0]; this.loadimage = function () { this.node.src = image[0].src; if ($.browser.safari) { this.node.onload(); } }; this.findborder = function () {
                    var bordertop = ''; bordertop = $(img).css('border-top-width'); btop = ''; var borderleft = ''; borderleft = $(img).css('border-left-width'); bleft = ''; if (bordertop) { for (i = 0; i < 3; i++) { var x = []; x = bordertop.substr(i, 1); if (isNaN(x) == false) { btop = btop + '' + bordertop.substr(i, 1); } else { break; } } }
                    if (borderleft) { for (i = 0; i < 3; i++) { if (!isNaN(borderleft.substr(i, 1))) { bleft = bleft + borderleft.substr(i, 1) } else { break; } } }
                    btop = (btop.length > 0) ? eval(btop) : 0; bleft = (bleft.length > 0) ? eval(bleft) : 0;
                }; this.node.onload = function () {
                    a.css({ 'cursor': 'pointer', 'display': 'block' }); if (a.css('position') != 'absolute' && a.parent().css('position')) { if ($.browser.mozilla) { a.css({ 'cursor': 'pointer', 'position': 'relative', 'display': 'inline-block' }); } else if ($.browser.opera) { a.css({ 'cursor': 'pointer', 'position': 'relative', 'display': 'block' }); } else { a.css({ 'cursor': 'pointer', 'position': 'relative', 'display': 'block' }); } }
                    if (a.parent().css('position') != 'absolute') { a.parent().css('position', 'relative'); }
                    else { }
                    smallimagedata.w = $(this).width(); smallimagedata.h = $(this).height(); smallimagedata.h = $(this).height(); smallimagedata.pos = $(this).offset(); smallimagedata.pos.l = $(this).offset().left; smallimagedata.pos.t = $(this).offset().top; smallimagedata.pos.r = smallimagedata.w + smallimagedata.pos.l; smallimagedata.pos.b = smallimagedata.h + smallimagedata.pos.t; a.height(smallimagedata.h); a.width(smallimagedata.w); if (settings.preloadImages) { if (largeimage) { largeimage.loadimage(); } }
                }; return this;
            }; function Lens() {
                this.node = document.createElement("div"); $(this.node).addClass('kZoomPreview'); this.node.onerror = function () { $(lens.node).remove(); lens = new Lens(); lens.activate(); }; this.loadlens = function () {
                    switch (settings.zoomType) {
                        case 'reverse': this.image = new Image(); this.image.src = smallimage.node.src; this.node.appendChild(this.image); $(this.node).css({ 'opacity': 1 }); break; case 'innerzoom': this.image = new Image(); this.image.src = largeimage.node.src; this.node.appendChild(this.image); $(this.node).css({ 'opacity': 1 }); break
                        default: break;
                    }; switch (settings.zoomType) { case 'innerzoom': lensdata.w = smallimagedata.w; lensdata.h = smallimagedata.h; break; default: lensdata.w = (settings.zoomWidth) / scale.x; lensdata.h = (settings.zoomHeight) / scale.y; break; }; $(this.node).css({ width: lensdata.w + 'px', height: lensdata.h + 'px', position: 'absolute', display: 'none', borderWidth: 1 + 'px' }); a.append(this.node);
                }; return this;
            }; Lens.prototype.activate = function () {
                this.loadlens(); switch (settings.zoomType) {
                    case 'reverse': img.css({ 'opacity': settings.imageOpacity }); (settings.alwaysOn) ? lens.center() : lens.setposition(null); a.bind('mousemove', function (e) { mousepos.x = e.pageX; mousepos.y = e.pageY; lens.setposition(e); }); break; case 'innerzoom': $(this.node).css({ top: 0, left: 0 }); if (settings.title) { ZoomTitleObj.loadtitle(); }
                        largeimage.setcenter(); a.bind('mousemove', function (e) { mousepos.x = e.pageX; mousepos.y = e.pageY; largeimage.setinner(e); }); break; default: (settings.alwaysOn) ? lens.center() : lens.setposition(null); $(a).bind('mousemove', function (e) { mousepos.x = e.pageX; mousepos.y = e.pageY; lens.setposition(e); }); break;
                }; return this;
            }; Lens.prototype.setposition = function (e) {
                if (e) { mousepos.x = e.pageX; mousepos.y = e.pageY; }
                if (firstime == 0) {
                    var lensleft = mousepos.x - smallimagedata.pos.l - (lensdata.w) / 2; var lenstop = mousepos.y - smallimagedata.pos.t - (lensdata.h) / 2; $('div.kZoomPreview').show()
                    if (settings.lens) { this.node.style.visibility = 'visible'; }
                    else { this.node.style.visibility = 'hidden'; $('div.kZoomPreview').hide(); }
                    firstime = 1;
                } else { var lensleft = mousepos.x - smallimagedata.pos.l - (lensdata.w) / 2; var lenstop = mousepos.y - smallimagedata.pos.t - (lensdata.h) / 2; }
                if (overleft()) { lensleft = 0 + bleft; } else if (overright()) { if ($.browser.msie) { lensleft = smallimagedata.w - lensdata.w + bleft + 1; } else { lensleft = smallimagedata.w - lensdata.w + bleft - 1; } }
                if (overtop()) { lenstop = 0 + btop; } else if (overbottom()) { if ($.browser.msie) { lenstop = smallimagedata.h - lensdata.h + btop + 1; } else { lenstop = smallimagedata.h - lensdata.h - 1 + btop; } }
                lensleft = parseInt(lensleft); lenstop = parseInt(lenstop); $('div.kZoomPreview', a).css({ top: lenstop, left: lensleft }); if (settings.zoomType == 'reverse') { $('div.kZoomPreview img', a).css({ 'position': 'relative', 'top': -(lenstop - btop + 1), 'left': -(lensleft - bleft + 1) }); }
                this.node.style.left = lensleft + 'px'; this.node.style.top = lenstop + 'px'; largeimage.setposition(); function overleft() { return mousepos.x - (lensdata.w + 2 * 1) / 2 - bleft < smallimagedata.pos.l; }; function overright() { return mousepos.x + (lensdata.w + 2 * 1) / 2 > smallimagedata.pos.r + bleft; }; function overtop() { return mousepos.y - (lensdata.h + 2 * 1) / 2 - btop < smallimagedata.pos.t; }; function overbottom() { return mousepos.y + (lensdata.h + 2 * 1) / 2 > smallimagedata.pos.b + btop; }; return this;
            }; Lens.prototype.center = function () {
                $('div.kZoomPreview', a).css('display', 'none'); var lensleft = (smallimagedata.w) / 2 - (lensdata.w) / 2; var lenstop = (smallimagedata.h) / 2 - (lensdata.h) / 2; this.node.style.left = lensleft + 'px'; this.node.style.top = lenstop + 'px'; $('div.kZoomPreview', a).css({ top: lenstop, left: lensleft }); if (settings.zoomType == 'reverse') { $('div.kZoomPreview img', a).css({ 'position': 'absolute', 'top': -(lenstop - btop + 1), 'left': -(lensleft - bleft + 1) }); }
                largeimage.setposition(); if ($.browser.msie) { $('div.kZoomPreview', a).show(); } else { setTimeout(function () { $('div.kZoomPreview').fadeIn('fast'); }, 10); }
            }; Lens.prototype.getoffset = function () { var o = {}; o.left = parseInt(this.node.style.left); o.top = parseInt(this.node.style.top); return o; }; Lens.prototype.remove = function () { if (settings.zoomType == 'innerzoom') { $('div.kZoomPreview', a).fadeOut('fast', function () { $(this).remove(); }); } else { $('div.kZoomPreview', a).remove(); } }; Lens.prototype.findborder = function () {
                var bordertop = ''; bordertop = $('div.kZoomPreview').css('borderTop'); lensbtop = ''; var borderleft = ''; borderleft = $('div.kZoomPreview').css('borderLeft'); lensbleft = ''; if ($.browser.msie) { var temp = bordertop.split(' '); bordertop = temp[1]; var temp = borderleft.split(' '); borderleft = temp[1]; }
                if (bordertop) { for (i = 0; i < 3; i++) { var x = []; x = bordertop.substr(i, 1); if (isNaN(x) == false) { lensbtop = lensbtop + '' + bordertop.substr(i, 1); } else { break; } } }
                if (borderleft) { for (i = 0; i < 3; i++) { if (!isNaN(borderleft.substr(i, 1))) { lensbleft = lensbleft + borderleft.substr(i, 1) } else { break; } } }
                lensbtop = (lensbtop.length > 0) ? eval(lensbtop) : 0; lensbleft = (lensbleft.length > 0) ? eval(lensbleft) : 0;
            }; function Largeimage(url) {
                this.url = url; this.node = new Image(); this.loadimage = function () {
                    if (!this.node) this.node = new Image(); this.node.style.position = 'absolute'; this.node.style.display = 'none'; this.node.style.left = '-5000px'; this.node.style.top = '10px'; loader = new Loader(); if (settings.showPreload && !preloadshow) { loader.show(); preloadshow = true; }
                    document.body.appendChild(this.node); this.node.width = imageZoomWidth; this.node.height = imageZoomHeight; this.node.src = this.url;
                }; this.node.onload = function () {
                    this.style.display = 'block'; var w = 0; var h = 0; w = Math.round(imageZoomWidth); h = Math.round(imageZoomHeight); this.style.display = 'none'; scale.x = (w / smallimagedata.w); scale.y = (h / smallimagedata.h); if ($('div.preload').length > 0) { $('div.preload').remove(); }
                    largeimageloaded = true; if (settings.zoomType != 'innerzoom' && running) { stage = new Stage(); stage.activate(); }
                    if (running) { lens = new Lens(); lens.activate(); }
                    if ($('div.preload').length > 0) { $('div.preload').remove(); }
                }; return this;
            }; Largeimage.prototype.setposition = function () { this.node.style.left = Math.ceil(-scale.x * parseInt(lens.getoffset().left) + bleft) + 'px'; this.node.style.top = Math.ceil(-scale.y * parseInt(lens.getoffset().top) + btop) + 'px'; }; Largeimage.prototype.setinner = function (e) { this.node.style.left = Math.ceil(-scale.x * Math.abs(e.pageX - smallimagedata.pos.l)) + 'px'; this.node.style.top = Math.ceil(-scale.y * Math.abs(e.pageY - smallimagedata.pos.t)) + 'px'; $('div.kZoomPreview img', a).css({ 'position': 'absolute', 'top': this.node.style.top, 'left': this.node.style.left }); }; Largeimage.prototype.setcenter = function () { this.node.style.left = Math.ceil(-scale.x * Math.abs((smallimagedata.w) / 2)) + 'px'; this.node.style.top = Math.ceil(-scale.y * Math.abs((smallimagedata.h) / 2)) + 'px'; $('div.kZoomPreview img', a).css({ 'position': 'absolute', 'top': this.node.style.top, 'left': this.node.style.left }); }; function Stage() { var leftpos = smallimagedata.pos.l; var toppos = smallimagedata.pos.t; this.node = document.createElement("div"); $(this.node).addClass('kZoomWindow'); $(this.node).css({ position: 'absolute', width: Math.round(settings.zoomWidth) + 'px', height: Math.round(settings.zoomHeight) + 'px', display: 'none', zIndex: 10000, overflow: 'hidden' }); switch (settings.position) { case "right": leftpos = (smallimagedata.pos.r + Math.abs(settings.xOffset) + settings.zoomWidth < screen.width) ? (smallimagedata.pos.l + smallimagedata.w + Math.abs(settings.xOffset)) : (smallimagedata.pos.l - settings.zoomWidth - Math.abs(settings.xOffset)); topwindow = smallimagedata.pos.t + settings.yOffset + settings.zoomHeight; toppos = (topwindow < screen.height && topwindow > 0) ? smallimagedata.pos.t + settings.yOffset : smallimagedata.pos.t; break; case "left": leftpos = (smallimagedata.pos.l - Math.abs(settings.xOffset) - settings.zoomWidth > 0) ? (smallimagedata.pos.l - Math.abs(settings.xOffset) - settings.zoomWidth) : (smallimagedata.pos.l + smallimagedata.w + Math.abs(settings.xOffset)); topwindow = smallimagedata.pos.t + settings.yOffset + settings.zoomHeight; toppos = (topwindow < screen.height && topwindow > 0) ? smallimagedata.pos.t + settings.yOffset : smallimagedata.pos.t; break; case "top": toppos = (smallimagedata.pos.t - Math.abs(settings.yOffset) - settings.zoomHeight > 0) ? (smallimagedata.pos.t - Math.abs(settings.yOffset) - settings.zoomHeight) : (smallimagedata.pos.t + smallimagedata.h + Math.abs(settings.yOffset)); leftwindow = smallimagedata.pos.l + settings.xOffset + settings.zoomWidth; leftpos = (leftwindow < screen.width && leftwindow > 0) ? smallimagedata.pos.l + settings.xOffset : smallimagedata.pos.l; break; case "bottom": toppos = (smallimagedata.pos.b + Math.abs(settings.yOffset) + settings.zoomHeight < $('body').height()) ? (smallimagedata.pos.b + Math.abs(settings.yOffset)) : (smallimagedata.pos.t - settings.zoomHeight - Math.abs(settings.yOffset)); leftwindow = smallimagedata.pos.l + settings.xOffset + settings.zoomWidth; leftpos = (leftwindow < screen.width && leftwindow > 0) ? smallimagedata.pos.l + settings.xOffset : smallimagedata.pos.l; break; default: leftpos = (smallimagedata.pos.l + smallimagedata.w + settings.xOffset + settings.zoomWidth < screen.width) ? (smallimagedata.pos.l + smallimagedata.w + Math.abs(settings.xOffset)) : (smallimagedata.pos.l - settings.zoomWidth - Math.abs(settings.xOffset)); toppos = (smallimagedata.pos.b + Math.abs(settings.yOffset) + settings.zoomHeight < screen.height) ? (smallimagedata.pos.b + Math.abs(settings.yOffset)) : (smallimagedata.pos.t - settings.zoomHeight - Math.abs(settings.yOffset)); break; }; this.node.style.left = leftpos + 'px'; this.node.style.top = toppos + 'px'; return this; }; Stage.prototype.activate = function () {
                if (!this.node.firstChild) this.node.appendChild(largeimage.node); if (settings.title) { ZoomTitleObj.loadtitle(); }
                document.body.appendChild(this.node); switch (settings.showEffect) { case 'show': $(this.node).show(); break; case 'fadein': $(this.node).fadeIn(settings.fadeinSpeed); break; default: $(this.node).show(); break; }; $(this.node).show(); if ($.browser.msie && $.browser.version < 7) { this.ieframe = $('<iframe class="zoom_ieframe" frameborder="0" src="#"></iframe>').css({ position: "absolute", left: this.node.style.left, top: this.node.style.top, zIndex: 99, width: settings.zoomWidth, height: settings.zoomHeight }).insertBefore(this.node); }; largeimage.node.style.display = 'block';
            }; Stage.prototype.remove = function () { switch (settings.hideEffect) { case 'hide': $('.kZoomWindow').remove(); break; case 'fadeout': $('.kZoomWindow').fadeOut(settings.fadeoutSpeed); break; default: $('.kZoomWindow').remove(); break; }; }; function zoomTitle() { this.node = jQuery('<div />').addClass('kZoomTitle').html('' + ZoomTitle + ''); this.loadtitle = function () { if (settings.zoomType == 'innerzoom') { $(this.node).css({ position: 'absolute', top: smallimagedata.pos.b + 3, left: (smallimagedata.pos.l + 1), width: smallimagedata.w }).appendTo('body'); } else { $(this.node).appendTo(stage.node); } }; }; zoomTitle.prototype.remove = function () { $('.kZoomTitle').remove(); }; function Loader() { this.node = document.createElement("div"); $(this.node).addClass('preload'); $(this.node).html(settings.preloadText); $(this.node).appendTo("body").css('visibility', 'hidden'); this.show = function () { switch (settings.preloadPosition) { case 'center': loadertop = smallimagedata.pos.t + (smallimagedata.h - $(this.node).height()) / 2; loaderleft = smallimagedata.pos.l + (smallimagedata.w - $(this.node).width()) / 2; break; default: var loaderoffset = this.getoffset(); loadertop = !isNaN(loaderoffset.top) ? smallimagedata.pos.t + loaderoffset.top : smallimagedata.pos.t + 0; loaderleft = !isNaN(loaderoffset.left) ? smallimagedata.pos.l + loaderoffset.left : smallimagedata.pos.l + 0; break; }; $(this.node).css({ top: loadertop, left: loaderleft, position: 'absolute', visibility: 'visible' }); }; return this; }; Loader.prototype.getoffset = function () { var o = null; o = $('div.preload').offset(); return o; };
        });
    }
    function trim(stringa) {
        while (stringa.substring(0, 1) == ' ') { stringa = stringa.substring(1, stringa.length); }
        while (stringa.substring(stringa.length - 1, stringa.length) == ' ') { stringa = stringa.substring(0, stringa.length - 1); }
        return stringa;
    };
})(jQuery);


/*****************************************/

/*
 * SimpleModal 1.4.3 - jQuery Plugin
 * http://simplemodal.com/
 * Copyright (c) 2012 Eric Martin
 * Licensed under MIT and GPL
 * Date: Sat, Sep 8 2012 07:52:31 -0700
 */
(function (b) { "function" === typeof define && define.amd ? define(["jquery"], b) : b(jQuery) })(function (b) {
    var j = [], l = b(document), m = b.browser.msie && 6 === parseInt(b.browser.version) && "object" !== typeof window.XMLHttpRequest, o = b.browser.msie && 7 === parseInt(b.browser.version), n = null, k = b(window), h = []; b.modal = function (a, d) { return b.modal.impl.init(a, d) }; b.modal.close = function () { b.modal.impl.close() }; b.modal.focus = function (a) { b.modal.impl.focus(a) }; b.modal.setContainerDimensions = function () { b.modal.impl.setContainerDimensions() };
    b.modal.setPosition = function () { b.modal.impl.setPosition() }; b.modal.update = function (a, d) { b.modal.impl.update(a, d) }; b.fn.modal = function (a) { return b.modal.impl.init(this, a) }; b.modal.defaults = {
        appendTo: "body", focus: !0, opacity: 50, overlayId: "simplemodal-overlay", overlayCss: {}, containerId: "simplemodal-container", containerCss: {}, dataId: "simplemodal-data", dataCss: {}, minHeight: null, minWidth: null, maxHeight: null, maxWidth: null, autoResize: !1, autoPosition: !0, zIndex: 1E3, close: !0, closeHTML: '<a class="modalCloseImg" title="Close"></a>',
        closeClass: "simplemodal-close", escClose: !0, overlayClose: !1, fixed: !0, position: null, persist: !1, modal: !0, onOpen: null, onShow: null, onClose: null
    }; b.modal.impl = {
        d: {}, init: function (a, d) {
            if (this.d.data) return !1; n = b.browser.msie && !b.support.boxModel && parseInt(b.browser.version) < 10; this.o = b.extend({}, b.modal.defaults, d); this.zIndex = this.o.zIndex; this.occb = !1; if ("object" === typeof a) {
                if (a = a instanceof b ? a : b(a), this.d.placeholder = !1, 0 < a.parent().parent().size() && (a.before(b("<span></span>").attr("id", "simplemodal-placeholder").css({ display: "none" })),
                this.d.placeholder = !0, this.display = a.css("display"), !this.o.persist)) this.d.orig = a.clone(!0)
            } else if ("string" === typeof a || "number" === typeof a) a = b("<div></div>").html(a); else return alert("SimpleModal Error: Unsupported data type: " + typeof a), this; this.create(a); this.open(); b.isFunction(this.o.onShow) && this.o.onShow.apply(this, [this.d]); return this
        }, create: function (a) {
            this.getDimensions(); if (this.o.modal && m) this.d.iframe = b('<iframe src="javascript:false;"></iframe>').css(b.extend(this.o.iframeCss,
            { display: "none", opacity: 0, position: "fixed", height: h[0], width: h[1], zIndex: this.o.zIndex, top: 0, left: 0 })).appendTo(this.o.appendTo); this.d.overlay = b("<div></div>").attr("id", this.o.overlayId).addClass("simplemodal-overlay").css(b.extend(this.o.overlayCss, { display: "none", opacity: this.o.opacity / 100, height: this.o.modal ? j[0] : 0, width: this.o.modal ? j[1] : 0, position: "fixed", left: 0, top: 0, zIndex: this.o.zIndex + 1 })).appendTo(this.o.appendTo); this.d.container = b("<div></div>").attr("id", this.o.containerId).addClass("simplemodal-container").css(b.extend({
                position: this.o.fixed ?
                "fixed" : "absolute"
            }, this.o.containerCss, { display: "none", zIndex: this.o.zIndex + 2 })).append(this.o.close && this.o.closeHTML ? b(this.o.closeHTML).addClass(this.o.closeClass) : "").appendTo(this.o.appendTo); this.d.wrap = b("<div></div>").attr("tabIndex", -1).addClass("simplemodal-wrap").css({ height: "100%", outline: 0, width: "100%" }).appendTo(this.d.container); this.d.data = a.attr("id", a.attr("id") || this.o.dataId).addClass("simplemodal-data").css(b.extend(this.o.dataCss, { display: "none" })).appendTo("body"); this.setContainerDimensions();
            this.d.data.appendTo(this.d.wrap); (m || n) && this.fixIE()
        }, bindEvents: function () {
            var a = this; b("." + a.o.closeClass).bind("click.simplemodal", function (b) { b.preventDefault(); a.close() }); a.o.modal && a.o.close && a.o.overlayClose && a.d.overlay.bind("click.simplemodal", function (b) { b.preventDefault(); a.close() }); l.bind("keydown.simplemodal", function (b) { a.o.modal && 9 === b.keyCode ? a.watchTab(b) : a.o.close && a.o.escClose && 27 === b.keyCode && (b.preventDefault(), a.close()) }); k.bind("resize.simplemodal orientationchange.simplemodal",
            function () { a.getDimensions(); a.o.autoResize ? a.setContainerDimensions() : a.o.autoPosition && a.setPosition(); m || n ? a.fixIE() : a.o.modal && (a.d.iframe && a.d.iframe.css({ height: h[0], width: h[1] }), a.d.overlay.css({ height: j[0], width: j[1] })) })
        }, unbindEvents: function () { b("." + this.o.closeClass).unbind("click.simplemodal"); l.unbind("keydown.simplemodal"); k.unbind(".simplemodal"); this.d.overlay.unbind("click.simplemodal") }, fixIE: function () {
            var a = this.o.position; b.each([this.d.iframe || null, !this.o.modal ? null : this.d.overlay,
            "fixed" === this.d.container.css("position") ? this.d.container : null], function (b, f) {
                if (f) {
                    var g = f[0].style; g.position = "absolute"; if (2 > b) g.removeExpression("height"), g.removeExpression("width"), g.setExpression("height", 'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"'), g.setExpression("width", 'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"'); else {
                        var c, e; a && a.constructor ===
                        Array ? (c = a[0] ? "number" === typeof a[0] ? a[0].toString() : a[0].replace(/px/, "") : f.css("top").replace(/px/, ""), c = -1 === c.indexOf("%") ? c + ' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"' : parseInt(c.replace(/%/, "")) + ' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"', a[1] && (e = "number" === typeof a[1] ?
                        a[1].toString() : a[1].replace(/px/, ""), e = -1 === e.indexOf("%") ? e + ' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"' : parseInt(e.replace(/%/, "")) + ' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"')) : (c = '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',
                        e = '(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"'); g.removeExpression("top"); g.removeExpression("left"); g.setExpression("top", c); g.setExpression("left", e)
                    }
                }
            })
        }, focus: function (a) {
            var d = this, a = a && -1 !== b.inArray(a, ["first", "last"]) ? a : "first", f = b(":input:enabled:visible:" + a, d.d.wrap); setTimeout(function () { 0 < f.length ? f.focus() : d.d.wrap.focus() },
            10)
        }, getDimensions: function () { var a = "undefined" === typeof window.innerHeight ? k.height() : window.innerHeight; j = [l.height(), l.width()]; h = [a, k.width()] }, getVal: function (a, b) { return a ? "number" === typeof a ? a : "auto" === a ? 0 : 0 < a.indexOf("%") ? parseInt(a.replace(/%/, "")) / 100 * ("h" === b ? h[0] : h[1]) : parseInt(a.replace(/px/, "")) : null }, update: function (a, b) {
            if (!this.d.data) return !1; this.d.origHeight = this.getVal(a, "h"); this.d.origWidth = this.getVal(b, "w"); this.d.data.hide(); a && this.d.container.css("height", a); b && this.d.container.css("width",
            b); this.setContainerDimensions(); this.d.data.show(); this.o.focus && this.focus(); this.unbindEvents(); this.bindEvents()
        }, setContainerDimensions: function () {
            var a = m || o, d = this.d.origHeight ? this.d.origHeight : b.browser.opera ? this.d.container.height() : this.getVal(a ? this.d.container[0].currentStyle.height : this.d.container.css("height"), "h"), a = this.d.origWidth ? this.d.origWidth : b.browser.opera ? this.d.container.width() : this.getVal(a ? this.d.container[0].currentStyle.width : this.d.container.css("width"), "w"), f = this.d.data.outerHeight(!0),
            g = this.d.data.outerWidth(!0); this.d.origHeight = this.d.origHeight || d; this.d.origWidth = this.d.origWidth || a; var c = this.o.maxHeight ? this.getVal(this.o.maxHeight, "h") : null, e = this.o.maxWidth ? this.getVal(this.o.maxWidth, "w") : null, c = c && c < h[0] ? c : h[0], e = e && e < h[1] ? e : h[1], i = this.o.minHeight ? this.getVal(this.o.minHeight, "h") : "auto", d = d ? this.o.autoResize && d > c ? c : d < i ? i : d : f ? f > c ? c : this.o.minHeight && "auto" !== i && f < i ? i : f : i, c = this.o.minWidth ? this.getVal(this.o.minWidth, "w") : "auto", a = a ? this.o.autoResize && a > e ? e : a < c ? c : a :
            g ? g > e ? e : this.o.minWidth && "auto" !== c && g < c ? c : g : c; this.d.container.css({ height: d, width: a }); this.d.wrap.css({ overflow: f > d || g > a ? "auto" : "visible" }); this.o.autoPosition && this.setPosition()
        }, setPosition: function () {
            var a, b; a = h[0] / 2 - this.d.container.outerHeight(!0) / 2; b = h[1] / 2 - this.d.container.outerWidth(!0) / 2; var f = "fixed" !== this.d.container.css("position") ? k.scrollTop() : 0; this.o.position && "[object Array]" === Object.prototype.toString.call(this.o.position) ? (a = f + (this.o.position[0] || a), b = this.o.position[1] ||
            b) : a = f + a; this.d.container.css({ left: b, top: a })
        }, watchTab: function (a) { if (0 < b(a.target).parents(".simplemodal-container").length) { if (this.inputs = b(":input:enabled:visible:first, :input:enabled:visible:last", this.d.data[0]), !a.shiftKey && a.target === this.inputs[this.inputs.length - 1] || a.shiftKey && a.target === this.inputs[0] || 0 === this.inputs.length) a.preventDefault(), this.focus(a.shiftKey ? "last" : "first") } else a.preventDefault(), this.focus() }, open: function () {
            this.d.iframe && this.d.iframe.show(); b.isFunction(this.o.onOpen) ?
            this.o.onOpen.apply(this, [this.d]) : (this.d.overlay.show(), this.d.container.show(), this.d.data.show()); this.o.focus && this.focus(); this.bindEvents()
        }, close: function () {
            if (!this.d.data) return !1; this.unbindEvents(); if (b.isFunction(this.o.onClose) && !this.occb) this.occb = !0, this.o.onClose.apply(this, [this.d]); else {
                if (this.d.placeholder) { var a = b("#simplemodal-placeholder"); this.o.persist ? a.replaceWith(this.d.data.removeClass("simplemodal-data").css("display", this.display)) : (this.d.data.hide().remove(), a.replaceWith(this.d.orig)) } else this.d.data.hide().remove();
                this.d.container.hide().remove(); this.d.overlay.hide(); this.d.iframe && this.d.iframe.hide().remove(); this.d.overlay.remove(); this.d = {}
            }
        }
    }
});




/*
 * jQuery Tools 1.2.5 - The missing UI library for the Web
 * 
 * [scrollable]
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/
 * 
 * File generated: Fri Nov 26 02:15:39 GMT 2010
 */
(function (e) {
    function p(f, c) { var b = e(c); return b.length < 2 ? b : f.parent().find(c) } function u(f, c) {
        var b = this, n = f.add(b), g = f.children(), l = 0, j = c.vertical; k || (k = b); if (g.length > 1) g = e(c.items, f); e.extend(b, {
            getConf: function () { return c }, getIndex: function () { return l }, getSize: function () { return b.getItems().size() }, getNaviButtons: function () { return o.add(q) }, getRoot: function () { return f }, getItemWrap: function () { return g }, getItems: function () { return g.children(c.item).not("." + c.clonedClass) }, move: function (a, d) {
                return b.seekTo(l +
                a, d)
            }, next: function (a) { return b.move(1, a) }, prev: function (a) { return b.move(-1, a) }, begin: function (a) { return b.seekTo(0, a) }, end: function (a) { return b.seekTo(b.getSize() - 1, a) }, focus: function () { return k = b }, addItem: function (a) { a = e(a); if (c.circular) { g.children("." + c.clonedClass + ":last").before(a); g.children("." + c.clonedClass + ":first").replaceWith(a.clone().addClass(c.clonedClass)) } else g.append(a); n.trigger("onAddItem", [a]); return b }, seekTo: function (a, d, h) {
                a.jquery || (a *= 1); if (c.circular && a === 0 && l == -1 && d !==
                0) return b; if (!c.circular && a < 0 || a > b.getSize() || a < -1) return b; var i = a; if (a.jquery) a = b.getItems().index(a); else i = b.getItems().eq(a); var r = e.Event("onBeforeSeek"); if (!h) { n.trigger(r, [a, d]); if (r.isDefaultPrevented() || !i.length) return b } i = j ? { top: -i.position().top } : { left: -i.position().left }; l = a; k = b; if (d === undefined) d = c.speed; g.animate(i, d, c.easing, h || function () { n.trigger("onSeek", [a]) }); return b
            }
        }); e.each(["onBeforeSeek", "onSeek", "onAddItem"], function (a, d) {
            e.isFunction(c[d]) && e(b).bind(d, c[d]); b[d] = function (h) {
                h &&
                e(b).bind(d, h); return b
            }
        }); if (c.circular) { var s = b.getItems().slice(-1).clone().prependTo(g), t = b.getItems().eq(1).clone().appendTo(g); s.add(t).addClass(c.clonedClass); b.onBeforeSeek(function (a, d, h) { if (!a.isDefaultPrevented()) if (d == -1) { b.seekTo(s, h, function () { b.end(0) }); return a.preventDefault() } else d == b.getSize() && b.seekTo(t, h, function () { b.begin(0) }) }); b.seekTo(0, 0, function () { }) } var o = p(f, c.prev).click(function () { b.prev() }), q = p(f, c.next).click(function () { b.next() }); if (!c.circular && b.getSize() > 1) {
            b.onBeforeSeek(function (a,
            d) { setTimeout(function () { if (!a.isDefaultPrevented()) { o.toggleClass(c.disabledClass, d <= 0); q.toggleClass(c.disabledClass, d >= b.getSize() - 1) } }, 1) }); c.initialIndex || o.addClass(c.disabledClass)
        } c.mousewheel && e.fn.mousewheel && f.mousewheel(function (a, d) { if (c.mousewheel) { b.move(d < 0 ? 1 : -1, c.wheelSpeed || 50); return false } }); if (c.touch) {
            var m = {}; g[0].ontouchstart = function (a) { a = a.touches[0]; m.x = a.clientX; m.y = a.clientY }; g[0].ontouchmove = function (a) {
                if (a.touches.length == 1 && !g.is(":animated")) {
                    var d = a.touches[0], h =
                    m.x - d.clientX; d = m.y - d.clientY; b[j && d > 0 || !j && h > 0 ? "next" : "prev"](); a.preventDefault()
                }
            }
        } c.keyboard && e(document).bind("keydown.scrollable", function (a) { if (!(!c.keyboard || a.altKey || a.ctrlKey || e(a.target).is(":input"))) if (!(c.keyboard != "static" && k != b)) { var d = a.keyCode; if (j && (d == 38 || d == 40)) { b.move(d == 38 ? -1 : 1); return a.preventDefault() } if (!j && (d == 37 || d == 39)) { b.move(d == 37 ? -1 : 1); return a.preventDefault() } } }); c.initialIndex && b.seekTo(c.initialIndex, 0, function () { })
    } e.tools = e.tools || { version: "1.2.5" }; e.tools.scrollable =
    { conf: { activeClass: "active", circular: false, clonedClass: "cloned", disabledClass: "disabled", easing: "swing", initialIndex: 0, item: null, items: ".items", keyboard: true, mousewheel: false, next: ".next", prev: ".prev", speed: 400, vertical: false, touch: true, wheelSpeed: 0 } }; var k; e.fn.scrollable = function (f) { var c = this.data("scrollable"); if (c) return c; f = e.extend({}, e.tools.scrollable.conf, f); this.each(function () { c = new u(e(this), f); e(this).data("scrollable", c) }); return f.api ? c : this }
})(jQuery);



/*
 AnythingSlider v1.4.7 minified using Google Closure Compiler
 By Chris Coyier: http://css-tricks.com
 with major improvements by Doug Neiner: http://pixelgraphics.us/
 based on work by Remy Sharp: http://jqueryfordesigners.com/
*/
(function ($) { $.anythingSlider = function (f, g) { var a = this; a.$el = $(f).addClass("anythingBase").wrap('<div class="anythingSlider"><div class="anythingWindow" /></div>'); a.$el.data("AnythingSlider", a); a.init = function () { a.options = $.extend({}, $.anythingSlider.defaults, g); a.$wrapper = a.$el.parent().closest("div.anythingSlider").addClass("anythingSlider-" + a.options.theme); a.$window = a.$el.closest("div.anythingWindow"); a.$controls = $('<div class="anythingControls"></div>').appendTo(a.$wrapper); a.$items = a.$el.find("> li").addClass("panel"); a.pages = a.$items.length; a.timer = null; a.flag = false; a.playing = false; a.hovered = false; a.panelSize = []; a.currentPage = a.options.startPanel; a.$currentPage = a.$items.eq(a.currentPage); a.$lastPage = a.$currentPage; a.hasEmb = !!a.$items.find("embed[src*=youtube]").length; a.hasSwfo = typeof swfobject !== "undefined" && swfobject.hasOwnProperty("embedSWF") && $.isFunction(swfobject.embedSWF) ? true : false; a.runTimes = $("div.anythingSlider").index(a.$wrapper) + 1; a.regex = RegExp("panel" + a.runTimes + "-(\\d+)", "i"); if (!$.isFunction($.easing[a.options.easing])) a.options.easing = "swing"; a.options.theme != "default" && !$("link[href*=" + a.options.theme + "]").length && $("body").append('<link rel="stylesheet" href="' + a.options.themeDirectory.replace(/\{themeName\}/g, a.options.theme) + '" type="text/css" />'); a.hasEmb && a.hasSwfo && a.$items.find("embed[src*=youtube]").each(function (c) { ($(this).parent()[0].tagName == "OBJECT" ? $(this).parent() : $(this)).wrap('<div id="ytvideo' + c + '"></div>'); swfobject.embedSWF($(this).attr("src") + "&enablejsapi=1&version=3&playerapiid=ytvideo" + c, "ytvideo" + c, "100%", "100%", "10", null, null, { allowScriptAccess: "always", wmode: a.options.addWmodeToObject }, {}) }); if (a.options.resizeContents) { a.options.width && a.$wrapper.add(a.$items).css("width", a.options.width); a.options.height && a.$wrapper.add(a.$items).css("height", a.options.height); a.hasEmb && a.$el.find("object, embed").css({ width: "100%", height: "100%" }) } if (a.pages === 1) { a.options.autoPlay = false; a.options.buildNavigation = false; a.options.buildArrows = false } if (a.options.autoPlay) { a.playing = !a.options.startStopped; a.buildAutoPlay() } a.buildNavigation(); a.$el.prepend(a.$items.filter(":last").clone().addClass("cloned").removeAttr("id")); a.$el.append(a.$items.filter(":first").clone().addClass("cloned").removeAttr("id")); a.$items = a.$el.find("> li"); a.setDimensions(); a.options.resizeContents || $(window).load(function () { a.setDimensions() }); a.options.buildArrows && a.buildNextBackButtons(); a.options.pauseOnHover && a.$wrapper.hover(function () { if (a.playing) { a.$el.trigger("slideshow_paused", a); $.isFunction(a.options.onShowPause) && a.options.onShowPause(a); a.clearTimer(true) } }, function () { if (a.playing) { a.$el.trigger("slideshow_unpaused", a); $.isFunction(a.options.onShowUnpause) && a.options.onShowUnpause(a); a.startStop(a.playing, true) } }); var b = a.options.hashTags ? a.gotoHash() || a.options.startPanel : a.options.startPanel; a.setCurrentPage(b, false); a.$items.find("a").focus(function () { a.$items.find(".focusedLink").removeClass("focusedLink"); $(this).addClass("focusedLink"); a.$items.each(function (c) { if ($(this).find("a.focusedLink").length) { a.gotoPage(c); return false } }) }); a.slideControls(false); a.$wrapper.hover(function (c) { a.hovered = c.type == "mouseenter" ? true : false; a.slideControls(a.hovered, false) }); $(document).keyup(function (c) { if (a.$wrapper.is(".activeSlider")) switch (c.which) { case 39: a.goForward(); break; case 37: a.goBack() } }) }; a.buildNavigation = function () { a.$nav = $('<ul class="thumbNav" />').appendTo(a.$controls); a.options.playRtl && a.$wrapper.addClass("rtl"); a.options.buildNavigation && a.pages > 1 && a.$items.each(function (b) { var c = b + 1; b = $("<a href='#'></a>").addClass("panel" + c).wrap("<li />"); a.$nav.append(b.parent()); if ($.isFunction(a.options.navigationFormatter)) { var d = a.options.navigationFormatter(c, $(this)); b.html(d); parseInt(b.css("text-indent"), 10) < 0 && b.addClass(a.options.tooltipClass).attr("title", d) } else b.text(c); b.bind(a.options.clickControls, function (e) { if (!a.flag) { a.flag = true; setTimeout(function () { a.flag = false }, 100); a.gotoPage(c); a.options.hashTags && a.setHash(c) } e.preventDefault() }) }) }; a.buildNextBackButtons = function () { a.$forward = $('<span class="arrow forward"><a href="#">' + a.options.forwardText + "</a></span>"); a.$back = $('<span class="arrow back"><a href="#">' + a.options.backText + "</a></span>"); a.$back.bind(a.options.clickArrows, function (b) { a.goBack(); b.preventDefault() }); a.$forward.bind(a.options.clickArrows, function (b) { a.goForward(); b.preventDefault() }); a.$back.add(a.$forward).find("a").bind("focusin focusout", function () { $(this).toggleClass("hover") }); a.$wrapper.prepend(a.$forward).prepend(a.$back); a.$arrowWidth = a.$forward.width() }; a.buildAutoPlay = function () { a.$startStop = $("<a href='#' class='start-stop'></a>").html(a.playing ? a.options.stopText : a.options.startText); a.$controls.append(a.$startStop); a.$startStop.bind(a.options.clickSlideshow, function (b) { a.startStop(!a.playing); if (a.playing) a.options.playRtl ? a.goBack(true) : a.goForward(true); b.preventDefault() }).bind("focusin focusout", function () { $(this).toggleClass("hover") }); a.startStop(a.playing) }; a.setDimensions = function () { var b, c, d, e, i, h = 0, j = a.$window.width(), k = $(window).width(); a.$items.each(function (l) { d = $(this).children("*"); if (a.options.resizeContents) { b = parseInt(a.options.width, 10) || j; c = parseInt(a.options.height, 10) || a.$window.height(); $(this).css({ width: b, height: c }); d.length == 1 && d.css({ width: "100%", height: "100%" }) } else { b = $(this).width(); i = b >= k ? true : false; if (d.length == 1 && i) { e = d.width() >= k ? j : d.width(); $(this).css("width", e); d.css("max-width", e); b = e } b = i ? a.options.width || j : b; $(this).css("width", b); c = $(this).outerHeight(); $(this).css("height", c) } a.panelSize[l] = [b, c, h]; h += b }); a.$el.css("width", h < a.options.maxOverallWidth ? h : a.options.maxOverallWidth) }; a.gotoPage = function (b, c) { a.$lastPage = a.$items.eq(a.currentPage); if (typeof b === "undefined" || b === null) { b = a.options.startPage; a.setCurrentPage(a.options.startPage) } if (!(a.hasEmb && a.checkVideo(a.playing))) { if (b > a.pages + 1) b = a.pages; if (b < 0) b = 1; a.$currentPage = a.$items.eq(b); a.$el.trigger("slide_init", a); $.isFunction(a.options.onSlideInit) && a.options.onSlideInit(a); a.slideControls(true, false); if (c !== true) c = false; if (!c || a.options.stopAtEnd && b == a.pages) a.startStop(false); a.$el.trigger("slide_begin", a); $.isFunction(a.options.onSlideBegin) && a.options.onSlideBegin(a); a.options.resizeContents || a.$wrapper.filter(":not(:animated)").animate({ width: a.panelSize[b][0], height: a.panelSize[b][1] }, { queue: false, duration: a.options.animationTime, easing: a.options.easing }); a.$window.filter(":not(:animated)").animate({ scrollLeft: a.panelSize[b][2] }, { queue: false, duration: a.options.animationTime, easing: a.options.easing, complete: function () { a.endAnimation(b) } }) } }; a.endAnimation = function (b) { if (b === 0) { a.$window.scrollLeft(a.panelSize[a.pages][2]); b = a.pages } else if (b > a.pages) { a.$window.scrollLeft(a.panelSize[1][2]); b = 1 } a.setCurrentPage(b, false); a.hovered || a.slideControls(false); if (a.hasEmb) { b = a.$currentPage.find("object[id*=ytvideo], embed[id*=ytvideo]"); b.length && $.isFunction(b[0].getPlayerState) && b[0].getPlayerState() > 0 && b[0].getPlayerState() != 5 && b[0].playVideo() } a.$el.trigger("slide_complete", a); $.isFunction(a.options.onSlideComplete) && setTimeout(function () { a.options.onSlideComplete(a) }, 0) }; a.setCurrentPage = function (b, c) { if (a.options.buildNavigation) { a.$nav.find(".cur").removeClass("cur"); a.$nav.find("a").eq(b - 1).addClass("cur") } if (!c) { a.$wrapper.css({ width: a.panelSize[b][0], height: a.panelSize[b][1] }); a.$wrapper.scrollLeft(0); a.$window.scrollLeft(a.panelSize[b][2]) } a.currentPage = b; if (!a.$wrapper.is(".activeSlider")) { $(".activeSlider").removeClass("activeSlider"); a.$wrapper.addClass("activeSlider") } }; a.goForward = function (b) { if (b !== true) { b = false; a.startStop(false) } a.gotoPage(a.currentPage + 1, b) }; a.goBack = function (b) { if (b !== true) { b = false; a.startStop(false) } a.gotoPage(a.currentPage - 1, b) }; a.gotoHash = function () { var b = window.location.hash.match(a.regex); return b === null ? "" : parseInt(b[1], 10) }; a.setHash = function (b) { var c = "panel" + a.runTimes + "-", d = window.location.hash; if (typeof d !== "undefined") window.location.hash = d.indexOf(c) > 0 ? d.replace(a.regex, c + b) : d + "&" + c + b }; a.slideControls = function (b) { var c = b ? "slideDown" : "slideUp", d = b ? 0 : a.options.animationTime, e = b ? a.options.animationTime : 0; b = b ? 0 : 1; a.options.toggleControls && a.$controls.stop(true, true).delay(d)[c](a.options.animationTime / 2).delay(e); if (a.options.toggleArrows) { if (!a.hovered && a.playing) b = 1; a.$forward.stop(true, true).delay(d).animate({ right: b * a.$arrowWidth, opacity: e }, a.options.animationTime / 2); a.$back.stop(true, true).delay(d).animate({ left: b * a.$arrowWidth, opacity: e }, a.options.animationTime / 2) } }; a.clearTimer = function (b) { if (a.timer) { window.clearInterval(a.timer); if (!b) { a.$el.trigger("slideshow_stop", a); $.isFunction(a.options.onShowStop) && a.options.onShowStop(a) } } }; a.startStop = function (b, c) { if (b !== true) b = false; if (b && !c) { a.$el.trigger("slideshow_start", a); $.isFunction(a.options.onShowStart) && a.options.onShowStart(a) } a.playing = b; if (a.options.autoPlay) { a.$startStop.toggleClass("playing", b).html(b ? a.options.stopText : a.options.startText); if (parseInt(a.$startStop.css("text-indent"), 10) < 0) a.$startStop.addClass(a.options.tooltipClass).attr("title", b ? "Stop" : "Start") } if (b) { a.clearTimer(true); a.timer = window.setInterval(function () { a.hasEmb && a.checkVideo(b) || (a.options.playRtl ? a.goBack(true) : a.goForward(true)) }, a.options.delay) } else a.clearTimer() }; a.checkVideo = function (b) { var c, d, e = false; a.$items.find("object[id*=ytvideo], embed[id*=ytvideo]").each(function () { c = $(this); if (c.length && $.isFunction(c[0].getPlayerState)) { d = c[0].getPlayerState(); if (b && (d == 1 || d > 2) && a.$items.index(c.closest("li.panel")) == a.currentPage && a.options.resumeOnVideoEnd) e = true; else d > 0 && c[0].pauseVideo() } }); return e }; a.init() }; $.anythingSlider.defaults = { width: null, height: null, resizeContents: true, tooltipClass: "tooltip", theme: "default", themeDirectory: "css/theme-{themeName}.css", startPanel: 1, hashTags: true, buildArrows: true, toggleArrows: false, buildNavigation: true, toggleControls: false, navigationFormatter: null, forwardText: "&raquo;", backText: "&laquo;", autoPlay: true, startStopped: false, pauseOnHover: true, resumeOnVideoEnd: true, stopAtEnd: false, playRtl: false, startText: "Start", stopText: "Stop", delay: 3E3, animationTime: 600, easing: "swing", onShowStart: null, onShowStop: null, onShowPause: null, onShowUnpause: null, onSlideInit: null, onSlideBegin: null, onSlideComplete: null, clickArrows: "click", clickControls: "click focusin", clickSlideshow: "click", addWmodeToObject: "opaque", maxOverallWidth: 32766 }; $.fn.anythingSlider = function (f) { if ((typeof f).match("object|undefined")) return this.each(function () { $(this).is(".anythingBase") || new $.anythingSlider(this, f) }); else if (/\d/.test(f) && !isNaN(f)) return this.each(function () { var g = $(this).data("AnythingSlider"); if (g) { var a = typeof f == "number" ? f : parseInt($.trim(f), 10); a < 1 || a > g.pages || g.gotoPage(a) } }) } })(jQuery);





/*
 * jQuery Nivo Slider v2.1
 * http://nivo.dev7studios.com
 *
 * Copyright 2010, Gilbert Pellegrom
 * Free to use and abuse under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * May 2010 - Pick random effect from specified set of effects by toronegro
 * May 2010 - controlNavThumbsFromRel option added by nerd-sh
 * May 2010 - Do not start nivoRun timer if there is only 1 slide by msielski
 * April 2010 - controlNavThumbs option added by Jamie Thompson (http://jamiethompson.co.uk)
 * March 2010 - manualAdvance option added by HelloPablo (http://hellopablo.co.uk)
 */

eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) { d[e(c)] = k[c] || e(c) } k = [function (e) { return d[e] }]; e = function () { return '\\w+' }; c = 1 }; while (c--) { if (k[c]) { p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]) } } return p }('(9($){$.1k.1o=9(2b){b 3=$.2g({},$.1k.1o.21,2b);N g.H(9(){b 4={f:0,u:\'\',W:0,r:\'\',L:n,1j:n,1S:n};b 5=$(g);5.1T(\'7:4\',4);5.e(\'2o\',\'2m\');5.1f(\'1o\');b d=5.2n();d.H(9(){b l=$(g);b 1t=\'\';6(!l.J(\'B\')){6(l.J(\'a\')){l.1f(\'7-2h\');1t=l}l=l.1m(\'B:1r\')}b 18=l.x();6(18==0)18=l.t(\'x\');b 1b=l.y();6(1b==0)1b=l.t(\'y\');6(18>5.x()){5.x(18)}6(1b>5.y()){5.y(1b)}6(1t!=\'\'){1t.e(\'P\',\'1q\')}l.e(\'P\',\'1q\');4.W++});6(3.19>0){6(3.19>=4.W)3.19=4.W-1;4.f=3.19}6($(d[4.f]).J(\'B\')){4.u=$(d[4.f])}k{4.u=$(d[4.f]).1m(\'B:1r\')}6($(d[4.f]).J(\'a\')){$(d[4.f]).e(\'P\',\'1A\')}5.e(\'11\',\'10(\'+4.u.t(\'E\')+\') Z-Y\');23(b i=0;i<3.h;i++){b G=U.29(5.x()/3.h);6(i==3.h-1){5.O($(\'<D A="7-c"></D>\').e({2a:(G*i)+\'1c\',x:(5.x()-(G*i))+\'1c\'}))}k{5.O($(\'<D A="7-c"></D>\').e({2a:(G*i)+\'1c\',x:G+\'1c\'}))}}5.O($(\'<D A="7-K"><p></p></D>\').e({P:\'1q\',z:3.1U}));6(4.u.t(\'w\')!=\'\'){b w=4.u.t(\'w\');6(w.24(0,1)==\'#\')w=$(w).1d();$(\'.7-K p\',5).1d(w);$(\'.7-K\',5).1z(3.o)}b m=0;6(!3.1p&&d.1g>1){m=1E(9(){F(5,d,3,n)},3.1u)}6(3.S){5.O(\'<D A="7-S"><a A="7-27">2k</a><a A="7-25">2i</a></D>\');6(3.1R){$(\'.7-S\',5).26();5.1V(9(){$(\'.7-S\',5).2j()},9(){$(\'.7-S\',5).26()})}$(\'a.7-27\',5).1C(\'1F\',9(){6(4.L)N n;T(m);m=\'\';4.f-=2;F(5,d,3,\'1y\')});$(\'a.7-25\',5).1C(\'1F\',9(){6(4.L)N n;T(m);m=\'\';F(5,d,3,\'1x\')})}6(3.M){b 14=$(\'<D A="7-M"></D>\');5.O(14);23(b i=0;i<d.1g;i++){6(3.1P){b l=d.1B(i);6(!l.J(\'B\')){l=l.1m(\'B:1r\')}6(3.1O){14.O(\'<a A="7-1s" 1a="\'+i+\'"><B E="\'+l.t(\'1a\')+\'" 2e="" /></a>\')}k{14.O(\'<a A="7-1s" 1a="\'+i+\'"><B E="\'+l.t(\'E\').2l(3.1M,3.1N)+\'" 2e="" /></a>\')}}k{14.O(\'<a A="7-1s" 1a="\'+i+\'">\'+(i+1)+\'</a>\')}}$(\'.7-M a:1B(\'+4.f+\')\',5).1f(\'1h\');$(\'.7-M a\',5).1C(\'1F\',9(){6(4.L)N n;6($(g).2f(\'1h\'))N n;T(m);m=\'\';5.e(\'11\',\'10(\'+4.u.t(\'E\')+\') Z-Y\');4.f=$(g).t(\'1a\')-1;F(5,d,3,\'1s\')})}6(3.1X){$(2s).2F(9(1D){6(1D.1Q==\'2D\'){6(4.L)N n;T(m);m=\'\';4.f-=2;F(5,d,3,\'1y\')}6(1D.1Q==\'2C\'){6(4.L)N n;T(m);m=\'\';F(5,d,3,\'1x\')}})}6(3.1W){5.1V(9(){4.1j=Q;T(m);m=\'\'},9(){4.1j=n;6(m==\'\'&&!3.1p){m=1E(9(){F(5,d,3,n)},3.1u)}})}5.2E(\'7:X\',9(){4.L=n;$(d).H(9(){6($(g).J(\'a\')){$(g).e(\'P\',\'1q\')}});6($(d[4.f]).J(\'a\')){$(d[4.f]).e(\'P\',\'1A\')}6(m==\'\'&&!4.1j&&!3.1p){m=1E(9(){F(5,d,3,n)},3.1u)}3.20.1w(g)})});9 F(5,d,3,17){b 4=5.1T(\'7:4\');6((!4||4.1S)&&!17)N n;3.1Y.1w(g);6(!17){5.e(\'11\',\'10(\'+4.u.t(\'E\')+\') Z-Y\')}k{6(17==\'1y\'){5.e(\'11\',\'10(\'+4.u.t(\'E\')+\') Z-Y\')}6(17==\'1x\'){5.e(\'11\',\'10(\'+4.u.t(\'E\')+\') Z-Y\')}}4.f++;6(4.f==4.W){4.f=0;3.2d.1w(g)}6(4.f<0)4.f=(4.W-1);6($(d[4.f]).J(\'B\')){4.u=$(d[4.f])}k{4.u=$(d[4.f]).1m(\'B:1r\')}6(3.M){$(\'.7-M a\',5).2B(\'1h\');$(\'.7-M a:1B(\'+4.f+\')\',5).1f(\'1h\')}6(4.u.t(\'w\')!=\'\'){b w=4.u.t(\'w\');6(w.24(0,1)==\'#\')w=$(w).1d();6($(\'.7-K\',5).e(\'P\')==\'1A\'){$(\'.7-K p\',5).2c(3.o,9(){$(g).1d(w);$(g).1z(3.o)})}k{$(\'.7-K p\',5).1d(w)}$(\'.7-K\',5).1z(3.o)}k{$(\'.7-K\',5).2c(3.o)}b i=0;$(\'.7-c\',5).H(9(){b G=U.29(5.x()/3.h);$(g).e({y:\'R\',z:\'0\',11:\'10(\'+4.u.t(\'E\')+\') Z-Y -\'+((G+(i*G))-G)+\'1c 0%\'});i++});6(3.j==\'1l\'){b V=2H 2G("1K","12","1H","1e","1G","13","1I","1v");4.r=V[U.22(U.1l()*(V.1g+1))];6(4.r==2I)4.r=\'1v\'}6(3.j.2p(\',\')!=-1){b V=3.j.2t(\',\');4.r=$.2A(V[U.22(U.1l()*V.1g)])}4.L=Q;6(3.j==\'2r\'||3.j==\'1K\'||4.r==\'1K\'||3.j==\'12\'||4.r==\'12\'){b q=0;b i=0;b h=$(\'.7-c\',5);6(3.j==\'12\'||4.r==\'12\')h=$(\'.7-c\',5).1n();h.H(9(){b c=$(g);c.e(\'1L\',\'R\');6(i==3.h-1){I(9(){c.C({y:\'s%\',z:\'1.0\'},3.o,\'\',9(){5.16(\'7:X\')})},(s+q))}k{I(9(){c.C({y:\'s%\',z:\'1.0\'},3.o)},(s+q))}q+=1i;i++})}k 6(3.j==\'2q\'||3.j==\'1H\'||4.r==\'1H\'||3.j==\'1e\'||4.r==\'1e\'){b q=0;b i=0;b h=$(\'.7-c\',5);6(3.j==\'1e\'||4.r==\'1e\')h=$(\'.7-c\',5).1n();h.H(9(){b c=$(g);c.e(\'28\',\'R\');6(i==3.h-1){I(9(){c.C({y:\'s%\',z:\'1.0\'},3.o,\'\',9(){5.16(\'7:X\')})},(s+q))}k{I(9(){c.C({y:\'s%\',z:\'1.0\'},3.o)},(s+q))}q+=1i;i++})}k 6(3.j==\'1G\'||3.j==\'2u\'||4.r==\'1G\'||3.j==\'13\'||4.r==\'13\'){b q=0;b i=0;b v=0;b h=$(\'.7-c\',5);6(3.j==\'13\'||4.r==\'13\')h=$(\'.7-c\',5).1n();h.H(9(){b c=$(g);6(i==0){c.e(\'1L\',\'R\');i++}k{c.e(\'28\',\'R\');i=0}6(v==3.h-1){I(9(){c.C({y:\'s%\',z:\'1.0\'},3.o,\'\',9(){5.16(\'7:X\')})},(s+q))}k{I(9(){c.C({y:\'s%\',z:\'1.0\'},3.o)},(s+q))}q+=1i;v++})}k 6(3.j==\'1I\'||4.r==\'1I\'){b q=0;b i=0;$(\'.7-c\',5).H(9(){b c=$(g);b 1J=c.x();c.e({1L:\'R\',y:\'s%\',x:\'R\'});6(i==3.h-1){I(9(){c.C({x:1J,z:\'1.0\'},3.o,\'\',9(){5.16(\'7:X\')})},(s+q))}k{I(9(){c.C({x:1J,z:\'1.0\'},3.o)},(s+q))}q+=1i;i++})}k 6(3.j==\'1v\'||4.r==\'1v\'){b i=0;$(\'.7-c\',5).H(9(){$(g).e(\'y\',\'s%\');6(i==3.h-1){$(g).C({z:\'1.0\'},(3.o*2),\'\',9(){5.16(\'7:X\')})}k{$(g).C({z:\'1.0\'},(3.o*2))}i++})}}};$.1k.1o.21={j:\'1l\',h:15,o:2v,1u:2y,19:0,S:Q,1R:Q,M:Q,1P:n,1O:n,1M:\'.1Z\',1N:\'2x.1Z\',1X:Q,1W:Q,1p:n,1U:0.8,1Y:9(){},20:9(){},2d:9(){}};$.1k.1n=[].2w})(2z);', 62, 169, '|||settings|vars|slider|if|nivo||function||var|slice|kids|css|currentSlide|this|slices||effect|else|child|timer|false|animSpeed||timeBuff|randAnim|100|attr|currentImage||title|width|height|opacity|class|img|animate|div|src|nivoRun|sliceWidth|each|setTimeout|is|caption|running|controlNav|return|append|display|true|0px|directionNav|clearInterval|Math|anims|totalSlides|animFinished|repeat|no|url|background|sliceDownLeft|sliceUpDownLeft|nivoControl||trigger|nudge|childWidth|startSlide|rel|childHeight|px|html|sliceUpLeft|addClass|length|active|50|paused|fn|random|find|_reverse|nivoSlider|manualAdvance|none|first|control|link|pauseTime|fade|call|next|prev|fadeIn|block|eq|live|event|setInterval|click|sliceUpDown|sliceUpRight|fold|origWidth|sliceDownRight|top|controlNavThumbsSearch|controlNavThumbsReplace|controlNavThumbsFromRel|controlNavThumbs|keyCode|directionNavHide|stop|data|captionOpacity|hover|pauseOnHover|keyboardNav|beforeChange|jpg|afterChange|defaults|floor|for|substr|nextNav|hide|prevNav|bottom|round|left|options|fadeOut|slideshowEnd|alt|hasClass|extend|imageLink|Next|show|Prev|replace|relative|children|position|indexOf|sliceUp|sliceDown|window|split|sliceUpDownRight|500|reverse|_thumb|3000|jQuery|trim|removeClass|39|37|bind|keypress|Array|new|undefined'.split('|'), 0, {}));


/* Format Currency */
(function ($) {
    $.formatCurrency = {}; $.formatCurrency.regions = []; $.formatCurrency.regions[""] = { symbol: "$", positiveFormat: "%s%n", negativeFormat: "(%s%n)", decimalSymbol: ".", digitGroupSymbol: ",", groupDigits: true };
    $.fn.formatCurrency = function (destination, settings) {
        if (arguments.length == 1 && typeof destination !== "string") {
            settings = destination; destination = false
        } var defaults = { name: "formatCurrency", colorize: false, region: "", global: true, roundToDecimalPlace: 2, eventOnDecimalsEntered: false }; defaults = $.extend(defaults, $.formatCurrency.regions[""]);
        settings = $.extend(defaults, settings); if (settings.region.length > 0) { settings = $.extend(settings, getRegionOrCulture(settings.region)) } settings.regex = generateRegex(settings);
        return this.each(function () {
            $this = $(this); var num = "0"; num = $this[$this.is("input, select, textarea") ? "val" : "html"](); if (num.search("\\(") >= 0) {
                num = "-" + num
            } if (num === "" || (num === "-" && settings.roundToDecimalPlace === -1)) { return } if (isNaN(num)) {
                num = num.replace(settings.regex, ""); if (num === "" || (num === "-" && settings.roundToDecimalPlace === -1)) {
                    return
                } if (settings.decimalSymbol != ".") { num = num.replace(settings.decimalSymbol, ".") } if (isNaN(num)) { num = "0" }
            } var numParts = String(num).split("."); var isPositive = (num == Math.abs(num));
            var hasDecimals = (numParts.length > 1); var decimals = (hasDecimals ? numParts[1].toString() : "0"); var originalDecimals = decimals; num = Math.abs(numParts[0]);
            num = isNaN(num) ? 0 : num; if (settings.roundToDecimalPlace >= 0) {
                decimals = parseFloat("1." + decimals); decimals = decimals.toFixed(settings.roundToDecimalPlace);
                if (decimals.substring(0, 1) == "2") { num = Number(num) + 1 } decimals = decimals.substring(2)
            } num = String(num); if (settings.groupDigits) {
                for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3) ;
                i++) { num = num.substring(0, num.length - (4 * i + 3)) + settings.digitGroupSymbol + num.substring(num.length - (4 * i + 3)) }
            } if ((hasDecimals && settings.roundToDecimalPlace == -1) || settings.roundToDecimalPlace > 0) {
                num += settings.decimalSymbol + decimals
            } var format = isPositive ? settings.positiveFormat : settings.negativeFormat; var money = format.replace(/%s/g, settings.symbol); money = money.replace(/%n/g, num);
            var $destination = $([]); if (!destination) { $destination = $this } else { $destination = $(destination) } $destination[$destination.is("input, select, textarea") ? "val" : "html"](money);
            if (hasDecimals && settings.eventOnDecimalsEntered && originalDecimals.length > settings.roundToDecimalPlace) {
                $destination.trigger("decimalsEntered", originalDecimals)
            } if (settings.colorize) { $destination.css("color", isPositive ? "black" : "red") }
        })
    }; $.fn.toNumber = function (settings) {
        var defaults = $.extend({ name: "toNumber", region: "", global: true }, $.formatCurrency.regions[""]);
        settings = jQuery.extend(defaults, settings); if (settings.region.length > 0) { settings = $.extend(settings, getRegionOrCulture(settings.region)) } settings.regex = generateRegex(settings);
        return this.each(function () {
            var method = $(this).is("input, select, textarea") ? "val" : "html"; $(this)[method]($(this)[method]().replace("(", "(-").replace(settings.regex, ""))
        })
    }; $.fn.asNumber = function (settings) {
        var defaults = $.extend({ name: "asNumber", region: "", parse: true, parseType: "Float", global: true }, $.formatCurrency.regions[""]);
        settings = jQuery.extend(defaults, settings); if (settings.region.length > 0) { settings = $.extend(settings, getRegionOrCulture(settings.region)) } settings.regex = generateRegex(settings);
        settings.parseType = validateParseType(settings.parseType); var method = $(this).is("input, select, textarea") ? "val" : "html"; var num = $(this)[method]();
        num = num ? num : ""; num = num.replace("(", "(-"); num = num.replace(settings.regex, ""); if (!settings.parse) { return num } if (num.length == 0) { num = "0" } if (settings.decimalSymbol != ".") {
            num = num.replace(settings.decimalSymbol, ".")
        } return window["parse" + settings.parseType](num)
    }; function getRegionOrCulture(region) {
        var regionInfo = $.formatCurrency.regions[region]; if (regionInfo) {
            return regionInfo
        } else { if (/(\w+)-(\w+)/g.test(region)) { var culture = region.replace(/(\w+)-(\w+)/g, "$1"); return $.formatCurrency.regions[culture] } } return null
    } function validateParseType(parseType) {
        switch (parseType.toLowerCase()) {
            case "int": return "Int";
            case "float": return "Float"; default: throw "invalid parseType"
        }
    } function generateRegex(settings) {
        if (settings.symbol === "") {
            return new RegExp("[^\\d" + settings.decimalSymbol + "-]", "g")
        } else { var symbol = settings.symbol.replace("$", "\\$").replace(".", "\\."); return new RegExp(symbol + "|[^\\d" + settings.decimalSymbol + "-]", "g") }
    }
})(jQuery);



/*!
 * jCarousel - Riding carousels with jQuery
 *   http://sorgalla.com/jcarousel/
 *
 * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Built on top of the jQuery library
 *   http://jquery.com
 *
 * Inspired by the "Carousel Component" by Bill Scott
 *   http://billwscott.com/carousel/
 */

(function (g) { var q = { vertical: !1, rtl: !1, start: 1, offset: 1, size: null, scroll: 3, visible: null, animation: "normal", easing: "swing", auto: 0, wrap: null, initCallback: null, setupCallback: null, reloadCallback: null, itemLoadCallback: null, itemFirstInCallback: null, itemFirstOutCallback: null, itemLastInCallback: null, itemLastOutCallback: null, itemVisibleInCallback: null, itemVisibleOutCallback: null, animationStepCallback: null, buttonNextHTML: "<div></div>", buttonPrevHTML: "<div></div>", buttonNextEvent: "click", buttonPrevEvent: "click", buttonNextCallback: null, buttonPrevCallback: null, itemFallbackDimension: null }, m = !1; g(window).bind("load.jcarousel", function () { m = !0 }); g.jcarousel = function (a, c) { this.options = g.extend({}, q, c || {}); this.autoStopped = this.locked = !1; this.buttonPrevState = this.buttonNextState = this.buttonPrev = this.buttonNext = this.list = this.clip = this.container = null; if (!c || c.rtl === void 0) this.options.rtl = (g(a).attr("dir") || g("html").attr("dir") || "").toLowerCase() == "rtl"; this.wh = !this.options.vertical ? "width" : "height"; this.lt = !this.options.vertical ? this.options.rtl ? "right" : "left" : "top"; for (var b = "", d = a.className.split(" "), f = 0; f < d.length; f++) if (d[f].indexOf("jcarousel-skin") != -1) { g(a).removeClass(d[f]); b = d[f]; break } a.nodeName.toUpperCase() == "UL" || a.nodeName.toUpperCase() == "OL" ? (this.list = g(a), this.clip = this.list.parents(".jcarousel-clip"), this.container = this.list.parents(".jcarousel-container")) : (this.container = g(a), this.list = this.container.find("ul,ol").eq(0), this.clip = this.container.find(".jcarousel-clip")); if (this.clip.size() === 0) this.clip = this.list.wrap("<div></div>").parent(); if (this.container.size() === 0) this.container = this.clip.wrap("<div></div>").parent(); b !== "" && this.container.parent()[0].className.indexOf("jcarousel-skin") == -1 && this.container.wrap('<div class=" ' + b + '"></div>'); this.buttonPrev = g(".jcarousel-prev", this.container); if (this.buttonPrev.size() === 0 && this.options.buttonPrevHTML !== null) this.buttonPrev = g(this.options.buttonPrevHTML).appendTo(this.container); this.buttonPrev.addClass(this.className("jcarousel-prev")); this.buttonNext = g(".jcarousel-next", this.container); if (this.buttonNext.size() === 0 && this.options.buttonNextHTML !== null) this.buttonNext = g(this.options.buttonNextHTML).appendTo(this.container); this.buttonNext.addClass(this.className("jcarousel-next")); this.clip.addClass(this.className("jcarousel-clip")).css({ position: "relative" }); this.list.addClass(this.className("jcarousel-list")).css({ overflow: "hidden", position: "relative", top: 0, margin: 0, padding: 0 }).css(this.options.rtl ? "right" : "left", 0); this.container.addClass(this.className("jcarousel-container")).css({ position: "relative" }); !this.options.vertical && this.options.rtl && this.container.addClass("jcarousel-direction-rtl").attr("dir", "rtl"); var j = this.options.visible !== null ? Math.ceil(this.clipping() / this.options.visible) : null, b = this.list.children("li"), e = this; if (b.size() > 0) { var h = 0, i = this.options.offset; b.each(function () { e.format(this, i++); h += e.dimension(this, j) }); this.list.css(this.wh, h + 100 + "px"); if (!c || c.size === void 0) this.options.size = b.size() } this.container.css("display", "block"); this.buttonNext.css("display", "block"); this.buttonPrev.css("display", "block"); this.funcNext = function () { e.next() }; this.funcPrev = function () { e.prev() }; this.funcResize = function () { e.resizeTimer && clearTimeout(e.resizeTimer); e.resizeTimer = setTimeout(function () { e.reload() }, 100) }; this.options.initCallback !== null && this.options.initCallback(this, "init"); !m && g.browser.safari ? (this.buttons(!1, !1), g(window).bind("load.jcarousel", function () { e.setup() })) : this.setup() }; var f = g.jcarousel; f.fn = f.prototype = { jcarousel: "0.2.8" }; f.fn.extend = f.extend = g.extend; f.fn.extend({ setup: function () { this.prevLast = this.prevFirst = this.last = this.first = null; this.animating = !1; this.tail = this.resizeTimer = this.timer = null; this.inTail = !1; if (!this.locked) { this.list.css(this.lt, this.pos(this.options.offset) + "px"); var a = this.pos(this.options.start, !0); this.prevFirst = this.prevLast = null; this.animate(a, !1); g(window).unbind("resize.jcarousel", this.funcResize).bind("resize.jcarousel", this.funcResize); this.options.setupCallback !== null && this.options.setupCallback(this) } }, reset: function () { this.list.empty(); this.list.css(this.lt, "0px"); this.list.css(this.wh, "10px"); this.options.initCallback !== null && this.options.initCallback(this, "reset"); this.setup() }, reload: function () { this.tail !== null && this.inTail && this.list.css(this.lt, f.intval(this.list.css(this.lt)) + this.tail); this.tail = null; this.inTail = !1; this.options.reloadCallback !== null && this.options.reloadCallback(this); if (this.options.visible !== null) { var a = this, c = Math.ceil(this.clipping() / this.options.visible), b = 0, d = 0; this.list.children("li").each(function (f) { b += a.dimension(this, c); f + 1 < a.first && (d = b) }); this.list.css(this.wh, b + "px"); this.list.css(this.lt, -d + "px") } this.scroll(this.first, !1) }, lock: function () { this.locked = !0; this.buttons() }, unlock: function () { this.locked = !1; this.buttons() }, size: function (a) { if (a !== void 0) this.options.size = a, this.locked || this.buttons(); return this.options.size }, has: function (a, c) { if (c === void 0 || !c) c = a; if (this.options.size !== null && c > this.options.size) c = this.options.size; for (var b = a; b <= c; b++) { var d = this.get(b); if (!d.length || d.hasClass("jcarousel-item-placeholder")) return !1 } return !0 }, get: function (a) { return g(">.jcarousel-item-" + a, this.list) }, add: function (a, c) { var b = this.get(a), d = 0, p = g(c); if (b.length === 0) for (var j, e = f.intval(a), b = this.create(a) ; ;) { if (j = this.get(--e), e <= 0 || j.length) { e <= 0 ? this.list.prepend(b) : j.after(b); break } } else d = this.dimension(b); p.get(0).nodeName.toUpperCase() == "LI" ? (b.replaceWith(p), b = p) : b.empty().append(c); this.format(b.removeClass(this.className("jcarousel-item-placeholder")), a); p = this.options.visible !== null ? Math.ceil(this.clipping() / this.options.visible) : null; d = this.dimension(b, p) - d; a > 0 && a < this.first && this.list.css(this.lt, f.intval(this.list.css(this.lt)) - d + "px"); this.list.css(this.wh, f.intval(this.list.css(this.wh)) + d + "px"); return b }, remove: function (a) { var c = this.get(a); if (c.length && !(a >= this.first && a <= this.last)) { var b = this.dimension(c); a < this.first && this.list.css(this.lt, f.intval(this.list.css(this.lt)) + b + "px"); c.remove(); this.list.css(this.wh, f.intval(this.list.css(this.wh)) - b + "px") } }, next: function () { this.tail !== null && !this.inTail ? this.scrollTail(!1) : this.scroll((this.options.wrap == "both" || this.options.wrap == "last") && this.options.size !== null && this.last == this.options.size ? 1 : this.first + this.options.scroll) }, prev: function () { this.tail !== null && this.inTail ? this.scrollTail(!0) : this.scroll((this.options.wrap == "both" || this.options.wrap == "first") && this.options.size !== null && this.first == 1 ? this.options.size : this.first - this.options.scroll) }, scrollTail: function (a) { if (!this.locked && !this.animating && this.tail) { this.pauseAuto(); var c = f.intval(this.list.css(this.lt)), c = !a ? c - this.tail : c + this.tail; this.inTail = !a; this.prevFirst = this.first; this.prevLast = this.last; this.animate(c) } }, scroll: function (a, c) { !this.locked && !this.animating && (this.pauseAuto(), this.animate(this.pos(a), c)) }, pos: function (a, c) { var b = f.intval(this.list.css(this.lt)); if (this.locked || this.animating) return b; this.options.wrap != "circular" && (a = a < 1 ? 1 : this.options.size && a > this.options.size ? this.options.size : a); for (var d = this.first > a, g = this.options.wrap != "circular" && this.first <= 1 ? 1 : this.first, j = d ? this.get(g) : this.get(this.last), e = d ? g : g - 1, h = null, i = 0, k = !1, l = 0; d ? --e >= a : ++e < a;) { h = this.get(e); k = !h.length; if (h.length === 0 && (h = this.create(e).addClass(this.className("jcarousel-item-placeholder")), j[d ? "before" : "after"](h), this.first !== null && this.options.wrap == "circular" && this.options.size !== null && (e <= 0 || e > this.options.size))) j = this.get(this.index(e)), j.length && (h = this.add(e, j.clone(!0))); j = h; l = this.dimension(h); k && (i += l); if (this.first !== null && (this.options.wrap == "circular" || e >= 1 && (this.options.size === null || e <= this.options.size))) b = d ? b + l : b - l } for (var g = this.clipping(), m = [], o = 0, n = 0, j = this.get(a - 1), e = a; ++o;) { h = this.get(e); k = !h.length; if (h.length === 0) { h = this.create(e).addClass(this.className("jcarousel-item-placeholder")); if (j.length === 0) this.list.prepend(h); else j[d ? "before" : "after"](h); if (this.first !== null && this.options.wrap == "circular" && this.options.size !== null && (e <= 0 || e > this.options.size)) j = this.get(this.index(e)), j.length && (h = this.add(e, j.clone(!0))) } j = h; l = this.dimension(h); if (l === 0) throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting..."); this.options.wrap != "circular" && this.options.size !== null && e > this.options.size ? m.push(h) : k && (i += l); n += l; if (n >= g) break; e++ } for (h = 0; h < m.length; h++) m[h].remove(); i > 0 && (this.list.css(this.wh, this.dimension(this.list) + i + "px"), d && (b -= i, this.list.css(this.lt, f.intval(this.list.css(this.lt)) - i + "px"))); i = a + o - 1; if (this.options.wrap != "circular" && this.options.size && i > this.options.size) i = this.options.size; if (e > i) { o = 0; e = i; for (n = 0; ++o;) { h = this.get(e--); if (!h.length) break; n += this.dimension(h); if (n >= g) break } } e = i - o + 1; this.options.wrap != "circular" && e < 1 && (e = 1); if (this.inTail && d) b += this.tail, this.inTail = !1; this.tail = null; if (this.options.wrap != "circular" && i == this.options.size && i - o + 1 >= 1 && (d = f.intval(this.get(i).css(!this.options.vertical ? "marginRight" : "marginBottom")), n - d > g)) this.tail = n - g - d; if (c && a === this.options.size && this.tail) b -= this.tail, this.inTail = !0; for (; a-- > e;) b += this.dimension(this.get(a)); this.prevFirst = this.first; this.prevLast = this.last; this.first = e; this.last = i; return b }, animate: function (a, c) { if (!this.locked && !this.animating) { this.animating = !0; var b = this, d = function () { b.animating = !1; a === 0 && b.list.css(b.lt, 0); !b.autoStopped && (b.options.wrap == "circular" || b.options.wrap == "both" || b.options.wrap == "last" || b.options.size === null || b.last < b.options.size || b.last == b.options.size && b.tail !== null && !b.inTail) && b.startAuto(); b.buttons(); b.notify("onAfterAnimation"); if (b.options.wrap == "circular" && b.options.size !== null) for (var c = b.prevFirst; c <= b.prevLast; c++) c !== null && !(c >= b.first && c <= b.last) && (c < 1 || c > b.options.size) && b.remove(c) }; this.notify("onBeforeAnimation"); if (!this.options.animation || c === !1) this.list.css(this.lt, a + "px"), d(); else { var f = !this.options.vertical ? this.options.rtl ? { right: a } : { left: a } : { top: a }, d = { duration: this.options.animation, easing: this.options.easing, complete: d }; if (g.isFunction(this.options.animationStepCallback)) d.step = this.options.animationStepCallback; this.list.animate(f, d) } } }, startAuto: function (a) { if (a !== void 0) this.options.auto = a; if (this.options.auto === 0) return this.stopAuto(); if (this.timer === null) { this.autoStopped = !1; var c = this; this.timer = window.setTimeout(function () { c.next() }, this.options.auto * 1E3) } }, stopAuto: function () { this.pauseAuto(); this.autoStopped = !0 }, pauseAuto: function () { if (this.timer !== null) window.clearTimeout(this.timer), this.timer = null }, buttons: function (a, c) { if (a == null && (a = !this.locked && this.options.size !== 0 && (this.options.wrap && this.options.wrap != "first" || this.options.size === null || this.last < this.options.size), !this.locked && (!this.options.wrap || this.options.wrap == "first") && this.options.size !== null && this.last >= this.options.size)) a = this.tail !== null && !this.inTail; if (c == null && (c = !this.locked && this.options.size !== 0 && (this.options.wrap && this.options.wrap != "last" || this.first > 1), !this.locked && (!this.options.wrap || this.options.wrap == "last") && this.options.size !== null && this.first == 1)) c = this.tail !== null && this.inTail; var b = this; this.buttonNext.size() > 0 ? (this.buttonNext.unbind(this.options.buttonNextEvent + ".jcarousel", this.funcNext), a && this.buttonNext.bind(this.options.buttonNextEvent + ".jcarousel", this.funcNext), this.buttonNext[a ? "removeClass" : "addClass"](this.className("jcarousel-next-disabled")).attr("disabled", a ? !1 : !0), this.options.buttonNextCallback !== null && this.buttonNext.data("jcarouselstate") != a && this.buttonNext.each(function () { b.options.buttonNextCallback(b, this, a) }).data("jcarouselstate", a)) : this.options.buttonNextCallback !== null && this.buttonNextState != a && this.options.buttonNextCallback(b, null, a); this.buttonPrev.size() > 0 ? (this.buttonPrev.unbind(this.options.buttonPrevEvent + ".jcarousel", this.funcPrev), c && this.buttonPrev.bind(this.options.buttonPrevEvent + ".jcarousel", this.funcPrev), this.buttonPrev[c ? "removeClass" : "addClass"](this.className("jcarousel-prev-disabled")).attr("disabled", c ? !1 : !0), this.options.buttonPrevCallback !== null && this.buttonPrev.data("jcarouselstate") != c && this.buttonPrev.each(function () { b.options.buttonPrevCallback(b, this, c) }).data("jcarouselstate", c)) : this.options.buttonPrevCallback !== null && this.buttonPrevState != c && this.options.buttonPrevCallback(b, null, c); this.buttonNextState = a; this.buttonPrevState = c }, notify: function (a) { var c = this.prevFirst === null ? "init" : this.prevFirst < this.first ? "next" : "prev"; this.callback("itemLoadCallback", a, c); this.prevFirst !== this.first && (this.callback("itemFirstInCallback", a, c, this.first), this.callback("itemFirstOutCallback", a, c, this.prevFirst)); this.prevLast !== this.last && (this.callback("itemLastInCallback", a, c, this.last), this.callback("itemLastOutCallback", a, c, this.prevLast)); this.callback("itemVisibleInCallback", a, c, this.first, this.last, this.prevFirst, this.prevLast); this.callback("itemVisibleOutCallback", a, c, this.prevFirst, this.prevLast, this.first, this.last) }, callback: function (a, c, b, d, f, j, e) { if (!(this.options[a] == null || typeof this.options[a] != "object" && c != "onAfterAnimation")) { var h = typeof this.options[a] == "object" ? this.options[a][c] : this.options[a]; if (g.isFunction(h)) { var i = this; if (d === void 0) h(i, b, c); else if (f === void 0) this.get(d).each(function () { h(i, this, d, b, c) }); else for (var a = function (a) { i.get(a).each(function () { h(i, this, a, b, c) }) }, k = d; k <= f; k++) k !== null && !(k >= j && k <= e) && a(k) } } }, create: function (a) { return this.format("<li></li>", a) }, format: function (a, c) { for (var a = g(a), b = a.get(0).className.split(" "), d = 0; d < b.length; d++) b[d].indexOf("jcarousel-") != -1 && a.removeClass(b[d]); a.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-" + c)).css({ "float": this.options.rtl ? "right" : "left", "list-style": "none" }).attr("jcarouselindex", c); return a }, className: function (a) { return a + " " + a + (!this.options.vertical ? "-horizontal" : "-vertical") }, dimension: function (a, c) { var b = g(a); if (c == null) return !this.options.vertical ? b.outerWidth(!0) || f.intval(this.options.itemFallbackDimension) : b.outerHeight(!0) || f.intval(this.options.itemFallbackDimension); else { var d = !this.options.vertical ? c - f.intval(b.css("marginLeft")) - f.intval(b.css("marginRight")) : c - f.intval(b.css("marginTop")) - f.intval(b.css("marginBottom")); g(b).css(this.wh, d + "px"); return this.dimension(b) } }, clipping: function () { return !this.options.vertical ? this.clip[0].offsetWidth - f.intval(this.clip.css("borderLeftWidth")) - f.intval(this.clip.css("borderRightWidth")) : this.clip[0].offsetHeight - f.intval(this.clip.css("borderTopWidth")) - f.intval(this.clip.css("borderBottomWidth")) }, index: function (a, c) { if (c == null) c = this.options.size; return Math.round(((a - 1) / c - Math.floor((a - 1) / c)) * c) + 1 } }); f.extend({ defaults: function (a) { return g.extend(q, a || {}) }, intval: function (a) { a = parseInt(a, 10); return isNaN(a) ? 0 : a }, windowLoaded: function () { m = !0 } }); g.fn.jcarousel = function (a) { if (typeof a == "string") { var c = g(this).data("jcarousel"), b = Array.prototype.slice.call(arguments, 1); return c[a].apply(c, b) } else return this.each(function () { var b = g(this).data("jcarousel"); b ? (a && g.extend(b.options, a), b.reload()) : g(this).data("jcarousel", new f(this, a)) }) } })(jQuery);


/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

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; } });

/*!
* jQuery FlexBox $Version: 0.9.6 $
*
* Copyright (c) 2008-2010 Noah Heldman and Fairway Technologies (http://www.fairwaytech.com/flexbox)
* Licensed under Ms-PL (http://www.codeplex.com/flexbox/license)
*
* $Date: 2010-11-24 01:02:00 PM $
* $Rev: 0.9.6.1 $
*/
/*!
* jQuery FlexBox $Version: 0.9.6 $
*
* Copyright (c) 2008-2010 Noah Heldman and Fairway Technologies (http://www.fairwaytech.com/flexbox)
* Licensed under Ms-PL (http://www.codeplex.com/flexbox/license)
*
* $Date: 2010-11-24 01:02:00 PM $
* $Rev: 0.9.6.1 $
*/
(function (a) { a.flexbox = function (b, c) { function S() { $curr = L(); if ($curr && $curr.prev().length > 0) { $curr.removeClass(c.selectClass).prev().addClass(c.selectClass); var a = w.attr("scrollTop"), b = $curr[0], d = $curr.parent()[0], e, f, g; if (N()) { g = document.getBoxObjectFor(b).height; e = document.getBoxObjectFor(w[0]).y - g * 2; f = document.getBoxObjectFor(b).y - document.getBoxObjectFor(w[0]).y } else if (O()) { e = d.getBoundingClientRect().top; var h = b.getBoundingClientRect(); f = h.top; g = h.bottom - f } if (f <= e) w.attr("scrollTop", a - g) } else if (!$curr) w.children("div:last-child").addClass(c.selectClass) } function R() { $curr = L(); if ($curr && $curr.next().length > 0) { $curr.removeClass(c.selectClass).next().addClass(c.selectClass); var a = w.attr("scrollTop"), b = $curr[0], d, e, f; if (N()) { d = document.getBoxObjectFor(w[0]).y + w.attr("offsetHeight"); e = document.getBoxObjectFor(b).y + $curr.attr("offsetHeight"); f = document.getBoxObjectFor(b).height } else if (O()) { d = w[0].getBoundingClientRect().bottom; var g = b.getBoundingClientRect(); e = g.bottom; f = e - g.top } if (e >= d) w.attr("scrollTop", a + f) } else if (!$curr) w.children("div:first-child").addClass(c.selectClass) } function Q() { $curr = L(); if ($curr && $curr.prev().length > 0) { $curr.removeClass(c.selectClass); for (var a = 0; a < c.maxVisibleRows; a++) { if ($curr.prev().length > 0) { $curr = $curr.prev() } } $curr.addClass(c.selectClass); var b = w.attr("scrollTop"); w.attr("scrollTop", b - w.height()) } else if (!$curr) w.children("div:last-child").addClass(c.selectClass) } function P() { $curr = L(); if ($curr && $curr.next().length > 0) { $curr.removeClass(c.selectClass); for (var a = 0; a < c.maxVisibleRows; a++) { if ($curr.next().length > 0) { $curr = $curr.next() } } $curr.addClass(c.selectClass); var b = w.attr("scrollTop"); w.attr("scrollTop", b + w.height()) } else if (!$curr) w.children("div:first-child").addClass(c.selectClass) } function O() { try { document.body.getBoundingClientRect(); return true } catch (a) { return false } } function N() { try { document.getBoxObjectFor(document.body); return true } catch (a) { return false } } function M() { $curr = L(); if ($curr) { m.val($curr.attr("id")); n.val($curr.attr("val")).focus(); K(); if (c.onSelect) { c.onSelect.apply({ value: m[0].value, text: n[0].value }) } } } function L() { if (!u.is(":visible")) return false; var a = w.children("div." + c.selectClass); if (!a.length) a = false; return a } function K() { n.data("active", false); l.css("z-index", 0); u.hide() } function J(a, b) { var c = n[0]; if (c.createTextRange) { var d = c.createTextRange(); d.moveStart("character", a); d.moveEnd("character", b - c.value.length); d.select() } else if (c.setSelectionRange) { c.setSelectionRange(a, b) } c.focus(); return true } function I(b, d) { var e = 0, f = 0; if (!b) return; m.val(n.val()); if (parseInt(b[c.totalProperty]) === 0 && c.noResultsText && c.noResultsText.length > 0) { w.addClass(c.noResultsClass).html(c.noResultsText); u.show(); return } else w.removeClass(c.noResultsClass); for (var g = 0; g < b[c.resultsProperty].length; g++) { var h = b[c.resultsProperty][g], i = c.resultTemplate.applyTemplate(h), j = d === i, k = false, l = false, o = h[c.displayValue]; if (!j && c.highlightMatches && d !== "") { var p = d, q = o.toLowerCase().indexOf(d.toLowerCase()), r = '<span class="' + c.matchClass + '">' + o.substr(q, d.length) + "</span>"; if (i.match("<(.|\n)*?>")) { l = true; p = "(>)([^<]*?)(" + d + ")((.|\n)*?)(<)"; r = '$1$2<span class="' + c.matchClass + '">$3</span>$4$6' } i = i.replace(new RegExp(p, c.highlightMatchesRegExModifier), r) } if (c.autoCompleteFirstMatch && !l && g === 0) { if (d.length > 0 && o.toLowerCase().indexOf(d.toLowerCase()) === 0) { n.attr("pq", d); m.val(h[c.hiddenValue]); n.val(h[c.displayValue]); k = J(d.length, n.val().length) } } if (!c.showResults) return; $row = a("<div></div>").attr("id", h[c.hiddenValue]).attr("val", h[c.displayValue]).addClass("row").html(i).appendTo(w); if (j || ++f == 1 && c.selectFirstMatch || k) { $row.addClass(c.selectClass) } e += i.length } if (e === 0) { K(); return } u.parent().css("z-index", 11e3); u.show(); w.children("div").mouseover(function () { w.children("div").removeClass(c.selectClass); a(this).addClass(c.selectClass) }).mouseup(function (a) { a.preventDefault(); a.stopPropagation(); M() }); if (c.maxVisibleRows > 0) { var s = $row.outerHeight() * c.maxVisibleRows; w.css("max-height", s) } return e } function H(a, b, d, i, j, k) { if (c.maxCacheBytes > 0) { while (e.length && g + k > c.maxCacheBytes) { var l = e.pop(); g -= l.size } var m = a + h + b; f[m] = { q: a, p: b, s: d, t: i, size: k, data: j }; e.push(m); g += k } } function G(a, b) { var c = a + h + b; if (f[c]) { for (var d = 0; d < e.length; d++) { if (e[d] === c) { e.unshift(e.splice(d, 1)[0]); return f[c] } } } return false } function F(b, d, e) { var f = "&lt;&lt;", g = "&lt;", h = "&gt;", i = "&gt;&gt;", k = "..."; x.addClass(c.paging.cssClass); var m = a("<a/>").attr("href", "#").addClass("page").click(E), n = a("<span></span>").addClass("page"), o = l.attr("id"); if (d > 1) { m.clone(true).attr("id", o + "f").attr("page", 1).html(f).appendTo(x); m.clone(true).attr("id", o + "p").attr("page", d - 1).html(g).appendTo(x) } else { n.clone(true).html(f).appendTo(x); n.clone(true).html(g).appendTo(x) } if (c.paging.style === "links") { var p = c.paging.maxPageLinks; if (b <= p) { for (var q = 1; q <= b; q++) { if (q === d) { n.clone(true).html(d).appendTo(x) } else { m.clone(true).attr("page", q).html(q).appendTo(x) } } } else { if (d + parseInt(p / 2) > b) { startPage = b - p + 1 } else { startPage = d - parseInt(p / 2) } if (startPage > 1) { m.clone(true).attr("page", startPage - 1).html(k).appendTo(x) } else { startPage = 1 } for (var q = startPage; q < startPage + p; q++) { if (q === d) { n.clone(true).html(q).appendTo(x) } else { m.clone(true).attr("page", q).html(q).appendTo(x) } } if (b > startPage + p) { m.clone(true).attr("page", q).html(k).appendTo(x) } } } else if (c.paging.style === "input") { var r = a("<input/>").addClass("box").click(function (a) { this.select() }).keypress(function (a) { return D(a, this.value, b) }).val(d).appendTo(x) } if (d < b) { m.clone(true).attr("id", o + "n").attr("page", +d + 1).html(h).appendTo(x); m.clone(true).attr("id", o + "l").attr("page", b).html(i).appendTo(x) } else { n.clone(true).html(h).appendTo(x); n.clone(true).html(i).appendTo(x) } var s = (d - 1) * j + 1; var t = s > e - j ? e : s + j - 1; if (c.paging.showSummary) { var u = { start: s, end: t, total: e, page: d, pages: b }; var v = c.paging.summaryTemplate.applyTemplate(u); a("<br/>").appendTo(x); a("<span></span>").addClass(c.paging.summaryClass).html(v).appendTo(x) } } function E(b) { A(parseInt(a(this).attr("page")), true, n.attr("pq")); return false } function D(b, c, d) { if (/^13$|^39$|^37$/.test(b.keyCode)) { if (b.preventDefault) b.preventDefault(); if (b.stopPropagation) b.stopPropagation(); b.cancelBubble = true; b.returnValue = false; switch (b.keyCode) { case 13: if (/^\d+$/.test(c) && c > 0 && c <= d) A(c, true); else alert("Please enter a page number between 1 and " + d); break; case 39: a("#" + l.attr("id") + "n").click(); break; case 37: a("#" + l.attr("id") + "p").click(); break } } } function C(a, b) { x.html("").removeClass(c.paging.cssClass); if (c.showResults && c.paging && b > j) { var d = b / j; if (b % j > 0) d = parseInt(++d); F(d, a, b) } } function B(a, b) { var d = {}; d[c.resultsProperty] = []; d[c.totalProperty] = 0; var e = 0; for (var f = 0; f < a[c.resultsProperty].length; f++) { var g = a[c.resultsProperty][f][c.displayValue].toLowerCase().indexOf(b.q.toLowerCase()); if (c.matchAny && g !== -1 || !c.matchAny && g === 0) { d[c.resultsProperty][e++] = a[c.resultsProperty][f]; d[c.totalProperty] += 1 } } if (c.paging) { var h = (b.p - 1) * b.s; var i = h + b.s > d[c.totalProperty] ? d[c.totalProperty] - h : b.s; d[c.resultsProperty] = d[c.resultsProperty].splice(h, i) } return d } function A(b, d, e) { if (d) e = ""; var f = e && e.length > 0 ? e : a.trim(n.val()); if (f.length >= c.minChars || d) { if (w.outerHeight() > 0) w.css("height", w.outerHeight()); w.html("").attr("scrollTop", 0); var g = G(f, b); if (g) { w.css("height", "auto"); I(g.data, f); C(b, g.t) } else { var h = { q: f, p: b, s: j, contentType: "application/json; charset=utf-8" }; var i = function (a, d) { if (d === true) f = d; var e = parseInt(a[c.totalProperty]); if (isNaN(e) && c.paging) { if (c.maxCacheBytes <= 0) alert('The "maxCacheBytes" configuration option must be greater\nthan zero when implementing client-side paging.'); e = a[c.resultsProperty].length; var g = e / j; if (e % j > 0) g = parseInt(++g); for (var h = 1; h <= g; h++) { var i = {}; i[c.totalProperty] = e; i[c.resultsProperty] = a[c.resultsProperty].splice(0, j); if (h === 1) l = I(i, f); H(f, h, j, e, i, l) } } else { var l = I(a, f); H(f, b, j, e, a, l) } C(b, e); w.css("height", "auto"); k = false }; if (typeof c.source === "object") { if (c.allowInput) i(B(c.source, h)); else i(c.source) } else { k = true; if (c.method.toUpperCase() == "POST") a.post(c.source, h, i, "json"); else a.getJSON(c.source, h, i) } } } else K() } function z(a, b) { if (d) clearTimeout(d); var e = b ? c.queryDelay * 5 : c.queryDelay; d = setTimeout(function () { A(1, a, "") }, e) } function y(b) { var d = 0; if (typeof b.ctrlKey !== "undefined") { if (b.ctrlKey) d |= 1; if (b.shiftKey) d |= 2 } else { if (b.modifiers & Event.CONTROL_MASK) d |= 1; if (b.modifiers & Event.SHIFT_MASK) d |= 2 } if (/16$|17$/.test(b.keyCode)) return; var e = b.keyCode === 9, f = b.keyCode === 27; var g = b.keyCode === 9 && d > 0; var h = b.keyCode === 8; if (e) if (L()) M(); if (/27$|38$|33$|34$/.test(b.keyCode) && u.is(":visible") || /13$|40$/.test(b.keyCode) || !c.allowInput) { if (b.preventDefault) b.preventDefault(); if (b.stopPropagation) b.stopPropagation(); b.cancelBubble = true; b.returnValue = false; switch (b.keyCode) { case 38: S(); break; case 40: if (u.is(":visible")) R(); else z(true); break; case 13: if (L()) M(); else z(true); break; case 27: K(); break; case 34: if (!k) { if (c.paging) a("#" + l.attr("id") + "n").click(); else P() } break; case 33: if (!k) { if (c.paging) a("#" + l.attr("id") + "p").click(); else Q() } break; default: if (!c.allowInput) { return } } } else if (!f && !e && !g) { z(false, h) } } var d = false, e = [], f = [], g = 0, h = "◊", i = false, j = c.paging && c.paging.pageSize ? c.paging.pageSize : 0, k = false, l = a(b).css("position", "relative").css("z-index", 0); var m = a('<input type="hidden"/>').attr("id", l.attr("id") + "_hidden").attr("name", l.attr("id")).val(c.initialValue).appendTo(l); var n = a("<input/>").attr("id", l.attr("id") + "_input").attr("autocomplete", "off").addClass(c.inputClass).css("width", c.width + "px").appendTo(l).click(function (a) { if (c.watermark !== "" && this.value === c.watermark) this.value = ""; else this.select() }).focus(function (b) { a(this).removeClass("watermark") }).blur(function (a) { if (this.value === "") m.val(""); setTimeout(function () { if (!n.data("active")) K() }, 200); if (c.onTextboxBlur) { c.onTextboxBlur.apply({ value: m[0].value, text: n[0].value }) } }).keydown(y); if (c.initialValue !== "") n.val(c.initialValue).removeClass("watermark"); else n.val(c.watermark).addClass("watermark"); var o = 0; if (c.showArrow && c.showResults) { var p = function () { if (u.is(":visible")) { if (n[0].value == "" && n.data("lastValue")) { n[0].value = n.data("lastValue") } K() } else { n.data("lastValue", n[0].value); if (c.watermark !== "" && n.val() === c.watermark) { n.val("") } else { n.val("") } if (d) clearTimeout(d); d = setTimeout(function () { A(1, true, c.arrowQuery) }, c.queryDelay) } }; var q = a("<span></span>").attr("id", l.attr("id") + "_arrow").addClass(c.arrowClass).addClass("out").hover(function () { a(this).removeClass("out").addClass("over") }, function () { a(this).removeClass("over").addClass("out") }).mousedown(function () { a(this).removeClass("over").addClass("active") }).mouseup(function () { a(this).removeClass("active").addClass("over") }).click(p).appendTo(l); o = q.width(); n.css("width", c.width - o + "px") } if (!c.allowInput) { c.selectFirstMatch = false; n.click(p) } var r = n.outerHeight() - n.height() - 2; var s = n.outerWidth() - 2; var t = n.outerHeight(); if (r === 0) { s += 4; t += 4 } else if (r !== 4) { s += r; t += r } var u = a("<div></div>").attr("id", l.attr("id") + "_ctr").css("width", s + o).css("top", t).css("left", 0).addClass(c.containerClass).appendTo(l).mousedown(function (a) { n.data("active", true) }).hide(); var v = a('<div class="close">' + c.closeText + "</div>").appendTo(u).click(function (a) { n[0].value = n.data("lastValue"); K() }); var w = a("<div></div>").addClass(c.contentClass).appendTo(u).scroll(function () { i = true }); var x = a("<div></div>").appendTo(u); l.css("height", n.outerHeight()); String.prototype.applyTemplate = function (a) { try { if (a === "") return this; return this.replace(/{([^{}]*)}/g, function (b, c) { var d; if (c.indexOf(".") !== -1) { var e = c.split("."); var f = a; for (var g = 0; g < e.length; g++) f = f[e[g]]; d = f } else d = a[c]; if (typeof d === "string" || typeof d === "number") return d; else throw b }) } catch (b) { alert("Invalid JSON property " + b + " found when trying to apply resultTemplate or paging.summaryTemplate.\nPlease check your spelling and try again.") } } }; a.fn.flexbox = function (b, c) { if (!b) return; try { var d = a.fn.flexbox.defaults; var e = a.extend({}, d, c); for (var f in e) { if (d[f] === undefined) throw "Invalid option specified: " + f + "\nPlease check your spelling and try again." } e.source = b; if (c) { e.paging = c.paging || c.paging == null ? a.extend({}, d.paging, c.paging) : false; for (var f in e.paging) { if (d.paging[f] === undefined) throw "Invalid option specified: " + f + "\nPlease check your spelling and try again." } if (c.displayValue && !c.hiddenValue) { e.hiddenValue = c.displayValue } } this.each(function () { new a.flexbox(this, e) }); return this } catch (g) { if (typeof g === "object") alert(g.message); else alert(g) } }; a.fn.flexbox.defaults = { method: "GET", queryDelay: 100, allowInput: true, containerClass: "ffb", contentClass: "content", selectClass: "ffb-sel", inputClass: "ffb-input", arrowClass: "ffb-arrow", matchClass: "ffb-match", noResultsText: "No matching results", noResultsClass: "ffb-no-results", showResults: true, selectFirstMatch: true, autoCompleteFirstMatch: false, highlightMatches: true, highlightMatchesRegExModifier: "i", matchAny: true, minChars: 1, showArrow: true, arrowQuery: "", onSelect: false, onTextboxBlur: false, maxCacheBytes: 32768, resultTemplate: "{name}", displayValue: "name", hiddenValue: "id", initialValue: "", watermark: "", width: 200, resultsProperty: "results", totalProperty: "total", maxVisibleRows: 0, closeText: "Close", paging: { style: "input", cssClass: "paging", pageSize: 10, maxPageLinks: 5, showSummary: true, summaryClass: "summary", summaryTemplate: "Displaying {start}-{end} of {total} results" } }; a.fn.setValue = function (b) { var c = "#" + this.attr("id"); if (b && b.value && b.text) { a(c + "_hidden").val(b.value).removeClass("watermark"); a(c + "_input").val(b.text).removeClass("watermark") } else { a(c + "_hidden," + c + "_input").val(b).removeClass("watermark") } } })(jQuery)

/*
* jQuery sliderInit create the html elements into the divs
* from a xml source file before apply the FlexSlider plugin.
*/
$(window).load(function () {
    $(this).sliderInit();
});

function getSliderConf(xmlUrl) {
    var xmlhttp;

    if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp = new XMLHttpRequest();
    }
    else {// code for IE6, IE5
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }

    xmlhttp.open("GET", xmlUrl, false);
    xmlhttp.send();

    var xmlDoc = xmlhttp.responseXML;
    var imagesPath;
    var options = new Object;

    var rootNode = xmlDoc.getElementsByTagName("images")[0];

    for (var i = 0; i < rootNode.attributes.length; i++) {
        var attrib = rootNode.attributes[i];

        if (attrib.name == 'imagesPath') {
            imagesPath = attrib.value + '/';
        }
        else {
            options[attrib.name] = attrib.value;
        }
    }

    //Dertermine the language to be used
    var lang;

    if (EcommercePageCulture != null && xmlDoc.getElementsByTagName(EcommercePageCulture.substring(0, 2)) != null) {
        lang = EcommercePageCulture.substring(0, 2);
    }
    else {
        lang = 'en';
    }

    //Generate the InnerHtml
    var imagesNodes = rootNode.getElementsByTagName("image");
    var imageNode;
    var innerHtml = '';

    for (var i = 0; i < imagesNodes.length; i++) {
        imageNode = imagesNodes[i].getElementsByTagName(lang);

        var fileName = imageNode[0].getElementsByTagName('fileName')[0].childNodes[0].nodeValue;

        try {
            var link = imageNode[0].getElementsByTagName('link')[0].childNodes[0].nodeValue;

            innerHtml += '<li><a href="' + link + '" target="_blank"><img src="' + imagesPath + lang + '/' + fileName + '" border="0" alt="" /></a></li>';
        }
        catch (e) {
            innerHtml += '<li><img src="' + imagesPath + lang + '/' + fileName + '" border="0" alt="" /></li>';
        }
    }

    return {
        'InnerHtml': '<ul class="slides">' + innerHtml + '</ul>',
        'Options': options
    };
}

(function ($) {

    var methods = {
        init: function () {
            $('.slider').each(function () {
                var $this = $(this);
                var xmlFile = $this.attr('data-xml-images');
                var sliderConf = getSliderConf(xmlFile);

                $this.append(sliderConf['InnerHtml']).flexslider(sliderConf['Options']);
            });
        }
    };

    $.fn.sliderInit = function (method) {

        if (methods[method]) {
            return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
        } else if (typeof method === 'object' || !method) {
            return methods.init.apply(this, arguments);
        } else {
            $.error('Method ' + method + ' does not exist on jQuery.sliderInit');
        }
    };

})(jQuery);


/*
* jQuery FlexSlider v2.1
* Copyright 2012 WooThemes
* Contributing Author: Tyler Smith
*/
(function (e) { e.flexslider = function (t, n) { var r = e(t), i = e.extend({}, e.flexslider.defaults, n), s = i.namespace, o = "ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch, u = o ? "touchend" : "click", a = "vertical" === i.direction, f = i.reverse, l = 0 < i.itemWidth, c = "fade" === i.animation, h = "" !== i.asNavFor, p = {}; e.data(t, "flexslider", r); p = { init: function () { r.animating = !1; r.currentSlide = i.startAt; r.animatingTo = r.currentSlide; r.atEnd = 0 === r.currentSlide || r.currentSlide === r.last; r.containerSelector = i.selector.substr(0, i.selector.search(" ")); r.slides = e(i.selector, r); r.container = e(r.containerSelector, r); r.count = r.slides.length; r.syncExists = 0 < e(i.sync).length; "slide" === i.animation && (i.animation = "swing"); r.prop = a ? "top" : "marginLeft"; r.args = {}; r.manualPause = !1; var t = r, n; if (n = !i.video) if (n = !c) if (n = i.useCSS) e: { n = document.createElement("div"); var s = ["perspectiveProperty", "WebkitPerspective", "MozPerspective", "OPerspective", "msPerspective"], u; for (u in s) if (void 0 !== n.style[s[u]]) { r.pfx = s[u].replace("Perspective", "").toLowerCase(); r.prop = "-" + r.pfx + "-transform"; n = !0; break e } n = !1 } t.transitions = n; "" !== i.controlsContainer && (r.controlsContainer = 0 < e(i.controlsContainer).length && e(i.controlsContainer)); "" !== i.manualControls && (r.manualControls = 0 < e(i.manualControls).length && e(i.manualControls)); i.randomize && (r.slides.sort(function () { return Math.round(Math.random()) - .5 }), r.container.empty().append(r.slides)); r.doMath(); h && p.asNav.setup(); r.setup("init"); i.controlNav && p.controlNav.setup(); i.directionNav && p.directionNav.setup(); i.keyboard && (1 === e(r.containerSelector).length || i.multipleKeyboard) && e(document).bind("keyup", function (e) { e = e.keyCode; if (!r.animating && (39 === e || 37 === e)) e = 39 === e ? r.getTarget("next") : 37 === e ? r.getTarget("prev") : !1, r.flexAnimate(e, i.pauseOnAction) }); i.mousewheel && r.bind("mousewheel", function (e, t) { e.preventDefault(); var n = 0 > t ? r.getTarget("next") : r.getTarget("prev"); r.flexAnimate(n, i.pauseOnAction) }); i.pausePlay && p.pausePlay.setup(); i.slideshow && (i.pauseOnHover && r.hover(function () { !r.manualPlay && !r.manualPause && r.pause() }, function () { !r.manualPause && !r.manualPlay && r.play() }), 0 < i.initDelay ? setTimeout(r.play, i.initDelay) : r.play()); o && i.touch && p.touch(); (!c || c && i.smoothHeight) && e(window).bind("resize focus", p.resize); setTimeout(function () { i.start(r) }, 200) }, asNav: { setup: function () { r.asNav = !0; r.animatingTo = Math.floor(r.currentSlide / r.move); r.currentItem = r.currentSlide; r.slides.removeClass(s + "active-slide").eq(r.currentItem).addClass(s + "active-slide"); r.slides.click(function (t) { t.preventDefault(); var t = e(this), n = t.index(); !e(i.asNavFor).data("flexslider").animating && !t.hasClass("active") && (r.direction = r.currentItem < n ? "next" : "prev", r.flexAnimate(n, i.pauseOnAction, !1, !0, !0)) }) } }, controlNav: { setup: function () { r.manualControls ? p.controlNav.setupManual() : p.controlNav.setupPaging() }, setupPaging: function () { var t = 1, n; r.controlNavScaffold = e('<ol class="' + s + "control-nav " + s + ("thumbnails" === i.controlNav ? "control-thumbs" : "control-paging") + '"></ol>'); if (1 < r.pagingCount) for (var a = 0; a < r.pagingCount; a++) n = "thumbnails" === i.controlNav ? '<img src="' + r.slides.eq(a).attr("data-thumb") + '"/>' : "<a>" + t + "</a>", r.controlNavScaffold.append("<li>" + n + "</li>"), t++; r.controlsContainer ? e(r.controlsContainer).append(r.controlNavScaffold) : r.append(r.controlNavScaffold); p.controlNav.set(); p.controlNav.active(); r.controlNavScaffold.delegate("a, img", u, function (t) { t.preventDefault(); var t = e(this), n = r.controlNav.index(t); t.hasClass(s + "active") || (r.direction = n > r.currentSlide ? "next" : "prev", r.flexAnimate(n, i.pauseOnAction)) }); o && r.controlNavScaffold.delegate("a", "click touchstart", function (e) { e.preventDefault() }) }, setupManual: function () { r.controlNav = r.manualControls; p.controlNav.active(); r.controlNav.live(u, function (t) { t.preventDefault(); var t = e(this), n = r.controlNav.index(t); t.hasClass(s + "active") || (n > r.currentSlide ? r.direction = "next" : r.direction = "prev", r.flexAnimate(n, i.pauseOnAction)) }); o && r.controlNav.live("click touchstart", function (e) { e.preventDefault() }) }, set: function () { r.controlNav = e("." + s + "control-nav li " + ("thumbnails" === i.controlNav ? "img" : "a"), r.controlsContainer ? r.controlsContainer : r) }, active: function () { r.controlNav.removeClass(s + "active").eq(r.animatingTo).addClass(s + "active") }, update: function (t, n) { 1 < r.pagingCount && "add" === t ? r.controlNavScaffold.append(e("<li><a>" + r.count + "</a></li>")) : 1 === r.pagingCount ? r.controlNavScaffold.find("li").remove() : r.controlNav.eq(n).closest("li").remove(); p.controlNav.set(); 1 < r.pagingCount && r.pagingCount !== r.controlNav.length ? r.update(n, t) : p.controlNav.active() } }, directionNav: { setup: function () { var t = e('<ul class="' + s + 'direction-nav"><li><a class="' + s + 'prev" href="#">' + i.prevText + '</a></li><li><a class="' + s + 'next" href="#">' + i.nextText + "</a></li></ul>"); r.controlsContainer ? (e(r.controlsContainer).append(t), r.directionNav = e("." + s + "direction-nav li a", r.controlsContainer)) : (r.append(t), r.directionNav = e("." + s + "direction-nav li a", r)); p.directionNav.update(); r.directionNav.bind(u, function (t) { t.preventDefault(); t = e(this).hasClass(s + "next") ? r.getTarget("next") : r.getTarget("prev"); r.flexAnimate(t, i.pauseOnAction) }); o && r.directionNav.bind("click touchstart", function (e) { e.preventDefault() }) }, update: function () { var e = s + "disabled"; 1 === r.pagingCount ? r.directionNav.addClass(e) : i.animationLoop ? r.directionNav.removeClass(e) : 0 === r.animatingTo ? r.directionNav.removeClass(e).filter("." + s + "prev").addClass(e) : r.animatingTo === r.last ? r.directionNav.removeClass(e).filter("." + s + "next").addClass(e) : r.directionNav.removeClass(e) } }, pausePlay: { setup: function () { var t = e('<div class="' + s + 'pauseplay"><a></a></div>'); r.controlsContainer ? (r.controlsContainer.append(t), r.pausePlay = e("." + s + "pauseplay a", r.controlsContainer)) : (r.append(t), r.pausePlay = e("." + s + "pauseplay a", r)); p.pausePlay.update(i.slideshow ? s + "pause" : s + "play"); r.pausePlay.bind(u, function (t) { t.preventDefault(); e(this).hasClass(s + "pause") ? (r.manualPause = !0, r.manualPlay = !1, r.pause()) : (r.manualPause = !1, r.manualPlay = !0, r.play()) }); o && r.pausePlay.bind("click touchstart", function (e) { e.preventDefault() }) }, update: function (e) { "play" === e ? r.pausePlay.removeClass(s + "pause").addClass(s + "play").text(i.playText) : r.pausePlay.removeClass(s + "play").addClass(s + "pause").text(i.pauseText) } }, touch: function () { function e(e) { p = a ? s - e.touches[0].pageY : s - e.touches[0].pageX; v = a ? Math.abs(p) < Math.abs(e.touches[0].pageX - o) : Math.abs(p) < Math.abs(e.touches[0].pageY - o); if (!v || 500 < Number(new Date) - d) e.preventDefault(), !c && r.transitions && (i.animationLoop || (p /= 0 === r.currentSlide && 0 > p || r.currentSlide === r.last && 0 < p ? Math.abs(p) / h + 2 : 1), r.setProps(u + p, "setTouch")) } function n() { t.removeEventListener("touchmove", e, !1); if (r.animatingTo === r.currentSlide && !v && null !== p) { var a = f ? -p : p, l = 0 < a ? r.getTarget("next") : r.getTarget("prev"); r.canAdvance(l) && (550 > Number(new Date) - d && 50 < Math.abs(a) || Math.abs(a) > h / 2) ? r.flexAnimate(l, i.pauseOnAction) : c || r.flexAnimate(r.currentSlide, i.pauseOnAction, !0) } t.removeEventListener("touchend", n, !1); u = p = o = s = null } var s, o, u, h, p, d, v = !1; t.addEventListener("touchstart", function (c) { r.animating ? c.preventDefault() : 1 === c.touches.length && (r.pause(), h = a ? r.h : r.w, d = Number(new Date), u = l && f && r.animatingTo === r.last ? 0 : l && f ? r.limit - (r.itemW + i.itemMargin) * r.move * r.animatingTo : l && r.currentSlide === r.last ? r.limit : l ? (r.itemW + i.itemMargin) * r.move * r.currentSlide : f ? (r.last - r.currentSlide + r.cloneOffset) * h : (r.currentSlide + r.cloneOffset) * h, s = a ? c.touches[0].pageY : c.touches[0].pageX, o = a ? c.touches[0].pageX : c.touches[0].pageY, t.addEventListener("touchmove", e, !1), t.addEventListener("touchend", n, !1)) }, !1) }, resize: function () { !r.animating && r.is(":visible") && (l || r.doMath(), c ? p.smoothHeight() : l ? (r.slides.width(r.computedW), r.update(r.pagingCount), r.setProps()) : a ? (r.viewport.height(r.h), r.setProps(r.h, "setTotal")) : (i.smoothHeight && p.smoothHeight(), r.newSlides.width(r.computedW), r.setProps(r.computedW, "setTotal"))) }, smoothHeight: function (e) { if (!a || c) { var t = c ? r : r.viewport; e ? t.animate({ height: r.slides.eq(r.animatingTo).height() }, e) : t.height(r.slides.eq(r.animatingTo).height()) } }, sync: function (t) { var n = e(i.sync).data("flexslider"), s = r.animatingTo; switch (t) { case "animate": n.flexAnimate(s, i.pauseOnAction, !1, !0); break; case "play": !n.playing && !n.asNav && n.play(); break; case "pause": n.pause() } } }; r.flexAnimate = function (t, n, u, v, g) { h && 1 === r.pagingCount && (r.direction = r.currentItem < t ? "next" : "prev"); if (!r.animating && (r.canAdvance(t, g) || u) && r.is(":visible")) { if (h && v) if (u = e(i.asNavFor).data("flexslider"), r.atEnd = 0 === t || t === r.count - 1, u.flexAnimate(t, !0, !1, !0, g), r.direction = r.currentItem < t ? "next" : "prev", u.direction = r.direction, Math.ceil((t + 1) / r.visible) - 1 !== r.currentSlide && 0 !== t) r.currentItem = t, r.slides.removeClass(s + "active-slide").eq(t).addClass(s + "active-slide"), t = Math.floor(t / r.visible); else return r.currentItem = t, r.slides.removeClass(s + "active-slide").eq(t).addClass(s + "active-slide"), !1; r.animating = !0; r.animatingTo = t; i.before(r); n && r.pause(); r.syncExists && !g && p.sync("animate"); i.controlNav && p.controlNav.active(); l || r.slides.removeClass(s + "active-slide").eq(t).addClass(s + "active-slide"); r.atEnd = 0 === t || t === r.last; i.directionNav && p.directionNav.update(); t === r.last && (i.end(r), i.animationLoop || r.pause()); if (c) o ? (r.slides.eq(r.currentSlide).css({ opacity: 0, zIndex: 1 }), r.slides.eq(t).css({ opacity: 1, zIndex: 2 }), r.slides.unbind("webkitTransitionEnd transitionend"), r.slides.eq(r.currentSlide).bind("webkitTransitionEnd transitionend", function () { i.after(r) }), r.animating = !1, r.currentSlide = r.animatingTo) : (r.slides.eq(r.currentSlide).fadeOut(i.animationSpeed, i.easing), r.slides.eq(t).fadeIn(i.animationSpeed, i.easing, r.wrapup)); else { var y = a ? r.slides.filter(":first").height() : r.computedW; l ? (t = i.itemWidth > r.w ? 2 * i.itemMargin : i.itemMargin, t = (r.itemW + t) * r.move * r.animatingTo, t = t > r.limit && 1 !== r.visible ? r.limit : t) : t = 0 === r.currentSlide && t === r.count - 1 && i.animationLoop && "next" !== r.direction ? f ? (r.count + r.cloneOffset) * y : 0 : r.currentSlide === r.last && 0 === t && i.animationLoop && "prev" !== r.direction ? f ? 0 : (r.count + 1) * y : f ? (r.count - 1 - t + r.cloneOffset) * y : (t + r.cloneOffset) * y; r.setProps(t, "", i.animationSpeed); if (r.transitions) { if (!i.animationLoop || !r.atEnd) r.animating = !1, r.currentSlide = r.animatingTo; r.container.unbind("webkitTransitionEnd transitionend"); r.container.bind("webkitTransitionEnd transitionend", function () { r.wrapup(y) }) } else r.container.animate(r.args, i.animationSpeed, i.easing, function () { r.wrapup(y) }) } i.smoothHeight && p.smoothHeight(i.animationSpeed) } }; r.wrapup = function (e) { !c && !l && (0 === r.currentSlide && r.animatingTo === r.last && i.animationLoop ? r.setProps(e, "jumpEnd") : r.currentSlide === r.last && 0 === r.animatingTo && i.animationLoop && r.setProps(e, "jumpStart")); r.animating = !1; r.currentSlide = r.animatingTo; i.after(r) }; r.animateSlides = function () { r.animating || r.flexAnimate(r.getTarget("next")) }; r.pause = function () { clearInterval(r.animatedSlides); r.playing = !1; i.pausePlay && p.pausePlay.update("play"); r.syncExists && p.sync("pause") }; r.play = function () { r.animatedSlides = setInterval(r.animateSlides, i.slideshowSpeed); r.playing = !0; i.pausePlay && p.pausePlay.update("pause"); r.syncExists && p.sync("play") }; r.canAdvance = function (e, t) { var n = h ? r.pagingCount - 1 : r.last; return t ? !0 : h && r.currentItem === r.count - 1 && 0 === e && "prev" === r.direction ? !0 : h && 0 === r.currentItem && e === r.pagingCount - 1 && "next" !== r.direction ? !1 : e === r.currentSlide && !h ? !1 : i.animationLoop ? !0 : r.atEnd && 0 === r.currentSlide && e === n && "next" !== r.direction ? !1 : r.atEnd && r.currentSlide === n && 0 === e && "next" === r.direction ? !1 : !0 }; r.getTarget = function (e) { r.direction = e; return "next" === e ? r.currentSlide === r.last ? 0 : r.currentSlide + 1 : 0 === r.currentSlide ? r.last : r.currentSlide - 1 }; r.setProps = function (e, t, n) { var s, o = e ? e : (r.itemW + i.itemMargin) * r.move * r.animatingTo; s = -1 * function () { if (l) return "setTouch" === t ? e : f && r.animatingTo === r.last ? 0 : f ? r.limit - (r.itemW + i.itemMargin) * r.move * r.animatingTo : r.animatingTo === r.last ? r.limit : o; switch (t) { case "setTotal": return f ? (r.count - 1 - r.currentSlide + r.cloneOffset) * e : (r.currentSlide + r.cloneOffset) * e; case "setTouch": return e; case "jumpEnd": return f ? e : r.count * e; case "jumpStart": return f ? r.count * e : e; default: return e } }() + "px"; r.transitions && (s = a ? "translate3d(0," + s + ",0)" : "translate3d(" + s + ",0,0)", n = void 0 !== n ? n / 1e3 + "s" : "0s", r.container.css("-" + r.pfx + "-transition-duration", n)); r.args[r.prop] = s; (r.transitions || void 0 === n) && r.container.css(r.args) }; r.setup = function (t) { if (c) r.slides.css({ width: "100%", "float": "left", marginRight: "-100%", position: "relative" }), "init" === t && (o ? r.slides.css({ opacity: 0, display: "block", webkitTransition: "opacity " + i.animationSpeed / 1e3 + "s ease", zIndex: 1 }).eq(r.currentSlide).css({ opacity: 1, zIndex: 2 }) : r.slides.eq(r.currentSlide).fadeIn(i.animationSpeed, i.easing)), i.smoothHeight && p.smoothHeight(); else { var n, u; "init" === t && (r.viewport = e('<div class="' + s + 'viewport"></div>').css({ overflow: "hidden", position: "relative" }).appendTo(r).append(r.container), r.cloneCount = 0, r.cloneOffset = 0, f && (u = e.makeArray(r.slides).reverse(), r.slides = e(u), r.container.empty().append(r.slides))); i.animationLoop && !l && (r.cloneCount = 2, r.cloneOffset = 1, "init" !== t && r.container.find(".clone").remove(), r.container.append(r.slides.first().clone().addClass("clone")).prepend(r.slides.last().clone().addClass("clone"))); r.newSlides = e(i.selector, r); n = f ? r.count - 1 - r.currentSlide + r.cloneOffset : r.currentSlide + r.cloneOffset; a && !l ? (r.container.height(200 * (r.count + r.cloneCount) + "%").css("position", "absolute").width("100%"), setTimeout(function () { r.newSlides.css({ display: "block" }); r.doMath(); r.viewport.height(r.h); r.setProps(n * r.h, "init") }, "init" === t ? 100 : 0)) : (r.container.width(200 * (r.count + r.cloneCount) + "%"), r.setProps(n * r.computedW, "init"), setTimeout(function () { r.doMath(); r.newSlides.css({ width: r.computedW, "float": "left", display: "block" }); i.smoothHeight && p.smoothHeight() }, "init" === t ? 100 : 0)) } l || r.slides.removeClass(s + "active-slide").eq(r.currentSlide).addClass(s + "active-slide") }; r.doMath = function () { var e = r.slides.first(), t = i.itemMargin, n = i.minItems, s = i.maxItems; r.w = r.width(); r.h = e.height(); r.boxPadding = e.outerWidth() - e.width(); l ? (r.itemT = i.itemWidth + t, r.minW = n ? n * r.itemT : r.w, r.maxW = s ? s * r.itemT : r.w, r.itemW = r.minW > r.w ? (r.w - t * n) / n : r.maxW < r.w ? (r.w - t * s) / s : i.itemWidth > r.w ? r.w : i.itemWidth, r.visible = Math.floor(r.w / (r.itemW + t)), r.move = 0 < i.move && i.move < r.visible ? i.move : r.visible, r.pagingCount = Math.ceil((r.count - r.visible) / r.move + 1), r.last = r.pagingCount - 1, r.limit = 1 === r.pagingCount ? 0 : i.itemWidth > r.w ? (r.itemW + 2 * t) * r.count - r.w - t : (r.itemW + t) * r.count - r.w - t) : (r.itemW = r.w, r.pagingCount = r.count, r.last = r.count - 1); r.computedW = r.itemW - r.boxPadding }; r.update = function (e, t) { r.doMath(); l || (e < r.currentSlide ? r.currentSlide += 1 : e <= r.currentSlide && 0 !== e && (r.currentSlide -= 1), r.animatingTo = r.currentSlide); if (i.controlNav && !r.manualControls) if ("add" === t && !l || r.pagingCount > r.controlNav.length) p.controlNav.update("add"); else if ("remove" === t && !l || r.pagingCount < r.controlNav.length) l && r.currentSlide > r.last && (r.currentSlide -= 1, r.animatingTo -= 1), p.controlNav.update("remove", r.last); i.directionNav && p.directionNav.update() }; r.addSlide = function (t, n) { var s = e(t); r.count += 1; r.last = r.count - 1; a && f ? void 0 !== n ? r.slides.eq(r.count - n).after(s) : r.container.prepend(s) : void 0 !== n ? r.slides.eq(n).before(s) : r.container.append(s); r.update(n, "add"); r.slides = e(i.selector + ":not(.clone)", r); r.setup(); i.added(r) }; r.removeSlide = function (t) { var n = isNaN(t) ? r.slides.index(e(t)) : t; r.count -= 1; r.last = r.count - 1; isNaN(t) ? e(t, r.slides).remove() : a && f ? r.slides.eq(r.last).remove() : r.slides.eq(t).remove(); r.doMath(); r.update(n, "remove"); r.slides = e(i.selector + ":not(.clone)", r); r.setup(); i.removed(r) }; p.init(); var v = ($(".slides").outerHeight() / 2 + $(".flex-control-nav").outerHeight(true) + $(".flex-prev").outerHeight() / 2) * -1; $(".flex-prev").css("top", v); $(".flex-next").css("top", v) }; e.flexslider.defaults = { namespace: "flex-", selector: ".slides > li", animation: "fade", easing: "swing", direction: "horizontal", reverse: !1, animationLoop: !0, smoothHeight: !1, startAt: 0, slideshow: !0, slideshowSpeed: 7e3, animationSpeed: 600, initDelay: 0, randomize: !1, pauseOnAction: !0, pauseOnHover: !1, useCSS: !0, touch: !0, video: !1, controlNav: !0, directionNav: !0, prevText: "Previous", nextText: "Next", keyboard: !0, multipleKeyboard: !1, mousewheel: !1, pausePlay: !1, pauseText: "Pause", playText: "Play", controlsContainer: "", manualControls: "", sync: "", asNavFor: "", itemWidth: 0, itemMargin: 0, minItems: 0, maxItems: 0, move: 0, start: function () { }, before: function () { }, after: function () { }, end: function () { }, added: function () { }, removed: function () { } }; e.fn.flexslider = function (t) { void 0 === t && (t = {}); if ("object" === typeof t) return this.each(function () { var n = e(this), r = n.find(t.selector ? t.selector : ".slides > li"); 1 === r.length ? (r.fadeIn(400), t.start && t.start(n)) : void 0 == n.data("flexslider") && new e.flexslider(this, t) }); var n = e(this).data("flexslider"); switch (t) { case "play": n.play(); break; case "pause": n.pause(); break; case "next": n.flexAnimate(n.getTarget("next"), !0); break; case "prev": case "previous": n.flexAnimate(n.getTarget("prev"), !0); break; default: "number" === typeof t && n.flexAnimate(t, !0) } } })(jQuery)
