Advertisement
wrsi

Java script

Apr 15th, 2013
2,629
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var juicebox_lib = juicebox_lib ? juicebox_lib: {};
  2. (function (aq, ap) {
  3.     var an = aq.document,
  4.     bN = aq.navigator,
  5.     bE = aq.location;
  6.     var al = (function () {
  7.         var bT = function (b4, b3) {
  8.             return new bT.fn.init(b4, b3, E)
  9.         },
  10.         bX = aq.jQuery,
  11.         H = aq.$,
  12.         E,
  13.         b1 = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
  14.         bO = /\S/,
  15.         J = /^\s+/,
  16.         F = /\s+$/,
  17.         I = /\d/,
  18.         B = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
  19.         bP = /^[\],:{}\s]*$/,
  20.         bZ = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
  21.         bR = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
  22.         K = /(?:^|:|,)(?:\s*\[)+/g,
  23.         z = /(webkit)[ \/]([\w.]+)/,
  24.         bU = /(opera)(?:.*version)?[ \/]([\w.]+)/,
  25.         bS = /(msie) ([\w.]+)/,
  26.         bV = /(mozilla)(?:.*? rv:([\w.]+))?/,
  27.         C = /-([a-z]|[0-9])/ig,
  28.         b2 = /^-ms-/,
  29.         bW = function (b4, b3) {
  30.             return (b3 + "").toUpperCase()
  31.         },
  32.         b0 = bN.userAgent,
  33.         bY,
  34.         D,
  35.         e,
  36.         M = Object.prototype.toString,
  37.         G = Object.prototype.hasOwnProperty,
  38.         A = Array.prototype.push,
  39.         L = Array.prototype.slice,
  40.         bQ = String.prototype.trim,
  41.         w = Array.prototype.indexOf,
  42.         y = {};
  43.         bT.fn = bT.prototype = {
  44.             constructor: bT,
  45.             init: function (b4, b3, b9) {
  46.                 var b8, b6, b5, b7;
  47.                 if (!b4) {
  48.                     return this
  49.                 }
  50.                 if (b4.nodeType) {
  51.                     this.context = this[0] = b4;
  52.                     this.length = 1;
  53.                     return this
  54.                 }
  55.                 if (b4 === "body" && !b3 && an.body) {
  56.                     this.context = an;
  57.                     this[0] = an.body;
  58.                     this.selector = b4;
  59.                     this.length = 1;
  60.                     return this
  61.                 }
  62.                 if (typeof b4 === "string") {
  63.                     if (b4.charAt(0) === "<" && b4.charAt(b4.length - 1) === ">" && b4.length >= 3) {
  64.                         b8 = [null, b4, null]
  65.                     } else {
  66.                         b8 = b1.exec(b4)
  67.                     }
  68.                     if (b8 && (b8[1] || !b3)) {
  69.                         if (b8[1]) {
  70.                             b3 = b3 instanceof bT ? b3[0] : b3;
  71.                             b7 = (b3 ? b3.ownerDocument || b3: an);
  72.                             b5 = B.exec(b4);
  73.                             if (b5) {
  74.                                 if (bT.isPlainObject(b3)) {
  75.                                     b4 = [an.createElement(b5[1])];
  76.                                     bT.fn.attr.call(b4, b3, true)
  77.                                 } else {
  78.                                     b4 = [b7.createElement(b5[1])]
  79.                                 }
  80.                             } else {
  81.                                 b5 = bT.buildFragment([b8[1]], [b7]);
  82.                                 b4 = (b5.cacheable ? bT.clone(b5.fragment) : b5.fragment).childNodes
  83.                             }
  84.                             return bT.merge(this, b4)
  85.                         } else {
  86.                             b6 = an.getElementById(b8[2]);
  87.                             if (b6 && b6.parentNode) {
  88.                                 if (b6.id !== b8[2]) {
  89.                                     return b9.find(b4)
  90.                                 }
  91.                                 this.length = 1;
  92.                                 this[0] = b6
  93.                             }
  94.                             this.context = an;
  95.                             this.selector = b4;
  96.                             return this
  97.                         }
  98.                     } else {
  99.                         if (!b3 || b3.jquery) {
  100.                             return (b3 || b9).find(b4)
  101.                         } else {
  102.                             return this.constructor(b3).find(b4)
  103.                         }
  104.                     }
  105.                 } else {
  106.                     if (bT.isFunction(b4)) {
  107.                         return b9.ready(b4)
  108.                     }
  109.                 }
  110.                 if (b4.selector !== ap) {
  111.                     this.selector = b4.selector;
  112.                     this.context = b4.context
  113.                 }
  114.                 return bT.makeArray(b4, this)
  115.             },
  116.             selector: "",
  117.             jquery: "1.7",
  118.             length: 0,
  119.             size: function () {
  120.                 return this.length
  121.             },
  122.             toArray: function () {
  123.                 return L.call(this, 0)
  124.             },
  125.             get: function (b3) {
  126.                 return b3 == null ? this.toArray() : (b3 < 0 ? this[this.length + b3] : this[b3])
  127.             },
  128.             pushStack: function (b4, b3, b6) {
  129.                 var b5 = this.constructor();
  130.                 if (bT.isArray(b4)) {
  131.                     A.apply(b5, b4)
  132.                 } else {
  133.                     bT.merge(b5, b4)
  134.                 }
  135.                 b5.prevObject = this;
  136.                 b5.context = this.context;
  137.                 if (b3 === "find") {
  138.                     b5.selector = this.selector + (this.selector ? " ": "") + b6
  139.                 } else {
  140.                     if (b3) {
  141.                         b5.selector = this.selector + "." + b3 + "(" + b6 + ")"
  142.                     }
  143.                 }
  144.                 return b5
  145.             },
  146.             each: function (b4, b3) {
  147.                 return bT.each(this, b4, b3)
  148.             },
  149.             ready: function (b3) {
  150.                 bT.bindReady();
  151.                 D.add(b3);
  152.                 return this
  153.             },
  154.             eq: function (b3) {
  155.                 return b3 === -1 ? this.slice(b3) : this.slice(b3, +b3 + 1)
  156.             },
  157.             first: function () {
  158.                 return this.eq(0)
  159.             },
  160.             last: function () {
  161.                 return this.eq( - 1)
  162.             },
  163.             slice: function () {
  164.                 return this.pushStack(L.apply(this, arguments), "slice", L.call(arguments).join(","))
  165.             },
  166.             map: function (b3) {
  167.                 return this.pushStack(bT.map(this, function (b4, b5) {
  168.                     return b3.call(b4, b5, b4)
  169.                 }))
  170.             },
  171.             end: function () {
  172.                 return this.prevObject || this.constructor(null)
  173.             },
  174.             push: A,
  175.             sort: [].sort,
  176.             splice: [].splice
  177.         };
  178.         bT.fn.init.prototype = bT.fn;
  179.         bT.extend = bT.fn.extend = function () {
  180.             var cb, b5, b3, b4, b9, ca, b8 = arguments[0] || {},
  181.             b7 = 1,
  182.             b6 = arguments.length,
  183.             cc = false;
  184.             if (typeof b8 === "boolean") {
  185.                 cc = b8;
  186.                 b8 = arguments[1] || {};
  187.                 b7 = 2
  188.             }
  189.             if (typeof b8 !== "object" && !bT.isFunction(b8)) {
  190.                 b8 = {}
  191.             }
  192.             if (b6 === b7) {
  193.                 b8 = this; --b7
  194.             }
  195.             for (; b7 < b6; b7++) {
  196.                 if ((cb = arguments[b7]) != null) {
  197.                     for (b5 in cb) {
  198.                         b3 = b8[b5];
  199.                         b4 = cb[b5];
  200.                         if (b8 === b4) {
  201.                             continue
  202.                         }
  203.                         if (cc && b4 && (bT.isPlainObject(b4) || (b9 = bT.isArray(b4)))) {
  204.                             if (b9) {
  205.                                 b9 = false;
  206.                                 ca = b3 && bT.isArray(b3) ? b3: []
  207.                             } else {
  208.                                 ca = b3 && bT.isPlainObject(b3) ? b3: {}
  209.                             }
  210.                             b8[b5] = bT.extend(cc, ca, b4)
  211.                         } else {
  212.                             if (b4 !== ap) {
  213.                                 b8[b5] = b4
  214.                             }
  215.                         }
  216.                     }
  217.                 }
  218.             }
  219.             return b8
  220.         };
  221.         bT.extend({
  222.             noConflict: function (b3) {
  223.                 if (aq.$ === bT) {
  224.                     aq.$ = H
  225.                 }
  226.                 if (b3 && aq.jQuery === bT) {
  227.                     aq.jQuery = bX
  228.                 }
  229.                 return bT
  230.             },
  231.             isReady: false,
  232.             readyWait: 1,
  233.             holdReady: function (b3) {
  234.                 if (b3) {
  235.                     bT.readyWait++
  236.                 } else {
  237.                     bT.ready(true)
  238.                 }
  239.             },
  240.             ready: function (b3) {
  241.                 if ((b3 === true && !--bT.readyWait) || (b3 !== true && !bT.isReady)) {
  242.                     if (!an.body) {
  243.                         return setTimeout(bT.ready, 1)
  244.                     }
  245.                     bT.isReady = true;
  246.                     if (b3 !== true && --bT.readyWait > 0) {
  247.                         return
  248.                     }
  249.                     D.fireWith(an, [bT]);
  250.                     if (bT.fn.trigger) {
  251.                         bT(an).trigger("ready").unbind("ready")
  252.                     }
  253.                 }
  254.             },
  255.             bindReady: function () {
  256.                 if (D) {
  257.                     return
  258.                 }
  259.                 D = bT.Callbacks("once memory");
  260.                 if (an.readyState === "complete") {
  261.                     return setTimeout(bT.ready, 1)
  262.                 }
  263.                 if (an.addEventListener) {
  264.                     an.addEventListener("DOMContentLoaded", e, false);
  265.                     aq.addEventListener("load", bT.ready, false)
  266.                 } else {
  267.                     if (an.attachEvent) {
  268.                         an.attachEvent("onreadystatechange", e);
  269.                         aq.attachEvent("onload", bT.ready);
  270.                         var b3 = false;
  271.                         try {
  272.                             b3 = aq.frameElement == null
  273.                         } catch(b4) {}
  274.                         if (an.documentElement.doScroll && b3) {
  275.                             x()
  276.                         }
  277.                     }
  278.                 }
  279.             },
  280.             isFunction: function (b3) {
  281.                 return bT.type(b3) === "function"
  282.             },
  283.             isArray: Array.isArray ||
  284.             function (b3) {
  285.                 return bT.type(b3) === "array"
  286.             },
  287.             isWindow: function (b3) {
  288.                 return b3 && typeof b3 === "object" && "setInterval" in b3
  289.             },
  290.             isNumeric: function (b3) {
  291.                 return b3 != null && I.test(b3) && !isNaN(b3)
  292.             },
  293.             type: function (b3) {
  294.                 return b3 == null ? String(b3) : y[M.call(b3)] || "object"
  295.             },
  296.             isPlainObject: function (b4) {
  297.                 if (!b4 || bT.type(b4) !== "object" || b4.nodeType || bT.isWindow(b4)) {
  298.                     return false
  299.                 }
  300.                 try {
  301.                     if (b4.constructor && !G.call(b4, "constructor") && !G.call(b4.constructor.prototype, "isPrototypeOf")) {
  302.                         return false
  303.                     }
  304.                 } catch(b5) {
  305.                     return false
  306.                 }
  307.                 var b3;
  308.                 for (b3 in b4) {}
  309.                 return b3 === ap || G.call(b4, b3)
  310.             },
  311.             isEmptyObject: function (b4) {
  312.                 for (var b3 in b4) {
  313.                     return false
  314.                 }
  315.                 return true
  316.             },
  317.             error: function (b3) {
  318.                 throw b3
  319.             },
  320.             parseJSON: function (b3) {
  321.                 if (typeof b3 !== "string" || !b3) {
  322.                     return null
  323.                 }
  324.                 b3 = bT.trim(b3);
  325.                 if (aq.JSON && aq.JSON.parse) {
  326.                     return aq.JSON.parse(b3)
  327.                 }
  328.                 if (bP.test(b3.replace(bZ, "@").replace(bR, "]").replace(K, ""))) {
  329.                     return (new Function("return " + b3))()
  330.                 }
  331.                 bT.error("Invalid JSON: " + b3)
  332.             },
  333.             parseXML: function (b4) {
  334.                 var b3, b5;
  335.                 try {
  336.                     if (aq.DOMParser) {
  337.                         b5 = new DOMParser();
  338.                         b3 = b5.parseFromString(b4, "text/xml")
  339.                     } else {
  340.                         b3 = new ActiveXObject("Microsoft.XMLDOM");
  341.                         b3.async = "false";
  342.                         b3.loadXML(b4)
  343.                     }
  344.                 } catch(b6) {
  345.                     b3 = ap
  346.                 }
  347.                 if (!b3 || !b3.documentElement || b3.getElementsByTagName("parsererror").length) {
  348.                     bT.error("Invalid XML: " + b4)
  349.                 }
  350.                 return b3
  351.             },
  352.             noop: function () {},
  353.             globalEval: function (b3) {
  354.                 if (b3 && bO.test(b3)) { (aq.execScript ||
  355.                     function (b4) {
  356.                         aq["eval"].call(aq, b4)
  357.                     })(b3)
  358.                 }
  359.             },
  360.             camelCase: function (b3) {
  361.                 return b3.replace(b2, "ms-").replace(C, bW)
  362.             },
  363.             nodeName: function (b4, b3) {
  364.                 return b4.nodeName && b4.nodeName.toUpperCase() === b3.toUpperCase()
  365.             },
  366.             each: function (b4, b3, b9) {
  367.                 var b8, b6 = 0,
  368.                 b7 = b4.length,
  369.                 b5 = b7 === ap || bT.isFunction(b4);
  370.                 if (b9) {
  371.                     if (b5) {
  372.                         for (b8 in b4) {
  373.                             if (b3.apply(b4[b8], b9) === false) {
  374.                                 break
  375.                             }
  376.                         }
  377.                     } else {
  378.                         for (; b6 < b7;) {
  379.                             if (b3.apply(b4[b6++], b9) === false) {
  380.                                 break
  381.                             }
  382.                         }
  383.                     }
  384.                 } else {
  385.                     if (b5) {
  386.                         for (b8 in b4) {
  387.                             if (b3.call(b4[b8], b8, b4[b8]) === false) {
  388.                                 break
  389.                             }
  390.                         }
  391.                     } else {
  392.                         for (; b6 < b7;) {
  393.                             if (b3.call(b4[b6], b6, b4[b6++]) === false) {
  394.                                 break
  395.                             }
  396.                         }
  397.                     }
  398.                 }
  399.                 return b4
  400.             },
  401.             trim: bQ ?
  402.             function (b3) {
  403.                 return b3 == null ? "": bQ.call(b3)
  404.             }: function (b3) {
  405.                 return b3 == null ? "": b3.toString().replace(J, "").replace(F, "")
  406.             },
  407.             makeArray: function (b4, b3) {
  408.                 var b6 = b3 || [];
  409.                 if (b4 != null) {
  410.                     var b5 = bT.type(b4);
  411.                     if (b4.length == null || b5 === "string" || b5 === "function" || b5 === "regexp" || bT.isWindow(b4)) {
  412.                         A.call(b6, b4)
  413.                     } else {
  414.                         bT.merge(b6, b4)
  415.                     }
  416.                 }
  417.                 return b6
  418.             },
  419.             inArray: function (b4, b3, b5) {
  420.                 var b6;
  421.                 if (b3) {
  422.                     if (w) {
  423.                         return w.call(b3, b4, b5)
  424.                     }
  425.                     b6 = b3.length;
  426.                     b5 = b5 ? b5 < 0 ? Math.max(0, b6 + b5) : b5: 0;
  427.                     for (; b5 < b6; b5++) {
  428.                         if (b5 in b3 && b3[b5] === b4) {
  429.                             return b5
  430.                         }
  431.                     }
  432.                 }
  433.                 return - 1
  434.             },
  435.             merge: function (b5, b3) {
  436.                 var b7 = b5.length,
  437.                 b6 = 0;
  438.                 if (typeof b3.length === "number") {
  439.                     for (var b4 = b3.length; b6 < b4; b6++) {
  440.                         b5[b7++] = b3[b6]
  441.                     }
  442.                 } else {
  443.                     while (b3[b6] !== ap) {
  444.                         b5[b7++] = b3[b6++]
  445.                     }
  446.                 }
  447.                 b5.length = b7;
  448.                 return b5
  449.             },
  450.             grep: function (b4, b3, b9) {
  451.                 var b8 = [],
  452.                 b7;
  453.                 b9 = !!b9;
  454.                 for (var b5 = 0, b6 = b4.length; b5 < b6; b5++) {
  455.                     b7 = !!b3(b4[b5], b5);
  456.                     if (b9 !== b7) {
  457.                         b8.push(b4[b5])
  458.                     }
  459.                 }
  460.                 return b8
  461.             },
  462.             map: function (ca, b9, b8) {
  463.                 var b7, cb, b6 = [],
  464.                 b4 = 0,
  465.                 b3 = ca.length,
  466.                 b5 = ca instanceof bT || b3 !== ap && typeof b3 === "number" && ((b3 > 0 && ca[0] && ca[b3 - 1]) || b3 === 0 || bT.isArray(ca));
  467.                 if (b5) {
  468.                     for (; b4 < b3; b4++) {
  469.                         b7 = b9(ca[b4], b4, b8);
  470.                         if (b7 != null) {
  471.                             b6[b6.length] = b7
  472.                         }
  473.                     }
  474.                 } else {
  475.                     for (cb in ca) {
  476.                         b7 = b9(ca[cb], cb, b8);
  477.                         if (b7 != null) {
  478.                             b6[b6.length] = b7
  479.                         }
  480.                     }
  481.                 }
  482.                 return b6.concat.apply([], b6)
  483.             },
  484.             guid: 1,
  485.             proxy: function (b4, b3) {
  486.                 if (typeof b3 === "string") {
  487.                     var b7 = b4[b3];
  488.                     b3 = b4;
  489.                     b4 = b7
  490.                 }
  491.                 if (!bT.isFunction(b4)) {
  492.                     return ap
  493.                 }
  494.                 var b6 = L.call(arguments, 2),
  495.                 b5 = function () {
  496.                     return b4.apply(b3, b6.concat(L.call(arguments)))
  497.                 };
  498.                 b5.guid = b4.guid = b4.guid || b5.guid || bT.guid++;
  499.                 return b5
  500.             },
  501.             access: function (cb, ca, b9, b8, b7, b6) {
  502.                 var b5 = cb.length;
  503.                 if (typeof ca === "object") {
  504.                     for (var b3 in ca) {
  505.                         bT.access(cb, b3, ca[b3], b8, b7, b9)
  506.                     }
  507.                     return cb
  508.                 }
  509.                 if (b9 !== ap) {
  510.                     b8 = !b6 && b8 && bT.isFunction(b9);
  511.                     for (var b4 = 0; b4 < b5; b4++) {
  512.                         b7(cb[b4], ca, b8 ? b9.call(cb[b4], b4, b7(cb[b4], ca)) : b9, b6)
  513.                     }
  514.                     return cb
  515.                 }
  516.                 return b5 ? b7(cb[0], ca) : ap
  517.             },
  518.             now: function () {
  519.                 return (new Date()).getTime()
  520.             },
  521.             uaMatch: function (b4) {
  522.                 b4 = b4.toLowerCase();
  523.                 var b3 = z.exec(b4) || bU.exec(b4) || bS.exec(b4) || b4.indexOf("compatible") < 0 && bV.exec(b4) || [];
  524.                 return {
  525.                     browser: b3[1] || "",
  526.                     version: b3[2] || "0"
  527.                 }
  528.             },
  529.             sub: function () {
  530.                 function b3(b7, b6) {
  531.                     return new b3.fn.init(b7, b6)
  532.                 }
  533.                 bT.extend(true, b3, this);
  534.                 b3.superclass = this;
  535.                 b3.fn = b3.prototype = this();
  536.                 b3.fn.constructor = b3;
  537.                 b3.sub = this.sub;
  538.                 b3.fn.init = function b4(b7, b6) {
  539.                     if (b6 && b6 instanceof bT && !(b6 instanceof b3)) {
  540.                         b6 = b3(b6)
  541.                     }
  542.                     return bT.fn.init.call(this, b7, b6, b5)
  543.                 };
  544.                 b3.fn.init.prototype = b3.fn;
  545.                 var b5 = b3(an);
  546.                 return b3
  547.             },
  548.             browser: {}
  549.         });
  550.         bT.each("Boolean Number String Function Array Date RegExp Object".split(" "), function (b4, b3) {
  551.             y["[object " + b3 + "]"] = b3.toLowerCase()
  552.         });
  553.         bY = bT.uaMatch(b0);
  554.         if (bY.browser) {
  555.             bT.browser[bY.browser] = true;
  556.             bT.browser.version = bY.version
  557.         }
  558.         if (bT.browser.webkit) {
  559.             bT.browser.safari = true
  560.         }
  561.         if (bO.test("\xA0")) {
  562.             J = /^[\s\xA0]+/;
  563.             F = /[\s\xA0]+$/
  564.         }
  565.         E = bT(an);
  566.         if (an.addEventListener) {
  567.             e = function () {
  568.                 an.removeEventListener("DOMContentLoaded", e, false);
  569.                 bT.ready()
  570.             }
  571.         } else {
  572.             if (an.attachEvent) {
  573.                 e = function () {
  574.                     if (an.readyState === "complete") {
  575.                         an.detachEvent("onreadystatechange", e);
  576.                         bT.ready()
  577.                     }
  578.                 }
  579.             }
  580.         }
  581.         function x() {
  582.             if (bT.isReady) {
  583.                 return
  584.             }
  585.             try {
  586.                 an.documentElement.doScroll("left")
  587.             } catch(b3) {
  588.                 setTimeout(x, 1);
  589.                 return
  590.             }
  591.             bT.ready()
  592.         }
  593.         if (typeof define === "function" && define.amd && define.amd.jQuery) {
  594.             define("jquery", [], function () {
  595.                 return bT
  596.             })
  597.         }
  598.         return bT
  599.     })();
  600.     var bc = {};
  601.     function ai(w) {
  602.         var e = bc[w] = {},
  603.         x,
  604.         y;
  605.         w = w.split(/\s+/);
  606.         for (x = 0, y = w.length; x < y; x++) {
  607.             e[w[x]] = true
  608.         }
  609.         return e
  610.     }
  611.     al.Callbacks = function (C) {
  612.         C = C ? (bc[C] || ai(C)) : {};
  613.         var B = [],
  614.         D = [],
  615.         x,
  616.         y,
  617.         w,
  618.         z,
  619.         A,
  620.         F = function (G) {
  621.             var H, K, J, I, L;
  622.             for (H = 0, K = G.length; H < K; H++) {
  623.                 J = G[H];
  624.                 I = al.type(J);
  625.                 if (I === "array") {
  626.                     F(J)
  627.                 } else {
  628.                     if (I === "function") {
  629.                         if (!C.unique || !E.has(J)) {
  630.                             B.push(J)
  631.                         }
  632.                     }
  633.                 }
  634.             }
  635.         },
  636.         e = function (H, G) {
  637.             G = G || [];
  638.             x = !C.memory || [H, G];
  639.             y = true;
  640.             A = w || 0;
  641.             w = 0;
  642.             z = B.length;
  643.             for (; B && A < z; A++) {
  644.                 if (B[A].apply(H, G) === false && C.stopOnFalse) {
  645.                     x = true;
  646.                     break
  647.                 }
  648.             }
  649.             y = false;
  650.             if (B) {
  651.                 if (!C.once) {
  652.                     if (D && D.length) {
  653.                         x = D.shift();
  654.                         E.fireWith(x[0], x[1])
  655.                     }
  656.                 } else {
  657.                     if (x === true) {
  658.                         E.disable()
  659.                     } else {
  660.                         B = []
  661.                     }
  662.                 }
  663.             }
  664.         },
  665.         E = {
  666.             add: function () {
  667.                 if (B) {
  668.                     var G = B.length;
  669.                     F(arguments);
  670.                     if (y) {
  671.                         z = B.length
  672.                     } else {
  673.                         if (x && x !== true) {
  674.                             w = G;
  675.                             e(x[0], x[1])
  676.                         }
  677.                     }
  678.                 }
  679.                 return this
  680.             },
  681.             remove: function () {
  682.                 if (B) {
  683.                     var G = arguments,
  684.                     I = 0,
  685.                     J = G.length;
  686.                     for (; I < J; I++) {
  687.                         for (var H = 0; H < B.length; H++) {
  688.                             if (G[I] === B[H]) {
  689.                                 if (y) {
  690.                                     if (H <= z) {
  691.                                         z--;
  692.                                         if (H <= A) {
  693.                                             A--
  694.                                         }
  695.                                     }
  696.                                 }
  697.                                 B.splice(H--, 1);
  698.                                 if (C.unique) {
  699.                                     break
  700.                                 }
  701.                             }
  702.                         }
  703.                     }
  704.                 }
  705.                 return this
  706.             },
  707.             has: function (G) {
  708.                 if (B) {
  709.                     var H = 0,
  710.                     I = B.length;
  711.                     for (; H < I; H++) {
  712.                         if (G === B[H]) {
  713.                             return true
  714.                         }
  715.                     }
  716.                 }
  717.                 return false
  718.             },
  719.             empty: function () {
  720.                 B = [];
  721.                 return this
  722.             },
  723.             disable: function () {
  724.                 B = D = x = ap;
  725.                 return this
  726.             },
  727.             disabled: function () {
  728.                 return ! B
  729.             },
  730.             lock: function () {
  731.                 D = ap;
  732.                 if (!x || x === true) {
  733.                     E.disable()
  734.                 }
  735.                 return this
  736.             },
  737.             locked: function () {
  738.                 return ! D
  739.             },
  740.             fireWith: function (H, G) {
  741.                 if (D) {
  742.                     if (y) {
  743.                         if (!C.once) {
  744.                             D.push([H, G])
  745.                         }
  746.                     } else {
  747.                         if (! (C.once && x)) {
  748.                             e(H, G)
  749.                         }
  750.                     }
  751.                 }
  752.                 return this
  753.             },
  754.             fire: function () {
  755.                 E.fireWith(this, arguments);
  756.                 return this
  757.             },
  758.             fired: function () {
  759.                 return !! x
  760.             }
  761.         };
  762.         return E
  763.     };
  764.     var bb = [].slice;
  765.     al.extend({
  766.         Deferred: function (z) {
  767.             var y = al.Callbacks("once memory"),
  768.             x = al.Callbacks("once memory"),
  769.             w = al.Callbacks("memory"),
  770.             e = "pending",
  771.             B = {
  772.                 resolve: y,
  773.                 reject: x,
  774.                 notify: w
  775.             },
  776.             D = {
  777.                 done: y.add,
  778.                 fail: x.add,
  779.                 progress: w.add,
  780.                 state: function () {
  781.                     return e
  782.                 },
  783.                 isResolved: y.fired,
  784.                 isRejected: x.fired,
  785.                 then: function (F, E, G) {
  786.                     C.done(F).fail(E).progress(G);
  787.                     return this
  788.                 },
  789.                 always: function () {
  790.                     return C.done.apply(C, arguments).fail.apply(C, arguments)
  791.                 },
  792.                 pipe: function (G, F, E) {
  793.                     return al.Deferred(function (H) {
  794.                         al.each({
  795.                             done: [G, "resolve"],
  796.                             fail: [F, "reject"],
  797.                             progress: [E, "notify"]
  798.                         },
  799.                         function (J, I) {
  800.                             var M = I[0],
  801.                             L = I[1],
  802.                             K;
  803.                             if (al.isFunction(M)) {
  804.                                 C[J](function () {
  805.                                     K = M.apply(this, arguments);
  806.                                     if (K && al.isFunction(K.promise)) {
  807.                                         K.promise().then(H.resolve, H.reject, H.notify)
  808.                                     } else {
  809.                                         H[L + "With"](this === C ? H: this, [K])
  810.                                     }
  811.                                 })
  812.                             } else {
  813.                                 C[J](H[L])
  814.                             }
  815.                         })
  816.                     }).promise()
  817.                 },
  818.                 promise: function (F) {
  819.                     if (F == null) {
  820.                         F = D
  821.                     } else {
  822.                         for (var E in D) {
  823.                             F[E] = D[E]
  824.                         }
  825.                     }
  826.                     return F
  827.                 }
  828.             },
  829.             C = D.promise({}),
  830.             A;
  831.             for (A in B) {
  832.                 C[A] = B[A].fire;
  833.                 C[A + "With"] = B[A].fireWith
  834.             }
  835.             C.done(function () {
  836.                 e = "resolved"
  837.             },
  838.             x.disable, w.lock).fail(function () {
  839.                 e = "rejected"
  840.             },
  841.             y.disable, w.lock);
  842.             if (z) {
  843.                 z.call(C, C)
  844.             }
  845.             return C
  846.         },
  847.         when: function (B) {
  848.             var y = bb.call(arguments, 0),
  849.             w = 0,
  850.             e = y.length,
  851.             C = new Array(e),
  852.             x = e,
  853.             z = e,
  854.             D = e <= 1 && B && al.isFunction(B.promise) ? B: al.Deferred(),
  855.             F = D.promise();
  856.             function E(G) {
  857.                 return function (H) {
  858.                     y[G] = arguments.length > 1 ? bb.call(arguments, 0) : H;
  859.                     if (! (--x)) {
  860.                         D.resolveWith(D, y)
  861.                     }
  862.                 }
  863.             }
  864.             function A(G) {
  865.                 return function (H) {
  866.                     C[G] = arguments.length > 1 ? bb.call(arguments, 0) : H;
  867.                     D.notifyWith(F, C)
  868.                 }
  869.             }
  870.             if (e > 1) {
  871.                 for (; w < e; w++) {
  872.                     if (y[w] && y[w].promise && al.isFunction(y[w].promise)) {
  873.                         y[w].promise().then(E(w), D.reject, A(w))
  874.                     } else {--x
  875.                     }
  876.                 }
  877.                 if (!x) {
  878.                     D.resolveWith(D, y)
  879.                 }
  880.             } else {
  881.                 if (D !== B) {
  882.                     D.resolveWith(D, e ? [B] : [])
  883.                 }
  884.             }
  885.             return F
  886.         }
  887.     });
  888.     al.support = (function () {
  889.         var M = an.createElement("div"),
  890.         bO = an.documentElement,
  891.         z,
  892.         bP,
  893.         G,
  894.         x,
  895.         F,
  896.         A,
  897.         D,
  898.         w,
  899.         E,
  900.         H,
  901.         C,
  902.         L,
  903.         J,
  904.         y,
  905.         B,
  906.         I,
  907.         bQ;
  908.         M.setAttribute("className", "t");
  909.         M.innerHTML = "   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/><nav></nav>";
  910.         z = M.getElementsByTagName("*");
  911.         bP = M.getElementsByTagName("a")[0];
  912.         if (!z || !z.length || !bP) {
  913.             return {}
  914.         }
  915.         G = an.createElement("select");
  916.         x = G.appendChild(an.createElement("option"));
  917.         F = M.getElementsByTagName("input")[0];
  918.         D = {
  919.             leadingWhitespace: (M.firstChild.nodeType === 3),
  920.             tbody: !M.getElementsByTagName("tbody").length,
  921.             htmlSerialize: !!M.getElementsByTagName("link").length,
  922.             style: /top/.test(bP.getAttribute("style")),
  923.             hrefNormalized: (bP.getAttribute("href") === "/a"),
  924.             opacity: /^0.55/.test(bP.style.opacity),
  925.             cssFloat: !!bP.style.cssFloat,
  926.             unknownElems: !!M.getElementsByTagName("nav").length,
  927.             checkOn: (F.value === "on"),
  928.             optSelected: x.selected,
  929.             getSetAttribute: M.className !== "t",
  930.             enctype: !!an.createElement("form").enctype,
  931.             submitBubbles: true,
  932.             changeBubbles: true,
  933.             focusinBubbles: false,
  934.             deleteExpando: true,
  935.             noCloneEvent: true,
  936.             inlineBlockNeedsLayout: false,
  937.             shrinkWrapBlocks: false,
  938.             reliableMarginRight: true
  939.         };
  940.         F.checked = true;
  941.         D.noCloneChecked = F.cloneNode(true).checked;
  942.         G.disabled = true;
  943.         D.optDisabled = !x.disabled;
  944.         try {
  945.             delete M.test
  946.         } catch(K) {
  947.             D.deleteExpando = false
  948.         }
  949.         if (!M.addEventListener && M.attachEvent && M.fireEvent) {
  950.             M.attachEvent("onclick", function () {
  951.                 D.noCloneEvent = false
  952.             });
  953.             M.cloneNode(true).fireEvent("onclick")
  954.         }
  955.         F = an.createElement("input");
  956.         F.value = "t";
  957.         F.setAttribute("type", "radio");
  958.         D.radioValue = F.value === "t";
  959.         F.setAttribute("checked", "checked");
  960.         M.appendChild(F);
  961.         w = an.createDocumentFragment();
  962.         w.appendChild(M.lastChild);
  963.         D.checkClone = w.cloneNode(true).cloneNode(true).lastChild.checked;
  964.         M.innerHTML = "";
  965.         M.style.width = M.style.paddingLeft = "1px";
  966.         E = an.getElementsByTagName("body")[0];
  967.         C = an.createElement(E ? "div": "body");
  968.         L = {
  969.             visibility: "hidden",
  970.             width: 0,
  971.             height: 0,
  972.             border: 0,
  973.             margin: 0,
  974.             background: "none"
  975.         };
  976.         if (E) {
  977.             al.extend(L, {
  978.                 position: "absolute",
  979.                 left: "-999px",
  980.                 top: "-999px"
  981.             })
  982.         }
  983.         for (I in L) {
  984.             C.style[I] = L[I]
  985.         }
  986.         C.appendChild(M);
  987.         H = E || bO;
  988.         H.insertBefore(C, H.firstChild);
  989.         D.appendChecked = F.checked;
  990.         D.boxModel = M.offsetWidth === 2;
  991.         if ("zoom" in M.style) {
  992.             M.style.display = "inline";
  993.             M.style.zoom = 1;
  994.             D.inlineBlockNeedsLayout = (M.offsetWidth === 2);
  995.             M.style.display = "";
  996.             M.innerHTML = "<div style='width:4px;'></div>";
  997.             D.shrinkWrapBlocks = (M.offsetWidth !== 2)
  998.         }
  999.         M.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
  1000.         J = M.getElementsByTagName("td");
  1001.         bQ = (J[0].offsetHeight === 0);
  1002.         J[0].style.display = "";
  1003.         J[1].style.display = "none";
  1004.         D.reliableHiddenOffsets = bQ && (J[0].offsetHeight === 0);
  1005.         M.innerHTML = "";
  1006.         if (an.defaultView && an.defaultView.getComputedStyle) {
  1007.             A = an.createElement("div");
  1008.             A.style.width = "0";
  1009.             A.style.marginRight = "0";
  1010.             M.appendChild(A);
  1011.             D.reliableMarginRight = (parseInt((an.defaultView.getComputedStyle(A, null) || {
  1012.                 marginRight: 0
  1013.             }).marginRight, 10) || 0) === 0
  1014.         }
  1015.         if (M.attachEvent) {
  1016.             for (I in {
  1017.                 submit: 1,
  1018.                 change: 1,
  1019.                 focusin: 1
  1020.             }) {
  1021.                 B = "on" + I;
  1022.                 bQ = (B in M);
  1023.                 if (!bQ) {
  1024.                     M.setAttribute(B, "return;");
  1025.                     bQ = (typeof M[B] === "function")
  1026.                 }
  1027.                 D[I + "Bubbles"] = bQ
  1028.             }
  1029.         }
  1030.         al(function () {
  1031.             var bX, bZ, b0, bY, bS, bT, bR = 1,
  1032.             bW = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",
  1033.             bV = "visibility:hidden;border:0;",
  1034.             e = "style='" + bW + "border:5px solid #000;padding:0;'",
  1035.             bU = "<div " + e + "><div></div></div><table " + e + " cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
  1036.             E = an.getElementsByTagName("body")[0];
  1037.             if (!E) {
  1038.                 return
  1039.             }
  1040.             bX = an.createElement("div");
  1041.             bX.style.cssText = bV + "width:0;height:0;position:static;top:0;margin-top:" + bR + "px";
  1042.             E.insertBefore(bX, E.firstChild);
  1043.             C = an.createElement("div");
  1044.             C.style.cssText = bW + bV;
  1045.             C.innerHTML = bU;
  1046.             bX.appendChild(C);
  1047.             bZ = C.firstChild;
  1048.             b0 = bZ.firstChild;
  1049.             bS = bZ.nextSibling.firstChild.firstChild;
  1050.             bT = {
  1051.                 doesNotAddBorder: (b0.offsetTop !== 5),
  1052.                 doesAddBorderForTableAndCells: (bS.offsetTop === 5)
  1053.             };
  1054.             b0.style.position = "fixed";
  1055.             b0.style.top = "20px";
  1056.             bT.fixedPosition = (b0.offsetTop === 20 || b0.offsetTop === 15);
  1057.             b0.style.position = b0.style.top = "";
  1058.             bZ.style.overflow = "hidden";
  1059.             bZ.style.position = "relative";
  1060.             bT.subtractsBorderForOverflowNotVisible = (b0.offsetTop === -5);
  1061.             bT.doesNotIncludeMarginInBodyOffset = (E.offsetTop !== bR);
  1062.             E.removeChild(bX);
  1063.             C = bX = null;
  1064.             al.extend(D, bT)
  1065.         });
  1066.         C.innerHTML = "";
  1067.         H.removeChild(C);
  1068.         C = w = G = x = E = A = M = F = null;
  1069.         return D
  1070.     })();
  1071.     al.boxModel = al.support.boxModel;
  1072.     var a9 = /^(?:\{.*\}|\[.*\])$/,
  1073.     aL = /([A-Z])/g;
  1074.     al.extend({
  1075.         cache: {},
  1076.         uuid: 0,
  1077.         expando: "jQuery" + (al.fn.jquery + Math.random()).replace(/\D/g, ""),
  1078.         noData: {
  1079.             embed: true,
  1080.             object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
  1081.             applet: true
  1082.         },
  1083.         hasData: function (e) {
  1084.             e = e.nodeType ? al.cache[e[al.expando]] : e[al.expando];
  1085.             return !! e && !af(e)
  1086.         },
  1087.         data: function (H, F, E, D) {
  1088.             if (!al.acceptData(H)) {
  1089.                 return
  1090.             }
  1091.             var B, y, C, G = al.expando,
  1092.             A = typeof F === "string",
  1093.             I = H.nodeType,
  1094.             w = I ? al.cache: H,
  1095.             x = I ? H[al.expando] : H[al.expando] && al.expando,
  1096.             z = F === "events";
  1097.             if ((!x || !w[x] || (!z && !D && !w[x].data)) && A && E === ap) {
  1098.                 return
  1099.             }
  1100.             if (!x) {
  1101.                 if (I) {
  1102.                     H[al.expando] = x = ++al.uuid
  1103.                 } else {
  1104.                     x = al.expando
  1105.                 }
  1106.             }
  1107.             if (!w[x]) {
  1108.                 w[x] = {};
  1109.                 if (!I) {
  1110.                     w[x].toJSON = al.noop
  1111.                 }
  1112.             }
  1113.             if (typeof F === "object" || typeof F === "function") {
  1114.                 if (D) {
  1115.                     w[x] = al.extend(w[x], F)
  1116.                 } else {
  1117.                     w[x].data = al.extend(w[x].data, F)
  1118.                 }
  1119.             }
  1120.             B = y = w[x];
  1121.             if (!D) {
  1122.                 if (!y.data) {
  1123.                     y.data = {}
  1124.                 }
  1125.                 y = y.data
  1126.             }
  1127.             if (E !== ap) {
  1128.                 y[al.camelCase(F)] = E
  1129.             }
  1130.             if (z && !y[F]) {
  1131.                 return B.events
  1132.             }
  1133.             if (A) {
  1134.                 C = y[F];
  1135.                 if (C == null) {
  1136.                     C = y[al.camelCase(F)]
  1137.                 }
  1138.             } else {
  1139.                 C = y
  1140.             }
  1141.             return C
  1142.         },
  1143.         removeData: function (D, B, A) {
  1144.             if (!al.acceptData(D)) {
  1145.                 return
  1146.             }
  1147.             var z, y, x, C = al.expando,
  1148.             E = D.nodeType,
  1149.             e = E ? al.cache: D,
  1150.             w = E ? D[al.expando] : al.expando;
  1151.             if (!e[w]) {
  1152.                 return
  1153.             }
  1154.             if (B) {
  1155.                 z = A ? e[w] : e[w].data;
  1156.                 if (z) {
  1157.                     if (al.isArray(B)) {
  1158.                         B = B
  1159.                     } else {
  1160.                         if (B in z) {
  1161.                             B = [B]
  1162.                         } else {
  1163.                             B = al.camelCase(B);
  1164.                             if (B in z) {
  1165.                                 B = [B]
  1166.                             } else {
  1167.                                 B = B.split(" ")
  1168.                             }
  1169.                         }
  1170.                     }
  1171.                     for (y = 0, x = B.length; y < x; y++) {
  1172.                         delete z[B[y]]
  1173.                     }
  1174.                     if (! (A ? af: al.isEmptyObject)(z)) {
  1175.                         return
  1176.                     }
  1177.                 }
  1178.             }
  1179.             if (!A) {
  1180.                 delete e[w].data;
  1181.                 if (!af(e[w])) {
  1182.                     return
  1183.                 }
  1184.             }
  1185.             if (al.support.deleteExpando || !e.setInterval) {
  1186.                 delete e[w]
  1187.             } else {
  1188.                 e[w] = null
  1189.             }
  1190.             if (E) {
  1191.                 if (al.support.deleteExpando) {
  1192.                     delete D[al.expando]
  1193.                 } else {
  1194.                     if (D.removeAttribute) {
  1195.                         D.removeAttribute(al.expando)
  1196.                     } else {
  1197.                         D[al.expando] = null
  1198.                     }
  1199.                 }
  1200.             }
  1201.         },
  1202.         _data: function (w, e, x) {
  1203.             return al.data(w, e, x, true)
  1204.         },
  1205.         acceptData: function (w) {
  1206.             if (w.nodeName) {
  1207.                 var e = al.noData[w.nodeName.toLowerCase()];
  1208.                 if (e) {
  1209.                     return ! (e === true || w.getAttribute("classid") !== e)
  1210.                 }
  1211.             }
  1212.             return true
  1213.         }
  1214.     });
  1215.     al.fn.extend({
  1216.         data: function (w, C) {
  1217.             var B, e, y, A = null;
  1218.             if (typeof w === "undefined") {
  1219.                 if (this.length) {
  1220.                     A = al.data(this[0]);
  1221.                     if (this[0].nodeType === 1 && !al._data(this[0], "parsedAttrs")) {
  1222.                         e = this[0].attributes;
  1223.                         for (var z = 0, x = e.length; z < x; z++) {
  1224.                             y = e[z].name;
  1225.                             if (y.indexOf("data-") === 0) {
  1226.                                 y = al.camelCase(y.substring(5));
  1227.                                 bo(this[0], y, A[y])
  1228.                             }
  1229.                         }
  1230.                         al._data(this[0], "parsedAttrs", true)
  1231.                     }
  1232.                 }
  1233.                 return A
  1234.             } else {
  1235.                 if (typeof w === "object") {
  1236.                     return this.each(function () {
  1237.                         al.data(this, w)
  1238.                     })
  1239.                 }
  1240.             }
  1241.             B = w.split(".");
  1242.             B[1] = B[1] ? "." + B[1] : "";
  1243.             if (C === ap) {
  1244.                 A = this.triggerHandler("getData" + B[1] + "!", [B[0]]);
  1245.                 if (A === ap && this.length) {
  1246.                     A = al.data(this[0], w);
  1247.                     A = bo(this[0], w, A)
  1248.                 }
  1249.                 return A === ap && B[1] ? this.data(B[0]) : A
  1250.             } else {
  1251.                 return this.each(function () {
  1252.                     var D = al(this),
  1253.                     E = [B[0], C];
  1254.                     D.triggerHandler("setData" + B[1] + "!", E);
  1255.                     al.data(this, w, C);
  1256.                     D.triggerHandler("changeData" + B[1] + "!", E)
  1257.                 })
  1258.             }
  1259.         },
  1260.         removeData: function (e) {
  1261.             return this.each(function () {
  1262.                 al.removeData(this, e)
  1263.             })
  1264.         }
  1265.     });
  1266.     function bo(x, w, A) {
  1267.         if (A === ap && x.nodeType === 1) {
  1268.             var z = "data-" + w.replace(aL, "-$1").toLowerCase();
  1269.             A = x.getAttribute(z);
  1270.             if (typeof A === "string") {
  1271.                 try {
  1272.                     A = A === "true" ? true: A === "false" ? false: A === "null" ? null: al.isNumeric(A) ? parseFloat(A) : a9.test(A) ? al.parseJSON(A) : A
  1273.                 } catch(y) {}
  1274.                 al.data(x, w, A)
  1275.             } else {
  1276.                 A = ap
  1277.             }
  1278.         }
  1279.         return A
  1280.     }
  1281.     function af(w) {
  1282.         for (var e in w) {
  1283.             if (e === "data" && al.isEmptyObject(w[e])) {
  1284.                 continue
  1285.             }
  1286.             if (e !== "toJSON") {
  1287.                 return false
  1288.             }
  1289.         }
  1290.         return true
  1291.     }
  1292.     function bA(y, e, B) {
  1293.         var A = e + "defer",
  1294.         x = e + "queue",
  1295.         w = e + "mark",
  1296.         z = al._data(y, A);
  1297.         if (z && (B === "queue" || !al._data(y, x)) && (B === "mark" || !al._data(y, w))) {
  1298.             setTimeout(function () {
  1299.                 if (!al._data(y, x) && !al._data(y, w)) {
  1300.                     al.removeData(y, A, true);
  1301.                     z.fire()
  1302.                 }
  1303.             },
  1304.             0)
  1305.         }
  1306.     }
  1307.     al.extend({
  1308.         _mark: function (w, e) {
  1309.             if (w) {
  1310.                 e = (e || "fx") + "mark";
  1311.                 al._data(w, e, (al._data(w, e) || 0) + 1)
  1312.             }
  1313.         },
  1314.         _unmark: function (w, e, z) {
  1315.             if (w !== true) {
  1316.                 z = e;
  1317.                 e = w;
  1318.                 w = false
  1319.             }
  1320.             if (e) {
  1321.                 z = z || "fx";
  1322.                 var y = z + "mark",
  1323.                 x = w ? 0 : ((al._data(e, y) || 1) - 1);
  1324.                 if (x) {
  1325.                     al._data(e, y, x)
  1326.                 } else {
  1327.                     al.removeData(e, y, true);
  1328.                     bA(e, z, "mark")
  1329.                 }
  1330.             }
  1331.         },
  1332.         queue: function (w, e, y) {
  1333.             var x;
  1334.             if (w) {
  1335.                 e = (e || "fx") + "queue";
  1336.                 x = al._data(w, e);
  1337.                 if (y) {
  1338.                     if (!x || al.isArray(y)) {
  1339.                         x = al._data(w, e, al.makeArray(y))
  1340.                     } else {
  1341.                         x.push(y)
  1342.                     }
  1343.                 }
  1344.                 return x || []
  1345.             }
  1346.         },
  1347.         dequeue: function (x, w) {
  1348.             w = w || "fx";
  1349.             var z = al.queue(x, w),
  1350.             y = z.shift(),
  1351.             e = {};
  1352.             if (y === "inprogress") {
  1353.                 y = z.shift()
  1354.             }
  1355.             if (y) {
  1356.                 if (w === "fx") {
  1357.                     z.unshift("inprogress")
  1358.                 }
  1359.                 al._data(x, w + ".run", e);
  1360.                 y.call(x, function () {
  1361.                     al.dequeue(x, w)
  1362.                 },
  1363.                 e)
  1364.             }
  1365.             if (!z.length) {
  1366.                 al.removeData(x, w + "queue " + w + ".run", true);
  1367.                 bA(x, w, "queue")
  1368.             }
  1369.         }
  1370.     });
  1371.     al.fn.extend({
  1372.         queue: function (e, w) {
  1373.             if (typeof e !== "string") {
  1374.                 w = e;
  1375.                 e = "fx"
  1376.             }
  1377.             if (w === ap) {
  1378.                 return al.queue(this[0], e)
  1379.             }
  1380.             return this.each(function () {
  1381.                 var x = al.queue(this, e, w);
  1382.                 if (e === "fx" && x[0] !== "inprogress") {
  1383.                     al.dequeue(this, e)
  1384.                 }
  1385.             })
  1386.         },
  1387.         dequeue: function (e) {
  1388.             return this.each(function () {
  1389.                 al.dequeue(this, e)
  1390.             })
  1391.         },
  1392.         delay: function (x, w) {
  1393.             x = al.fx ? al.fx.speeds[x] || x: x;
  1394.             w = w || "fx";
  1395.             return this.queue(w, function (y, e) {
  1396.                 var z = setTimeout(y, x);
  1397.                 e.stop = function () {
  1398.                     clearTimeout(z)
  1399.                 }
  1400.             })
  1401.         },
  1402.         clearQueue: function (e) {
  1403.             return this.queue(e || "fx", [])
  1404.         },
  1405.         promise: function (E, D) {
  1406.             if (typeof E !== "string") {
  1407.                 D = E;
  1408.                 E = ap
  1409.             }
  1410.             E = E || "fx";
  1411.             var C = al.Deferred(),
  1412.             e = this,
  1413.             x = e.length,
  1414.             A = 1,
  1415.             y = E + "defer",
  1416.             z = E + "queue",
  1417.             B = E + "mark",
  1418.             w;
  1419.             function F() {
  1420.                 if (! (--A)) {
  1421.                     C.resolveWith(e, [e])
  1422.                 }
  1423.             }
  1424.             while (x--) {
  1425.                 if ((w = al.data(e[x], y, ap, true) || (al.data(e[x], z, ap, true) || al.data(e[x], B, ap, true)) && al.data(e[x], y, al.Callbacks("once memory"), true))) {
  1426.                     A++;
  1427.                     w.add(F)
  1428.                 }
  1429.             }
  1430.             F();
  1431.             return C.promise()
  1432.         }
  1433.     });
  1434.     var a8 = /[\n\t\r]/g,
  1435.     au = /\s+/,
  1436.     be = /\r/g,
  1437.     f = /^(?:button|input)$/i,
  1438.     R = /^(?:button|input|object|select|textarea)$/i,
  1439.     j = /^a(?:rea)?$/i,
  1440.     aB = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
  1441.     T = al.support.getSetAttribute,
  1442.     bw, bi, aP;
  1443.     al.fn.extend({
  1444.         attr: function (w, e) {
  1445.             return al.access(this, w, e, true, al.attr)
  1446.         },
  1447.         removeAttr: function (e) {
  1448.             return this.each(function () {
  1449.                 al.removeAttr(this, e)
  1450.             })
  1451.         },
  1452.         prop: function (w, e) {
  1453.             return al.access(this, w, e, true, al.prop)
  1454.         },
  1455.         removeProp: function (e) {
  1456.             e = al.propFix[e] || e;
  1457.             return this.each(function () {
  1458.                 try {
  1459.                     this[e] = ap;
  1460.                     delete this[e]
  1461.                 } catch(w) {}
  1462.             })
  1463.         },
  1464.         addClass: function (y) {
  1465.             var e, z, x, A, B, C, w;
  1466.             if (al.isFunction(y)) {
  1467.                 return this.each(function (D) {
  1468.                     al(this).addClass(y.call(this, D, this.className))
  1469.                 })
  1470.             }
  1471.             if (y && typeof y === "string") {
  1472.                 e = y.split(au);
  1473.                 for (z = 0, x = this.length; z < x; z++) {
  1474.                     A = this[z];
  1475.                     if (A.nodeType === 1) {
  1476.                         if (!A.className && e.length === 1) {
  1477.                             A.className = y
  1478.                         } else {
  1479.                             B = " " + A.className + " ";
  1480.                             for (C = 0, w = e.length; C < w; C++) {
  1481.                                 if (!~B.indexOf(" " + e[C] + " ")) {
  1482.                                     B += e[C] + " "
  1483.                                 }
  1484.                             }
  1485.                             A.className = al.trim(B)
  1486.                         }
  1487.                     }
  1488.                 }
  1489.             }
  1490.             return this
  1491.         },
  1492.         removeClass: function (y) {
  1493.             var e, z, x, B, A, C, w;
  1494.             if (al.isFunction(y)) {
  1495.                 return this.each(function (D) {
  1496.                     al(this).removeClass(y.call(this, D, this.className))
  1497.                 })
  1498.             }
  1499.             if ((y && typeof y === "string") || y === ap) {
  1500.                 e = (y || "").split(au);
  1501.                 for (z = 0, x = this.length; z < x; z++) {
  1502.                     B = this[z];
  1503.                     if (B.nodeType === 1 && B.className) {
  1504.                         if (y) {
  1505.                             A = (" " + B.className + " ").replace(a8, " ");
  1506.                             for (C = 0, w = e.length; C < w; C++) {
  1507.                                 A = A.replace(" " + e[C] + " ", " ")
  1508.                             }
  1509.                             B.className = al.trim(A)
  1510.                         } else {
  1511.                             B.className = ""
  1512.                         }
  1513.                     }
  1514.                 }
  1515.             }
  1516.             return this
  1517.         },
  1518.         toggleClass: function (e, y) {
  1519.             var x = typeof e,
  1520.             w = typeof y === "boolean";
  1521.             if (al.isFunction(e)) {
  1522.                 return this.each(function (z) {
  1523.                     al(this).toggleClass(e.call(this, z, this.className, y), y)
  1524.                 })
  1525.             }
  1526.             return this.each(function () {
  1527.                 if (x === "string") {
  1528.                     var z, B = 0,
  1529.                     A = al(this),
  1530.                     C = y,
  1531.                     D = e.split(au);
  1532.                     while ((z = D[B++])) {
  1533.                         C = w ? C: !A.hasClass(z);
  1534.                         A[C ? "addClass": "removeClass"](z)
  1535.                     }
  1536.                 } else {
  1537.                     if (x === "undefined" || x === "boolean") {
  1538.                         if (this.className) {
  1539.                             al._data(this, "__className__", this.className)
  1540.                         }
  1541.                         this.className = this.className || e === false ? "": al._data(this, "__className__") || ""
  1542.                     }
  1543.                 }
  1544.             })
  1545.         },
  1546.         hasClass: function (x) {
  1547.             var e = " " + x + " ",
  1548.             y = 0,
  1549.             w = this.length;
  1550.             for (; y < w; y++) {
  1551.                 if (this[y].nodeType === 1 && (" " + this[y].className + " ").replace(a8, " ").indexOf(e) > -1) {
  1552.                     return true
  1553.                 }
  1554.             }
  1555.             return false
  1556.         },
  1557.         val: function (z) {
  1558.             var y, e, x, w = this[0];
  1559.             if (!arguments.length) {
  1560.                 if (w) {
  1561.                     y = al.valHooks[w.nodeName.toLowerCase()] || al.valHooks[w.type];
  1562.                     if (y && "get" in y && (e = y.get(w, "value")) !== ap) {
  1563.                         return e
  1564.                     }
  1565.                     e = w.value;
  1566.                     return typeof e === "string" ? e.replace(be, "") : e == null ? "": e
  1567.                 }
  1568.                 return ap
  1569.             }
  1570.             x = al.isFunction(z);
  1571.             return this.each(function (B) {
  1572.                 var A = al(this),
  1573.                 C;
  1574.                 if (this.nodeType !== 1) {
  1575.                     return
  1576.                 }
  1577.                 if (x) {
  1578.                     C = z.call(this, B, A.val())
  1579.                 } else {
  1580.                     C = z
  1581.                 }
  1582.                 if (C == null) {
  1583.                     C = ""
  1584.                 } else {
  1585.                     if (typeof C === "number") {
  1586.                         C += ""
  1587.                     } else {
  1588.                         if (al.isArray(C)) {
  1589.                             C = al.map(C, function (D) {
  1590.                                 return D == null ? "": D + ""
  1591.                             })
  1592.                         }
  1593.                     }
  1594.                 }
  1595.                 y = al.valHooks[this.nodeName.toLowerCase()] || al.valHooks[this.type];
  1596.                 if (!y || !("set" in y) || y.set(this, C, "value") === ap) {
  1597.                     this.value = C
  1598.                 }
  1599.             })
  1600.         }
  1601.     });
  1602.     al.extend({
  1603.         valHooks: {
  1604.             option: {
  1605.                 get: function (w) {
  1606.                     var e = w.attributes.value;
  1607.                     return ! e || e.specified ? w.value: w.text
  1608.                 }
  1609.             },
  1610.             select: {
  1611.                 get: function (B) {
  1612.                     var z, e, A, x, y = B.selectedIndex,
  1613.                     C = [],
  1614.                     D = B.options,
  1615.                     w = B.type === "select-one";
  1616.                     if (y < 0) {
  1617.                         return null
  1618.                     }
  1619.                     e = w ? y: 0;
  1620.                     A = w ? y + 1 : D.length;
  1621.                     for (; e < A; e++) {
  1622.                         x = D[e];
  1623.                         if (x.selected && (al.support.optDisabled ? !x.disabled: x.getAttribute("disabled") === null) && (!x.parentNode.disabled || !al.nodeName(x.parentNode, "optgroup"))) {
  1624.                             z = al(x).val();
  1625.                             if (w) {
  1626.                                 return z
  1627.                             }
  1628.                             C.push(z)
  1629.                         }
  1630.                     }
  1631.                     if (w && !C.length && D.length) {
  1632.                         return al(D[y]).val()
  1633.                     }
  1634.                     return C
  1635.                 },
  1636.                 set: function (w, e) {
  1637.                     var x = al.makeArray(e);
  1638.                     al(w).find("option").each(function () {
  1639.                         this.selected = al.inArray(al(this).val(), x) >= 0
  1640.                     });
  1641.                     if (!x.length) {
  1642.                         w.selectedIndex = -1
  1643.                     }
  1644.                     return x
  1645.                 }
  1646.             }
  1647.         },
  1648.         attrFn: {
  1649.             val: true,
  1650.             css: true,
  1651.             html: true,
  1652.             text: true,
  1653.             data: true,
  1654.             width: true,
  1655.             height: true,
  1656.             offset: true
  1657.         },
  1658.         attr: function (y, x, D, C) {
  1659.             var B, w, A, z = y.nodeType;
  1660.             if (!y || z === 3 || z === 8 || z === 2) {
  1661.                 return ap
  1662.             }
  1663.             if (C && x in al.attrFn) {
  1664.                 return al(y)[x](D)
  1665.             }
  1666.             if (! ("getAttribute" in y)) {
  1667.                 return al.prop(y, x, D)
  1668.             }
  1669.             A = z !== 1 || !al.isXMLDoc(y);
  1670.             if (A) {
  1671.                 x = x.toLowerCase();
  1672.                 w = al.attrHooks[x] || (aB.test(x) ? bi: bw)
  1673.             }
  1674.             if (D !== ap) {
  1675.                 if (D === null) {
  1676.                     al.removeAttr(y, x);
  1677.                     return ap
  1678.                 } else {
  1679.                     if (w && "set" in w && A && (B = w.set(y, D, x)) !== ap) {
  1680.                         return B
  1681.                     } else {
  1682.                         y.setAttribute(x, "" + D);
  1683.                         return D
  1684.                     }
  1685.                 }
  1686.             } else {
  1687.                 if (w && "get" in w && A && (B = w.get(y, x)) !== null) {
  1688.                     return B
  1689.                 } else {
  1690.                     B = y.getAttribute(x);
  1691.                     return B === null ? ap: B
  1692.                 }
  1693.             }
  1694.         },
  1695.         removeAttr: function (x, e) {
  1696.             var B, A, y, w, z = 0;
  1697.             if (x.nodeType === 1) {
  1698.                 A = (e || "").split(au);
  1699.                 w = A.length;
  1700.                 for (; z < w; z++) {
  1701.                     y = A[z].toLowerCase();
  1702.                     B = al.propFix[y] || y;
  1703.                     al.attr(x, y, "");
  1704.                     x.removeAttribute(T ? y: B);
  1705.                     if (aB.test(y) && B in x) {
  1706.                         x[B] = false
  1707.                     }
  1708.                 }
  1709.             }
  1710.         },
  1711.         attrHooks: {
  1712.             type: {
  1713.                 set: function (w, e) {
  1714.                     if (f.test(w.nodeName) && w.parentNode) {
  1715.                         al.error("type property can't be changed")
  1716.                     } else {
  1717.                         if (!al.support.radioValue && e === "radio" && al.nodeName(w, "input")) {
  1718.                             var x = w.value;
  1719.                             w.setAttribute("type", e);
  1720.                             if (x) {
  1721.                                 w.value = x
  1722.                             }
  1723.                             return e
  1724.                         }
  1725.                     }
  1726.                 }
  1727.             },
  1728.             value: {
  1729.                 get: function (w, e) {
  1730.                     if (bw && al.nodeName(w, "button")) {
  1731.                         return bw.get(w, e)
  1732.                     }
  1733.                     return e in w ? w.value: null
  1734.                 },
  1735.                 set: function (w, e, x) {
  1736.                     if (bw && al.nodeName(w, "button")) {
  1737.                         return bw.set(w, e, x)
  1738.                     }
  1739.                     w.value = e
  1740.                 }
  1741.             }
  1742.         },
  1743.         propFix: {
  1744.             tabindex: "tabIndex",
  1745.             readonly: "readOnly",
  1746.             "for": "htmlFor",
  1747.             "class": "className",
  1748.             maxlength: "maxLength",
  1749.             cellspacing: "cellSpacing",
  1750.             cellpadding: "cellPadding",
  1751.             rowspan: "rowSpan",
  1752.             colspan: "colSpan",
  1753.             usemap: "useMap",
  1754.             frameborder: "frameBorder",
  1755.             contenteditable: "contentEditable"
  1756.         },
  1757.         prop: function (x, w, B) {
  1758.             var A, e, z, y = x.nodeType;
  1759.             if (!x || y === 3 || y === 8 || y === 2) {
  1760.                 return ap
  1761.             }
  1762.             z = y !== 1 || !al.isXMLDoc(x);
  1763.             if (z) {
  1764.                 w = al.propFix[w] || w;
  1765.                 e = al.propHooks[w]
  1766.             }
  1767.             if (B !== ap) {
  1768.                 if (e && "set" in e && (A = e.set(x, B, w)) !== ap) {
  1769.                     return A
  1770.                 } else {
  1771.                     return (x[w] = B)
  1772.                 }
  1773.             } else {
  1774.                 if (e && "get" in e && (A = e.get(x, w)) !== null) {
  1775.                     return A
  1776.                 } else {
  1777.                     return x[w]
  1778.                 }
  1779.             }
  1780.         },
  1781.         propHooks: {
  1782.             tabIndex: {
  1783.                 get: function (w) {
  1784.                     var e = w.getAttributeNode("tabindex");
  1785.                     return e && e.specified ? parseInt(e.value, 10) : R.test(w.nodeName) || j.test(w.nodeName) && w.href ? 0 : ap
  1786.                 }
  1787.             }
  1788.         }
  1789.     });
  1790.     al.attrHooks.tabindex = al.propHooks.tabIndex;
  1791.     bi = {
  1792.         get: function (w, e) {
  1793.             var y, x = al.prop(w, e);
  1794.             return x === true || typeof x !== "boolean" && (y = w.getAttributeNode(e)) && y.nodeValue !== false ? e.toLowerCase() : ap
  1795.         },
  1796.         set: function (w, e, y) {
  1797.             var x;
  1798.             if (e === false) {
  1799.                 al.removeAttr(w, y)
  1800.             } else {
  1801.                 x = al.propFix[y] || y;
  1802.                 if (x in w) {
  1803.                     w[x] = true
  1804.                 }
  1805.                 w.setAttribute(y, y.toLowerCase())
  1806.             }
  1807.             return y
  1808.         }
  1809.     };
  1810.     if (!T) {
  1811.         aP = {
  1812.             name: true,
  1813.             id: true
  1814.         };
  1815.         bw = al.valHooks.button = {
  1816.             get: function (w, e) {
  1817.                 var x;
  1818.                 x = w.getAttributeNode(e);
  1819.                 return x && (aP[e] ? x.nodeValue !== "": x.specified) ? x.nodeValue: ap
  1820.             },
  1821.             set: function (w, e, y) {
  1822.                 var x = w.getAttributeNode(y);
  1823.                 if (!x) {
  1824.                     x = an.createAttribute(y);
  1825.                     w.setAttributeNode(x)
  1826.                 }
  1827.                 return (x.nodeValue = e + "")
  1828.             }
  1829.         };
  1830.         al.attrHooks.tabindex.set = bw.set;
  1831.         al.each(["width", "height"], function (e, w) {
  1832.             al.attrHooks[w] = al.extend(al.attrHooks[w], {
  1833.                 set: function (y, x) {
  1834.                     if (x === "") {
  1835.                         y.setAttribute(w, "auto");
  1836.                         return x
  1837.                     }
  1838.                 }
  1839.             })
  1840.         });
  1841.         al.attrHooks.contenteditable = {
  1842.             get: bw.get,
  1843.             set: function (w, e, x) {
  1844.                 if (e === "") {
  1845.                     e = "false"
  1846.                 }
  1847.                 bw.set(w, e, x)
  1848.             }
  1849.         }
  1850.     }
  1851.     if (!al.support.hrefNormalized) {
  1852.         al.each(["href", "src", "width", "height"], function (e, w) {
  1853.             al.attrHooks[w] = al.extend(al.attrHooks[w], {
  1854.                 get: function (y) {
  1855.                     var x = y.getAttribute(w, 2);
  1856.                     return x === null ? ap: x
  1857.                 }
  1858.             })
  1859.         })
  1860.     }
  1861.     if (!al.support.style) {
  1862.         al.attrHooks.style = {
  1863.             get: function (e) {
  1864.                 return e.style.cssText.toLowerCase() || ap
  1865.             },
  1866.             set: function (w, e) {
  1867.                 return (w.style.cssText = "" + e)
  1868.             }
  1869.         }
  1870.     }
  1871.     if (!al.support.optSelected) {
  1872.         al.propHooks.selected = al.extend(al.propHooks.selected, {
  1873.             get: function (w) {
  1874.                 var e = w.parentNode;
  1875.                 if (e) {
  1876.                     e.selectedIndex;
  1877.                     if (e.parentNode) {
  1878.                         e.parentNode.selectedIndex
  1879.                     }
  1880.                 }
  1881.                 return null
  1882.             }
  1883.         })
  1884.     }
  1885.     if (!al.support.enctype) {
  1886.         al.propFix.enctype = "encoding"
  1887.     }
  1888.     if (!al.support.checkOn) {
  1889.         al.each(["radio", "checkbox"], function () {
  1890.             al.valHooks[this] = {
  1891.                 get: function (e) {
  1892.                     return e.getAttribute("value") === null ? "on": e.value
  1893.                 }
  1894.             }
  1895.         })
  1896.     }
  1897.     al.each(["radio", "checkbox"], function () {
  1898.         al.valHooks[this] = al.extend(al.valHooks[this], {
  1899.             set: function (w, e) {
  1900.                 if (al.isArray(e)) {
  1901.                     return (w.checked = al.inArray(al(w).val(), e) >= 0)
  1902.                 }
  1903.             }
  1904.         })
  1905.     });
  1906.     var a7 = /\.(.*)$/,
  1907.     bv = /^(?:textarea|input|select)$/i,
  1908.     ab = /\./g,
  1909.     bB = / /g,
  1910.     aR = /[^\w\s.|`]/g,
  1911.     l = /^([^\.]*)?(?:\.(.+))?$/,
  1912.     X = /\bhover(\.\S+)?/,
  1913.     a6 = /^key/,
  1914.     bx = /^(?:mouse|contextmenu)|click/,
  1915.     ag = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
  1916.     aj = function (w) {
  1917.         var e = ag.exec(w);
  1918.         if (e) {
  1919.             e[1] = (e[1] || "").toLowerCase();
  1920.             e[3] = e[3] && new RegExp("(?:^|\\s)" + e[3] + "(?:\\s|$)")
  1921.         }
  1922.         return e
  1923.     },
  1924.     i = function (w, e) {
  1925.         return ((!e[1] || w.nodeName.toLowerCase() === e[1]) && (!e[2] || w.id === e[2]) && (!e[3] || e[3].test(w.className)))
  1926.     },
  1927.     bM = function (e) {
  1928.         return al.event.special.hover ? e: e.replace(X, "mouseenter$1 mouseleave$1")
  1929.     };
  1930.     al.event = {
  1931.         add: function (I, G, F, D, B) {
  1932.             var z, A, L, K, J, E, e, H, w, y, x, C;
  1933.             if (I.nodeType === 3 || I.nodeType === 8 || !G || !F || !(z = al._data(I))) {
  1934.                 return
  1935.             }
  1936.             if (F.handler) {
  1937.                 w = F;
  1938.                 F = w.handler
  1939.             }
  1940.             if (!F.guid) {
  1941.                 F.guid = al.guid++
  1942.             }
  1943.             L = z.events;
  1944.             if (!L) {
  1945.                 z.events = L = {}
  1946.             }
  1947.             A = z.handle;
  1948.             if (!A) {
  1949.                 z.handle = A = function (M) {
  1950.                     return typeof al !== "undefined" && (!M || al.event.triggered !== M.type) ? al.event.dispatch.apply(A.elem, arguments) : ap
  1951.                 };
  1952.                 A.elem = I
  1953.             }
  1954.             G = bM(G).split(" ");
  1955.             for (K = 0; K < G.length; K++) {
  1956.                 J = l.exec(G[K]) || [];
  1957.                 E = J[1];
  1958.                 e = (J[2] || "").split(".").sort();
  1959.                 C = al.event.special[E] || {};
  1960.                 E = (B ? C.delegateType: C.bindType) || E;
  1961.                 C = al.event.special[E] || {};
  1962.                 H = al.extend({
  1963.                     type: E,
  1964.                     origType: J[1],
  1965.                     data: D,
  1966.                     handler: F,
  1967.                     guid: F.guid,
  1968.                     selector: B,
  1969.                     namespace: e.join(".")
  1970.                 },
  1971.                 w);
  1972.                 if (B) {
  1973.                     H.quick = aj(B);
  1974.                     if (!H.quick && al.expr.match.POS.test(B)) {
  1975.                         H.isPositional = true
  1976.                     }
  1977.                 }
  1978.                 x = L[E];
  1979.                 if (!x) {
  1980.                     x = L[E] = [];
  1981.                     x.delegateCount = 0;
  1982.                     if (!C.setup || C.setup.call(I, D, e, A) === false) {
  1983.                         if (I.addEventListener) {
  1984.                             I.addEventListener(E, A, false)
  1985.                         } else {
  1986.                             if (I.attachEvent) {
  1987.                                 I.attachEvent("on" + E, A)
  1988.                             }
  1989.                         }
  1990.                     }
  1991.                 }
  1992.                 if (C.add) {
  1993.                     C.add.call(I, H);
  1994.                     if (!H.handler.guid) {
  1995.                         H.handler.guid = F.guid
  1996.                     }
  1997.                 }
  1998.                 if (B) {
  1999.                     x.splice(x.delegateCount++, 0, H)
  2000.                 } else {
  2001.                     x.push(H)
  2002.                 }
  2003.                 al.event.global[E] = true
  2004.             }
  2005.             I = null
  2006.         },
  2007.         global: {},
  2008.         remove: function (I, G, E, D) {
  2009.             var B = al.hasData(I) && al._data(I),
  2010.             K,
  2011.             L,
  2012.             F,
  2013.             x,
  2014.             y,
  2015.             z,
  2016.             J,
  2017.             C,
  2018.             A,
  2019.             w,
  2020.             H;
  2021.             if (!B || !(J = B.events)) {
  2022.                 return
  2023.             }
  2024.             G = bM(G || "").split(" ");
  2025.             for (K = 0; K < G.length; K++) {
  2026.                 L = l.exec(G[K]) || [];
  2027.                 F = L[1];
  2028.                 x = L[2];
  2029.                 if (!F) {
  2030.                     x = x ? "." + x: "";
  2031.                     for (z in J) {
  2032.                         al.event.remove(I, z + x, E, D)
  2033.                     }
  2034.                     return
  2035.                 }
  2036.                 C = al.event.special[F] || {};
  2037.                 F = (D ? C.delegateType: C.bindType) || F;
  2038.                 w = J[F] || [];
  2039.                 y = w.length;
  2040.                 x = x ? new RegExp("(^|\\.)" + x.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
  2041.                 if (E || x || D || C.remove) {
  2042.                     for (z = 0; z < w.length; z++) {
  2043.                         H = w[z];
  2044.                         if (!E || E.guid === H.guid) {
  2045.                             if (!x || x.test(H.namespace)) {
  2046.                                 if (!D || D === H.selector || D === "**" && H.selector) {
  2047.                                     w.splice(z--, 1);
  2048.                                     if (H.selector) {
  2049.                                         w.delegateCount--
  2050.                                     }
  2051.                                     if (C.remove) {
  2052.                                         C.remove.call(I, H)
  2053.                                     }
  2054.                                 }
  2055.                             }
  2056.                         }
  2057.                     }
  2058.                 } else {
  2059.                     w.length = 0
  2060.                 }
  2061.                 if (w.length === 0 && y !== w.length) {
  2062.                     if (!C.teardown || C.teardown.call(I, x) === false) {
  2063.                         al.removeEvent(I, F, B.handle)
  2064.                     }
  2065.                     delete J[F]
  2066.                 }
  2067.             }
  2068.             if (al.isEmptyObject(J)) {
  2069.                 A = B.handle;
  2070.                 if (A) {
  2071.                     A.elem = null
  2072.                 }
  2073.                 al.removeData(I, ["events", "handle"], true)
  2074.             }
  2075.         },
  2076.         customEvent: {
  2077.             getData: true,
  2078.             setData: true,
  2079.             changeData: true
  2080.         },
  2081.         trigger: function (J, I, H, G) {
  2082.             if (H && (H.nodeType === 3 || H.nodeType === 8)) {
  2083.                 return
  2084.             }
  2085.             var E = J.type || J,
  2086.             y = [],
  2087.             w,
  2088.             x,
  2089.             C,
  2090.             K,
  2091.             A,
  2092.             z,
  2093.             F,
  2094.             D,
  2095.             B,
  2096.             L;
  2097.             if (E.indexOf("!") >= 0) {
  2098.                 E = E.slice(0, -1);
  2099.                 x = true
  2100.             }
  2101.             if (E.indexOf(".") >= 0) {
  2102.                 y = E.split(".");
  2103.                 E = y.shift();
  2104.                 y.sort()
  2105.             }
  2106.             if ((!H || al.event.customEvent[E]) && !al.event.global[E]) {
  2107.                 return
  2108.             }
  2109.             J = typeof J === "object" ? J[al.expando] ? J: new al.Event(E, J) : new al.Event(E);
  2110.             J.type = E;
  2111.             J.isTrigger = true;
  2112.             J.exclusive = x;
  2113.             J.namespace = y.join(".");
  2114.             J.namespace_re = J.namespace ? new RegExp("(^|\\.)" + y.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
  2115.             z = E.indexOf(":") < 0 ? "on" + E: "";
  2116.             if (G || !H) {
  2117.                 J.preventDefault()
  2118.             }
  2119.             if (!H) {
  2120.                 w = al.cache;
  2121.                 for (C in w) {
  2122.                     if (w[C].events && w[C].events[E]) {
  2123.                         al.event.trigger(J, I, w[C].handle.elem, true)
  2124.                     }
  2125.                 }
  2126.                 return
  2127.             }
  2128.             J.result = ap;
  2129.             if (!J.target) {
  2130.                 J.target = H
  2131.             }
  2132.             I = I != null ? al.makeArray(I) : [];
  2133.             I.unshift(J);
  2134.             F = al.event.special[E] || {};
  2135.             if (F.trigger && F.trigger.apply(H, I) === false) {
  2136.                 return
  2137.             }
  2138.             B = [[H, F.bindType || E]];
  2139.             if (!G && !F.noBubble && !al.isWindow(H)) {
  2140.                 L = F.delegateType || E;
  2141.                 A = null;
  2142.                 for (K = H.parentNode; K; K = K.parentNode) {
  2143.                     B.push([K, L]);
  2144.                     A = K
  2145.                 }
  2146.                 if (A && A === H.ownerDocument) {
  2147.                     B.push([A.defaultView || A.parentWindow || aq, L])
  2148.                 }
  2149.             }
  2150.             for (C = 0; C < B.length; C++) {
  2151.                 K = B[C][0];
  2152.                 J.type = B[C][1];
  2153.                 D = (al._data(K, "events") || {})[J.type] && al._data(K, "handle");
  2154.                 if (D) {
  2155.                     D.apply(K, I)
  2156.                 }
  2157.                 D = z && K[z];
  2158.                 if (D && al.acceptData(K)) {
  2159.                     D.apply(K, I)
  2160.                 }
  2161.                 if (J.isPropagationStopped()) {
  2162.                     break
  2163.                 }
  2164.             }
  2165.             J.type = E;
  2166.             if (!J.isDefaultPrevented()) {
  2167.                 if ((!F._default || F._default.apply(H.ownerDocument, I) === false) && !(E === "click" && al.nodeName(H, "a")) && al.acceptData(H)) {
  2168.                     if (z && H[E] && ((E !== "focus" && E !== "blur") || J.target.offsetWidth !== 0) && !al.isWindow(H)) {
  2169.                         A = H[z];
  2170.                         if (A) {
  2171.                             H[z] = null
  2172.                         }
  2173.                         al.event.triggered = E;
  2174.                         H[E]();
  2175.                         al.event.triggered = ap;
  2176.                         if (A) {
  2177.                             H[z] = A
  2178.                         }
  2179.                     }
  2180.                 }
  2181.             }
  2182.             return J.result
  2183.         },
  2184.         dispatch: function (K) {
  2185.             K = al.event.fix(K || aq.event);
  2186.             var J = ((al._data(this, "events") || {})[K.type] || []),
  2187.             C = J.delegateCount,
  2188.             y = [].slice.call(arguments, 0),
  2189.             D = !K.exclusive && !K.namespace,
  2190.             A = (al.event.special[K.type] || {}).handle,
  2191.             w = [],
  2192.             H,
  2193.             F,
  2194.             z,
  2195.             L,
  2196.             G,
  2197.             B,
  2198.             x,
  2199.             e,
  2200.             E,
  2201.             I,
  2202.             M;
  2203.             y[0] = K;
  2204.             K.delegateTarget = this;
  2205.             if (C && !K.target.disabled && !(K.button && K.type === "click")) {
  2206.                 for (z = K.target; z != this; z = z.parentNode || this) {
  2207.                     G = {};
  2208.                     x = [];
  2209.                     for (H = 0; H < C; H++) {
  2210.                         e = J[H];
  2211.                         E = e.selector;
  2212.                         I = G[E];
  2213.                         if (e.isPositional) {
  2214.                             I = (I || (G[E] = al(E))).index(z) >= 0
  2215.                         } else {
  2216.                             if (I === ap) {
  2217.                                 I = G[E] = (e.quick ? i(z, e.quick) : al(z).is(E))
  2218.                             }
  2219.                         }
  2220.                         if (I) {
  2221.                             x.push(e)
  2222.                         }
  2223.                     }
  2224.                     if (x.length) {
  2225.                         w.push({
  2226.                             elem: z,
  2227.                             matches: x
  2228.                         })
  2229.                     }
  2230.                 }
  2231.             }
  2232.             if (J.length > C) {
  2233.                 w.push({
  2234.                     elem: this,
  2235.                     matches: J.slice(C)
  2236.                 })
  2237.             }
  2238.             for (H = 0; H < w.length && !K.isPropagationStopped(); H++) {
  2239.                 B = w[H];
  2240.                 K.currentTarget = B.elem;
  2241.                 for (F = 0; F < B.matches.length && !K.isImmediatePropagationStopped(); F++) {
  2242.                     e = B.matches[F];
  2243.                     if (D || (!K.namespace && !e.namespace) || K.namespace_re && K.namespace_re.test(e.namespace)) {
  2244.                         K.data = e.data;
  2245.                         K.handleObj = e;
  2246.                         L = (A || e.handler).apply(B.elem, y);
  2247.                         if (L !== ap) {
  2248.                             K.result = L;
  2249.                             if (L === false) {
  2250.                                 K.preventDefault();
  2251.                                 K.stopPropagation()
  2252.                             }
  2253.                         }
  2254.                     }
  2255.                 }
  2256.             }
  2257.             return K.result
  2258.         },
  2259.         props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
  2260.         fixHooks: {},
  2261.         keyHooks: {
  2262.             props: "char charCode key keyCode".split(" "),
  2263.             filter: function (w, e) {
  2264.                 if (w.which == null) {
  2265.                     w.which = e.charCode != null ? e.charCode: e.keyCode
  2266.                 }
  2267.                 return w
  2268.             }
  2269.         },
  2270.         mouseHooks: {
  2271.             props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement wheelDelta".split(" "),
  2272.             filter: function (x, w) {
  2273.                 var B, z, e, y = w.button,
  2274.                 A = w.fromElement;
  2275.                 if (x.pageX == null && w.clientX != null) {
  2276.                     B = x.target.ownerDocument || an;
  2277.                     z = B.documentElement;
  2278.                     e = B.body;
  2279.                     x.pageX = w.clientX + (z && z.scrollLeft || e && e.scrollLeft || 0) - (z && z.clientLeft || e && e.clientLeft || 0);
  2280.                     x.pageY = w.clientY + (z && z.scrollTop || e && e.scrollTop || 0) - (z && z.clientTop || e && e.clientTop || 0)
  2281.                 }
  2282.                 if (!x.relatedTarget && A) {
  2283.                     x.relatedTarget = A === x.target ? w.toElement: A
  2284.                 }
  2285.                 if (!x.which && y !== ap) {
  2286.                     x.which = (y & 1 ? 1 : (y & 2 ? 3 : (y & 4 ? 2 : 0)))
  2287.                 }
  2288.                 return x
  2289.             }
  2290.         },
  2291.         fix: function (w) {
  2292.             if (w[al.expando]) {
  2293.                 return w
  2294.             }
  2295.             var x, A, e = w,
  2296.             y = al.event.fixHooks[w.type] || {},
  2297.             z = y.props ? this.props.concat(y.props) : this.props;
  2298.             w = al.Event(e);
  2299.             for (x = z.length; x;) {
  2300.                 A = z[--x];
  2301.                 w[A] = e[A]
  2302.             }
  2303.             if (!w.target) {
  2304.                 w.target = e.srcElement || an
  2305.             }
  2306.             if (w.target.nodeType === 3) {
  2307.                 w.target = w.target.parentNode
  2308.             }
  2309.             if (w.metaKey === ap) {
  2310.                 w.metaKey = w.ctrlKey
  2311.             }
  2312.             return y.filter ? y.filter(w, e) : w
  2313.         },
  2314.         special: {
  2315.             ready: {
  2316.                 setup: al.bindReady
  2317.             },
  2318.             focus: {
  2319.                 delegateType: "focusin",
  2320.                 noBubble: true
  2321.             },
  2322.             blur: {
  2323.                 delegateType: "focusout",
  2324.                 noBubble: true
  2325.             },
  2326.             beforeunload: {
  2327.                 setup: function (w, e, x) {
  2328.                     if (al.isWindow(this)) {
  2329.                         this.onbeforeunload = x
  2330.                     }
  2331.                 },
  2332.                 teardown: function (w, e) {
  2333.                     if (this.onbeforeunload === e) {
  2334.                         this.onbeforeunload = null
  2335.                     }
  2336.                 }
  2337.             }
  2338.         },
  2339.         simulate: function (x, w, A, z) {
  2340.             var y = al.extend(new al.Event(), A, {
  2341.                 type: x,
  2342.                 isSimulated: true,
  2343.                 originalEvent: {}
  2344.             });
  2345.             if (z) {
  2346.                 al.event.trigger(y, null, w)
  2347.             } else {
  2348.                 al.event.dispatch.call(w, y)
  2349.             }
  2350.             if (y.isDefaultPrevented()) {
  2351.                 A.preventDefault()
  2352.             }
  2353.         }
  2354.     };
  2355.     al.event.handle = al.event.dispatch;
  2356.     al.removeEvent = an.removeEventListener ?
  2357.     function (w, e, x) {
  2358.         if (w.removeEventListener) {
  2359.             w.removeEventListener(e, x, false)
  2360.         }
  2361.     }: function (w, e, x) {
  2362.         if (w.detachEvent) {
  2363.             w.detachEvent("on" + e, x)
  2364.         }
  2365.     };
  2366.     al.Event = function (w, e) {
  2367.         if (! (this instanceof al.Event)) {
  2368.             return new al.Event(w, e)
  2369.         }
  2370.         if (w && w.type) {
  2371.             this.originalEvent = w;
  2372.             this.type = w.type;
  2373.             this.isDefaultPrevented = (w.defaultPrevented || w.returnValue === false || w.getPreventDefault && w.getPreventDefault()) ? h: bD
  2374.         } else {
  2375.             this.type = w
  2376.         }
  2377.         if (e) {
  2378.             al.extend(this, e)
  2379.         }
  2380.         this.timeStamp = w && w.timeStamp || al.now();
  2381.         this[al.expando] = true
  2382.     };
  2383.     function bD() {
  2384.         return false
  2385.     }
  2386.     function h() {
  2387.         return true
  2388.     }
  2389.     al.Event.prototype = {
  2390.         preventDefault: function () {
  2391.             this.isDefaultPrevented = h;
  2392.             var w = this.originalEvent;
  2393.             if (!w) {
  2394.                 return
  2395.             }
  2396.             if (w.preventDefault) {
  2397.                 w.preventDefault()
  2398.             } else {
  2399.                 w.returnValue = false
  2400.             }
  2401.         },
  2402.         stopPropagation: function () {
  2403.             this.isPropagationStopped = h;
  2404.             var w = this.originalEvent;
  2405.             if (!w) {
  2406.                 return
  2407.             }
  2408.             if (w.stopPropagation) {
  2409.                 w.stopPropagation()
  2410.             }
  2411.             w.cancelBubble = true
  2412.         },
  2413.         stopImmediatePropagation: function () {
  2414.             this.isImmediatePropagationStopped = h;
  2415.             this.stopPropagation()
  2416.         },
  2417.         isDefaultPrevented: bD,
  2418.         isPropagationStopped: bD,
  2419.         isImmediatePropagationStopped: bD
  2420.     };
  2421.     al.each({
  2422.         mouseenter: "mouseover",
  2423.         mouseleave: "mouseout"
  2424.     },
  2425.     function (w, e) {
  2426.         al.event.special[w] = al.event.special[e] = {
  2427.             delegateType: e,
  2428.             bindType: e,
  2429.             handle: function (z) {
  2430.                 var y = this,
  2431.                 D = z.relatedTarget,
  2432.                 B = z.handleObj,
  2433.                 x = B.selector,
  2434.                 C, A;
  2435.                 if (!D || B.origType === z.type || (D !== y && !al.contains(y, D))) {
  2436.                     C = z.type;
  2437.                     z.type = B.origType;
  2438.                     A = B.handler.apply(this, arguments);
  2439.                     z.type = C
  2440.                 }
  2441.                 return A
  2442.             }
  2443.         }
  2444.     });
  2445.     if (!al.support.submitBubbles) {
  2446.         al.event.special.submit = {
  2447.             setup: function () {
  2448.                 if (al.nodeName(this, "form")) {
  2449.                     return false
  2450.                 }
  2451.                 al.event.add(this, "click._submit keypress._submit", function (y) {
  2452.                     var w = y.target,
  2453.                     x = al.nodeName(w, "input") || al.nodeName(w, "button") ? w.form: ap;
  2454.                     if (x && !x._submit_attached) {
  2455.                         al.event.add(x, "submit._submit", function (e) {
  2456.                             if (this.parentNode) {
  2457.                                 al.event.simulate("submit", this.parentNode, e, true)
  2458.                             }
  2459.                         });
  2460.                         x._submit_attached = true
  2461.                     }
  2462.                 })
  2463.             },
  2464.             teardown: function () {
  2465.                 if (al.nodeName(this, "form")) {
  2466.                     return false
  2467.                 }
  2468.                 al.event.remove(this, "._submit")
  2469.             }
  2470.         }
  2471.     }
  2472.     if (!al.support.changeBubbles) {
  2473.         al.event.special.change = {
  2474.             setup: function () {
  2475.                 if (bv.test(this.nodeName)) {
  2476.                     if (this.type === "checkbox" || this.type === "radio") {
  2477.                         al.event.add(this, "propertychange._change", function (e) {
  2478.                             if (e.originalEvent.propertyName === "checked") {
  2479.                                 this._just_changed = true
  2480.                             }
  2481.                         });
  2482.                         al.event.add(this, "click._change", function (e) {
  2483.                             if (this._just_changed) {
  2484.                                 this._just_changed = false;
  2485.                                 al.event.simulate("change", this, e, true)
  2486.                             }
  2487.                         })
  2488.                     }
  2489.                     return false
  2490.                 }
  2491.                 al.event.add(this, "beforeactivate._change", function (x) {
  2492.                     var w = x.target;
  2493.                     if (bv.test(w.nodeName) && !w._change_attached) {
  2494.                         al.event.add(w, "change._change", function (e) {
  2495.                             if (this.parentNode && !e.isSimulated) {
  2496.                                 al.event.simulate("change", this.parentNode, e, true)
  2497.                             }
  2498.                         });
  2499.                         w._change_attached = true
  2500.                     }
  2501.                 })
  2502.             },
  2503.             handle: function (w) {
  2504.                 var e = w.target;
  2505.                 if (this !== e || w.isSimulated || w.isTrigger || (e.type !== "radio" && e.type !== "checkbox")) {
  2506.                     return w.handleObj.handler.apply(this, arguments)
  2507.                 }
  2508.             },
  2509.             teardown: function () {
  2510.                 al.event.remove(this, "._change");
  2511.                 return bv.test(this.nodeName)
  2512.             }
  2513.         }
  2514.     }
  2515.     if (!al.support.focusinBubbles) {
  2516.         al.each({
  2517.             focus: "focusin",
  2518.             blur: "focusout"
  2519.         },
  2520.         function (e, y) {
  2521.             var x = 0,
  2522.             w = function (z) {
  2523.                 al.event.simulate(y, z.target, al.event.fix(z), true)
  2524.             };
  2525.             al.event.special[y] = {
  2526.                 setup: function () {
  2527.                     if (x++===0) {
  2528.                         an.addEventListener(e, w, true)
  2529.                     }
  2530.                 },
  2531.                 teardown: function () {
  2532.                     if (--x === 0) {
  2533.                         an.removeEventListener(e, w, true)
  2534.                     }
  2535.                 }
  2536.             }
  2537.         })
  2538.     }
  2539.     al.fn.extend({
  2540.         on: function (w, C, B, A, z) {
  2541.             var y, x;
  2542.             if (typeof w === "object") {
  2543.                 if (typeof C !== "string") {
  2544.                     B = C;
  2545.                     C = ap
  2546.                 }
  2547.                 for (x in w) {
  2548.                     this.on(x, C, B, w[x], z)
  2549.                 }
  2550.                 return this
  2551.             }
  2552.             if (B == null && A == null) {
  2553.                 A = C;
  2554.                 B = C = ap
  2555.             } else {
  2556.                 if (A == null) {
  2557.                     if (typeof C === "string") {
  2558.                         A = B;
  2559.                         B = ap
  2560.                     } else {
  2561.                         A = B;
  2562.                         B = C;
  2563.                         C = ap
  2564.                     }
  2565.                 }
  2566.             }
  2567.             if (A === false) {
  2568.                 A = bD
  2569.             } else {
  2570.                 if (!A) {
  2571.                     return this
  2572.                 }
  2573.             }
  2574.             if (z === 1) {
  2575.                 y = A;
  2576.                 A = function (e) {
  2577.                     al().off(e);
  2578.                     return y.apply(this, arguments)
  2579.                 };
  2580.                 A.guid = y.guid || (y.guid = al.guid++)
  2581.             }
  2582.             return this.each(function () {
  2583.                 al.event.add(this, w, A, B, C)
  2584.             })
  2585.         },
  2586.         one: function (w, e, y, x) {
  2587.             return this.on.call(this, w, e, y, x, 1)
  2588.         },
  2589.         off: function (x, w, A) {
  2590.             if (x && x.preventDefault && x.handleObj) {
  2591.                 var z = x.handleObj;
  2592.                 al(x.delegateTarget).off(z.namespace ? z.type + "." + z.namespace: z.type, z.selector, z.handler);
  2593.                 return this
  2594.             }
  2595.             if (typeof x === "object") {
  2596.                 for (var y in x) {
  2597.                     this.off(y, w, x[y])
  2598.                 }
  2599.                 return this
  2600.             }
  2601.             if (w === false || typeof w === "function") {
  2602.                 A = w;
  2603.                 w = ap
  2604.             }
  2605.             if (A === false) {
  2606.                 A = bD
  2607.             }
  2608.             return this.each(function () {
  2609.                 al.event.remove(this, x, A, w)
  2610.             })
  2611.         },
  2612.         bind: function (w, e, x) {
  2613.             return this.on(w, null, e, x)
  2614.         },
  2615.         unbind: function (w, e) {
  2616.             return this.off(w, null, e)
  2617.         },
  2618.         live: function (w, e, x) {
  2619.             al(this.context).on(w, this.selector, e, x);
  2620.             return this
  2621.         },
  2622.         die: function (w, e) {
  2623.             al(this.context).off(w, this.selector || "**", e);
  2624.             return this
  2625.         },
  2626.         delegate: function (w, e, y, x) {
  2627.             return this.on(e, w, y, x)
  2628.         },
  2629.         undelegate: function (w, e, x) {
  2630.             return arguments.length == 1 ? this.off(w, "**") : this.off(e, w, x)
  2631.         },
  2632.         trigger: function (w, e) {
  2633.             return this.each(function () {
  2634.                 al.event.trigger(w, e, this)
  2635.             })
  2636.         },
  2637.         triggerHandler: function (w, e) {
  2638.             if (this[0]) {
  2639.                 return al.event.trigger(w, e, this[0], true)
  2640.             }
  2641.         },
  2642.         toggle: function (z) {
  2643.             var y = arguments,
  2644.             e = z.guid || al.guid++,
  2645.             w = 0,
  2646.             x = function (B) {
  2647.                 var A = (al._data(this, "lastToggle" + z.guid) || 0) % w;
  2648.                 al._data(this, "lastToggle" + z.guid, A + 1);
  2649.                 B.preventDefault();
  2650.                 return y[A].apply(this, arguments) || false
  2651.             };
  2652.             x.guid = e;
  2653.             while (w < y.length) {
  2654.                 y[w++].guid = e
  2655.             }
  2656.             return this.click(x)
  2657.         },
  2658.         hover: function (w, e) {
  2659.             return this.mouseenter(w).mouseleave(e || w)
  2660.         }
  2661.     });
  2662.     al.each(("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu").split(" "), function (e, w) {
  2663.         al.fn[w] = function (y, x) {
  2664.             if (x == null) {
  2665.                 x = y;
  2666.                 y = null
  2667.             }
  2668.             return arguments.length > 0 ? this.bind(w, y, x) : this.trigger(w)
  2669.         };
  2670.         if (al.attrFn) {
  2671.             al.attrFn[w] = true
  2672.         }
  2673.         if (a6.test(w)) {
  2674.             al.event.fixHooks[w] = al.event.keyHooks
  2675.         }
  2676.         if (bx.test(w)) {
  2677.             al.event.fixHooks[w] = al.event.mouseHooks
  2678.         }
  2679.     });
  2680.     (function () {
  2681.         var bO = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
  2682.         A = "sizcache" + (Math.random() + "").replace(".", ""),
  2683.         G = 0,
  2684.         M = Object.prototype.toString,
  2685.         z = false,
  2686.         y = true,
  2687.         K = /\\/g,
  2688.         bQ = /\r\n/g,
  2689.         bS = /\W/;
  2690.         [0, 0].sort(function () {
  2691.             y = false;
  2692.             return 0
  2693.         });
  2694.         var L = function (b5, b4, b3, b2) {
  2695.             b3 = b3 || [];
  2696.             b4 = b4 || an;
  2697.             var b1 = b4;
  2698.             if (b4.nodeType !== 1 && b4.nodeType !== 9) {
  2699.                 return []
  2700.             }
  2701.             if (!b5 || typeof b5 !== "string") {
  2702.                 return b3
  2703.             }
  2704.             var bU, b6, b9, bT, b0, b8, b7, bY, bW = true,
  2705.             bV = L.isXML(b4),
  2706.             bX = [],
  2707.             bZ = b5;
  2708.             do {
  2709.                 bO.exec("");
  2710.                 bU = bO.exec(bZ);
  2711.                 if (bU) {
  2712.                     bZ = bU[3];
  2713.                     bX.push(bU[1]);
  2714.                     if (bU[2]) {
  2715.                         bT = bU[3];
  2716.                         break
  2717.                     }
  2718.                 }
  2719.             } while (bU);
  2720.             if (bX.length > 1 && H.exec(b5)) {
  2721.                 if (bX.length === 2 && I.relative[bX[0]]) {
  2722.                     b6 = C(bX[0] + bX[1], b4, b2)
  2723.                 } else {
  2724.                     b6 = I.relative[bX[0]] ? [b4] : L(bX.shift(), b4);
  2725.                     while (bX.length) {
  2726.                         b5 = bX.shift();
  2727.                         if (I.relative[b5]) {
  2728.                             b5 += bX.shift()
  2729.                         }
  2730.                         b6 = C(b5, b6, b2)
  2731.                     }
  2732.                 }
  2733.             } else {
  2734.                 if (!b2 && bX.length > 1 && b4.nodeType === 9 && !bV && I.match.ID.test(bX[0]) && !I.match.ID.test(bX[bX.length - 1])) {
  2735.                     b0 = L.find(bX.shift(), b4, bV);
  2736.                     b4 = b0.expr ? L.filter(b0.expr, b0.set)[0] : b0.set[0]
  2737.                 }
  2738.                 if (b4) {
  2739.                     b0 = b2 ? {
  2740.                         expr: bX.pop(),
  2741.                         set: E(b2)
  2742.                     }: L.find(bX.pop(), bX.length === 1 && (bX[0] === "~" || bX[0] === "+") && b4.parentNode ? b4.parentNode: b4, bV);
  2743.                     b6 = b0.expr ? L.filter(b0.expr, b0.set) : b0.set;
  2744.                     if (bX.length > 0) {
  2745.                         b9 = E(b6)
  2746.                     } else {
  2747.                         bW = false
  2748.                     }
  2749.                     while (bX.length) {
  2750.                         b8 = bX.pop();
  2751.                         b7 = b8;
  2752.                         if (!I.relative[b8]) {
  2753.                             b8 = ""
  2754.                         } else {
  2755.                             b7 = bX.pop()
  2756.                         }
  2757.                         if (b7 == null) {
  2758.                             b7 = b4
  2759.                         }
  2760.                         I.relative[b8](b9, b7, bV)
  2761.                     }
  2762.                 } else {
  2763.                     b9 = bX = []
  2764.                 }
  2765.             }
  2766.             if (!b9) {
  2767.                 b9 = b6
  2768.             }
  2769.             if (!b9) {
  2770.                 L.error(b8 || b5)
  2771.             }
  2772.             if (M.call(b9) === "[object Array]") {
  2773.                 if (!bW) {
  2774.                     b3.push.apply(b3, b9)
  2775.                 } else {
  2776.                     if (b4 && b4.nodeType === 1) {
  2777.                         for (bY = 0; b9[bY] != null; bY++) {
  2778.                             if (b9[bY] && (b9[bY] === true || b9[bY].nodeType === 1 && L.contains(b4, b9[bY]))) {
  2779.                                 b3.push(b6[bY])
  2780.                             }
  2781.                         }
  2782.                     } else {
  2783.                         for (bY = 0; b9[bY] != null; bY++) {
  2784.                             if (b9[bY] && b9[bY].nodeType === 1) {
  2785.                                 b3.push(b6[bY])
  2786.                             }
  2787.                         }
  2788.                     }
  2789.                 }
  2790.             } else {
  2791.                 E(b9, b3)
  2792.             }
  2793.             if (bT) {
  2794.                 L(bT, b1, b3, b2);
  2795.                 L.uniqueSort(b3)
  2796.             }
  2797.             return b3
  2798.         };
  2799.         L.uniqueSort = function (e) {
  2800.             if (D) {
  2801.                 z = y;
  2802.                 e.sort(D);
  2803.                 if (z) {
  2804.                     for (var bT = 1; bT < e.length; bT++) {
  2805.                         if (e[bT] === e[bT - 1]) {
  2806.                             e.splice(bT--, 1)
  2807.                         }
  2808.                     }
  2809.                 }
  2810.             }
  2811.             return e
  2812.         };
  2813.         L.matches = function (bT, e) {
  2814.             return L(bT, null, null, e)
  2815.         };
  2816.         L.matchesSelector = function (bT, e) {
  2817.             return L(e, null, null, [bT]).length > 0
  2818.         };
  2819.         L.find = function (b0, bZ, bY) {
  2820.             var bX, bU, bW, bV, e, bT;
  2821.             if (!b0) {
  2822.                 return []
  2823.             }
  2824.             for (bU = 0, bW = I.order.length; bU < bW; bU++) {
  2825.                 e = I.order[bU];
  2826.                 if ((bV = I.leftMatch[e].exec(b0))) {
  2827.                     bT = bV[1];
  2828.                     bV.splice(1, 1);
  2829.                     if (bT.substr(bT.length - 1) !== "\\") {
  2830.                         bV[1] = (bV[1] || "").replace(K, "");
  2831.                         bX = I.find[e](bV, bZ, bY);
  2832.                         if (bX != null) {
  2833.                             b0 = b0.replace(I.match[e], "");
  2834.                             break
  2835.                         }
  2836.                     }
  2837.                 }
  2838.             }
  2839.             if (!bX) {
  2840.                 bX = typeof bZ.getElementsByTagName !== "undefined" ? bZ.getElementsByTagName("*") : []
  2841.             }
  2842.             return {
  2843.                 set: bX,
  2844.                 expr: b0
  2845.             }
  2846.         };
  2847.         L.filter = function (b5, b4, b3, b2) {
  2848.             var b1, bU, bT, b9, b7, bV, bX, bY, b6, bW = b5,
  2849.             b8 = [],
  2850.             b0 = b4,
  2851.             bZ = b4 && b4[0] && L.isXML(b4[0]);
  2852.             while (b5 && b4.length) {
  2853.                 for (bT in I.filter) {
  2854.                     if ((b1 = I.leftMatch[bT].exec(b5)) != null && b1[2]) {
  2855.                         bV = I.filter[bT];
  2856.                         bX = b1[1];
  2857.                         bU = false;
  2858.                         b1.splice(1, 1);
  2859.                         if (bX.substr(bX.length - 1) === "\\") {
  2860.                             continue
  2861.                         }
  2862.                         if (b0 === b8) {
  2863.                             b8 = []
  2864.                         }
  2865.                         if (I.preFilter[bT]) {
  2866.                             b1 = I.preFilter[bT](b1, b0, b3, b8, b2, bZ);
  2867.                             if (!b1) {
  2868.                                 bU = b9 = true
  2869.                             } else {
  2870.                                 if (b1 === true) {
  2871.                                     continue
  2872.                                 }
  2873.                             }
  2874.                         }
  2875.                         if (b1) {
  2876.                             for (bY = 0;
  2877.                             (b7 = b0[bY]) != null; bY++) {
  2878.                                 if (b7) {
  2879.                                     b9 = bV(b7, b1, bY, b0);
  2880.                                     b6 = b2 ^ b9;
  2881.                                     if (b3 && b9 != null) {
  2882.                                         if (b6) {
  2883.                                             bU = true
  2884.                                         } else {
  2885.                                             b0[bY] = false
  2886.                                         }
  2887.                                     } else {
  2888.                                         if (b6) {
  2889.                                             b8.push(b7);
  2890.                                             bU = true
  2891.                                         }
  2892.                                     }
  2893.                                 }
  2894.                             }
  2895.                         }
  2896.                         if (b9 !== ap) {
  2897.                             if (!b3) {
  2898.                                 b0 = b8
  2899.                             }
  2900.                             b5 = b5.replace(I.match[bT], "");
  2901.                             if (!bU) {
  2902.                                 return []
  2903.                             }
  2904.                             break
  2905.                         }
  2906.                     }
  2907.                 }
  2908.                 if (b5 === bW) {
  2909.                     if (bU == null) {
  2910.                         L.error(b5)
  2911.                     } else {
  2912.                         break
  2913.                     }
  2914.                 }
  2915.                 bW = b5
  2916.             }
  2917.             return b0
  2918.         };
  2919.         L.error = function (e) {
  2920.             throw "Syntax error, unrecognized expression: " + e
  2921.         };
  2922.         var J = L.getText = function (bT) {
  2923.             var bV, bW, e = bT.nodeType,
  2924.             bU = "";
  2925.             if (e) {
  2926.                 if (e === 1) {
  2927.                     if (typeof bT.textContent === "string") {
  2928.                         return bT.textContent
  2929.                     } else {
  2930.                         if (typeof bT.innerText === "string") {
  2931.                             return bT.innerText.replace(bQ, "")
  2932.                         } else {
  2933.                             for (bT = bT.firstChild; bT; bT = bT.nextSibling) {
  2934.                                 bU += J(bT)
  2935.                             }
  2936.                         }
  2937.                     }
  2938.                 } else {
  2939.                     if (e === 3 || e === 4) {
  2940.                         return bT.nodeValue
  2941.                     }
  2942.                 }
  2943.             } else {
  2944.                 for (bV = 0;
  2945.                 (bW = bT[bV]); bV++) {
  2946.                     if (bW.nodeType !== 8) {
  2947.                         bU += J(bW)
  2948.                     }
  2949.                 }
  2950.             }
  2951.             return bU
  2952.         };
  2953.         var I = L.selectors = {
  2954.             order: ["ID", "NAME", "TAG"],
  2955.             match: {
  2956.                 ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
  2957.                 CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
  2958.                 NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
  2959.                 ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
  2960.                 TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
  2961.                 CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
  2962.                 POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
  2963.                 PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
  2964.             },
  2965.             leftMatch: {},
  2966.             attrMap: {
  2967.                 "class": "className",
  2968.                 "for": "htmlFor"
  2969.             },
  2970.             attrHandle: {
  2971.                 href: function (e) {
  2972.                     return e.getAttribute("href")
  2973.                 },
  2974.                 type: function (e) {
  2975.                     return e.getAttribute("type")
  2976.                 }
  2977.             },
  2978.             relative: {
  2979.                 "+": function (bU, e) {
  2980.                     var bZ = typeof e === "string",
  2981.                     bX = bZ && !bS.test(e),
  2982.                     bY = bZ && !bX;
  2983.                     if (bX) {
  2984.                         e = e.toLowerCase()
  2985.                     }
  2986.                     for (var bV = 0, bT = bU.length, bW; bV < bT; bV++) {
  2987.                         if ((bW = bU[bV])) {
  2988.                             while ((bW = bW.previousSibling) && bW.nodeType !== 1) {}
  2989.                             bU[bV] = bY || bW && bW.nodeName.toLowerCase() === e ? bW || false: bW === e
  2990.                         }
  2991.                     }
  2992.                     if (bY) {
  2993.                         L.filter(e, bU, true)
  2994.                     }
  2995.                 },
  2996.                 ">": function (bU, e) {
  2997.                     var bY, bW = typeof e === "string",
  2998.                     bV = 0,
  2999.                     bT = bU.length;
  3000.                     if (bW && !bS.test(e)) {
  3001.                         e = e.toLowerCase();
  3002.                         for (; bV < bT; bV++) {
  3003.                             bY = bU[bV];
  3004.                             if (bY) {
  3005.                                 var bX = bY.parentNode;
  3006.                                 bU[bV] = bX.nodeName.toLowerCase() === e ? bX: false
  3007.                             }
  3008.                         }
  3009.                     } else {
  3010.                         for (; bV < bT; bV++) {
  3011.                             bY = bU[bV];
  3012.                             if (bY) {
  3013.                                 bU[bV] = bW ? bY.parentNode: bY.parentNode === e
  3014.                             }
  3015.                         }
  3016.                         if (bW) {
  3017.                             L.filter(e, bU, true)
  3018.                         }
  3019.                     }
  3020.                 },
  3021.                 "": function (bU, bT, bX) {
  3022.                     var bW, bV = G++,
  3023.                     e = bP;
  3024.                     if (typeof bT === "string" && !bS.test(bT)) {
  3025.                         bT = bT.toLowerCase();
  3026.                         bW = bT;
  3027.                         e = w
  3028.                     }
  3029.                     e("parentNode", bT, bV, bU, bW, bX)
  3030.                 },
  3031.                 "~": function (bU, bT, bX) {
  3032.                     var bW, bV = G++,
  3033.                     e = bP;
  3034.                     if (typeof bT === "string" && !bS.test(bT)) {
  3035.                         bT = bT.toLowerCase();
  3036.                         bW = bT;
  3037.                         e = w
  3038.                     }
  3039.                     e("previousSibling", bT, bV, bU, bW, bX)
  3040.                 }
  3041.             },
  3042.             find: {
  3043.                 ID: function (bU, bT, bV) {
  3044.                     if (typeof bT.getElementById !== "undefined" && !bV) {
  3045.                         var e = bT.getElementById(bU[1]);
  3046.                         return e && e.parentNode ? [e] : []
  3047.                     }
  3048.                 },
  3049.                 NAME: function (bU, e) {
  3050.                     if (typeof e.getElementsByName !== "undefined") {
  3051.                         var bX = [],
  3052.                         bW = e.getElementsByName(bU[1]);
  3053.                         for (var bV = 0, bT = bW.length; bV < bT; bV++) {
  3054.                             if (bW[bV].getAttribute("name") === bU[1]) {
  3055.                                 bX.push(bW[bV])
  3056.                             }
  3057.                         }
  3058.                         return bX.length === 0 ? null: bX
  3059.                     }
  3060.                 },
  3061.                 TAG: function (bT, e) {
  3062.                     if (typeof e.getElementsByTagName !== "undefined") {
  3063.                         return e.getElementsByTagName(bT[1])
  3064.                     }
  3065.                 }
  3066.             },
  3067.             preFilter: {
  3068.                 CLASS: function (bU, bT, b0, bZ, bY, bX) {
  3069.                     bU = " " + bU[1].replace(K, "") + " ";
  3070.                     if (bX) {
  3071.                         return bU
  3072.                     }
  3073.                     for (var bV = 0, bW;
  3074.                     (bW = bT[bV]) != null; bV++) {
  3075.                         if (bW) {
  3076.                             if (bY ^ (bW.className && (" " + bW.className + " ").replace(/[\t\n\r]/g, " ").indexOf(bU) >= 0)) {
  3077.                                 if (!b0) {
  3078.                                     bZ.push(bW)
  3079.                                 }
  3080.                             } else {
  3081.                                 if (b0) {
  3082.                                     bT[bV] = false
  3083.                                 }
  3084.                             }
  3085.                         }
  3086.                     }
  3087.                     return false
  3088.                 },
  3089.                 ID: function (e) {
  3090.                     return e[1].replace(K, "")
  3091.                 },
  3092.                 TAG: function (bT, e) {
  3093.                     return bT[1].replace(K, "").toLowerCase()
  3094.                 },
  3095.                 CHILD: function (bT) {
  3096.                     if (bT[1] === "nth") {
  3097.                         if (!bT[2]) {
  3098.                             L.error(bT[0])
  3099.                         }
  3100.                         bT[2] = bT[2].replace(/^\+|\s*/g, "");
  3101.                         var e = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(bT[2] === "even" && "2n" || bT[2] === "odd" && "2n+1" || !/\D/.test(bT[2]) && "0n+" + bT[2] || bT[2]);
  3102.                         bT[2] = (e[1] + (e[2] || 1)) - 0;
  3103.                         bT[3] = e[3] - 0
  3104.                     } else {
  3105.                         if (bT[2]) {
  3106.                             L.error(bT[0])
  3107.                         }
  3108.                     }
  3109.                     bT[0] = G++;
  3110.                     return bT
  3111.                 },
  3112.                 ATTR: function (bU, bT, bZ, bY, bX, bW) {
  3113.                     var bV = bU[1] = bU[1].replace(K, "");
  3114.                     if (!bW && I.attrMap[bV]) {
  3115.                         bU[1] = I.attrMap[bV]
  3116.                     }
  3117.                     bU[4] = (bU[4] || bU[5] || "").replace(K, "");
  3118.                     if (bU[2] === "~=") {
  3119.                         bU[4] = " " + bU[4] + " "
  3120.                     }
  3121.                     return bU
  3122.                 },
  3123.                 PSEUDO: function (bU, bT, bY, bX, bW) {
  3124.                     if (bU[1] === "not") {
  3125.                         if ((bO.exec(bU[3]) || "").length > 1 || /^\w/.test(bU[3])) {
  3126.                             bU[3] = L(bU[3], null, null, bT)
  3127.                         } else {
  3128.                             var bV = L.filter(bU[3], bT, bY, true ^ bW);
  3129.                             if (!bY) {
  3130.                                 bX.push.apply(bX, bV)
  3131.                             }
  3132.                             return false
  3133.                         }
  3134.                     } else {
  3135.                         if (I.match.POS.test(bU[0]) || I.match.CHILD.test(bU[0])) {
  3136.                             return true
  3137.                         }
  3138.                     }
  3139.                     return bU
  3140.                 },
  3141.                 POS: function (e) {
  3142.                     e.unshift(true);
  3143.                     return e
  3144.                 }
  3145.             },
  3146.             filters: {
  3147.                 enabled: function (e) {
  3148.                     return e.disabled === false && e.type !== "hidden"
  3149.                 },
  3150.                 disabled: function (e) {
  3151.                     return e.disabled === true
  3152.                 },
  3153.                 checked: function (e) {
  3154.                     return e.checked === true
  3155.                 },
  3156.                 selected: function (e) {
  3157.                     if (e.parentNode) {
  3158.                         e.parentNode.selectedIndex
  3159.                     }
  3160.                     return e.selected === true
  3161.                 },
  3162.                 parent: function (e) {
  3163.                     return !! e.firstChild
  3164.                 },
  3165.                 empty: function (e) {
  3166.                     return ! e.firstChild
  3167.                 },
  3168.                 has: function (bT, bU, e) {
  3169.                     return !! L(e[3], bT).length
  3170.                 },
  3171.                 header: function (e) {
  3172.                     return (/h\d/i).test(e.nodeName)
  3173.                 },
  3174.                 text: function (bT) {
  3175.                     var e = bT.getAttribute("type"),
  3176.                     bU = bT.type;
  3177.                     return bT.nodeName.toLowerCase() === "input" && "text" === bU && (e === bU || e === null)
  3178.                 },
  3179.                 radio: function (e) {
  3180.                     return e.nodeName.toLowerCase() === "input" && "radio" === e.type
  3181.                 },
  3182.                 checkbox: function (e) {
  3183.                     return e.nodeName.toLowerCase() === "input" && "checkbox" === e.type
  3184.                 },
  3185.                 file: function (e) {
  3186.                     return e.nodeName.toLowerCase() === "input" && "file" === e.type
  3187.                 },
  3188.                 password: function (e) {
  3189.                     return e.nodeName.toLowerCase() === "input" && "password" === e.type
  3190.                 },
  3191.                 submit: function (bT) {
  3192.                     var e = bT.nodeName.toLowerCase();
  3193.                     return (e === "input" || e === "button") && "submit" === bT.type
  3194.                 },
  3195.                 image: function (e) {
  3196.                     return e.nodeName.toLowerCase() === "input" && "image" === e.type
  3197.                 },
  3198.                 reset: function (bT) {
  3199.                     var e = bT.nodeName.toLowerCase();
  3200.                     return (e === "input" || e === "button") && "reset" === bT.type
  3201.                 },
  3202.                 button: function (bT) {
  3203.                     var e = bT.nodeName.toLowerCase();
  3204.                     return e === "input" && "button" === bT.type || e === "button"
  3205.                 },
  3206.                 input: function (e) {
  3207.                     return (/input|select|textarea|button/i).test(e.nodeName)
  3208.                 },
  3209.                 focus: function (e) {
  3210.                     return e === e.ownerDocument.activeElement
  3211.                 }
  3212.             },
  3213.             setFilters: {
  3214.                 first: function (e, bT) {
  3215.                     return bT === 0
  3216.                 },
  3217.                 last: function (bT, bU, e, bV) {
  3218.                     return bU === bV.length - 1
  3219.                 },
  3220.                 even: function (e, bT) {
  3221.                     return bT % 2 === 0
  3222.                 },
  3223.                 odd: function (e, bT) {
  3224.                     return bT % 2 === 1
  3225.                 },
  3226.                 lt: function (bT, bU, e) {
  3227.                     return bU < e[3] - 0
  3228.                 },
  3229.                 gt: function (bT, bU, e) {
  3230.                     return bU > e[3] - 0
  3231.                 },
  3232.                 nth: function (bT, bU, e) {
  3233.                     return e[3] - 0 === bU
  3234.                 },
  3235.                 eq: function (bT, bU, e) {
  3236.                     return e[3] - 0 === bU
  3237.                 }
  3238.             },
  3239.             filter: {
  3240.                 PSEUDO: function (b1, b0, bW, bZ) {
  3241.                     var bY = b0[1],
  3242.                     bT = I.filters[bY];
  3243.                     if (bT) {
  3244.                         return bT(b1, bW, b0, bZ)
  3245.                     } else {
  3246.                         if (bY === "contains") {
  3247.                             return (b1.textContent || b1.innerText || J([b1]) || "").indexOf(b0[3]) >= 0
  3248.                         } else {
  3249.                             if (bY === "not") {
  3250.                                 var bX = b0[3];
  3251.                                 for (var bV = 0, bU = bX.length; bV < bU; bV++) {
  3252.                                     if (bX[bV] === b1) {
  3253.                                         return false
  3254.                                     }
  3255.                                 }
  3256.                                 return true
  3257.                             } else {
  3258.                                 L.error(bY)
  3259.                             }
  3260.                         }
  3261.                     }
  3262.                 },
  3263.                 CHILD: function (bZ, bY) {
  3264.                     var bX, b2, bW, b1, bT, bV, b0, e = bY[1],
  3265.                     bU = bZ;
  3266.                     switch (e) {
  3267.                     case "only":
  3268.                     case "first":
  3269.                         while ((bU = bU.previousSibling)) {
  3270.                             if (bU.nodeType === 1) {
  3271.                                 return false
  3272.                             }
  3273.                         }
  3274.                         if (e === "first") {
  3275.                             return true
  3276.                         }
  3277.                         bU = bZ;
  3278.                     case "last":
  3279.                         while ((bU = bU.nextSibling)) {
  3280.                             if (bU.nodeType === 1) {
  3281.                                 return false
  3282.                             }
  3283.                         }
  3284.                         return true;
  3285.                     case "nth":
  3286.                         bX = bY[2];
  3287.                         b2 = bY[3];
  3288.                         if (bX === 1 && b2 === 0) {
  3289.                             return true
  3290.                         }
  3291.                         bW = bY[0];
  3292.                         b1 = bZ.parentNode;
  3293.                         if (b1 && (b1[A] !== bW || !bZ.nodeIndex)) {
  3294.                             bV = 0;
  3295.                             for (bU = b1.firstChild; bU; bU = bU.nextSibling) {
  3296.                                 if (bU.nodeType === 1) {
  3297.                                     bU.nodeIndex = ++bV
  3298.                                 }
  3299.                             }
  3300.                             b1[A] = bW
  3301.                         }
  3302.                         b0 = bZ.nodeIndex - b2;
  3303.                         if (bX === 0) {
  3304.                             return b0 === 0
  3305.                         } else {
  3306.                             return (b0 % bX === 0 && b0 / bX >= 0)
  3307.                         }
  3308.                     }
  3309.                 },
  3310.                 ID: function (bT, e) {
  3311.                     return bT.nodeType === 1 && bT.getAttribute("id") === e
  3312.                 },
  3313.                 TAG: function (bT, e) {
  3314.                     return (e === "*" && bT.nodeType === 1) || !!bT.nodeName && bT.nodeName.toLowerCase() === e
  3315.                 },
  3316.                 CLASS: function (bT, e) {
  3317.                     return (" " + (bT.className || bT.getAttribute("class")) + " ").indexOf(e) > -1
  3318.                 },
  3319.                 ATTR: function (bV, bT) {
  3320.                     var bY = bT[1],
  3321.                     e = L.attr ? L.attr(bV, bY) : I.attrHandle[bY] ? I.attrHandle[bY](bV) : bV[bY] != null ? bV[bY] : bV.getAttribute(bY),
  3322.                     bX = e + "",
  3323.                     bW = bT[2],
  3324.                     bU = bT[4];
  3325.                     return e == null ? bW === "!=": !bW && L.attr ? e != null: bW === "=" ? bX === bU: bW === "*=" ? bX.indexOf(bU) >= 0 : bW === "~=" ? (" " + bX + " ").indexOf(bU) >= 0 : !bU ? bX && e !== false: bW === "!=" ? bX !== bU: bW === "^=" ? bX.indexOf(bU) === 0 : bW === "$=" ? bX.substr(bX.length - bU.length) === bU: bW === "|=" ? bX === bU || bX.substr(0, bU.length + 1) === bU + "-": false
  3326.                 },
  3327.                 POS: function (bT, e, bU, bX) {
  3328.                     var bW = e[2],
  3329.                     bV = I.setFilters[bW];
  3330.                     if (bV) {
  3331.                         return bV(bT, bU, e, bX)
  3332.                     }
  3333.                 }
  3334.             }
  3335.         };
  3336.         var H = I.match.POS,
  3337.         x = function (bT, e) {
  3338.             return "\\" + (e - 0 + 1)
  3339.         };
  3340.         for (var F in I.match) {
  3341.             I.match[F] = new RegExp(I.match[F].source + (/(?![^\[]*\])(?![^\(]*\))/.source));
  3342.             I.leftMatch[F] = new RegExp(/(^(?:.|\r|\n)*?)/.source + I.match[F].source.replace(/\\(\d+)/g, x))
  3343.         }
  3344.         var E = function (bT, e) {
  3345.             bT = Array.prototype.slice.call(bT, 0);
  3346.             if (e) {
  3347.                 e.push.apply(e, bT);
  3348.                 return e
  3349.             }
  3350.             return bT
  3351.         };
  3352.         try {
  3353.             Array.prototype.slice.call(an.documentElement.childNodes, 0)[0].nodeType
  3354.         } catch(bR) {
  3355.             E = function (bU, e) {
  3356.                 var bW = 0,
  3357.                 bV = e || [];
  3358.                 if (M.call(bU) === "[object Array]") {
  3359.                     Array.prototype.push.apply(bV, bU)
  3360.                 } else {
  3361.                     if (typeof bU.length === "number") {
  3362.                         for (var bT = bU.length; bW < bT; bW++) {
  3363.                             bV.push(bU[bW])
  3364.                         }
  3365.                     } else {
  3366.                         for (; bU[bW]; bW++) {
  3367.                             bV.push(bU[bW])
  3368.                         }
  3369.                     }
  3370.                 }
  3371.                 return bV
  3372.             }
  3373.         }
  3374.         var D, B;
  3375.         if (an.documentElement.compareDocumentPosition) {
  3376.             D = function (bT, e) {
  3377.                 if (bT === e) {
  3378.                     z = true;
  3379.                     return 0
  3380.                 }
  3381.                 if (!bT.compareDocumentPosition || !e.compareDocumentPosition) {
  3382.                     return bT.compareDocumentPosition ? -1 : 1
  3383.                 }
  3384.                 return bT.compareDocumentPosition(e) & 4 ? -1 : 1
  3385.             }
  3386.         } else {
  3387.             D = function (b0, bZ) {
  3388.                 if (b0 === bZ) {
  3389.                     z = true;
  3390.                     return 0
  3391.                 } else {
  3392.                     if (b0.sourceIndex && bZ.sourceIndex) {
  3393.                         return b0.sourceIndex - bZ.sourceIndex
  3394.                     }
  3395.                 }
  3396.                 var bX, bT, bU = [],
  3397.                 e = [],
  3398.                 bW = b0.parentNode,
  3399.                 bY = bZ.parentNode,
  3400.                 b1 = bW;
  3401.                 if (bW === bY) {
  3402.                     return B(b0, bZ)
  3403.                 } else {
  3404.                     if (!bW) {
  3405.                         return - 1
  3406.                     } else {
  3407.                         if (!bY) {
  3408.                             return 1
  3409.                         }
  3410.                     }
  3411.                 }
  3412.                 while (b1) {
  3413.                     bU.unshift(b1);
  3414.                     b1 = b1.parentNode
  3415.                 }
  3416.                 b1 = bY;
  3417.                 while (b1) {
  3418.                     e.unshift(b1);
  3419.                     b1 = b1.parentNode
  3420.                 }
  3421.                 bX = bU.length;
  3422.                 bT = e.length;
  3423.                 for (var bV = 0; bV < bX && bV < bT; bV++) {
  3424.                     if (bU[bV] !== e[bV]) {
  3425.                         return B(bU[bV], e[bV])
  3426.                     }
  3427.                 }
  3428.                 return bV === bX ? B(b0, e[bV], -1) : B(bU[bV], bZ, 1)
  3429.             };
  3430.             B = function (bT, e, bV) {
  3431.                 if (bT === e) {
  3432.                     return bV
  3433.                 }
  3434.                 var bU = bT.nextSibling;
  3435.                 while (bU) {
  3436.                     if (bU === e) {
  3437.                         return - 1
  3438.                     }
  3439.                     bU = bU.nextSibling
  3440.                 }
  3441.                 return 1
  3442.             }
  3443.         } (function () {
  3444.             var bT = an.createElement("div"),
  3445.             bU = "script" + (new Date()).getTime(),
  3446.             e = an.documentElement;
  3447.             bT.innerHTML = "<a name='" + bU + "'/>";
  3448.             e.insertBefore(bT, e.firstChild);
  3449.             if (an.getElementById(bU)) {
  3450.                 I.find.ID = function (bX, bW, bY) {
  3451.                     if (typeof bW.getElementById !== "undefined" && !bY) {
  3452.                         var bV = bW.getElementById(bX[1]);
  3453.                         return bV ? bV.id === bX[1] || typeof bV.getAttributeNode !== "undefined" && bV.getAttributeNode("id").nodeValue === bX[1] ? [bV] : ap: []
  3454.                     }
  3455.                 };
  3456.                 I.filter.ID = function (bW, bV) {
  3457.                     var bX = typeof bW.getAttributeNode !== "undefined" && bW.getAttributeNode("id");
  3458.                     return bW.nodeType === 1 && bX && bX.nodeValue === bV
  3459.                 }
  3460.             }
  3461.             e.removeChild(bT);
  3462.             e = bT = null
  3463.         })();
  3464.         (function () {
  3465.             var bT = an.createElement("div");
  3466.             bT.appendChild(an.createComment(""));
  3467.             if (bT.getElementsByTagName("*").length > 0) {
  3468.                 I.find.TAG = function (bU, e) {
  3469.                     var bX = e.getElementsByTagName(bU[1]);
  3470.                     if (bU[1] === "*") {
  3471.                         var bW = [];
  3472.                         for (var bV = 0; bX[bV]; bV++) {
  3473.                             if (bX[bV].nodeType === 1) {
  3474.                                 bW.push(bX[bV])
  3475.                             }
  3476.                         }
  3477.                         bX = bW
  3478.                     }
  3479.                     return bX
  3480.                 }
  3481.             }
  3482.             bT.innerHTML = "<a href='#'></a>";
  3483.             if (bT.firstChild && typeof bT.firstChild.getAttribute !== "undefined" && bT.firstChild.getAttribute("href") !== "#") {
  3484.                 I.attrHandle.href = function (e) {
  3485.                     return e.getAttribute("href", 2)
  3486.                 }
  3487.             }
  3488.             bT = null
  3489.         })();
  3490.         if (an.querySelectorAll) { (function () {
  3491.                 var bT = L,
  3492.                 bV = an.createElement("div"),
  3493.                 bU = "__sizzle__";
  3494.                 bV.innerHTML = "<p class='TEST'></p>";
  3495.                 if (bV.querySelectorAll && bV.querySelectorAll(".TEST").length === 0) {
  3496.                     return
  3497.                 }
  3498.                 L = function (b7, b5, b4, b3) {
  3499.                     b5 = b5 || an;
  3500.                     if (!b3 && !L.isXML(b5)) {
  3501.                         var b2 = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b7);
  3502.                         if (b2 && (b5.nodeType === 1 || b5.nodeType === 9)) {
  3503.                             if (b2[1]) {
  3504.                                 return E(b5.getElementsByTagName(b7), b4)
  3505.                             } else {
  3506.                                 if (b2[2] && I.find.CLASS && b5.getElementsByClassName) {
  3507.                                     return E(b5.getElementsByClassName(b2[2]), b4)
  3508.                                 }
  3509.                             }
  3510.                         }
  3511.                         if (b5.nodeType === 9) {
  3512.                             if (b7 === "body" && b5.body) {
  3513.                                 return E([b5.body], b4)
  3514.                             } else {
  3515.                                 if (b2 && b2[3]) {
  3516.                                     var b1 = b5.getElementById(b2[3]);
  3517.                                     if (b1 && b1.parentNode) {
  3518.                                         if (b1.id === b2[3]) {
  3519.                                             return E([b1], b4)
  3520.                                         }
  3521.                                     } else {
  3522.                                         return E([], b4)
  3523.                                     }
  3524.                                 }
  3525.                             }
  3526.                             try {
  3527.                                 return E(b5.querySelectorAll(b7), b4)
  3528.                             } catch(bY) {}
  3529.                         } else {
  3530.                             if (b5.nodeType === 1 && b5.nodeName.toLowerCase() !== "object") {
  3531.                                 var b0 = b5,
  3532.                                 bX = b5.getAttribute("id"),
  3533.                                 bW = bX || bU,
  3534.                                 b8 = b5.parentNode,
  3535.                                 b6 = /^\s*[+~]/.test(b7);
  3536.                                 if (!bX) {
  3537.                                     b5.setAttribute("id", bW)
  3538.                                 } else {
  3539.                                     bW = bW.replace(/'/g, "\\$&")
  3540.                                 }
  3541.                                 if (b6 && b8) {
  3542.                                     b5 = b5.parentNode
  3543.                                 }
  3544.                                 try {
  3545.                                     if (!b6 || b8) {
  3546.                                         return E(b5.querySelectorAll("[id='" + bW + "'] " + b7), b4)
  3547.                                     }
  3548.                                 } catch(bZ) {} finally {
  3549.                                     if (!bX) {
  3550.                                         b0.removeAttribute("id")
  3551.                                     }
  3552.                                 }
  3553.                             }
  3554.                         }
  3555.                     }
  3556.                     return bT(b7, b5, b4, b3)
  3557.                 };
  3558.                 for (var e in bT) {
  3559.                     L[e] = bT[e]
  3560.                 }
  3561.                 bV = null
  3562.             })()
  3563.         } (function () {
  3564.             var bW = an.documentElement,
  3565.             bU = bW.matchesSelector || bW.mozMatchesSelector || bW.webkitMatchesSelector || bW.msMatchesSelector;
  3566.             if (bU) {
  3567.                 var bT = !bU.call(an.createElement("div"), "div"),
  3568.                 e = false;
  3569.                 try {
  3570.                     bU.call(an.documentElement, "[test!='']:sizzle")
  3571.                 } catch(bV) {
  3572.                     e = true
  3573.                 }
  3574.                 L.matchesSelector = function (bY, bX) {
  3575.                     bX = bX.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
  3576.                     if (!L.isXML(bY)) {
  3577.                         try {
  3578.                             if (e || !I.match.PSEUDO.test(bX) && !/!=/.test(bX)) {
  3579.                                 var b0 = bU.call(bY, bX);
  3580.                                 if (b0 || !bT || bY.document && bY.document.nodeType !== 11) {
  3581.                                     return b0
  3582.                                 }
  3583.                             }
  3584.                         } catch(bZ) {}
  3585.                     }
  3586.                     return L(bX, null, null, [bY]).length > 0
  3587.                 }
  3588.             }
  3589.         })();
  3590.         (function () {
  3591.             var e = an.createElement("div");
  3592.             e.innerHTML = "<div class='test e'></div><div class='test'></div>";
  3593.             if (!e.getElementsByClassName || e.getElementsByClassName("e").length === 0) {
  3594.                 return
  3595.             }
  3596.             e.lastChild.className = "e";
  3597.             if (e.getElementsByClassName("e").length === 1) {
  3598.                 return
  3599.             }
  3600.             I.order.splice(1, 0, "CLASS");
  3601.             I.find.CLASS = function (bU, bT, bV) {
  3602.                 if (typeof bT.getElementsByClassName !== "undefined" && !bV) {
  3603.                     return bT.getElementsByClassName(bU[1])
  3604.                 }
  3605.             };
  3606.             e = null
  3607.         })();
  3608.         function w(b2, b1, b0, bZ, bY, bX) {
  3609.             for (var bU = 0, bT = bZ.length; bU < bT; bU++) {
  3610.                 var bW = bZ[bU];
  3611.                 if (bW) {
  3612.                     var bV = false;
  3613.                     bW = bW[b2];
  3614.                     while (bW) {
  3615.                         if (bW[A] === b0) {
  3616.                             bV = bZ[bW.sizset];
  3617.                             break
  3618.                         }
  3619.                         if (bW.nodeType === 1 && !bX) {
  3620.                             bW[A] = b0;
  3621.                             bW.sizset = bU
  3622.                         }
  3623.                         if (bW.nodeName.toLowerCase() === b1) {
  3624.                             bV = bW;
  3625.                             break
  3626.                         }
  3627.                         bW = bW[b2]
  3628.                     }
  3629.                     bZ[bU] = bV
  3630.                 }
  3631.             }
  3632.         }
  3633.         function bP(b2, b1, b0, bZ, bY, bX) {
  3634.             for (var bU = 0, bT = bZ.length; bU < bT; bU++) {
  3635.                 var bW = bZ[bU];
  3636.                 if (bW) {
  3637.                     var bV = false;
  3638.                     bW = bW[b2];
  3639.                     while (bW) {
  3640.                         if (bW[A] === b0) {
  3641.                             bV = bZ[bW.sizset];
  3642.                             break
  3643.                         }
  3644.                         if (bW.nodeType === 1) {
  3645.                             if (!bX) {
  3646.                                 bW[A] = b0;
  3647.                                 bW.sizset = bU
  3648.                             }
  3649.                             if (typeof b1 !== "string") {
  3650.                                 if (bW === b1) {
  3651.                                     bV = true;
  3652.                                     break
  3653.                                 }
  3654.                             } else {
  3655.                                 if (L.filter(b1, [bW]).length > 0) {
  3656.                                     bV = bW;
  3657.                                     break
  3658.                                 }
  3659.                             }
  3660.                         }
  3661.                         bW = bW[b2]
  3662.                     }
  3663.                     bZ[bU] = bV
  3664.                 }
  3665.             }
  3666.         }
  3667.         if (an.documentElement.contains) {
  3668.             L.contains = function (bT, e) {
  3669.                 return bT !== e && (bT.contains ? bT.contains(e) : true)
  3670.             }
  3671.         } else {
  3672.             if (an.documentElement.compareDocumentPosition) {
  3673.                 L.contains = function (bT, e) {
  3674.                     return !! (bT.compareDocumentPosition(e) & 16)
  3675.                 }
  3676.             } else {
  3677.                 L.contains = function () {
  3678.                     return false
  3679.                 }
  3680.             }
  3681.         }
  3682.         L.isXML = function (bT) {
  3683.             var e = (bT ? bT.ownerDocument || bT: 0).documentElement;
  3684.             return e ? e.nodeName !== "HTML": false
  3685.         };
  3686.         var C = function (b0, bZ, bW) {
  3687.             var bV, bX = [],
  3688.             bU = "",
  3689.             bY = bZ.nodeType ? [bZ] : bZ;
  3690.             while ((bV = I.match.PSEUDO.exec(b0))) {
  3691.                 bU += bV[0];
  3692.                 b0 = b0.replace(I.match.PSEUDO, "")
  3693.             }
  3694.             b0 = I.relative[b0] ? b0 + "*": b0;
  3695.             for (var bT = 0, e = bY.length; bT < e; bT++) {
  3696.                 L(b0, bY[bT], bX, bW)
  3697.             }
  3698.             return L.filter(bU, bX)
  3699.         };
  3700.         L.attr = al.attr;
  3701.         L.selectors.attrMap = {};
  3702.         al.find = L;
  3703.         al.expr = L.selectors;
  3704.         al.expr[":"] = al.expr.filters;
  3705.         al.unique = L.uniqueSort;
  3706.         al.text = L.getText;
  3707.         al.isXMLDoc = L.isXML;
  3708.         al.contains = L.contains
  3709.     })();
  3710.     var a3 = /Until$/,
  3711.     aD = /^(?:parents|prevUntil|prevAll)/,
  3712.     bs = /,/,
  3713.     bI = /^.[^:#\[\.,]*$/,
  3714.     ad = Array.prototype.slice,
  3715.     V = al.expr.match.POS,
  3716.     aJ = {
  3717.         children: true,
  3718.         contents: true,
  3719.         next: true,
  3720.         prev: true
  3721.     };
  3722.     al.fn.extend({
  3723.         find: function (x) {
  3724.             var e = this,
  3725.             y, w;
  3726.             if (typeof x !== "string") {
  3727.                 return al(x).filter(function () {
  3728.                     for (y = 0, w = e.length; y < w; y++) {
  3729.                         if (al.contains(e[y], this)) {
  3730.                             return true
  3731.                         }
  3732.                     }
  3733.                 })
  3734.             }
  3735.             var C = this.pushStack("", "find", x),
  3736.             A,
  3737.             B,
  3738.             z;
  3739.             for (y = 0, w = this.length; y < w; y++) {
  3740.                 A = C.length;
  3741.                 al.find(x, this[y], C);
  3742.                 if (y > 0) {
  3743.                     for (B = A; B < C.length; B++) {
  3744.                         for (z = 0; z < A; z++) {
  3745.                             if (C[z] === C[B]) {
  3746.                                 C.splice(B--, 1);
  3747.                                 break
  3748.                             }
  3749.                         }
  3750.                     }
  3751.                 }
  3752.             }
  3753.             return C
  3754.         },
  3755.         has: function (w) {
  3756.             var e = al(w);
  3757.             return this.filter(function () {
  3758.                 for (var y = 0, x = e.length; y < x; y++) {
  3759.                     if (al.contains(this, e[y])) {
  3760.                         return true
  3761.                     }
  3762.                 }
  3763.             })
  3764.         },
  3765.         not: function (e) {
  3766.             return this.pushStack(aQ(this, e, false), "not", e)
  3767.         },
  3768.         filter: function (e) {
  3769.             return this.pushStack(aQ(this, e, true), "filter", e)
  3770.         },
  3771.         is: function (e) {
  3772.             return !! e && (typeof e === "string" ? V.test(e) ? al(e, this.context).index(this[0]) >= 0 : al.filter(e, this).length > 0 : this.filter(e).length > 0)
  3773.         },
  3774.         closest: function (y, w) {
  3775.             var D = [],
  3776.             z,
  3777.             x,
  3778.             C = this[0];
  3779.             if (al.isArray(y)) {
  3780.                 var B = 1;
  3781.                 while (C && C.ownerDocument && C !== w) {
  3782.                     for (z = 0; z < y.length; z++) {
  3783.                         if (al(C).is(y[z])) {
  3784.                             D.push({
  3785.                                 selector: y[z],
  3786.                                 elem: C,
  3787.                                 level: B
  3788.                             })
  3789.                         }
  3790.                     }
  3791.                     C = C.parentNode;
  3792.                     B++
  3793.                 }
  3794.                 return D
  3795.             }
  3796.             var A = V.test(y) || typeof y !== "string" ? al(y, w || this.context) : 0;
  3797.             for (z = 0, x = this.length; z < x; z++) {
  3798.                 C = this[z];
  3799.                 while (C) {
  3800.                     if (A ? A.index(C) > -1 : al.find.matchesSelector(C, y)) {
  3801.                         D.push(C);
  3802.                         break
  3803.                     } else {
  3804.                         C = C.parentNode;
  3805.                         if (!C || !C.ownerDocument || C === w || C.nodeType === 11) {
  3806.                             break
  3807.                         }
  3808.                     }
  3809.                 }
  3810.             }
  3811.             D = D.length > 1 ? al.unique(D) : D;
  3812.             return this.pushStack(D, "closest", y)
  3813.         },
  3814.         index: function (e) {
  3815.             if (!e) {
  3816.                 return (this[0] && this[0].parentNode) ? this.prevAll().length: -1
  3817.             }
  3818.             if (typeof e === "string") {
  3819.                 return al.inArray(this[0], al(e))
  3820.             }
  3821.             return al.inArray(e.jquery ? e[0] : e, this)
  3822.         },
  3823.         add: function (w, e) {
  3824.             var y = typeof w === "string" ? al(w, e) : al.makeArray(w && w.nodeType ? [w] : w),
  3825.             x = al.merge(this.get(), y);
  3826.             return this.pushStack(Q(y[0]) || Q(x[0]) ? x: al.unique(x))
  3827.         },
  3828.         andSelf: function () {
  3829.             return this.add(this.prevObject)
  3830.         }
  3831.     });
  3832.     function Q(e) {
  3833.         return ! e || !e.parentNode || e.parentNode.nodeType === 11
  3834.     }
  3835.     al.each({
  3836.         parent: function (w) {
  3837.             var e = w.parentNode;
  3838.             return e && e.nodeType !== 11 ? e: null
  3839.         },
  3840.         parents: function (e) {
  3841.             return al.dir(e, "parentNode")
  3842.         },
  3843.         parentsUntil: function (w, x, e) {
  3844.             return al.dir(w, "parentNode", e)
  3845.         },
  3846.         next: function (e) {
  3847.             return al.nth(e, 2, "nextSibling")
  3848.         },
  3849.         prev: function (e) {
  3850.             return al.nth(e, 2, "previousSibling")
  3851.         },
  3852.         nextAll: function (e) {
  3853.             return al.dir(e, "nextSibling")
  3854.         },
  3855.         prevAll: function (e) {
  3856.             return al.dir(e, "previousSibling")
  3857.         },
  3858.         nextUntil: function (w, x, e) {
  3859.             return al.dir(w, "nextSibling", e)
  3860.         },
  3861.         prevUntil: function (w, x, e) {
  3862.             return al.dir(w, "previousSibling", e)
  3863.         },
  3864.         siblings: function (e) {
  3865.             return al.sibling(e.parentNode.firstChild, e)
  3866.         },
  3867.         children: function (e) {
  3868.             return al.sibling(e.firstChild)
  3869.         },
  3870.         contents: function (e) {
  3871.             return al.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document: al.makeArray(e.childNodes)
  3872.         }
  3873.     },
  3874.     function (x, w) {
  3875.         al.fn[x] = function (y, e) {
  3876.             var A = al.map(this, w, y),
  3877.             z = ad.call(arguments);
  3878.             if (!a3.test(x)) {
  3879.                 e = y
  3880.             }
  3881.             if (e && typeof e === "string") {
  3882.                 A = al.filter(e, A)
  3883.             }
  3884.             A = this.length > 1 && !aJ[x] ? al.unique(A) : A;
  3885.             if ((this.length > 1 || bs.test(e)) && aD.test(x)) {
  3886.                 A = A.reverse()
  3887.             }
  3888.             return this.pushStack(A, x, z.join(","))
  3889.         }
  3890.     });
  3891.     al.extend({
  3892.         filter: function (w, e, x) {
  3893.             if (x) {
  3894.                 w = ":not(" + w + ")"
  3895.             }
  3896.             return e.length === 1 ? al.find.matchesSelector(e[0], w) ? [e[0]] : [] : al.find.matches(w, e)
  3897.         },
  3898.         dir: function (w, e, z) {
  3899.             var y = [],
  3900.             x = w[e];
  3901.             while (x && x.nodeType !== 9 && (z === ap || x.nodeType !== 1 || !al(x).is(z))) {
  3902.                 if (x.nodeType === 1) {
  3903.                     y.push(x)
  3904.                 }
  3905.                 x = x[e]
  3906.             }
  3907.             return y
  3908.         },
  3909.         nth: function (x, w, A, z) {
  3910.             w = w || 1;
  3911.             var y = 0;
  3912.             for (; x; x = x[A]) {
  3913.                 if (x.nodeType === 1 && ++y === w) {
  3914.                     break
  3915.                 }
  3916.             }
  3917.             return x
  3918.         },
  3919.         sibling: function (x, e) {
  3920.             var w = [];
  3921.             for (; x; x = x.nextSibling) {
  3922.                 if (x.nodeType === 1 && x !== e) {
  3923.                     w.push(x)
  3924.                 }
  3925.             }
  3926.             return w
  3927.         }
  3928.     });
  3929.     function aQ(z, y, x) {
  3930.         y = y || 0;
  3931.         if (al.isFunction(y)) {
  3932.             return al.grep(z, function (A, B) {
  3933.                 var e = !!y.call(A, B, A);
  3934.                 return e === x
  3935.             })
  3936.         } else {
  3937.             if (y.nodeType) {
  3938.                 return al.grep(z, function (e, A) {
  3939.                     return (e === y) === x
  3940.                 })
  3941.             } else {
  3942.                 if (typeof y === "string") {
  3943.                     var w = al.grep(z, function (e) {
  3944.                         return e.nodeType === 1
  3945.                     });
  3946.                     if (bI.test(y)) {
  3947.                         return al.filter(y, w, !x)
  3948.                     } else {
  3949.                         y = al.filter(y, w)
  3950.                     }
  3951.                 }
  3952.             }
  3953.         }
  3954.         return al.grep(z, function (e, A) {
  3955.             return (al.inArray(e, y) >= 0) === x
  3956.         })
  3957.     }
  3958.     function a(w) {
  3959.         var e = a2.split(" "),
  3960.         x = w.createDocumentFragment();
  3961.         if (x.createElement) {
  3962.             while (e.length) {
  3963.                 x.createElement(e.pop())
  3964.             }
  3965.         }
  3966.         return x
  3967.     }
  3968.     var a2 = "abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",
  3969.     av = / jQuery\d+="(?:\d+|null)"/g,
  3970.     aE = /^\s+/,
  3971.     ae = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
  3972.     c = /<([\w:]+)/,
  3973.     u = /<tbody/i,
  3974.     ah = /<|&#?\w+;/,
  3975.     at = /<(?:script|style)/i,
  3976.     ac = /<(?:script|object|embed|option|style)/i,
  3977.     aw = new RegExp("<(?:" + a2.replace(" ", "|") + ")", "i"),
  3978.     m = /checked\s*(?:[^=]|=\s*.checked.)/i,
  3979.     bF = /\/(java|ecma)script/i,
  3980.     a5 = /^\s*<!(?:\[CDATA\[|\-\-)/,
  3981.     aI = {
  3982.         option: [1, "<select multiple='multiple'>", "</select>"],
  3983.         legend: [1, "<fieldset>", "</fieldset>"],
  3984.         thead: [1, "<table>", "</table>"],
  3985.         tr: [2, "<table><tbody>", "</tbody></table>"],
  3986.         td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
  3987.         col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
  3988.         area: [1, "<map>", "</map>"],
  3989.         _default: [0, "", ""]
  3990.     },
  3991.     ao = a(an);
  3992.     aI.optgroup = aI.option;
  3993.     aI.tbody = aI.tfoot = aI.colgroup = aI.caption = aI.thead;
  3994.     aI.th = aI.td;
  3995.     if (!al.support.htmlSerialize) {
  3996.         aI._default = [1, "div<div>", "</div>"]
  3997.     }
  3998.     al.fn.extend({
  3999.         text: function (e) {
  4000.             if (al.isFunction(e)) {
  4001.                 return this.each(function (x) {
  4002.                     var w = al(this);
  4003.                     w.text(e.call(this, x, w.text()))
  4004.                 })
  4005.             }
  4006.             if (typeof e !== "object" && e !== ap) {
  4007.                 return this.empty().append((this[0] && this[0].ownerDocument || an).createTextNode(e))
  4008.             }
  4009.             return al.text(this)
  4010.         },
  4011.         wrapAll: function (e) {
  4012.             if (al.isFunction(e)) {
  4013.                 return this.each(function (x) {
  4014.                     al(this).wrapAll(e.call(this, x))
  4015.                 })
  4016.             }
  4017.             if (this[0]) {
  4018.                 var w = al(e, this[0].ownerDocument).eq(0).clone(true);
  4019.                 if (this[0].parentNode) {
  4020.                     w.insertBefore(this[0])
  4021.                 }
  4022.                 w.map(function () {
  4023.                     var x = this;
  4024.                     while (x.firstChild && x.firstChild.nodeType === 1) {
  4025.                         x = x.firstChild
  4026.                     }
  4027.                     return x
  4028.                 }).append(this)
  4029.             }
  4030.             return this
  4031.         },
  4032.         wrapInner: function (e) {
  4033.             if (al.isFunction(e)) {
  4034.                 return this.each(function (w) {
  4035.                     al(this).wrapInner(e.call(this, w))
  4036.                 })
  4037.             }
  4038.             return this.each(function () {
  4039.                 var w = al(this),
  4040.                 x = w.contents();
  4041.                 if (x.length) {
  4042.                     x.wrapAll(e)
  4043.                 } else {
  4044.                     w.append(e)
  4045.                 }
  4046.             })
  4047.         },
  4048.         wrap: function (e) {
  4049.             return this.each(function () {
  4050.                 al(this).wrapAll(e)
  4051.             })
  4052.         },
  4053.         unwrap: function () {
  4054.             return this.parent().each(function () {
  4055.                 if (!al.nodeName(this, "body")) {
  4056.                     al(this).replaceWith(this.childNodes)
  4057.                 }
  4058.             }).end()
  4059.         },
  4060.         append: function () {
  4061.             return this.domManip(arguments, true, function (e) {
  4062.                 if (this.nodeType === 1) {
  4063.                     this.appendChild(e)
  4064.                 }
  4065.             })
  4066.         },
  4067.         prepend: function () {
  4068.             return this.domManip(arguments, true, function (e) {
  4069.                 if (this.nodeType === 1) {
  4070.                     this.insertBefore(e, this.firstChild)
  4071.                 }
  4072.             })
  4073.         },
  4074.         before: function () {
  4075.             if (this[0] && this[0].parentNode) {
  4076.                 return this.domManip(arguments, false, function (w) {
  4077.                     this.parentNode.insertBefore(w, this)
  4078.                 })
  4079.             } else {
  4080.                 if (arguments.length) {
  4081.                     var e = al(arguments[0]);
  4082.                     e.push.apply(e, this.toArray());
  4083.                     return this.pushStack(e, "before", arguments)
  4084.                 }
  4085.             }
  4086.         },
  4087.         after: function () {
  4088.             if (this[0] && this[0].parentNode) {
  4089.                 return this.domManip(arguments, false, function (w) {
  4090.                     this.parentNode.insertBefore(w, this.nextSibling)
  4091.                 })
  4092.             } else {
  4093.                 if (arguments.length) {
  4094.                     var e = this.pushStack(this, "after", arguments);
  4095.                     e.push.apply(e, al(arguments[0]).toArray());
  4096.                     return e
  4097.                 }
  4098.             }
  4099.         },
  4100.         remove: function (w, e) {
  4101.             for (var x = 0, y;
  4102.             (y = this[x]) != null; x++) {
  4103.                 if (!w || al.filter(w, [y]).length) {
  4104.                     if (!e && y.nodeType === 1) {
  4105.                         al.cleanData(y.getElementsByTagName("*"));
  4106.                         al.cleanData([y])
  4107.                     }
  4108.                     if (y.parentNode) {
  4109.                         y.parentNode.removeChild(y)
  4110.                     }
  4111.                 }
  4112.             }
  4113.             return this
  4114.         },
  4115.         empty: function () {
  4116.             for (var e = 0, w;
  4117.             (w = this[e]) != null; e++) {
  4118.                 if (w.nodeType === 1) {
  4119.                     al.cleanData(w.getElementsByTagName("*"))
  4120.                 }
  4121.                 while (w.firstChild) {
  4122.                     w.removeChild(w.firstChild)
  4123.                 }
  4124.             }
  4125.             return this
  4126.         },
  4127.         clone: function (w, e) {
  4128.             w = w == null ? false: w;
  4129.             e = e == null ? w: e;
  4130.             return this.map(function () {
  4131.                 return al.clone(this, w, e)
  4132.             })
  4133.         },
  4134.         html: function (w) {
  4135.             if (w === ap) {
  4136.                 return this[0] && this[0].nodeType === 1 ? this[0].innerHTML.replace(av, "") : null
  4137.             } else {
  4138.                 if (typeof w === "string" && !at.test(w) && (al.support.leadingWhitespace || !aE.test(w)) && !aI[(c.exec(w) || ["", ""])[1].toLowerCase()]) {
  4139.                     w = w.replace(ae, "<$1></$2>");
  4140.                     try {
  4141.                         for (var y = 0, x = this.length; y < x; y++) {
  4142.                             if (this[y].nodeType === 1) {
  4143.                                 al.cleanData(this[y].getElementsByTagName("*"));
  4144.                                 this[y].innerHTML = w
  4145.                             }
  4146.                         }
  4147.                     } catch(z) {
  4148.                         this.empty().append(w)
  4149.                     }
  4150.                 } else {
  4151.                     if (al.isFunction(w)) {
  4152.                         this.each(function (A) {
  4153.                             var e = al(this);
  4154.                             e.html(w.call(this, A, e.html()))
  4155.                         })
  4156.                     } else {
  4157.                         this.empty().append(w)
  4158.                     }
  4159.                 }
  4160.             }
  4161.             return this
  4162.         },
  4163.         replaceWith: function (e) {
  4164.             if (this[0] && this[0].parentNode) {
  4165.                 if (al.isFunction(e)) {
  4166.                     return this.each(function (y) {
  4167.                         var x = al(this),
  4168.                         w = x.html();
  4169.                         x.replaceWith(e.call(this, y, w))
  4170.                     })
  4171.                 }
  4172.                 if (typeof e !== "string") {
  4173.                     e = al(e).detach()
  4174.                 }
  4175.                 return this.each(function () {
  4176.                     var w = this.nextSibling,
  4177.                     x = this.parentNode;
  4178.                     al(this).remove();
  4179.                     if (w) {
  4180.                         al(w).before(e)
  4181.                     } else {
  4182.                         al(x).append(e)
  4183.                     }
  4184.                 })
  4185.             } else {
  4186.                 return this.length ? this.pushStack(al(al.isFunction(e) ? e() : e), "replaceWith", e) : this
  4187.             }
  4188.         },
  4189.         detach: function (e) {
  4190.             return this.remove(e, true)
  4191.         },
  4192.         domManip: function (F, E, D) {
  4193.             var B, z, C, H, G = F[0],
  4194.             x = [];
  4195.             if (!al.support.checkClone && arguments.length === 3 && typeof G === "string" && m.test(G)) {
  4196.                 return this.each(function () {
  4197.                     al(this).domManip(F, E, D, true)
  4198.                 })
  4199.             }
  4200.             if (al.isFunction(G)) {
  4201.                 return this.each(function (I) {
  4202.                     var e = al(this);
  4203.                     F[0] = G.call(this, I, E ? e.html() : ap);
  4204.                     e.domManip(F, E, D)
  4205.                 })
  4206.             }
  4207.             if (this[0]) {
  4208.                 H = G && G.parentNode;
  4209.                 if (al.support.parentNode && H && H.nodeType === 11 && H.childNodes.length === this.length) {
  4210.                     B = {
  4211.                         fragment: H
  4212.                     }
  4213.                 } else {
  4214.                     B = al.buildFragment(F, this, x)
  4215.                 }
  4216.                 C = B.fragment;
  4217.                 if (C.childNodes.length === 1) {
  4218.                     z = C = C.firstChild
  4219.                 } else {
  4220.                     z = C.firstChild
  4221.                 }
  4222.                 if (z) {
  4223.                     E = E && al.nodeName(z, "tr");
  4224.                     for (var y = 0, w = this.length, A = w - 1; y < w; y++) {
  4225.                         D.call(E ? bt(this[y], z) : this[y], B.cacheable || (w > 1 && y < A) ? al.clone(C, true, true) : C)
  4226.                     }
  4227.                 }
  4228.                 if (x.length) {
  4229.                     al.each(x, bH)
  4230.                 }
  4231.             }
  4232.             return this
  4233.         }
  4234.     });
  4235.     function bt(w, e) {
  4236.         return al.nodeName(w, "table") ? (w.getElementsByTagName("tbody")[0] || w.appendChild(w.ownerDocument.createElement("tbody"))) : w
  4237.     }
  4238.     function r(x, e) {
  4239.         if (e.nodeType !== 1 || !al.hasData(x)) {
  4240.             return
  4241.         }
  4242.         var C, z, w, B = al._data(x),
  4243.         A = al._data(e, B),
  4244.         y = B.events;
  4245.         if (y) {
  4246.             delete A.handle;
  4247.             A.events = {};
  4248.             for (C in y) {
  4249.                 for (z = 0, w = y[C].length; z < w; z++) {
  4250.                     al.event.add(e, C + (y[C][z].namespace ? ".": "") + y[C][z].namespace, y[C][z], y[C][z].data)
  4251.                 }
  4252.             }
  4253.         }
  4254.         if (A.data) {
  4255.             A.data = al.extend({},
  4256.             A.data)
  4257.         }
  4258.     }
  4259.     function ax(w, e) {
  4260.         var x;
  4261.         if (e.nodeType !== 1) {
  4262.             return
  4263.         }
  4264.         if (e.clearAttributes) {
  4265.             e.clearAttributes()
  4266.         }
  4267.         if (e.mergeAttributes) {
  4268.             e.mergeAttributes(w)
  4269.         }
  4270.         x = e.nodeName.toLowerCase();
  4271.         if (x === "object") {
  4272.             e.outerHTML = w.outerHTML
  4273.         } else {
  4274.             if (x === "input" && (w.type === "checkbox" || w.type === "radio")) {
  4275.                 if (w.checked) {
  4276.                     e.defaultChecked = e.checked = w.checked
  4277.                 }
  4278.                 if (e.value !== w.value) {
  4279.                     e.value = w.value
  4280.                 }
  4281.             } else {
  4282.                 if (x === "option") {
  4283.                     e.selected = w.defaultSelected
  4284.                 } else {
  4285.                     if (x === "input" || x === "textarea") {
  4286.                         e.defaultValue = w.defaultValue
  4287.                     }
  4288.                 }
  4289.             }
  4290.         }
  4291.         e.removeAttribute(al.expando)
  4292.     }
  4293.     al.buildFragment = function (x, w, C) {
  4294.         var B, e, y, z, A = x[0];
  4295.         if (w && w[0]) {
  4296.             z = w[0].ownerDocument || w[0]
  4297.         }
  4298.         if (!z.createDocumentFragment) {
  4299.             z = an
  4300.         }
  4301.         if (x.length === 1 && typeof A === "string" && A.length < 512 && z === an && A.charAt(0) === "<" && !ac.test(A) && (al.support.checkClone || !m.test(A)) && (!al.support.unknownElems && aw.test(A))) {
  4302.             e = true;
  4303.             y = al.fragments[A];
  4304.             if (y && y !== 1) {
  4305.                 B = y
  4306.             }
  4307.         }
  4308.         if (!B) {
  4309.             B = z.createDocumentFragment();
  4310.             al.clean(x, z, B, C)
  4311.         }
  4312.         if (e) {
  4313.             al.fragments[A] = y ? B: 1
  4314.         }
  4315.         return {
  4316.             fragment: B,
  4317.             cacheable: e
  4318.         }
  4319.     };
  4320.     al.fragments = {};
  4321.     al.each({
  4322.         appendTo: "append",
  4323.         prependTo: "prepend",
  4324.         insertBefore: "before",
  4325.         insertAfter: "after",
  4326.         replaceAll: "replaceWith"
  4327.     },
  4328.     function (x, w) {
  4329.         al.fn[x] = function (z) {
  4330.             var e = [],
  4331.             C = al(z),
  4332.             B = this.length === 1 && this[0].parentNode;
  4333.             if (B && B.nodeType === 11 && B.childNodes.length === 1 && C.length === 1) {
  4334.                 C[w](this[0]);
  4335.                 return this
  4336.             } else {
  4337.                 for (var A = 0, y = C.length; A < y; A++) {
  4338.                     var D = (A > 0 ? this.clone(true) : this).get();
  4339.                     al(C[A])[w](D);
  4340.                     e = e.concat(D)
  4341.                 }
  4342.                 return this.pushStack(e, x, C.selector)
  4343.             }
  4344.         }
  4345.     });
  4346.     function by(e) {
  4347.         if (typeof e.getElementsByTagName !== "undefined") {
  4348.             return e.getElementsByTagName("*")
  4349.         } else {
  4350.             if (typeof e.querySelectorAll !== "undefined") {
  4351.                 return e.querySelectorAll("*")
  4352.             } else {
  4353.                 return []
  4354.             }
  4355.         }
  4356.     }
  4357.     function aK(e) {
  4358.         if (e.type === "checkbox" || e.type === "radio") {
  4359.             e.defaultChecked = e.checked
  4360.         }
  4361.     }
  4362.     function S(w) {
  4363.         var e = (w.nodeName || "").toLowerCase();
  4364.         if (e === "input") {
  4365.             aK(w)
  4366.         } else {
  4367.             if (e !== "script" && typeof w.getElementsByTagName !== "undefined") {
  4368.                 al.grep(w.getElementsByTagName("input"), aK)
  4369.             }
  4370.         }
  4371.     }
  4372.     al.extend({
  4373.         clone: function (x, w, B) {
  4374.             var A = x.cloneNode(true),
  4375.             e,
  4376.             y,
  4377.             z;
  4378.             if ((!al.support.noCloneEvent || !al.support.noCloneChecked) && (x.nodeType === 1 || x.nodeType === 11) && !al.isXMLDoc(x)) {
  4379.                 ax(x, A);
  4380.                 e = by(x);
  4381.                 y = by(A);
  4382.                 for (z = 0; e[z]; ++z) {
  4383.                     if (y[z]) {
  4384.                         ax(e[z], y[z])
  4385.                     }
  4386.                 }
  4387.             }
  4388.             if (w) {
  4389.                 r(x, A);
  4390.                 if (B) {
  4391.                     e = by(x);
  4392.                     y = by(A);
  4393.                     for (z = 0; e[z]; ++z) {
  4394.                         r(e[z], y[z])
  4395.                     }
  4396.                 }
  4397.             }
  4398.             e = y = null;
  4399.             return A
  4400.         },
  4401.         clean: function (M, L, K, J) {
  4402.             var I;
  4403.             L = L || an;
  4404.             if (typeof L.createElement === "undefined") {
  4405.                 L = L.ownerDocument || L[0] && L[0].ownerDocument || an
  4406.             }
  4407.             var H = [],
  4408.             C;
  4409.             for (var F = 0, z;
  4410.             (z = M[F]) != null; F++) {
  4411.                 if (typeof z === "number") {
  4412.                     z += ""
  4413.                 }
  4414.                 if (!z) {
  4415.                     continue
  4416.                 }
  4417.                 if (typeof z === "string") {
  4418.                     if (!ah.test(z)) {
  4419.                         z = L.createTextNode(z)
  4420.                     } else {
  4421.                         z = z.replace(ae, "<$1></$2>");
  4422.                         var G = (c.exec(z) || ["", ""])[1].toLowerCase(),
  4423.                         x = aI[G] || aI._default,
  4424.                         E = x[0],
  4425.                         w = L.createElement("div");
  4426.                         if (L === an) {
  4427.                             ao.appendChild(w)
  4428.                         } else {
  4429.                             a(L).appendChild(w)
  4430.                         }
  4431.                         w.innerHTML = x[1] + z + x[2];
  4432.                         while (E--) {
  4433.                             w = w.lastChild
  4434.                         }
  4435.                         if (!al.support.tbody) {
  4436.                             var B = u.test(z),
  4437.                             D = G === "table" && !B ? w.firstChild && w.firstChild.childNodes: x[1] === "<table>" && !B ? w.childNodes: [];
  4438.                             for (C = D.length - 1; C >= 0; --C) {
  4439.                                 if (al.nodeName(D[C], "tbody") && !D[C].childNodes.length) {
  4440.                                     D[C].parentNode.removeChild(D[C])
  4441.                                 }
  4442.                             }
  4443.                         }
  4444.                         if (!al.support.leadingWhitespace && aE.test(z)) {
  4445.                             w.insertBefore(L.createTextNode(aE.exec(z)[0]), w.firstChild)
  4446.                         }
  4447.                         z = w.childNodes
  4448.                     }
  4449.                 }
  4450.                 var A;
  4451.                 if (!al.support.appendChecked) {
  4452.                     if (z[0] && typeof(A = z.length) === "number") {
  4453.                         for (C = 0; C < A; C++) {
  4454.                             S(z[C])
  4455.                         }
  4456.                     } else {
  4457.                         S(z)
  4458.                     }
  4459.                 }
  4460.                 if (z.nodeType) {
  4461.                     H.push(z)
  4462.                 } else {
  4463.                     H = al.merge(H, z)
  4464.                 }
  4465.             }
  4466.             if (K) {
  4467.                 I = function (e) {
  4468.                     return ! e.type || bF.test(e.type)
  4469.                 };
  4470.                 for (F = 0; H[F]; F++) {
  4471.                     if (J && al.nodeName(H[F], "script") && (!H[F].type || H[F].type.toLowerCase() === "text/javascript")) {
  4472.                         J.push(H[F].parentNode ? H[F].parentNode.removeChild(H[F]) : H[F])
  4473.                     } else {
  4474.                         if (H[F].nodeType === 1) {
  4475.                             var y = al.grep(H[F].getElementsByTagName("script"), I);
  4476.                             H.splice.apply(H, [F + 1, 0].concat(y))
  4477.                         }
  4478.                         K.appendChild(H[F])
  4479.                     }
  4480.                 }
  4481.             }
  4482.             return H
  4483.         },
  4484.         cleanData: function (D) {
  4485.             var C, w, e = al.cache,
  4486.             A = al.event.special,
  4487.             z = al.support.deleteExpando;
  4488.             for (var y = 0, x;
  4489.             (x = D[y]) != null; y++) {
  4490.                 if (x.nodeName && al.noData[x.nodeName.toLowerCase()]) {
  4491.                     continue
  4492.                 }
  4493.                 w = x[al.expando];
  4494.                 if (w) {
  4495.                     C = e[w];
  4496.                     if (C && C.events) {
  4497.                         for (var B in C.events) {
  4498.                             if (A[B]) {
  4499.                                 al.event.remove(x, B)
  4500.                             } else {
  4501.                                 al.removeEvent(x, B, C.handle)
  4502.                             }
  4503.                         }
  4504.                         if (C.handle) {
  4505.                             C.handle.elem = null
  4506.                         }
  4507.                     }
  4508.                     if (z) {
  4509.                         delete x[al.expando]
  4510.                     } else {
  4511.                         if (x.removeAttribute) {
  4512.                             x.removeAttribute(al.expando)
  4513.                         }
  4514.                     }
  4515.                     delete e[w]
  4516.                 }
  4517.             }
  4518.         }
  4519.     });
  4520.     function bH(w, e) {
  4521.         if (e.src) {
  4522.             al.ajax({
  4523.                 url: e.src,
  4524.                 async: false,
  4525.                 dataType: "script"
  4526.             })
  4527.         } else {
  4528.             al.globalEval((e.text || e.textContent || e.innerHTML || "").replace(a5, "/*$0*/"))
  4529.         }
  4530.         if (e.parentNode) {
  4531.             e.parentNode.removeChild(e)
  4532.         }
  4533.     }
  4534.     var a1 = /alpha\([^)]*\)/i,
  4535.     aG = /opacity=([^)]*)/,
  4536.     O = /([A-Z]|^ms)/g,
  4537.     bu = /^-?\d+(?:px)?$/i,
  4538.     bG = /^-?\d/,
  4539.     W = /^([\-+])=([\-+.\de]+)/,
  4540.     bq = {
  4541.         position: "absolute",
  4542.         visibility: "hidden",
  4543.         display: "block"
  4544.     },
  4545.     aA = ["Left", "Right"],
  4546.     bl = ["Top", "Bottom"],
  4547.     ak,
  4548.     aT,
  4549.     bh;
  4550.     al.fn.css = function (x, w) {
  4551.         if (arguments.length === 2 && w === ap) {
  4552.             return this
  4553.         }
  4554.         return al.access(this, x, w, true, function (y, e, z) {
  4555.             return z !== ap ? al.style(y, e, z) : al.css(y, e)
  4556.         })
  4557.     };
  4558.     al.extend({
  4559.         cssHooks: {
  4560.             opacity: {
  4561.                 get: function (w, e) {
  4562.                     if (e) {
  4563.                         var x = ak(w, "opacity", "opacity");
  4564.                         return x === "" ? "1": x
  4565.                     } else {
  4566.                         return w.style.opacity
  4567.                     }
  4568.                 }
  4569.             }
  4570.         },
  4571.         cssNumber: {
  4572.             fillOpacity: true,
  4573.             fontWeight: true,
  4574.             lineHeight: true,
  4575.             opacity: true,
  4576.             orphans: true,
  4577.             widows: true,
  4578.             zIndex: true,
  4579.             zoom: true
  4580.         },
  4581.         cssProps: {
  4582.             "float": al.support.cssFloat ? "cssFloat": "styleFloat"
  4583.         },
  4584.         style: function (E, D, B, A) {
  4585.             if (!E || E.nodeType === 3 || E.nodeType === 8 || !E.style) {
  4586.                 return
  4587.             }
  4588.             var x, C, y = al.camelCase(D),
  4589.             w = E.style,
  4590.             F = al.cssHooks[y];
  4591.             D = al.cssProps[y] || y;
  4592.             if (B !== ap) {
  4593.                 C = typeof B;
  4594.                 if (C === "string" && (x = W.exec(B))) {
  4595.                     B = ( + (x[1] + 1) * +x[2]) + parseFloat(al.css(E, D));
  4596.                     C = "number"
  4597.                 }
  4598.                 if (B == null || C === "number" && isNaN(B)) {
  4599.                     return
  4600.                 }
  4601.                 if (C === "number" && !al.cssNumber[y]) {
  4602.                     B += "px"
  4603.                 }
  4604.                 if (!F || !("set" in F) || (B = F.set(E, B)) !== ap) {
  4605.                     try {
  4606.                         w[D] = B
  4607.                     } catch(z) {}
  4608.                 }
  4609.             } else {
  4610.                 if (F && "get" in F && (x = F.get(E, false, A)) !== ap) {
  4611.                     return x
  4612.                 }
  4613.                 return w[D]
  4614.             }
  4615.         },
  4616.         css: function (x, w, z) {
  4617.             var y, e;
  4618.             w = al.camelCase(w);
  4619.             e = al.cssHooks[w];
  4620.             w = al.cssProps[w] || w;
  4621.             if (w === "cssFloat") {
  4622.                 w = "float"
  4623.             }
  4624.             if (e && "get" in e && (y = e.get(x, true, z)) !== ap) {
  4625.                 return y
  4626.             } else {
  4627.                 if (ak) {
  4628.                     return ak(x, w)
  4629.                 }
  4630.             }
  4631.         },
  4632.         swap: function (x, w, A) {
  4633.             var z = {};
  4634.             for (var y in w) {
  4635.                 z[y] = x.style[y];
  4636.                 x.style[y] = w[y]
  4637.             }
  4638.             A.call(x);
  4639.             for (y in w) {
  4640.                 x.style[y] = z[y]
  4641.             }
  4642.         }
  4643.     });
  4644.     al.curCSS = al.css;
  4645.     al.each(["height", "width"], function (w, x) {
  4646.         al.cssHooks[x] = {
  4647.             get: function (y, e, A) {
  4648.                 var z;
  4649.                 if (e) {
  4650.                     if (y.offsetWidth !== 0) {
  4651.                         return n(y, x, A)
  4652.                     } else {
  4653.                         al.swap(y, bq, function () {
  4654.                             z = n(y, x, A)
  4655.                         })
  4656.                     }
  4657.                     return z
  4658.                 }
  4659.             },
  4660.             set: function (y, e) {
  4661.                 if (bu.test(e)) {
  4662.                     e = parseFloat(e);
  4663.                     if (e >= 0) {
  4664.                         return e + "px"
  4665.                     }
  4666.                 } else {
  4667.                     return e
  4668.                 }
  4669.             }
  4670.         }
  4671.     });
  4672.     if (!al.support.opacity) {
  4673.         al.cssHooks.opacity = {
  4674.             get: function (w, e) {
  4675.                 return aG.test((e && w.currentStyle ? w.currentStyle.filter: w.style.filter) || "") ? (parseFloat(RegExp.$1) / 100) + "": e ? "1": ""
  4676.             },
  4677.             set: function (w, e) {
  4678.                 var A = w.style,
  4679.                 y = w.currentStyle,
  4680.                 x = al.isNumeric(e) ? "alpha(opacity=" + e * 100 + ")": "",
  4681.                 z = y && y.filter || A.filter || "";
  4682.                 A.zoom = 1;
  4683.                 if (e >= 1 && al.trim(z.replace(a1, "")) === "") {
  4684.                     A.removeAttribute("filter");
  4685.                     if (y && !y.filter) {
  4686.                         return
  4687.                     }
  4688.                 }
  4689.                 A.filter = a1.test(z) ? z.replace(a1, x) : z + " " + x
  4690.             }
  4691.         }
  4692.     }
  4693.     al(function () {
  4694.         if (!al.support.reliableMarginRight) {
  4695.             al.cssHooks.marginRight = {
  4696.                 get: function (w, e) {
  4697.                     var x;
  4698.                     al.swap(w, {
  4699.                         display: "inline-block"
  4700.                     },
  4701.                     function () {
  4702.                         if (e) {
  4703.                             x = ak(w, "margin-right", "marginRight")
  4704.                         } else {
  4705.                             x = w.style.marginRight
  4706.                         }
  4707.                     });
  4708.                     return x
  4709.                 }
  4710.             }
  4711.         }
  4712.     });
  4713.     if (an.defaultView && an.defaultView.getComputedStyle) {
  4714.         aT = function (w, e) {
  4715.             var z, y, x;
  4716.             e = e.replace(O, "-$1").toLowerCase();
  4717.             if (! (y = w.ownerDocument.defaultView)) {
  4718.                 return ap
  4719.             }
  4720.             if ((x = y.getComputedStyle(w, null))) {
  4721.                 z = x.getPropertyValue(e);
  4722.                 if (z === "" && !al.contains(w.ownerDocument.documentElement, w)) {
  4723.                     z = al.style(w, e)
  4724.                 }
  4725.             }
  4726.             return z
  4727.         }
  4728.     }
  4729.     if (an.documentElement.currentStyle) {
  4730.         bh = function (x, w) {
  4731.             var B, e, A, y = x.currentStyle && x.currentStyle[w],
  4732.             z = x.style;
  4733.             if (y === null && z && (A = z[w])) {
  4734.                 y = A
  4735.             }
  4736.             if (!bu.test(y) && bG.test(y)) {
  4737.                 B = z.left;
  4738.                 e = x.runtimeStyle && x.runtimeStyle.left;
  4739.                 if (e) {
  4740.                     x.runtimeStyle.left = x.currentStyle.left
  4741.                 }
  4742.                 z.left = w === "fontSize" ? "1em": (y || 0);
  4743.                 y = z.pixelLeft + "px";
  4744.                 z.left = B;
  4745.                 if (e) {
  4746.                     x.runtimeStyle.left = e
  4747.                 }
  4748.             }
  4749.             return y === "" ? "auto": y
  4750.         }
  4751.     }
  4752.     ak = aT || bh;
  4753.     function n(w, e, z) {
  4754.         var y = e === "width" ? w.offsetWidth: w.offsetHeight,
  4755.         x = e === "width" ? aA: bl;
  4756.         if (y > 0) {
  4757.             if (z !== "border") {
  4758.                 al.each(x, function () {
  4759.                     if (!z) {
  4760.                         y -= parseFloat(al.css(w, "padding" + this)) || 0
  4761.                     }
  4762.                     if (z === "margin") {
  4763.                         y += parseFloat(al.css(w, z + this)) || 0
  4764.                     } else {
  4765.                         y -= parseFloat(al.css(w, "border" + this + "Width")) || 0
  4766.                     }
  4767.                 })
  4768.             }
  4769.             return y + "px"
  4770.         }
  4771.         y = ak(w, e, e);
  4772.         if (y < 0 || y == null) {
  4773.             y = w.style[e] || 0
  4774.         }
  4775.         y = parseFloat(y) || 0;
  4776.         if (z) {
  4777.             al.each(x, function () {
  4778.                 y += parseFloat(al.css(w, "padding" + this)) || 0;
  4779.                 if (z !== "padding") {
  4780.                     y += parseFloat(al.css(w, "border" + this + "Width")) || 0
  4781.                 }
  4782.                 if (z === "margin") {
  4783.                     y += parseFloat(al.css(w, z + this)) || 0
  4784.                 }
  4785.             })
  4786.         }
  4787.         return y + "px"
  4788.     }
  4789.     if (al.expr && al.expr.filters) {
  4790.         al.expr.filters.hidden = function (x) {
  4791.             var w = x.offsetWidth,
  4792.             e = x.offsetHeight;
  4793.             return (w === 0 && e === 0) || (!al.support.reliableHiddenOffsets && ((x.style && x.style.display) || al.css(x, "display")) === "none")
  4794.         };
  4795.         al.expr.filters.visible = function (e) {
  4796.             return ! al.expr.filters.hidden(e)
  4797.         }
  4798.     }
  4799.     var a0 = / /g,
  4800.     aC = /\[\]$/,
  4801.     bL = /\r?\n/g,
  4802.     bJ = /#.*$/,
  4803.     aN = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg,
  4804.     bj = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
  4805.     a4 = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
  4806.     ba = /^(?:GET|HEAD)$/,
  4807.     b = /^\/\//,
  4808.     Z = /\?/,
  4809.     bp = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
  4810.     o = /^(?:select|textarea)/i,
  4811.     g = /\s+/,
  4812.     bK = /([?&])_=[^&]*/,
  4813.     Y = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
  4814.     P = al.fn.load,
  4815.     am = {},
  4816.     p = {},
  4817.     aO, q, bf = ["*/"] + ["*"];
  4818.     try {
  4819.         aO = bE.href
  4820.     } catch(aH) {
  4821.         aO = an.createElement("a");
  4822.         aO.href = "";
  4823.         aO = aO.href
  4824.     }
  4825.     q = Y.exec(aO.toLowerCase()) || [];
  4826.     function d(e) {
  4827.         return function (x, w) {
  4828.             if (typeof x !== "string") {
  4829.                 w = x;
  4830.                 x = "*"
  4831.             }
  4832.             if (al.isFunction(w)) {
  4833.                 var D = x.toLowerCase().split(g),
  4834.                 z = 0,
  4835.                 A = D.length,
  4836.                 y,
  4837.                 B,
  4838.                 C;
  4839.                 for (; z < A; z++) {
  4840.                     y = D[z];
  4841.                     C = /^\+/.test(y);
  4842.                     if (C) {
  4843.                         y = y.substr(1) || "*"
  4844.                     }
  4845.                     B = e[y] = e[y] || [];
  4846.                     B[C ? "unshift": "push"](w)
  4847.                 }
  4848.             }
  4849.         }
  4850.     }
  4851.     function bg(F, E, D, C, B, A) {
  4852.         B = B || E.dataTypes[0];
  4853.         A = A || {};
  4854.         A[B] = true;
  4855.         var z = F[B],
  4856.         x = 0,
  4857.         w = z ? z.length: 0,
  4858.         y = (F === am),
  4859.         G;
  4860.         for (; x < w && (y || !G); x++) {
  4861.             G = z[x](E, D, C);
  4862.             if (typeof G === "string") {
  4863.                 if (!y || A[G]) {
  4864.                     G = ap
  4865.                 } else {
  4866.                     E.dataTypes.unshift(G);
  4867.                     G = bg(F, E, D, C, G, A)
  4868.                 }
  4869.             }
  4870.         }
  4871.         if ((y || !G) && !A["*"]) {
  4872.             G = bg(F, E, D, C, "*", A)
  4873.         }
  4874.         return G
  4875.     }
  4876.     function az(x, e) {
  4877.         var z, w, y = al.ajaxSettings.flatOptions || {};
  4878.         for (z in e) {
  4879.             if (e[z] !== ap) { (y[z] ? x: (w || (w = {})))[z] = e[z]
  4880.             }
  4881.         }
  4882.         if (w) {
  4883.             al.extend(true, x, w)
  4884.         }
  4885.     }
  4886.     al.fn.extend({
  4887.         load: function (C, B, A) {
  4888.             if (typeof C !== "string" && P) {
  4889.                 return P.apply(this, arguments)
  4890.             } else {
  4891.                 if (!this.length) {
  4892.                     return this
  4893.                 }
  4894.             }
  4895.             var z = C.indexOf(" ");
  4896.             if (z >= 0) {
  4897.                 var y = C.slice(z, C.length);
  4898.                 C = C.slice(0, z)
  4899.             }
  4900.             var x = "GET";
  4901.             if (B) {
  4902.                 if (al.isFunction(B)) {
  4903.                     A = B;
  4904.                     B = ap
  4905.                 } else {
  4906.                     if (typeof B === "object") {
  4907.                         B = al.param(B, al.ajaxSettings.traditional);
  4908.                         x = "POST"
  4909.                     }
  4910.                 }
  4911.             }
  4912.             var w = this;
  4913.             al.ajax({
  4914.                 url: C,
  4915.                 type: x,
  4916.                 dataType: "html",
  4917.                 data: B,
  4918.                 complete: function (D, e, E) {
  4919.                     E = D.responseText;
  4920.                     if (D.isResolved()) {
  4921.                         D.done(function (F) {
  4922.                             E = F
  4923.                         });
  4924.                         w.html(y ? al("<div>").append(E.replace(bp, "")).find(y) : E)
  4925.                     }
  4926.                     if (A) {
  4927.                         w.each(A, [E, e, D])
  4928.                     }
  4929.                 }
  4930.             });
  4931.             return this
  4932.         },
  4933.         serialize: function () {
  4934.             return al.param(this.serializeArray())
  4935.         },
  4936.         serializeArray: function () {
  4937.             return this.map(function () {
  4938.                 return this.elements ? al.makeArray(this.elements) : this
  4939.             }).filter(function () {
  4940.                 return this.name && !this.disabled && (this.checked || o.test(this.nodeName) || bj.test(this.type))
  4941.             }).map(function (w, e) {
  4942.                 var x = al(this).val();
  4943.                 return x == null ? null: al.isArray(x) ? al.map(x, function (y, z) {
  4944.                     return {
  4945.                         name: e.name,
  4946.                         value: y.replace(bL, "\r\n")
  4947.                     }
  4948.                 }) : {
  4949.                     name: e.name,
  4950.                     value: x.replace(bL, "\r\n")
  4951.                 }
  4952.             }).get()
  4953.         }
  4954.     });
  4955.     al.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function (e, w) {
  4956.         al.fn[w] = function (x) {
  4957.             return this.bind(w, x)
  4958.         }
  4959.     });
  4960.     al.each(["get", "post"], function (w, x) {
  4961.         al[x] = function (y, e, A, z) {
  4962.             if (al.isFunction(e)) {
  4963.                 z = z || A;
  4964.                 A = e;
  4965.                 e = ap
  4966.             }
  4967.             return al.ajax({
  4968.                 type: x,
  4969.                 url: y,
  4970.                 data: e,
  4971.                 success: A,
  4972.                 dataType: z
  4973.             })
  4974.         }
  4975.     });
  4976.     al.extend({
  4977.         getScript: function (w, e) {
  4978.             return al.get(w, ap, e, "script")
  4979.         },
  4980.         getJSON: function (w, e, x) {
  4981.             return al.get(w, e, x, "json")
  4982.         },
  4983.         ajaxSetup: function (w, e) {
  4984.             if (e) {
  4985.                 az(w, al.ajaxSettings)
  4986.             } else {
  4987.                 e = w;
  4988.                 w = al.ajaxSettings
  4989.             }
  4990.             az(w, e);
  4991.             return w
  4992.         },
  4993.         ajaxSettings: {
  4994.             url: aO,
  4995.             isLocal: a4.test(q[1]),
  4996.             global: true,
  4997.             type: "GET",
  4998.             contentType: "application/x-www-form-urlencoded",
  4999.             processData: true,
  5000.             async: true,
  5001.             accepts: {
  5002.                 xml: "application/xml, text/xml",
  5003.                 html: "text/html",
  5004.                 text: "text/plain",
  5005.                 json: "application/json, text/javascript",
  5006.                 "*": bf
  5007.             },
  5008.             contents: {
  5009.                 xml: /xml/,
  5010.                 html: /html/,
  5011.                 json: /json/
  5012.             },
  5013.             responseFields: {
  5014.                 xml: "responseXML",
  5015.                 text: "responseText"
  5016.             },
  5017.             converters: {
  5018.                 "* text": aq.String,
  5019.                 "text html": true,
  5020.                 "text json": al.parseJSON,
  5021.                 "text xml": al.parseXML
  5022.             },
  5023.             flatOptions: {
  5024.                 context: true,
  5025.                 url: true
  5026.             }
  5027.         },
  5028.         ajaxPrefilter: d(am),
  5029.         ajaxTransport: d(p),
  5030.         ajax: function (L, K) {
  5031.             if (typeof L === "object") {
  5032.                 K = L;
  5033.                 L = ap
  5034.             }
  5035.             K = K || {};
  5036.             var B = al.ajaxSetup({},
  5037.             K),
  5038.             bU = B.context || B,
  5039.             E = bU !== B && (bU.nodeType || bU instanceof al) ? al(bU) : al.event,
  5040.             bT = al.Deferred(),
  5041.             bP = al.Callbacks("once memory"),
  5042.             z = B.statusCode || {},
  5043.             A,
  5044.             F = {},
  5045.             bQ = {},
  5046.             bS,
  5047.             x,
  5048.             M,
  5049.             C,
  5050.             G,
  5051.             y = 0,
  5052.             w,
  5053.             J,
  5054.             H = {
  5055.                 readyState: 0,
  5056.                 setRequestHeader: function (bV, e) {
  5057.                     if (!y) {
  5058.                         var bW = bV.toLowerCase();
  5059.                         bV = bQ[bW] = bQ[bW] || bV;
  5060.                         F[bV] = e
  5061.                     }
  5062.                     return this
  5063.                 },
  5064.                 getAllResponseHeaders: function () {
  5065.                     return y === 2 ? bS: null
  5066.                 },
  5067.                 getResponseHeader: function (bV) {
  5068.                     var e;
  5069.                     if (y === 2) {
  5070.                         if (!x) {
  5071.                             x = {};
  5072.                             while ((e = aN.exec(bS))) {
  5073.                                 x[e[1].toLowerCase()] = e[2]
  5074.                             }
  5075.                         }
  5076.                         e = x[bV.toLowerCase()]
  5077.                     }
  5078.                     return e === ap ? null: e
  5079.                 },
  5080.                 overrideMimeType: function (e) {
  5081.                     if (!y) {
  5082.                         B.mimeType = e
  5083.                     }
  5084.                     return this
  5085.                 },
  5086.                 abort: function (e) {
  5087.                     e = e || "abort";
  5088.                     if (M) {
  5089.                         M.abort(e)
  5090.                     }
  5091.                     D(0, e);
  5092.                     return this
  5093.                 }
  5094.             };
  5095.             function D(b5, b4, b2, b1) {
  5096.                 if (y === 2) {
  5097.                     return
  5098.                 }
  5099.                 y = 2;
  5100.                 if (C) {
  5101.                     clearTimeout(C)
  5102.                 }
  5103.                 M = ap;
  5104.                 bS = b1 || "";
  5105.                 H.readyState = b5 > 0 ? 4 : 0;
  5106.                 var bY, b6, b3, bW = b4,
  5107.                 bX = b2 ? bC(B, H, b2) : ap,
  5108.                 bV,
  5109.                 b0;
  5110.                 if (b5 >= 200 && b5 < 300 || b5 === 304) {
  5111.                     if (B.ifModified) {
  5112.                         if ((bV = H.getResponseHeader("Last-Modified"))) {
  5113.                             al.lastModified[A] = bV
  5114.                         }
  5115.                         if ((b0 = H.getResponseHeader("Etag"))) {
  5116.                             al.etag[A] = b0
  5117.                         }
  5118.                     }
  5119.                     if (b5 === 304) {
  5120.                         bW = "notmodified";
  5121.                         bY = true
  5122.                     } else {
  5123.                         try {
  5124.                             b6 = U(B, bX);
  5125.                             bW = "success";
  5126.                             bY = true
  5127.                         } catch(bZ) {
  5128.                             bW = "parsererror";
  5129.                             b3 = bZ
  5130.                         }
  5131.                     }
  5132.                 } else {
  5133.                     b3 = bW;
  5134.                     if (!bW || b5) {
  5135.                         bW = "error";
  5136.                         if (b5 < 0) {
  5137.                             b5 = 0
  5138.                         }
  5139.                     }
  5140.                 }
  5141.                 H.status = b5;
  5142.                 H.statusText = "" + (b4 || bW);
  5143.                 if (bY) {
  5144.                     bT.resolveWith(bU, [b6, bW, H])
  5145.                 } else {
  5146.                     bT.rejectWith(bU, [H, bW, b3])
  5147.                 }
  5148.                 H.statusCode(z);
  5149.                 z = ap;
  5150.                 if (w) {
  5151.                     E.trigger("ajax" + (bY ? "Success": "Error"), [H, B, bY ? b6: b3])
  5152.                 }
  5153.                 bP.fireWith(bU, [H, bW]);
  5154.                 if (w) {
  5155.                     E.trigger("ajaxComplete", [H, B]);
  5156.                     if (! (--al.active)) {
  5157.                         al.event.trigger("ajaxStop")
  5158.                     }
  5159.                 }
  5160.             }
  5161.             bT.promise(H);
  5162.             H.success = H.done;
  5163.             H.error = H.fail;
  5164.             H.complete = bP.add;
  5165.             H.statusCode = function (bV) {
  5166.                 if (bV) {
  5167.                     var e;
  5168.                     if (y < 2) {
  5169.                         for (e in bV) {
  5170.                             z[e] = [z[e], bV[e]]
  5171.                         }
  5172.                     } else {
  5173.                         e = bV[H.status];
  5174.                         H.then(e, e)
  5175.                     }
  5176.                 }
  5177.                 return this
  5178.             };
  5179.             B.url = ((L || B.url) + "").replace(bJ, "").replace(b, q[1] + "//");
  5180.             B.dataTypes = al.trim(B.dataType || "*").toLowerCase().split(g);
  5181.             if (B.crossDomain == null) {
  5182.                 G = Y.exec(B.url.toLowerCase());
  5183.                 B.crossDomain = !!(G && (G[1] != q[1] || G[2] != q[2] || (G[3] || (G[1] === "http:" ? 80 : 443)) != (q[3] || (q[1] === "http:" ? 80 : 443))))
  5184.             }
  5185.             if (B.data && B.processData && typeof B.data !== "string") {
  5186.                 B.data = al.param(B.data, B.traditional)
  5187.             }
  5188.             bg(am, B, K, H);
  5189.             if (y === 2) {
  5190.                 return false
  5191.             }
  5192.             w = B.global;
  5193.             B.type = B.type.toUpperCase();
  5194.             B.hasContent = !ba.test(B.type);
  5195.             if (w && al.active++===0) {
  5196.                 al.event.trigger("ajaxStart")
  5197.             }
  5198.             if (!B.hasContent) {
  5199.                 if (B.data) {
  5200.                     B.url += (Z.test(B.url) ? "&": "?") + B.data;
  5201.                     delete B.data
  5202.                 }
  5203.                 A = B.url;
  5204.                 if (B.cache === false) {
  5205.                     var I = al.now(),
  5206.                     bR = B.url.replace(bK, "$1_=" + I);
  5207.                     B.url = bR + ((bR === B.url) ? (Z.test(B.url) ? "&": "?") + "_=" + I: "")
  5208.                 }
  5209.             }
  5210.             if (B.data && B.hasContent && B.contentType !== false || K.contentType) {
  5211.                 H.setRequestHeader("Content-Type", B.contentType)
  5212.             }
  5213.             if (B.ifModified) {
  5214.                 A = A || B.url;
  5215.                 if (al.lastModified[A]) {
  5216.                     H.setRequestHeader("If-Modified-Since", al.lastModified[A])
  5217.                 }
  5218.                 if (al.etag[A]) {
  5219.                     H.setRequestHeader("If-None-Match", al.etag[A])
  5220.                 }
  5221.             }
  5222.             H.setRequestHeader("Accept", B.dataTypes[0] && B.accepts[B.dataTypes[0]] ? B.accepts[B.dataTypes[0]] + (B.dataTypes[0] !== "*" ? ", " + bf + "; q=0.01": "") : B.accepts["*"]);
  5223.             for (J in B.headers) {
  5224.                 H.setRequestHeader(J, B.headers[J])
  5225.             }
  5226.             if (B.beforeSend && (B.beforeSend.call(bU, H, B) === false || y === 2)) {
  5227.                 H.abort();
  5228.                 return false
  5229.             }
  5230.             for (J in {
  5231.                 success: 1,
  5232.                 error: 1,
  5233.                 complete: 1
  5234.             }) {
  5235.                 H[J](B[J])
  5236.             }
  5237.             M = bg(p, B, K, H);
  5238.             if (!M) {
  5239.                 D( - 1, "No Transport")
  5240.             } else {
  5241.                 H.readyState = 1;
  5242.                 if (w) {
  5243.                     E.trigger("ajaxSend", [H, B])
  5244.                 }
  5245.                 if (B.async && B.timeout > 0) {
  5246.                     C = setTimeout(function () {
  5247.                         H.abort("timeout")
  5248.                     },
  5249.                     B.timeout)
  5250.                 }
  5251.                 try {
  5252.                     y = 1;
  5253.                     M.send(F, D)
  5254.                 } catch(bO) {
  5255.                     if (y < 2) {
  5256.                         D( - 1, bO)
  5257.                     } else {
  5258.                         al.error(bO)
  5259.                     }
  5260.                 }
  5261.             }
  5262.             return H
  5263.         },
  5264.         param: function (e, z) {
  5265.             var w = [],
  5266.             x = function (B, A) {
  5267.                 A = al.isFunction(A) ? A() : A;
  5268.                 w[w.length] = encodeURIComponent(B) + "=" + encodeURIComponent(A)
  5269.             };
  5270.             if (z === ap) {
  5271.                 z = al.ajaxSettings.traditional
  5272.             }
  5273.             if (al.isArray(e) || (e.jquery && !al.isPlainObject(e))) {
  5274.                 al.each(e, function () {
  5275.                     x(this.name, this.value)
  5276.                 })
  5277.             } else {
  5278.                 for (var y in e) {
  5279.                     t(y, e[y], z, x)
  5280.                 }
  5281.             }
  5282.             return w.join("&").replace(a0, "+")
  5283.         }
  5284.     });
  5285.     function t(x, w, A, z) {
  5286.         if (al.isArray(w)) {
  5287.             al.each(w, function (B, e) {
  5288.                 if (A || aC.test(x)) {
  5289.                     z(x, e)
  5290.                 } else {
  5291.                     t(x + "[" + (typeof e === "object" || al.isArray(e) ? B: "") + "]", e, A, z)
  5292.                 }
  5293.             })
  5294.         } else {
  5295.             if (!A && w != null && typeof w === "object") {
  5296.                 for (var y in w) {
  5297.                     t(x + "[" + y + "]", w[y], A, z)
  5298.                 }
  5299.             } else {
  5300.                 z(x, w)
  5301.             }
  5302.         }
  5303.     }
  5304.     al.extend({
  5305.         active: 0,
  5306.         lastModified: {},
  5307.         etag: {}
  5308.     });
  5309.     function bC(E, D, B) {
  5310.         var z = E.contents,
  5311.         C = E.dataTypes,
  5312.         w = E.responseFields,
  5313.         y, A, x, e;
  5314.         for (A in w) {
  5315.             if (A in B) {
  5316.                 D[w[A]] = B[A]
  5317.             }
  5318.         }
  5319.         while (C[0] === "*") {
  5320.             C.shift();
  5321.             if (y === ap) {
  5322.                 y = E.mimeType || D.getResponseHeader("content-type")
  5323.             }
  5324.         }
  5325.         if (y) {
  5326.             for (A in z) {
  5327.                 if (z[A] && z[A].test(y)) {
  5328.                     C.unshift(A);
  5329.                     break
  5330.                 }
  5331.             }
  5332.         }
  5333.         if (C[0] in B) {
  5334.             x = C[0]
  5335.         } else {
  5336.             for (A in B) {
  5337.                 if (!C[0] || E.converters[A + " " + C[0]]) {
  5338.                     x = A;
  5339.                     break
  5340.                 }
  5341.                 if (!e) {
  5342.                     e = A
  5343.                 }
  5344.             }
  5345.             x = x || e
  5346.         }
  5347.         if (x) {
  5348.             if (x !== C[0]) {
  5349.                 C.unshift(x)
  5350.             }
  5351.             return B[x]
  5352.         }
  5353.     }
  5354.     function U(I, E) {
  5355.         if (I.dataFilter) {
  5356.             E = I.dataFilter(E, I.dataType)
  5357.         }
  5358.         var D = I.dataTypes,
  5359.         H = {},
  5360.         A, F, x = D.length,
  5361.         B, C = D[0],
  5362.         y,
  5363.         z,
  5364.         G,
  5365.         w,
  5366.         e;
  5367.         for (A = 1; A < x; A++) {
  5368.             if (A === 1) {
  5369.                 for (F in I.converters) {
  5370.                     if (typeof F === "string") {
  5371.                         H[F.toLowerCase()] = I.converters[F]
  5372.                     }
  5373.                 }
  5374.             }
  5375.             y = C;
  5376.             C = D[A];
  5377.             if (C === "*") {
  5378.                 C = y
  5379.             } else {
  5380.                 if (y !== "*" && y !== C) {
  5381.                     z = y + " " + C;
  5382.                     G = H[z] || H["* " + C];
  5383.                     if (!G) {
  5384.                         e = ap;
  5385.                         for (w in H) {
  5386.                             B = w.split(" ");
  5387.                             if (B[0] === y || B[0] === "*") {
  5388.                                 e = H[B[1] + " " + C];
  5389.                                 if (e) {
  5390.                                     w = H[w];
  5391.                                     if (w === true) {
  5392.                                         G = e
  5393.                                     } else {
  5394.                                         if (e === true) {
  5395.                                             G = w
  5396.                                         }
  5397.                                     }
  5398.                                     break
  5399.                                 }
  5400.                             }
  5401.                         }
  5402.                     }
  5403.                     if (! (G || e)) {
  5404.                         al.error("No conversion from " + z.replace(" ", " to "))
  5405.                     }
  5406.                     if (G !== true) {
  5407.                         E = G ? G(E) : e(w(E))
  5408.                     }
  5409.                 }
  5410.             }
  5411.         }
  5412.         return E
  5413.     }
  5414.     var aZ = al.now(),
  5415.     s = /(\=)\?(&|$)|\?\?/i;
  5416.     al.ajaxSetup({
  5417.         jsonp: "callback",
  5418.         jsonpCallback: function () {
  5419.             return al.expando + "_" + (aZ++)
  5420.         }
  5421.     });
  5422.     al.ajaxPrefilter("json jsonp", function (F, E, D) {
  5423.         var C = F.contentType === "application/x-www-form-urlencoded" && (typeof F.data === "string");
  5424.         if (F.dataTypes[0] === "jsonp" || F.jsonp !== false && (s.test(F.url) || C && s.test(F.data))) {
  5425.             var B, y = F.jsonpCallback = al.isFunction(F.jsonpCallback) ? F.jsonpCallback() : F.jsonpCallback,
  5426.             A = aq[y],
  5427.             w = F.url,
  5428.             z = F.data,
  5429.             x = "$1" + y + "$2";
  5430.             if (F.jsonp !== false) {
  5431.                 w = w.replace(s, x);
  5432.                 if (F.url === w) {
  5433.                     if (C) {
  5434.                         z = z.replace(s, x)
  5435.                     }
  5436.                     if (F.data === z) {
  5437.                         w += (/\?/.test(w) ? "&": "?") + F.jsonp + "=" + y
  5438.                     }
  5439.                 }
  5440.             }
  5441.             F.url = w;
  5442.             F.data = z;
  5443.             aq[y] = function (e) {
  5444.                 B = [e]
  5445.             };
  5446.             D.always(function () {
  5447.                 aq[y] = A;
  5448.                 if (B && al.isFunction(A)) {
  5449.                     aq[y](B[0])
  5450.                 }
  5451.             });
  5452.             F.converters["script json"] = function () {
  5453.                 if (!B) {
  5454.                     al.error(y + " was not called")
  5455.                 }
  5456.                 return B[0]
  5457.             };
  5458.             F.dataTypes[0] = "json";
  5459.             return "script"
  5460.         }
  5461.     });
  5462.     al.ajaxSetup({
  5463.         accepts: {
  5464.             script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  5465.         },
  5466.         contents: {
  5467.             script: /javascript|ecmascript/
  5468.         },
  5469.         converters: {
  5470.             "text script": function (e) {
  5471.                 al.globalEval(e);
  5472.                 return e
  5473.             }
  5474.         }
  5475.     });
  5476.     al.ajaxPrefilter("script", function (e) {
  5477.         if (e.cache === ap) {
  5478.             e.cache = false
  5479.         }
  5480.         if (e.crossDomain) {
  5481.             e.type = "GET";
  5482.             e.global = false
  5483.         }
  5484.     });
  5485.     al.ajaxTransport("script", function (w) {
  5486.         if (w.crossDomain) {
  5487.             var x, e = an.head || an.getElementsByTagName("head")[0] || an.documentElement;
  5488.             return {
  5489.                 send: function (z, y) {
  5490.                     x = an.createElement("script");
  5491.                     x.async = "async";
  5492.                     if (w.scriptCharset) {
  5493.                         x.charset = w.scriptCharset
  5494.                     }
  5495.                     x.src = w.url;
  5496.                     x.onload = x.onreadystatechange = function (B, A) {
  5497.                         if (A || !x.readyState || /loaded|complete/.test(x.readyState)) {
  5498.                             x.onload = x.onreadystatechange = null;
  5499.                             if (e && x.parentNode) {
  5500.                                 e.removeChild(x)
  5501.                             }
  5502.                             x = ap;
  5503.                             if (!A) {
  5504.                                 y(200, "success")
  5505.                             }
  5506.                         }
  5507.                     };
  5508.                     e.insertBefore(x, e.firstChild)
  5509.                 },
  5510.                 abort: function () {
  5511.                     if (x) {
  5512.                         x.onload(0, 1)
  5513.                     }
  5514.                 }
  5515.             }
  5516.         }
  5517.     });
  5518.     var aY = aq.ActiveXObject ?
  5519.     function () {
  5520.         for (var e in aa) {
  5521.             aa[e](0, 1)
  5522.         }
  5523.     }: false,
  5524.     N = 0,
  5525.     aa;
  5526.     function aX() {
  5527.         try {
  5528.             return new aq.XMLHttpRequest()
  5529.         } catch(w) {}
  5530.     }
  5531.     function ay() {
  5532.         try {
  5533.             return new aq.ActiveXObject("Microsoft.XMLHTTP")
  5534.         } catch(w) {}
  5535.     }
  5536.     al.ajaxSettings.xhr = aq.ActiveXObject ?
  5537.     function () {
  5538.         return ! this.isLocal && aX() || ay()
  5539.     }: aX;
  5540.     (function (e) {
  5541.         al.extend(al.support, {
  5542.             ajax: !!e,
  5543.             cors: !!e && ("withCredentials" in e)
  5544.         })
  5545.     })(al.ajaxSettings.xhr());
  5546.     if (al.support.ajax) {
  5547.         al.ajaxTransport(function (e) {
  5548.             if (!e.crossDomain || al.support.cors) {
  5549.                 var w;
  5550.                 return {
  5551.                     send: function (C, B) {
  5552.                         var A = e.xhr(),
  5553.                         z,
  5554.                         y;
  5555.                         if (e.username) {
  5556.                             A.open(e.type, e.url, e.async, e.username, e.password)
  5557.                         } else {
  5558.                             A.open(e.type, e.url, e.async)
  5559.                         }
  5560.                         if (e.xhrFields) {
  5561.                             for (y in e.xhrFields) {
  5562.                                 A[y] = e.xhrFields[y]
  5563.                             }
  5564.                         }
  5565.                         if (e.mimeType && A.overrideMimeType) {
  5566.                             A.overrideMimeType(e.mimeType)
  5567.                         }
  5568.                         if (!e.crossDomain && !C["X-Requested-With"]) {
  5569.                             C["X-Requested-With"] = "XMLHttpRequest"
  5570.                         }
  5571.                         try {
  5572.                             for (y in C) {
  5573.                                 A.setRequestHeader(y, C[y])
  5574.                             }
  5575.                         } catch(x) {}
  5576.                         A.send((e.hasContent && e.data) || null);
  5577.                         w = function (L, K) {
  5578.                             var J, E, D, H, G;
  5579.                             try {
  5580.                                 if (w && (K || A.readyState === 4)) {
  5581.                                     w = ap;
  5582.                                     if (z) {
  5583.                                         A.onreadystatechange = al.noop;
  5584.                                         if (aY) {
  5585.                                             delete aa[z]
  5586.                                         }
  5587.                                     }
  5588.                                     if (K) {
  5589.                                         if (A.readyState !== 4) {
  5590.                                             A.abort()
  5591.                                         }
  5592.                                     } else {
  5593.                                         J = A.status;
  5594.                                         D = A.getAllResponseHeaders();
  5595.                                         H = {};
  5596.                                         G = A.responseXML;
  5597.                                         if (G && G.documentElement) {
  5598.                                             H.xml = G
  5599.                                         }
  5600.                                         H.text = A.responseText;
  5601.                                         try {
  5602.                                             E = A.statusText
  5603.                                         } catch(I) {
  5604.                                             E = ""
  5605.                                         }
  5606.                                         if (!J && e.isLocal && !e.crossDomain) {
  5607.                                             J = H.text ? 200 : 404
  5608.                                         } else {
  5609.                                             if (J === 1223) {
  5610.                                                 J = 204
  5611.                                             }
  5612.                                         }
  5613.                                     }
  5614.                                 }
  5615.                             } catch(F) {
  5616.                                 if (!K) {
  5617.                                     B( - 1, F)
  5618.                                 }
  5619.                             }
  5620.                             if (H) {
  5621.                                 B(J, E, H, D)
  5622.                             }
  5623.                         };
  5624.                         if (!e.async || A.readyState === 4) {
  5625.                             w()
  5626.                         } else {
  5627.                             z = ++N;
  5628.                             if (aY) {
  5629.                                 if (!aa) {
  5630.                                     aa = {};
  5631.                                     al(aq).unload(aY)
  5632.                                 }
  5633.                                 aa[z] = w
  5634.                             }
  5635.                             A.onreadystatechange = w
  5636.                         }
  5637.                     },
  5638.                     abort: function () {
  5639.                         if (w) {
  5640.                             w(0, 1)
  5641.                         }
  5642.                     }
  5643.                 }
  5644.             }
  5645.         })
  5646.     }
  5647.     var aW = {},
  5648.     br, k, aM = /^(?:toggle|show|hide)$/,
  5649.     bd = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
  5650.     bm, aS = [["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"], ["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"], ["opacity"]],
  5651.     bn;
  5652.     al.fn.extend({
  5653.         show: function (w, e, B) {
  5654.             var A, z;
  5655.             if (w || w === 0) {
  5656.                 return this.animate(bk("show", 3), w, e, B)
  5657.             } else {
  5658.                 for (var y = 0, x = this.length; y < x; y++) {
  5659.                     A = this[y];
  5660.                     if (A.style) {
  5661.                         z = A.style.display;
  5662.                         if (!al._data(A, "olddisplay") && z === "none") {
  5663.                             z = A.style.display = ""
  5664.                         }
  5665.                         if (z === "" && al.css(A, "display") === "none") {
  5666.                             al._data(A, "olddisplay", v(A.nodeName))
  5667.                         }
  5668.                     }
  5669.                 }
  5670.                 for (y = 0; y < x; y++) {
  5671.                     A = this[y];
  5672.                     if (A.style) {
  5673.                         z = A.style.display;
  5674.                         if (z === "" || z === "none") {
  5675.                             A.style.display = al._data(A, "olddisplay") || ""
  5676.                         }
  5677.                     }
  5678.                 }
  5679.                 return this
  5680.             }
  5681.         },
  5682.         hide: function (w, e, B) {
  5683.             if (w || w === 0) {
  5684.                 return this.animate(bk("hide", 3), w, e, B)
  5685.             } else {
  5686.                 var A, z, y = 0,
  5687.                 x = this.length;
  5688.                 for (; y < x; y++) {
  5689.                     A = this[y];
  5690.                     if (A.style) {
  5691.                         z = al.css(A, "display");
  5692.                         if (z !== "none" && !al._data(A, "olddisplay")) {
  5693.                             al._data(A, "olddisplay", z)
  5694.                         }
  5695.                     }
  5696.                 }
  5697.                 for (y = 0; y < x; y++) {
  5698.                     if (this[y].style) {
  5699.                         this[y].style.display = "none"
  5700.                     }
  5701.                 }
  5702.                 return this
  5703.             }
  5704.         },
  5705.         _toggle: al.fn.toggle,
  5706.         toggle: function (w, z, y) {
  5707.             var x = typeof w === "boolean";
  5708.             if (al.isFunction(w) && al.isFunction(z)) {
  5709.                 this._toggle.apply(this, arguments)
  5710.             } else {
  5711.                 if (w == null || x) {
  5712.                     this.each(function () {
  5713.                         var e = x ? w: al(this).is(":hidden");
  5714.                         al(this)[e ? "show": "hide"]()
  5715.                     })
  5716.                 } else {
  5717.                     this.animate(bk("toggle", 3), w, z, y)
  5718.                 }
  5719.             }
  5720.             return this
  5721.         },
  5722.         fadeTo: function (w, e, y, x) {
  5723.             return this.filter(":hidden").css("opacity", 0).show().end().animate({
  5724.                 opacity: e
  5725.             },
  5726.             w, y, x)
  5727.         },
  5728.         animate: function (e, A, z, y) {
  5729.             var x = al.speed(A, z, y);
  5730.             if (al.isEmptyObject(e)) {
  5731.                 return this.each(x.complete, [false])
  5732.             }
  5733.             e = al.extend({},
  5734.             e);
  5735.             function w() {
  5736.                 if (x.queue === false) {
  5737.                     al._mark(this)
  5738.                 }
  5739.                 var L = al.extend({},
  5740.                 x),
  5741.                 K = this.nodeType === 1,
  5742.                 I = K && al(this).is(":hidden"),
  5743.                 C,
  5744.                 F,
  5745.                 E,
  5746.                 J,
  5747.                 H,
  5748.                 D,
  5749.                 G,
  5750.                 M,
  5751.                 B;
  5752.                 L.animatedProperties = {};
  5753.                 for (E in e) {
  5754.                     C = al.camelCase(E);
  5755.                     if (E !== C) {
  5756.                         e[C] = e[E];
  5757.                         delete e[E]
  5758.                     }
  5759.                     F = e[C];
  5760.                     if (al.isArray(F)) {
  5761.                         L.animatedProperties[C] = F[1];
  5762.                         F = e[C] = F[0]
  5763.                     } else {
  5764.                         L.animatedProperties[C] = L.specialEasing && L.specialEasing[C] || L.easing || "swing"
  5765.                     }
  5766.                     if (F === "hide" && I || F === "show" && !I) {
  5767.                         return L.complete.call(this)
  5768.                     }
  5769.                     if (K && (C === "height" || C === "width")) {
  5770.                         L.overflow = [this.style.overflow, this.style.overflowX, this.style.overflowY];
  5771.                         if (al.css(this, "display") === "inline" && al.css(this, "float") === "none") {
  5772.                             if (!al.support.inlineBlockNeedsLayout || v(this.nodeName) === "inline") {
  5773.                                 this.style.display = "inline-block"
  5774.                             } else {
  5775.                                 this.style.zoom = 1
  5776.                             }
  5777.                         }
  5778.                     }
  5779.                 }
  5780.                 if (L.overflow != null) {
  5781.                     this.style.overflow = "hidden"
  5782.                 }
  5783.                 for (E in e) {
  5784.                     J = new al.fx(this, L, E);
  5785.                     F = e[E];
  5786.                     if (aM.test(F)) {
  5787.                         B = al._data(this, "toggle" + E) || (F === "toggle" ? I ? "show": "hide": 0);
  5788.                         if (B) {
  5789.                             al._data(this, "toggle" + E, B === "show" ? "hide": "show");
  5790.                             J[B]()
  5791.                         } else {
  5792.                             J[F]()
  5793.                         }
  5794.                     } else {
  5795.                         H = bd.exec(F);
  5796.                         D = J.cur();
  5797.                         if (H) {
  5798.                             G = parseFloat(H[2]);
  5799.                             M = H[3] || (al.cssNumber[E] ? "": "px");
  5800.                             if (M !== "px") {
  5801.                                 al.style(this, E, (G || 1) + M);
  5802.                                 D = ((G || 1) / J.cur()) * D;
  5803.                                 al.style(this, E, D + M)
  5804.                             }
  5805.                             if (H[1]) {
  5806.                                 G = ((H[1] === "-=" ? -1 : 1) * G) + D
  5807.                             }
  5808.                             J.custom(D, G, M)
  5809.                         } else {
  5810.                             J.custom(D, F, "")
  5811.                         }
  5812.                     }
  5813.                 }
  5814.                 return true
  5815.             }
  5816.             return x.queue === false ? this.each(w) : this.queue(x.queue, w)
  5817.         },
  5818.         stop: function (y, x, w) {
  5819.             if (typeof y !== "string") {
  5820.                 w = x;
  5821.                 x = y;
  5822.                 y = ap
  5823.             }
  5824.             if (x && y !== false) {
  5825.                 this.queue(y || "fx", [])
  5826.             }
  5827.             return this.each(function () {
  5828.                 var z, e = false,
  5829.                 B = al.timers,
  5830.                 A = al._data(this);
  5831.                 if (!w) {
  5832.                     al._unmark(true, this)
  5833.                 }
  5834.                 function C(E, D, F) {
  5835.                     var G = D[F];
  5836.                     al.removeData(E, F, true);
  5837.                     G.stop(w)
  5838.                 }
  5839.                 if (y == null) {
  5840.                     for (z in A) {
  5841.                         if (A[z].stop && z.indexOf(".run") === z.length - 4) {
  5842.                             C(this, A, z)
  5843.                         }
  5844.                     }
  5845.                 } else {
  5846.                     if (A[z = y + ".run"] && A[z].stop) {
  5847.                         C(this, A, z)
  5848.                     }
  5849.                 }
  5850.                 for (z = B.length; z--;) {
  5851.                     if (B[z].elem === this && (y == null || B[z].queue === y)) {
  5852.                         if (w) {
  5853.                             B[z](true)
  5854.                         } else {
  5855.                             B[z].saveState()
  5856.                         }
  5857.                         e = true;
  5858.                         B.splice(z, 1)
  5859.                     }
  5860.                 }
  5861.                 if (! (w && e)) {
  5862.                     al.dequeue(this, y)
  5863.                 }
  5864.             })
  5865.         }
  5866.     });
  5867.     function bz() {
  5868.         setTimeout(aF, 0);
  5869.         return (bn = al.now())
  5870.     }
  5871.     function aF() {
  5872.         bn = ap
  5873.     }
  5874.     function bk(w, e) {
  5875.         var x = {};
  5876.         al.each(aS.concat.apply([], aS.slice(0, e)), function () {
  5877.             x[this] = w
  5878.         });
  5879.         return x
  5880.     }
  5881.     al.each({
  5882.         slideDown: bk("show", 1),
  5883.         slideUp: bk("hide", 1),
  5884.         slideToggle: bk("toggle", 1),
  5885.         fadeIn: {
  5886.             opacity: "show"
  5887.         },
  5888.         fadeOut: {
  5889.             opacity: "hide"
  5890.         },
  5891.         fadeToggle: {
  5892.             opacity: "toggle"
  5893.         }
  5894.     },
  5895.     function (x, w) {
  5896.         al.fn[x] = function (y, e, z) {
  5897.             return this.animate(w, y, e, z)
  5898.         }
  5899.     });
  5900.     al.extend({
  5901.         speed: function (w, z, y) {
  5902.             var x = w && typeof w === "object" ? al.extend({},
  5903.             w) : {
  5904.                 complete: y || !y && z || al.isFunction(w) && w,
  5905.                 duration: w,
  5906.                 easing: y && z || z && !al.isFunction(z) && z
  5907.             };
  5908.             x.duration = al.fx.off ? 0 : typeof x.duration === "number" ? x.duration: x.duration in al.fx.speeds ? al.fx.speeds[x.duration] : al.fx.speeds._default;
  5909.             if (x.queue == null || x.queue === true) {
  5910.                 x.queue = "fx"
  5911.             }
  5912.             x.old = x.complete;
  5913.             x.complete = function (e) {
  5914.                 if (al.isFunction(x.old)) {
  5915.                     x.old.call(this)
  5916.                 }
  5917.                 if (x.queue) {
  5918.                     al.dequeue(this, x.queue)
  5919.                 } else {
  5920.                     if (e !== false) {
  5921.                         al._unmark(this)
  5922.                     }
  5923.                 }
  5924.             };
  5925.             return x
  5926.         },
  5927.         easing: {
  5928.             linear: function (x, y, w, e) {
  5929.                 return w + e * x
  5930.             },
  5931.             swing: function (x, y, w, e) {
  5932.                 return (( - Math.cos(x * Math.PI) / 2) + 0.5) * e + w
  5933.             }
  5934.         },
  5935.         timers: [],
  5936.         fx: function (w, e, x) {
  5937.             this.options = e;
  5938.             this.elem = w;
  5939.             this.prop = x;
  5940.             e.orig = e.orig || {}
  5941.         }
  5942.     });
  5943.     al.fx.prototype = {
  5944.         update: function () {
  5945.             if (this.options.step) {
  5946.                 this.options.step.call(this.elem, this.now, this)
  5947.             } (al.fx.step[this.prop] || al.fx.step._default)(this)
  5948.         },
  5949.         cur: function () {
  5950.             if (this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null)) {
  5951.                 return this.elem[this.prop]
  5952.             }
  5953.             var e, w = al.css(this.elem, this.prop);
  5954.             return isNaN(e = parseFloat(w)) ? !w || w === "auto" ? 0 : w: e
  5955.         },
  5956.         custom: function (w, B, A) {
  5957.             var z = this,
  5958.             y = al.fx;
  5959.             this.startTime = bn || bz();
  5960.             this.end = B;
  5961.             this.now = this.start = w;
  5962.             this.pos = this.state = 0;
  5963.             this.unit = A || this.unit || (al.cssNumber[this.prop] ? "": "px");
  5964.             function x(e) {
  5965.                 return z.step(e)
  5966.             }
  5967.             x.queue = this.options.queue;
  5968.             x.elem = this.elem;
  5969.             x.saveState = function () {
  5970.                 if (z.options.hide && al._data(z.elem, "fxshow" + z.prop) === ap) {
  5971.                     al._data(z.elem, "fxshow" + z.prop, z.start)
  5972.                 }
  5973.             };
  5974.             if (x() && al.timers.push(x) && !bm) {
  5975.                 bm = setInterval(y.tick, y.interval)
  5976.             }
  5977.         },
  5978.         show: function () {
  5979.             var e = al._data(this.elem, "fxshow" + this.prop);
  5980.             this.options.orig[this.prop] = e || al.style(this.elem, this.prop);
  5981.             this.options.show = true;
  5982.             if (e !== ap) {
  5983.                 this.custom(this.cur(), e)
  5984.             } else {
  5985.                 this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur())
  5986.             }
  5987.             al(this.elem).show()
  5988.         },
  5989.         hide: function () {
  5990.             this.options.orig[this.prop] = al._data(this.elem, "fxshow" + this.prop) || al.style(this.elem, this.prop);
  5991.             this.options.hide = true;
  5992.             this.custom(this.cur(), 0)
  5993.         },
  5994.         step: function (C) {
  5995.             var A, B, w, y = bn || bz(),
  5996.             e = true,
  5997.             z = this.elem,
  5998.             x = this.options;
  5999.             if (C || y >= x.duration + this.startTime) {
  6000.                 this.now = this.end;
  6001.                 this.pos = this.state = 1;
  6002.                 this.update();
  6003.                 x.animatedProperties[this.prop] = true;
  6004.                 for (A in x.animatedProperties) {
  6005.                     if (x.animatedProperties[A] !== true) {
  6006.                         e = false
  6007.                     }
  6008.                 }
  6009.                 if (e) {
  6010.                     if (x.overflow != null && !al.support.shrinkWrapBlocks) {
  6011.                         al.each(["", "X", "Y"], function (E, D) {
  6012.                             z.style["overflow" + D] = x.overflow[E]
  6013.                         })
  6014.                     }
  6015.                     if (x.hide) {
  6016.                         al(z).hide()
  6017.                     }
  6018.                     if (x.hide || x.show) {
  6019.                         for (A in x.animatedProperties) {
  6020.                             al.style(z, A, x.orig[A]);
  6021.                             al.removeData(z, "fxshow" + A, true);
  6022.                             al.removeData(z, "toggle" + A, true)
  6023.                         }
  6024.                     }
  6025.                     w = x.complete;
  6026.                     if (w) {
  6027.                         x.complete = false;
  6028.                         w.call(z)
  6029.                     }
  6030.                 }
  6031.                 return false
  6032.             } else {
  6033.                 if (x.duration == Infinity) {
  6034.                     this.now = y
  6035.                 } else {
  6036.                     B = y - this.startTime;
  6037.                     this.state = B / x.duration;
  6038.                     this.pos = juicebox_lib.jQuery.easing[x.animatedProperties[this.prop]](this.state, B, 0, 1, x.duration);
  6039.                     this.now = this.start + ((this.end - this.start) * this.pos)
  6040.                 }
  6041.                 this.update()
  6042.             }
  6043.             return true
  6044.         }
  6045.     };
  6046.     al.extend(al.fx, {
  6047.         tick: function () {
  6048.             var e, x = al.timers,
  6049.             w = 0;
  6050.             for (; w < x.length; w++) {
  6051.                 e = x[w];
  6052.                 if (!e() && x[w] === e) {
  6053.                     x.splice(w--, 1)
  6054.                 }
  6055.             }
  6056.             if (!x.length) {
  6057.                 al.fx.stop()
  6058.             }
  6059.         },
  6060.         interval: 13,
  6061.         stop: function () {
  6062.             clearInterval(bm);
  6063.             bm = null
  6064.         },
  6065.         speeds: {
  6066.             slow: 600,
  6067.             fast: 200,
  6068.             _default: 400
  6069.         },
  6070.         step: {
  6071.             opacity: function (e) {
  6072.                 al.style(e.elem, "opacity", e.now)
  6073.             },
  6074.             _default: function (e) {
  6075.                 if (e.elem.style && e.elem.style[e.prop] != null) {
  6076.                     e.elem.style[e.prop] = e.now + e.unit
  6077.                 } else {
  6078.                     e.elem[e.prop] = e.now
  6079.                 }
  6080.             }
  6081.         }
  6082.     });
  6083.     al.each(["width", "height"], function (w, e) {
  6084.         al.fx.step[e] = function (x) {
  6085.             al.style(x.elem, e, Math.max(0, x.now))
  6086.         }
  6087.     });
  6088.     if (al.expr && al.expr.filters) {
  6089.         al.expr.filters.animated = function (e) {
  6090.             return al.grep(al.timers, function (w) {
  6091.                 return e === w.elem
  6092.             }).length
  6093.         }
  6094.     }
  6095.     function v(w) {
  6096.         if (!aW[w]) {
  6097.             var e = an.body,
  6098.             x = al("<" + w + ">").appendTo(e),
  6099.             y = x.css("display");
  6100.             x.remove();
  6101.             if (y === "none" || y === "") {
  6102.                 if (!br) {
  6103.                     br = an.createElement("iframe");
  6104.                     br.frameBorder = br.width = br.height = 0
  6105.                 }
  6106.                 e.appendChild(br);
  6107.                 if (!k || !br.createElement) {
  6108.                     k = (br.contentWindow || br.contentDocument).document;
  6109.                     k.write((an.compatMode === "CSS1Compat" ? "<!doctype html>": "") + "<html><body>");
  6110.                     k.close()
  6111.                 }
  6112.                 x = k.createElement(w);
  6113.                 k.body.appendChild(x);
  6114.                 y = al.css(x, "display");
  6115.                 e.removeChild(br)
  6116.             }
  6117.             aW[w] = y
  6118.         }
  6119.         return aW[w]
  6120.     }
  6121.     var aV = /^t(?:able|d|h)$/i,
  6122.     ar = /^(?:body|html)$/i;
  6123.     if ("getBoundingClientRect" in an.documentElement) {
  6124.         al.fn.offset = function (J) {
  6125.             var I = this[0],
  6126.             B;
  6127.             if (J) {
  6128.                 return this.each(function (e) {
  6129.                     al.offset.setOffset(this, J, e)
  6130.                 })
  6131.             }
  6132.             if (!I || !I.ownerDocument) {
  6133.                 return null
  6134.             }
  6135.             if (I === I.ownerDocument.body) {
  6136.                 return al.offset.bodyOffset(I)
  6137.             }
  6138.             try {
  6139.                 B = I.getBoundingClientRect()
  6140.             } catch(E) {}
  6141.             var G = I.ownerDocument,
  6142.             x = G.documentElement;
  6143.             if (!B || !al.contains(x, I)) {
  6144.                 return B ? {
  6145.                     top: B.top,
  6146.                     left: B.left
  6147.                 }: {
  6148.                     top: 0,
  6149.                     left: 0
  6150.                 }
  6151.             }
  6152.             var F = G.body,
  6153.             C = aU(G),
  6154.             A = x.clientTop || F.clientTop || 0,
  6155.             D = x.clientLeft || F.clientLeft || 0,
  6156.             w = C.pageYOffset || al.support.boxModel && x.scrollTop || F.scrollTop,
  6157.             z = C.pageXOffset || al.support.boxModel && x.scrollLeft || F.scrollLeft,
  6158.             H = B.top + w - A,
  6159.             y = B.left + z - D;
  6160.             return {
  6161.                 top: H,
  6162.                 left: y
  6163.             }
  6164.         }
  6165.     } else {
  6166.         al.fn.offset = function (F) {
  6167.             var E = this[0];
  6168.             if (F) {
  6169.                 return this.each(function (H) {
  6170.                     al.offset.setOffset(this, F, H)
  6171.                 })
  6172.             }
  6173.             if (!E || !E.ownerDocument) {
  6174.                 return null
  6175.             }
  6176.             if (E === E.ownerDocument.body) {
  6177.                 return al.offset.bodyOffset(E)
  6178.             }
  6179.             var C, x = E.offsetParent,
  6180.             w = E,
  6181.             G = E.ownerDocument,
  6182.             y = G.documentElement,
  6183.             A = G.body,
  6184.             B = G.defaultView,
  6185.             e = B ? B.getComputedStyle(E, null) : E.currentStyle,
  6186.             D = E.offsetTop,
  6187.             z = E.offsetLeft;
  6188.             while ((E = E.parentNode) && E !== A && E !== y) {
  6189.                 if (al.support.fixedPosition && e.position === "fixed") {
  6190.                     break
  6191.                 }
  6192.                 C = B ? B.getComputedStyle(E, null) : E.currentStyle;
  6193.                 D -= E.scrollTop;
  6194.                 z -= E.scrollLeft;
  6195.                 if (E === x) {
  6196.                     D += E.offsetTop;
  6197.                     z += E.offsetLeft;
  6198.                     if (al.support.doesNotAddBorder && !(al.support.doesAddBorderForTableAndCells && aV.test(E.nodeName))) {
  6199.                         D += parseFloat(C.borderTopWidth) || 0;
  6200.                         z += parseFloat(C.borderLeftWidth) || 0
  6201.                     }
  6202.                     w = x;
  6203.                     x = E.offsetParent
  6204.                 }
  6205.                 if (al.support.subtractsBorderForOverflowNotVisible && C.overflow !== "visible") {
  6206.                     D += parseFloat(C.borderTopWidth) || 0;
  6207.                     z += parseFloat(C.borderLeftWidth) || 0
  6208.                 }
  6209.                 e = C
  6210.             }
  6211.             if (e.position === "relative" || e.position === "static") {
  6212.                 D += A.offsetTop;
  6213.                 z += A.offsetLeft
  6214.             }
  6215.             if (al.support.fixedPosition && e.position === "fixed") {
  6216.                 D += Math.max(y.scrollTop, A.scrollTop);
  6217.                 z += Math.max(y.scrollLeft, A.scrollLeft)
  6218.             }
  6219.             return {
  6220.                 top: D,
  6221.                 left: z
  6222.             }
  6223.         }
  6224.     }
  6225.     al.offset = {
  6226.         bodyOffset: function (w) {
  6227.             var e = w.offsetTop,
  6228.             x = w.offsetLeft;
  6229.             if (al.support.doesNotIncludeMarginInBodyOffset) {
  6230.                 e += parseFloat(al.css(w, "marginTop")) || 0;
  6231.                 x += parseFloat(al.css(w, "marginLeft")) || 0
  6232.             }
  6233.             return {
  6234.                 top: e,
  6235.                 left: x
  6236.             }
  6237.         },
  6238.         setOffset: function (F, E, z) {
  6239.             var D = al.css(F, "position");
  6240.             if (D === "static") {
  6241.                 F.style.position = "relative"
  6242.             }
  6243.             var B = al(F),
  6244.             w = B.offset(),
  6245.             e = al.css(F, "top"),
  6246.             G = al.css(F, "left"),
  6247.             H = (D === "absolute" || D === "fixed") && al.inArray("auto", [e, G]) > -1,
  6248.             C = {},
  6249.             A = {},
  6250.             x,
  6251.             y;
  6252.             if (H) {
  6253.                 A = B.position();
  6254.                 x = A.top;
  6255.                 y = A.left
  6256.             } else {
  6257.                 x = parseFloat(e) || 0;
  6258.                 y = parseFloat(G) || 0
  6259.             }
  6260.             if (al.isFunction(E)) {
  6261.                 E = E.call(F, z, w)
  6262.             }
  6263.             if (E.top != null) {
  6264.                 C.top = (E.top - w.top) + x
  6265.             }
  6266.             if (E.left != null) {
  6267.                 C.left = (E.left - w.left) + y
  6268.             }
  6269.             if ("using" in E) {
  6270.                 E.using.call(F, C)
  6271.             } else {
  6272.                 B.css(C)
  6273.             }
  6274.         }
  6275.     };
  6276.     al.fn.extend({
  6277.         position: function () {
  6278.             if (!this[0]) {
  6279.                 return null
  6280.             }
  6281.             var e = this[0],
  6282.             x = this.offsetParent(),
  6283.             y = this.offset(),
  6284.             w = ar.test(x[0].nodeName) ? {
  6285.                 top: 0,
  6286.                 left: 0
  6287.             }: x.offset();
  6288.             y.top -= parseFloat(al.css(e, "marginTop")) || 0;
  6289.             y.left -= parseFloat(al.css(e, "marginLeft")) || 0;
  6290.             w.top += parseFloat(al.css(x[0], "borderTopWidth")) || 0;
  6291.             w.left += parseFloat(al.css(x[0], "borderLeftWidth")) || 0;
  6292.             return {
  6293.                 top: y.top - w.top,
  6294.                 left: y.left - w.left
  6295.             }
  6296.         },
  6297.         offsetParent: function () {
  6298.             return this.map(function () {
  6299.                 var e = this.offsetParent || an.body;
  6300.                 while (e && (!ar.test(e.nodeName) && al.css(e, "position") === "static")) {
  6301.                     e = e.offsetParent
  6302.                 }
  6303.                 return e
  6304.             })
  6305.         }
  6306.     });
  6307.     al.each(["Left", "Top"], function (e, x) {
  6308.         var w = "scroll" + x;
  6309.         al.fn[w] = function (z) {
  6310.             var y, A;
  6311.             if (z === ap) {
  6312.                 y = this[0];
  6313.                 if (!y) {
  6314.                     return null
  6315.                 }
  6316.                 A = aU(y);
  6317.                 return A ? ("pageXOffset" in A) ? A[e ? "pageYOffset": "pageXOffset"] : al.support.boxModel && A.document.documentElement[w] || A.document.body[w] : y[w]
  6318.             }
  6319.             return this.each(function () {
  6320.                 A = aU(this);
  6321.                 if (A) {
  6322.                     A.scrollTo(!e ? z: al(A).scrollLeft(), e ? z: al(A).scrollTop())
  6323.                 } else {
  6324.                     this[w] = z
  6325.                 }
  6326.             })
  6327.         }
  6328.     });
  6329.     function aU(e) {
  6330.         return al.isWindow(e) ? e: e.nodeType === 9 ? e.defaultView || e.parentWindow: false
  6331.     }
  6332.     al.each(["Height", "Width"], function (e, x) {
  6333.         var w = x.toLowerCase();
  6334.         al.fn["inner" + x] = function () {
  6335.             var y = this[0];
  6336.             return y ? y.style ? parseFloat(al.css(y, w, "padding")) : this[w]() : null
  6337.         };
  6338.         al.fn["outer" + x] = function (z) {
  6339.             var y = this[0];
  6340.             return y ? y.style ? parseFloat(al.css(y, w, z ? "margin": "border")) : this[w]() : null
  6341.         };
  6342.         al.fn[w] = function (z) {
  6343.             var D = this[0];
  6344.             if (!D) {
  6345.                 return z == null ? null: this
  6346.             }
  6347.             if (al.isFunction(z)) {
  6348.                 return this.each(function (F) {
  6349.                     var E = al(this);
  6350.                     E[w](z.call(this, F, E[w]()))
  6351.                 })
  6352.             }
  6353.             if (al.isWindow(D)) {
  6354.                 var C = D.document.documentElement["client" + x],
  6355.                 y = D.document.body;
  6356.                 return D.document.compatMode === "CSS1Compat" && C || y && y["client" + x] || C
  6357.             } else {
  6358.                 if (D.nodeType === 9) {
  6359.                     return Math.max(D.documentElement["client" + x], D.body["scroll" + x], D.documentElement["scroll" + x], D.body["offset" + x], D.documentElement["offset" + x])
  6360.                 } else {
  6361.                     if (z === ap) {
  6362.                         var B = al.css(D, w),
  6363.                         A = parseFloat(B);
  6364.                         return al.isNumeric(A) ? A: B
  6365.                     } else {
  6366.                         return this.css(w, typeof z === "string" ? z: z + "px")
  6367.                     }
  6368.                 }
  6369.             }
  6370.         }
  6371.     });
  6372.     juicebox_lib.jQuery = juicebox_lib.$ = al
  6373. })(window);
  6374. if (typeof jQuery === "undefined") {
  6375.     window.jQuery = juicebox_lib.jQuery
  6376. }
  6377. if (typeof $ === "undefined") {
  6378.     window.$ = juicebox_lib.jQuery
  6379. } (function (r, t, q) {
  6380.     var j = ["top", "right", "bottom", "left", "opacity", "height", "width"],
  6381.     s = ["top", "right", "bottom", "left"],
  6382.     n = ["", "-webkit-", "-moz-", "-o-"],
  6383.     v = ["avoidTransforms", "useTranslate3d", "leaveTransforms"],
  6384.     h = /^([+-]=)?([\d+-.]+)(.*)$/,
  6385.     z = /([A-Z])/g,
  6386.     w = {
  6387.         secondary: {},
  6388.         meta: {
  6389.             top: 0,
  6390.             right: 0,
  6391.             bottom: 0,
  6392.             left: 0
  6393.         }
  6394.     },
  6395.     m = "jQe",
  6396.     c = "cubic-bezier(",
  6397.     y = ")",
  6398.     g = false,
  6399.     b = null;
  6400.     var k = document.body || document.documentElement,
  6401.     e = k.style,
  6402.     a = (e.WebkitTransition !== undefined) ? "webkitTransitionEnd": (e.OTransition !== undefined) ? "oTransitionEnd": "transitionend",
  6403.     x = e.WebkitTransition !== undefined || e.MozTransition !== undefined || e.OTransition !== undefined || e.transition !== undefined,
  6404.     f = g = ("WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix());
  6405.     if (r.expr && r.expr.filters) {
  6406.         b = r.expr.filters.animated;
  6407.         r.expr.filters.animated = function (C) {
  6408.             return r(C).data("events") && r(C).data("events")[a] ? true: b.call(this, C)
  6409.         }
  6410.     }
  6411.     function i(M, G, D, H) {
  6412.         var J = h.exec(G),
  6413.         E = M.css(D) === "auto" ? 0 : M.css(D),
  6414.         N = typeof E == "string" ? A(E) : E,
  6415.         F = typeof G == "string" ? A(G) : G,
  6416.         L = H === true ? 0 : N,
  6417.         K = M.is(":hidden"),
  6418.         C = M.translation();
  6419.         if (D == "left") {
  6420.             L = parseInt(N, 10) + C.x
  6421.         }
  6422.         if (D == "right") {
  6423.             L = parseInt(N, 10) + C.x
  6424.         }
  6425.         if (D == "top") {
  6426.             L = parseInt(N, 10) + C.y
  6427.         }
  6428.         if (D == "bottom") {
  6429.             L = parseInt(N, 10) + C.y
  6430.         }
  6431.         if (!J && G == "show") {
  6432.             L = 1;
  6433.             if (K) {
  6434.                 M.css({
  6435.                     display: "block",
  6436.                     opacity: 0
  6437.                 })
  6438.             }
  6439.         } else {
  6440.             if (!J && G == "hide") {
  6441.                 L = 0
  6442.             }
  6443.         }
  6444.         if (J) {
  6445.             var I = parseFloat(J[2]);
  6446.             if (J[1]) {
  6447.                 I = ((J[1] === "-=" ? -1 : 1) * I) + parseInt(L, 10)
  6448.             }
  6449.             return I
  6450.         } else {
  6451.             return L
  6452.         }
  6453.     }
  6454.     function u(C, E, D) {
  6455.         return ((D === true || (g == true && D != false)) && f) ? "translate3d(" + C + "px," + E + "px,0)": "translate(" + C + "px," + E + "px)"
  6456.     }
  6457.     function l(J, O, H, K, N, D, G, C) {
  6458.         var I = J.data(m) ? !d(J.data(m)) ? J.data(m) : r.extend(true, {},
  6459.         w) : r.extend(true, {},
  6460.         w),
  6461.         F = N,
  6462.         M = r.inArray(O, s) > -1;
  6463.         if (M) {
  6464.             var P = I.meta,
  6465.             E = A(J.css(O)) || 0,
  6466.             L = O + "_o";
  6467.             F = N - E;
  6468.             P[O] = F;
  6469.             P[L] = J.css(O) == "auto" ? 0 + F: E + F || 0;
  6470.             I.meta = P;
  6471.             if (G && F === 0) {
  6472.                 F = 0 - P[L];
  6473.                 P[O] = F;
  6474.                 P[L] = 0
  6475.             }
  6476.         }
  6477.         return J.data(m, B(I, O, H, K, F, D, G, C))
  6478.     }
  6479.     function B(K, J, F, H, I, D, E, C) {
  6480.         K = typeof K === "undefined" ? {}: K;
  6481.         K.secondary = typeof K.secondary === "undefined" ? {}: K.secondary;
  6482.         for (var G = n.length - 1; G >= 0; G--) {
  6483.             if (typeof K[n[G] + "transition-property"] === "undefined") {
  6484.                 K[n[G] + "transition-property"] = ""
  6485.             }
  6486.             K[n[G] + "transition-property"] += ", " + ((D === true && E === true) ? n[G] + "transform": J);
  6487.             K[n[G] + "transition-duration"] = F + "ms";
  6488.             K[n[G] + "transition-timing-function"] = H;
  6489.             K.secondary[((D === true && E === true) ? n[G] + "transform": J)] = (D === true && E === true) ? u(K.meta.left, K.meta.top, C) : I
  6490.         }
  6491.         return K
  6492.     }
  6493.     function o(D) {
  6494.         for (var C in D) {
  6495.             if ((C == "width" || C == "height") && (D[C] == "show" || D[C] == "hide" || D[C] == "toggle")) {
  6496.                 return true
  6497.             }
  6498.         }
  6499.         return false
  6500.     }
  6501.     function d(D) {
  6502.         for (var C in D) {
  6503.             return false
  6504.         }
  6505.         return true
  6506.     }
  6507.     function A(C) {
  6508.         return parseFloat(C.replace(/px/i, ""))
  6509.     }
  6510.     function p(F, E, C) {
  6511.         var D = r.inArray(F, j) > -1;
  6512.         if ((F == "width" || F == "height") && (E === parseFloat(C.css(F)))) {
  6513.             D = false
  6514.         }
  6515.         return D
  6516.     }
  6517.     r.extend({
  6518.         toggle3DByDefault: function () {
  6519.             g = !g
  6520.         }
  6521.     });
  6522.     r.fn.translation = function () {
  6523.         if (!this[0]) {
  6524.             return null
  6525.         }
  6526.         var G = this[0],
  6527.         D = window.getComputedStyle(G, null),
  6528.         H = {
  6529.             x: 0,
  6530.             y: 0
  6531.         };
  6532.         for (var F = n.length - 1; F >= 0; F--) {
  6533.             var E = D.getPropertyValue(n[F] + "transform");
  6534.             if (E && (/matrix/i).test(E)) {
  6535.                 var C = E.replace(/^matrix\(/i, "").split(/, |\)$/g);
  6536.                 H = {
  6537.                     x: parseInt(C[4], 10),
  6538.                     y: parseInt(C[5], 10)
  6539.                 };
  6540.                 break
  6541.             }
  6542.         }
  6543.         return H
  6544.     };
  6545.     r.fn.animate = function (D, E, I, K) {
  6546.         D = D || {};
  6547.         var F = !(typeof D.bottom !== "undefined" || typeof D.right !== "undefined"),
  6548.         J = r.speed(E, I, K),
  6549.         C = this,
  6550.         H = 0,
  6551.         G = function () {
  6552.             H--;
  6553.             if (H === 0) {
  6554.                 if (typeof J.complete === "function") {
  6555.                     J.complete.apply(C[0], arguments)
  6556.                 }
  6557.             }
  6558.         };
  6559.         if (!x || d(D) || o(D) || J.duration <= 0 || (r.fn.animate.defaults.avoidTransforms === true && D.avoidTransforms !== false)) {
  6560.             return t.apply(this, arguments)
  6561.         }
  6562.         return this[J.queue === true ? "queue": "each"](function () {
  6563.             var V = r(this),
  6564.             M = r.extend({},
  6565.             J),
  6566.             R = function () {
  6567.                 var ac = {};
  6568.                 for (var Z = n.length - 1; Z >= 0; Z--) {
  6569.                     ac[n[Z] + "transition-property"] = "none";
  6570.                     ac[n[Z] + "transition-duration"] = "";
  6571.                     ac[n[Z] + "transition-timing-function"] = ""
  6572.                 }
  6573.                 V.unbind(a);
  6574.                 if (!D.leaveTransforms === true) {
  6575.                     var ab = V.data(m) || {},
  6576.                     aa = {};
  6577.                     for (Z = n.length - 1; Z >= 0; Z--) {
  6578.                         aa[n[Z] + "transform"] = ""
  6579.                     }
  6580.                     if (F && typeof ab.meta !== "undefined") {
  6581.                         for (var Y = 0, X; X = s[Y]; ++Y) {
  6582.                             aa[X] = ab.meta[X + "_o"] + "px"
  6583.                         }
  6584.                     }
  6585.                     V.css(ac).css(aa)
  6586.                 }
  6587.                 if (D.opacity === "hide") {
  6588.                     V.css("display", "none")
  6589.                 }
  6590.                 V.data(m, null);
  6591.                 G.call(V)
  6592.             },
  6593.             N = {
  6594.                 bounce: c + "0.0, 0.35, .5, 1.3" + y,
  6595.                 linear: "linear",
  6596.                 swing: "ease-in-out",
  6597.                 easeInQuad: c + "0.550, 0.085, 0.680, 0.530" + y,
  6598.                 easeInCubic: c + "0.550, 0.055, 0.675, 0.190" + y,
  6599.                 easeInQuart: c + "0.895, 0.030, 0.685, 0.220" + y,
  6600.                 easeInQuint: c + "0.755, 0.050, 0.855, 0.060" + y,
  6601.                 easeInSine: c + "0.470, 0.000, 0.745, 0.715" + y,
  6602.                 easeInExpo: c + "0.950, 0.050, 0.795, 0.035" + y,
  6603.                 easeInCirc: c + "0.600, 0.040, 0.980, 0.335" + y,
  6604.                 easeOutQuad: c + "0.250, 0.460, 0.450, 0.940" + y,
  6605.                 easeOutCubic: c + "0.215, 0.610, 0.355, 1.000" + y,
  6606.                 easeOutQuart: c + "0.165, 0.840, 0.440, 1.000" + y,
  6607.                 easeOutQuint: c + "0.230, 1.000, 0.320, 1.000" + y,
  6608.                 easeOutSine: c + "0.390, 0.575, 0.565, 1.000" + y,
  6609.                 easeOutExpo: c + "0.190, 1.000, 0.220, 1.000" + y,
  6610.                 easeOutCirc: c + "0.075, 0.820, 0.165, 1.000" + y,
  6611.                 easeInOutQuad: c + "0.455, 0.030, 0.515, 0.955" + y,
  6612.                 easeInOutCubic: c + "0.645, 0.045, 0.355, 1.000" + y,
  6613.                 easeInOutQuart: c + "0.770, 0.000, 0.175, 1.000" + y,
  6614.                 easeInOutQuint: c + "0.860, 0.000, 0.070, 1.000" + y,
  6615.                 easeInOutSine: c + "0.445, 0.050, 0.550, 0.950" + y,
  6616.                 easeInOutExpo: c + "1.000, 0.000, 0.000, 1.000" + y,
  6617.                 easeInOutCirc: c + "0.785, 0.135, 0.150, 0.860" + y
  6618.             },
  6619.             Q = {},
  6620.             O = N[M.easing || "swing"] ? N[M.easing || "swing"] : M.easing || "swing";
  6621.             for (var L in D) {
  6622.                 if (r.inArray(L, v) === -1) {
  6623.                     var S = r.inArray(L, s) > -1,
  6624.                     U = i(V, D[L], L, (S && D.avoidTransforms !== true));
  6625.                     if (D.avoidTransforms !== true && p(L, U, V)) {
  6626.                         l(V, L, M.duration, O, S && D.avoidTransforms === true ? U + "px": U, S && D.avoidTransforms !== true, F, D.useTranslate3d === true)
  6627.                     } else {
  6628.                         Q[L] = D[L]
  6629.                     }
  6630.                 }
  6631.             }
  6632.             var W = V.data(m) || {};
  6633.             for (var P = n.length - 1; P >= 0; P--) {
  6634.                 if (typeof W[n[P] + "transition-property"] !== "undefined") {
  6635.                     W[n[P] + "transition-property"] = W[n[P] + "transition-property"].substr(2)
  6636.                 }
  6637.             }
  6638.             V.data(m, W).unbind(a);
  6639.             if (!d(V.data(m)) && !d(V.data(m).secondary)) {
  6640.                 H++;
  6641.                 V.css(V.data(m));
  6642.                 var T = V.data(m).secondary;
  6643.                 setTimeout(function () {
  6644.                     V.bind(a, R).css(T)
  6645.                 })
  6646.             } else {
  6647.                 M.queue = false
  6648.             }
  6649.             if (!d(Q)) {
  6650.                 H++;
  6651.                 t.apply(V, [Q, {
  6652.                     duration: M.duration,
  6653.                     easing: r.easing[M.easing] ? M.easing: (r.easing.swing ? "swing": "linear"),
  6654.                     complete: G,
  6655.                     queue: M.queue
  6656.                 }])
  6657.             }
  6658.             return true
  6659.         })
  6660.     };
  6661.     r.fn.animate.defaults = {};
  6662.     r.fn.stop = function (F, D, E) {
  6663.         if (!x) {
  6664.             return q.apply(this, [F, D])
  6665.         }
  6666.         if (F) {
  6667.             this.queue([])
  6668.         }
  6669.         var G = {};
  6670.         for (var C = n.length - 1; C >= 0; C--) {
  6671.             G[n[C] + "transition-property"] = "none";
  6672.             G[n[C] + "transition-duration"] = "";
  6673.             G[n[C] + "transition-timing-function"] = ""
  6674.         }
  6675.         this.each(function () {
  6676.             var J = r(this),
  6677.             I = window.getComputedStyle(this, null),
  6678.             L = {},
  6679.             K;
  6680.             if (!d(J.data(m)) && !d(J.data(m).secondary)) {
  6681.                 var M = J.data(m);
  6682.                 if (D) {
  6683.                     L = M.secondary;
  6684.                     if (!E && typeof M.meta.left_o !== undefined || typeof M.meta.top_o !== undefined) {
  6685.                         L.left = typeof M.meta.left_o !== undefined ? M.meta.left_o: "auto";
  6686.                         L.top = typeof M.meta.top_o !== undefined ? M.meta.top_o: "auto";
  6687.                         for (K = n.length - 1; K >= 0; K--) {
  6688.                             L[n[K] + "transform"] = ""
  6689.                         }
  6690.                     }
  6691.                 } else {
  6692.                     for (var N in J.data(m).secondary) {
  6693.                         N = N.replace(z, "-$1").toLowerCase();
  6694.                         L[N] = I.getPropertyValue(N);
  6695.                         if (!E && (/matrix/i).test(L[N])) {
  6696.                             var H = L[N].replace(/^matrix\(/i, "").split(/, |\)$/g);
  6697.                             L.left = (parseFloat(H[4]) + parseFloat(J.css("left")) + "px") || "auto";
  6698.                             L.top = (parseFloat(H[5]) + parseFloat(J.css("top")) + "px") || "auto";
  6699.                             for (K = n.length - 1; K >= 0; K--) {
  6700.                                 L[n[K] + "transform"] = ""
  6701.                             }
  6702.                         }
  6703.                     }
  6704.                 }
  6705.                 J.unbind(a).css(G).css(L).data(m, null)
  6706.             } else {
  6707.                 q.apply(J, [F, D])
  6708.             }
  6709.         });
  6710.         return this
  6711.     }
  6712. })(juicebox_lib.jQuery, juicebox_lib.jQuery.fn.animate, juicebox_lib.jQuery.fn.stop);
  6713. juicebox_lib.jQuery.fn.extend({
  6714.     disableSelection: function () {
  6715.         return this.each(function () {
  6716.             this.onselectstart = function () {
  6717.                 return false
  6718.             };
  6719.             this.unselectable = "on";
  6720.             jQuery(this).css("user-select", "none");
  6721.             jQuery(this).css("-o-user-select", "none");
  6722.             jQuery(this).css("-moz-user-select", "none");
  6723.             jQuery(this).css("-khtml-user-select", "none");
  6724.             jQuery(this).css("-webkit-user-select", "none")
  6725.         })
  6726.     }
  6727. });
  6728. if (!juicebox_lib.jQuery.easing.easeOutQuart) {
  6729.     juicebox_lib.jQuery.extend(juicebox_lib.jQuery.easing, {
  6730.         easeOutQuart: function (e, f, a, h, g) {
  6731.             return - h * ((f = f / g - 1) * f * f * f - 1) + a
  6732.         }
  6733.     })
  6734. }
  6735. var juice_box_utils = function (p$) {
  6736.     var $ = p$;
  6737.     var is_pro_version = "juice_box_utils";
  6738.     var is_absolute_path = function (path) {
  6739.         if (!path) {
  6740.             return false
  6741.         }
  6742.         if (path.indexOf("/") === 0) {
  6743.             return true
  6744.         }
  6745.         if (path.toLowerCase().indexOf("http://") === 0) {
  6746.             return true
  6747.         }
  6748.         if (path.toLowerCase().indexOf("https://") === 0) {
  6749.             return true
  6750.         }
  6751.         return false
  6752.     };
  6753.     var is_end_with = function (str, ch) {
  6754.         if (!str || !ch) {
  6755.             return false
  6756.         }
  6757.         if (str.substring(str.length - ch.length) === ch) {
  6758.             return true
  6759.         }
  6760.         return false
  6761.     };
  6762.     var convert_to_absolute_path = function (url) {
  6763.         if (is_absolute_path(url)) {
  6764.             return url
  6765.         }
  6766.         var uri = window.location.href.split("#")[0].split("?")[0];
  6767.         var ipos = uri.lastIndexOf("/");
  6768.         var iposs = uri.indexOf("://");
  6769.         if (ipos <= 0) {
  6770.             return "/" + url
  6771.         }
  6772.         if (iposs > 0 && ipos - iposs < 3) {
  6773.             return "/" + url
  6774.         }
  6775.         return uri.substring(0, ipos) + "/" + url
  6776.     };
  6777.     var concatenate_path = function (base, url) {
  6778.         if (!base) {
  6779.             base = ""
  6780.         }
  6781.         if (!url) {
  6782.             url = ""
  6783.         }
  6784.         if (is_absolute_path(url)) {
  6785.             return url
  6786.         }
  6787.         if (!is_end_with(base, "/") && base) {
  6788.             base += "/"
  6789.         }
  6790.         return base + url
  6791.     };
  6792.     var is_it_scrolling = function () {
  6793.         var doc = $(document);
  6794.         var win = $(window);
  6795.         return {
  6796.             v_scrolling: doc.height() > win.height(),
  6797.             h_scrolling: doc.width() > win.width()
  6798.         }
  6799.     };
  6800.     var in_iframe = function () {
  6801.         if (top && top.location !== location) {
  6802.             return true
  6803.         }
  6804.         return false
  6805.     };
  6806.     var is_iphone_chrome = function () {
  6807.         if (navigator.userAgent.match(/iPhone/i) && navigator.userAgent.match(/CriOS/i)) {
  6808.             return true
  6809.         }
  6810.         return false
  6811.     };
  6812.     var is_iphone = function () {
  6813.         if (navigator.userAgent.match(/iPhone/i)) {
  6814.             return true
  6815.         }
  6816.         return false
  6817.     };
  6818.     var is_ipad = function () {
  6819.         if (navigator.userAgent.match(/iPad/i)) {
  6820.             return true
  6821.         }
  6822.         return false
  6823.     };
  6824.     var is_android = function () {
  6825.         if (navigator.userAgent.match(/Android/i)) {
  6826.             return true
  6827.         }
  6828.         return false
  6829.     };
  6830.     var is_mobile_ie = function () {
  6831.         if (navigator.userAgent.match(/IEMobile/i)) {
  6832.             return true
  6833.         }
  6834.         return false
  6835.     };
  6836.     var is_small_android = function () {
  6837.         if (navigator.userAgent.match(/Galaxy Nexus/i)) {
  6838.             return true
  6839.         }
  6840.         if (navigator.userAgent.match(/Nexus S/i)) {
  6841.             return true
  6842.         }
  6843.         if (navigator.userAgent.match(/HTC Panache/i)) {
  6844.             return true
  6845.         }
  6846.         if (navigator.userAgent.match(/HTC myTouch/i)) {
  6847.             return true
  6848.         }
  6849.         if (navigator.userAgent.match(/Sensation/i)) {
  6850.             return true
  6851.         }
  6852.         if (is_android() && is_small_screen()) {
  6853.             return true
  6854.         }
  6855.         return false
  6856.     };
  6857.     var is_chrome = function () {
  6858.         if (navigator.userAgent.match(/Chrome/i)) {
  6859.             return true
  6860.         }
  6861.         return false
  6862.     };
  6863.     var is_opera = function () {
  6864.         if (navigator.userAgent.match(/Opera/i)) {
  6865.             return true
  6866.         }
  6867.         return false
  6868.     };
  6869.     var is_firefox = function () {
  6870.         if (navigator.userAgent.match(/Firefox/i)) {
  6871.             return true
  6872.         }
  6873.         return false
  6874.     };
  6875.     var get_android_ver = function () {
  6876.         var pos = navigator.userAgent.indexOf("Android");
  6877.         if (pos < 0) {
  6878.             return 0
  6879.         }
  6880.         var pose = navigator.userAgent.indexOf(";", pos);
  6881.         if (pose <= pos) {
  6882.             return 0
  6883.         }
  6884.         var vi = navigator.userAgent.substring(pos, pose);
  6885.         var va = vi.split(" ");
  6886.         if (va.length !== 2) {
  6887.             return 0
  6888.         }
  6889.         var num = parseInt(va[1].replace(/\./g, "").substring(0, 3));
  6890.         var ver = parseFloat(parseFloat(num) / 100);
  6891.         if (ver < 1) {
  6892.             ver *= 10
  6893.         }
  6894.         if (ver < 1) {
  6895.             ver *= 10
  6896.         }
  6897.         return ver
  6898.     };
  6899.     var get_vp_meta_cnt = function (density, scalable) {
  6900.         return "width=device-width, initial-scale=1.0, minimum-scale=" + (scalable ? 0.25 : 1) + ", maximum-scale=" + (scalable ? 4 : 1) + ", user-scalable=" + (scalable ? 1 : 0) + (density ? ", target-densitydpi=" + density: "")
  6901.     };
  6902.     var get_vp_meta_cnt_4_iphone_with_ratio = function (ratio) {
  6903.         return "width=800, initial-scale=" + ratio + ", minimum-scale=" + ratio + ", maximum-scale=" + ratio + ", user-scalable=" + (scalable ? 1 : 0)
  6904.     };
  6905.     var meta_tag_id = "sv-meta";
  6906.     var populate_viewport_meta_content = function (isFullscreen) {
  6907.         if (isFullscreen) {
  6908.             if (is_ipad() || is_iphone()) {
  6909.                 return get_vp_meta_cnt("")
  6910.             } else {
  6911.                 if (is_android()) {
  6912.                     return get_vp_meta_cnt(160)
  6913.                 }
  6914.             }
  6915.         } else {
  6916.             return ""
  6917.         }
  6918.         return ""
  6919.     };
  6920.     var set_viewport_value = function (val, scalable) {
  6921.         if (is_android()) {
  6922.             $("#" + meta_tag_id).attr("content", get_vp_meta_cnt(val, scalable))
  6923.         }
  6924.         if (is_iphone()) {
  6925.             $("#" + meta_tag_id).attr("content", get_vp_meta_cnt_4_iphone_with_ratio(val, scalable))
  6926.         }
  6927.     };
  6928.     var host_has_viewport_meta = function () {
  6929.         return document.getElementsByName("viewport").length > 0 && $("#" + meta_tag_id).length <= 0
  6930.     };
  6931.     var has_viewport_locked = function () {
  6932.         var vp = document.getElementsByName("viewport");
  6933.         if (!vp || vp.length <= 0 || !vp[0].content) {
  6934.             return false
  6935.         }
  6936.         var cnt = vp[0].content.toLowerCase().replace(/ /g, "");
  6937.         var hasInitialScale = cnt.indexOf("initial-scale=1.0") >= 0 || cnt.indexOf("initial-scale=1.,") >= 0 || cnt.indexOf("initial-scale=1,") >= 0;
  6938.         var userScalable = cnt.indexOf("user-scalable=0") >= 0 || cnt.indexOf("user-scalable=off") || cnt.indexOf("user-scalable=false");
  6939.         return hasInitialScale && userScalable
  6940.     };
  6941.     var need_viewport_meta = function () {
  6942.         if (is_ipad() || is_iphone() || is_android()) {
  6943.             return true
  6944.         }
  6945.         return false
  6946.     };
  6947.     var add_viewport_meta = function (isFullscreen) {
  6948.         if (!need_viewport_meta()) {
  6949.             return
  6950.         }
  6951.         if ($("#" + meta_tag_id).length > 0) {
  6952.             return
  6953.         }
  6954.         if (host_has_viewport_meta()) {
  6955.             return
  6956.         }
  6957.         var svmeta4idvc = document.createElement("meta");
  6958.         svmeta4idvc.name = "viewport";
  6959.         svmeta4idvc.id = meta_tag_id;
  6960.         svmeta4idvc.content = populate_viewport_meta_content(isFullscreen);
  6961.         var header = document.getElementsByTagName("head");
  6962.         if (!header) {
  6963.             return
  6964.         }
  6965.         header[0].appendChild(svmeta4idvc)
  6966.     };
  6967.     var set_viewport_meta = function (isFullscreen) {
  6968.         if (!need_viewport_meta()) {
  6969.             return
  6970.         }
  6971.         $("#" + meta_tag_id).attr("content", populate_viewport_meta_content(isFullscreen))
  6972.     };
  6973.     var get_viewport_meta_content = function () {
  6974.         var tags = document.getElementsByName("viewport");
  6975.         if (tags.length <= 0) {
  6976.             return null
  6977.         }
  6978.         if (!tags[0].content) {
  6979.             return null
  6980.         }
  6981.         return tags[0].content
  6982.     };
  6983.     var set_viewport_meta_content = function (content) {
  6984.         var tags = document.getElementsByName("viewport");
  6985.         if (tags.length <= 0) {
  6986.             return
  6987.         }
  6988.         tags[0].content = content
  6989.     };
  6990.     var get_current_path = function () {
  6991.         var uri = window.location.href.split("#")[0].split("?")[0];
  6992.         var posLasts = uri.lastIndexOf("/");
  6993.         var posS = uri.indexOf("//");
  6994.         if (posLasts < 0 || posS < 0) {
  6995.             return ""
  6996.         }
  6997.         var pos1 = uri.indexOf("/", posS + 2);
  6998.         if (pos1 < 0 || posLasts - pos1 <= 0) {
  6999.             return "/"
  7000.         }
  7001.         var tail = uri.substring(posLasts + 1);
  7002.         if (tail.indexOf(".") > 0) {
  7003.             return uri.substring(pos1, posLasts)
  7004.         }
  7005.         return uri.substring(pos1)
  7006.     };
  7007.     var get_qs_value = function (key, dft_) {
  7008.         if (dft_ == null) {
  7009.             dft_ = ""
  7010.         }
  7011.         key = key.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
  7012.         var regex = new RegExp("[\\?&]" + key + "=([^&#]*)");
  7013.         var qs = regex.exec(window.location.href);
  7014.         if (qs == null) {
  7015.             return dft_
  7016.         } else {
  7017.             return qs[1]
  7018.         }
  7019.     };
  7020.     var get_js_folder_url = function () {
  7021.         var i, root, pos, scripts = document.getElementsByTagName("script");
  7022.         for (i = 0; i < scripts.length; i++) {
  7023.             pos = scripts[i].src.toLowerCase().indexOf("juicebox.js");
  7024.             if (pos === 0) {
  7025.                 return ""
  7026.             }
  7027.             if (pos > 0) {
  7028.                 return scripts[i].src.substring(0, pos)
  7029.             }
  7030.         }
  7031.         return ""
  7032.     };
  7033.     var u_skey = "cd64f8c2ad416da082f8c514ba054429";
  7034.     var set_cookie = function (c_name, value, expires) {
  7035.         if (expires < 0) {
  7036.             expires = "Thu, 01 Jan 1970 00:00:00 GMT"
  7037.         } else {
  7038.             expires = ""
  7039.         }
  7040.         document.cookie = c_name + "=" + escape(value) + ((expires === "") ? "": ";expires=" + expires) + ";path=/"
  7041.     };
  7042.     var get_cookie = function (c_name) {
  7043.         if (document.cookie.length > 0) {
  7044.             c_start = document.cookie.indexOf(c_name + "=");
  7045.             if (c_start !== -1) {
  7046.                 c_start = c_start + c_name.length + 1;
  7047.                 c_end = document.cookie.indexOf(";", c_start);
  7048.                 if (c_end === -1) {
  7049.                     c_end = document.cookie.length
  7050.                 }
  7051.                 return unescape(document.cookie.substring(c_start, c_end))
  7052.             }
  7053.         }
  7054.         return ""
  7055.     };
  7056.     var wrap_value = function (val) {
  7057.         switch (typeof val) {
  7058.         case "boolean":
  7059.         case "number":
  7060.             return val + "";
  7061.         default:
  7062.             return '"' + val + '"'
  7063.         }
  7064.     };
  7065.     var save_object_2_cookie = function (c_name, object) {
  7066.         if (!object) {
  7067.             set_cookie(c_name, "");
  7068.             return
  7069.         }
  7070.         var jsons = "";
  7071.         for (var k in object) {
  7072.             if (jsons.length > 0) {
  7073.                 jsons += ","
  7074.             }
  7075.             jsons += k + ":" + wrap_value(object[k])
  7076.         }
  7077.         jsons = "{" + jsons + "}";
  7078.         set_cookie(c_name, jsons)
  7079.     };
  7080.     var get_object_from_cookie = function (c_name) {
  7081.         var json = get_cookie(c_name);
  7082.         var ret;
  7083.         eval("ret = " + (json ? json: null) + ";");
  7084.         return ret
  7085.     };
  7086.     var get_device_dpi = function (cb) {
  7087.         if (!is_iphone() && !is_ipad() && !is_android()) {
  7088.             if (cb) {
  7089.                 cb(1)
  7090.             }
  7091.             return 1
  7092.         }
  7093.         var s = document.createElement("style");
  7094.         var d = document.createElement("div");
  7095.         d.id = "dpi-detector-01";
  7096.         var map = [{
  7097.             ratio: 1,
  7098.             pixel: "10px"
  7099.         },
  7100.         {
  7101.             ratio: 1.5,
  7102.             pixel: "15px"
  7103.         },
  7104.         {
  7105.             ratio: 2,
  7106.             pixel: "20px"
  7107.         }];
  7108.         s.innerText = "";
  7109.         for (var i = 0; i < map.length; i++) {
  7110.             s.innerText += "@media (-webkit-min-device-pixel-ratio:" + map[i].ratio + ") {#" + d.id + "{font-size:" + map[i].pixel + " !important;}}"
  7111.         }
  7112.         document.documentElement.appendChild(s).appendChild(d);
  7113.         window.setTimeout(function () {
  7114.             var dfs = getComputedStyle(d, null).getPropertyValue("font-size");
  7115.             for (var j = 0; j < map.length; j++) {
  7116.                 if (dfs == map[i].pixel) {
  7117.                     if (cb) {
  7118.                         cb(map[i].ratio)
  7119.                     }
  7120.                     return map[i].ratio
  7121.                 }
  7122.             }
  7123.             s.parentNode.removeChild(s);
  7124.             d.parentNode.removeChild(d);
  7125.             if (cb) {
  7126.                 cb(1)
  7127.             }
  7128.             return 1
  7129.         },
  7130.         100)
  7131.     };
  7132.     var get_query_path = function (document_id, path) {
  7133.         var paths = path.split(",");
  7134.         var xpath = "";
  7135.         for (var i = 0; i < paths.length; i++) {
  7136.             xpath += "#" + document_id + " " + paths[i] + (i === paths.length - 1 ? "": ", ")
  7137.         }
  7138.         return xpath
  7139.     };
  7140.     var is_small_screen = function () {
  7141.         if (is_android()) {
  7142.             if (navigator.userAgent.match(/Mobile/i)) {
  7143.                 return true
  7144.             }
  7145.             return false
  7146.         }
  7147.         if (Math.max(screen.height, screen.width) > 1000) {
  7148.             return false
  7149.         }
  7150.         return true
  7151.     };
  7152.     var is_swipable_device = function () {
  7153.         if (!is_iphone() && !is_ipad() && !is_android()) {
  7154.             return false
  7155.         }
  7156.         return true
  7157.     };
  7158.     var is_large_screen_mode = function (config) {
  7159.         if (config.screenmode.toUpperCase() === "LARGE") {
  7160.             return true
  7161.         }
  7162.         if (config.screenmode.toUpperCase() === "SMALL") {
  7163.             return false
  7164.         }
  7165.         if (!is_small_screen() && !is_small_android() && !is_iphone()) {
  7166.             return true
  7167.         }
  7168.         return false
  7169.     };
  7170.     var is_earlier_ie = function () {
  7171.         if ($.browser.msie && $.browser.version < 9) {
  7172.             return true
  7173.         }
  7174.         return false
  7175.     };
  7176.     var is_ie8 = function () {
  7177.         return ($.browser.msie && $.browser.version < 9 && $.browser.version > 7)
  7178.     };
  7179.     var is_firefox3 = function () {
  7180.         var bz = $.browser;
  7181.         if (bz.mozilla && bz.version.slice(0, 3) == "1.9") {
  7182.             return true
  7183.         }
  7184.         return false
  7185.     };
  7186.     var format_color = function (color) {
  7187.         color = color.replace(/#/g, "");
  7188.         if (color.match(/^[0-9a-f]{3,6}$/i)) {
  7189.             return "#" + color
  7190.         }
  7191.         return color
  7192.     };
  7193.     var need_new_window = function (config) {
  7194.         var optval = config.expandinnewpage.toUpperCase();
  7195.         if (optval === "TRUE") {
  7196.             return true
  7197.         }
  7198.         if (optval === "FALSE") {
  7199.             return false
  7200.         }
  7201.         if (is_iphone() || is_ipad()) {
  7202.             if (has_viewport_locked()) {
  7203.                 return false
  7204.             }
  7205.             return true
  7206.         }
  7207.         return false
  7208.     };
  7209.     var is_new_expanded_window = function () {
  7210.         return typeof(expanded_jb_gallery) != "undefined" && expanded_jb_gallery
  7211.     };
  7212.     var is_adobe_air = function () {
  7213.         return navigator.userAgent.match(/AdobeAIR/i)
  7214.     };
  7215.     var show_real_fullscreen = function (domid) {
  7216.         var eledlg = document.getElementById(domid);
  7217.         if (eledlg.requestFullScreen) {
  7218.             eledlg.requestFullScreen()
  7219.         } else {
  7220.             if (eledlg.mozRequestFullScreen) {
  7221.                 eledlg.mozRequestFullScreen()
  7222.             } else {
  7223.                 if (eledlg.webkitRequestFullScreen) {
  7224.                     eledlg.webkitRequestFullScreen()
  7225.                 }
  7226.             }
  7227.         }
  7228.     };
  7229.     var exit_fullscreen = function () {
  7230.         if (document.cancelFullScreen) {
  7231.             document.cancelFullScreen()
  7232.         } else {
  7233.             if (document.mozCancelFullScreen) {
  7234.                 document.mozCancelFullScreen()
  7235.             } else {
  7236.                 if (document.webkitCancelFullScreen) {
  7237.                     document.webkitCancelFullScreen()
  7238.                 }
  7239.             }
  7240.         }
  7241.     };
  7242.     var support_real_fullscreen = function () {
  7243.         if (document.cancelFullScreen) {
  7244.             return true
  7245.         } else {
  7246.             if (document.mozCancelFullScreen) {
  7247.                 return true
  7248.             } else {
  7249.                 if (document.webkitCancelFullScreen) {
  7250.                     return true
  7251.                 }
  7252.             }
  7253.         }
  7254.         return false
  7255.     };
  7256.     var exit_support_real_fullscreen = function () {
  7257.         if (document.cancelFullScreen || document.mozCancelFullScreen || document.webkitCancelFullScreen) {
  7258.             return true
  7259.         }
  7260.         return false
  7261.     };
  7262.     var add_fullscreen_listener = function (callback) {
  7263.         if (typeof(callback) != "function") {
  7264.             return
  7265.         }
  7266.         if ($.browser.msie) {
  7267.             return
  7268.         }
  7269.         document.addEventListener("fullscreenchange", function () {
  7270.             callback(document.fullscreen)
  7271.         },
  7272.         false);
  7273.         document.addEventListener("mozfullscreenchange", function () {
  7274.             callback(document.mozFullScreen)
  7275.         },
  7276.         false);
  7277.         document.addEventListener("webkitfullscreenchange", function () {
  7278.             callback(document.webkitIsFullScreen)
  7279.         },
  7280.         false)
  7281.     };
  7282.     var is_side_layout = function (config) {
  7283.         var tmbpos = config.thumbsposition.toUpperCase();
  7284.         return tmbpos === "LEFT" || tmbpos === "RIGHT"
  7285.     };
  7286.     var get_gallery_title_html = function (config) {
  7287.         return "<div class='jb-area-large-mode-title" + (config.gallerytitleposition.toUpperCase() === "OVERLAY" ? " jb-classifier-show-on-over ": " ") + "jb-classifier-layer' layer='600' style='position:absolute;display:none;z-index:600'>" + config.gallerytitle + "</div>"
  7288.     };
  7289.     var get_caption_html = function () {
  7290.         return "<div class='jb-area-caption jb-classifier-layer' layer='200' style='position:absolute !important;overflow:hidden; bottom: 0; z-index:200;'></div>"
  7291.     };
  7292.     return {
  7293.         ship: is_pro_version === u_skey,
  7294.         concate_path: concatenate_path,
  7295.         is_page_scrolling: is_it_scrolling,
  7296.         is_in_iframe: in_iframe,
  7297.         add_viewport_meta_tag_4_device: add_viewport_meta,
  7298.         set_viewport_meta: set_viewport_meta,
  7299.         is_iphone: is_iphone,
  7300.         is_iphone_chrome: is_iphone_chrome,
  7301.         is_ipad: is_ipad,
  7302.         is_android: is_android,
  7303.         is_small_android: is_small_android,
  7304.         get_android_ver: get_android_ver,
  7305.         is_chrome: is_chrome,
  7306.         is_opera: is_opera,
  7307.         get_current_path: get_current_path,
  7308.         get_query_string_value: get_qs_value,
  7309.         save_object_2_cookie: save_object_2_cookie,
  7310.         get_object_from_cookie: get_object_from_cookie,
  7311.         get_device_dpi: get_device_dpi,
  7312.         get_query_path: get_query_path,
  7313.         is_swipable_device: is_swipable_device,
  7314.         is_large_screen_mode: is_large_screen_mode,
  7315.         is_earlier_ie: is_earlier_ie,
  7316.         set_viewport_value: set_viewport_value,
  7317.         format_color: format_color,
  7318.         need_viewport_meta: need_viewport_meta,
  7319.         host_has_viewport_meta: host_has_viewport_meta,
  7320.         get_viewport_meta_content: get_viewport_meta_content,
  7321.         set_viewport_meta_content: set_viewport_meta_content,
  7322.         is_firefox: is_firefox,
  7323.         is_firefox3: is_firefox3,
  7324.         get_js_folder_url: get_js_folder_url,
  7325.         need_new_window: need_new_window,
  7326.         convert_to_absolute_path: convert_to_absolute_path,
  7327.         is_adobe_air: is_adobe_air,
  7328.         is_new_expanded_window: is_new_expanded_window,
  7329.         show_real_fullscreen: show_real_fullscreen,
  7330.         exit_fullscreen: exit_fullscreen,
  7331.         exit_support_real_fullscreen: exit_support_real_fullscreen,
  7332.         add_fullscreen_listener: add_fullscreen_listener,
  7333.         is_ie8: is_ie8,
  7334.         is_mobile_ie: is_mobile_ie,
  7335.         support_real_fullscreen: support_real_fullscreen,
  7336.         is_side_layout: is_side_layout,
  7337.         get_gallery_title_html: get_gallery_title_html,
  7338.         get_caption_html: get_caption_html
  7339.     }
  7340. };
  7341. var juicebox_config_manager = function (h, i) {
  7342.     var e = h;
  7343.     var m = i;
  7344.     var f = false;
  7345.     var c = true;
  7346.     var l = false;
  7347.     var C = "";
  7348.     var A = "";
  7349.     var E = {
  7350.         containerid: "",
  7351.         debugmode: false,
  7352.         forcetouchmode: false,
  7353.         usefullscreenexpand: false,
  7354.         expandinnewpage: "AUTO",
  7355.         gallerywidth: "100%",
  7356.         galleryheight: "100%",
  7357.         backgroundcolor: "",
  7358.         backgroundurl: "",
  7359.         backgroundscale: "STRETCH",
  7360.         backgroundopacity: "1",
  7361.         textcolor: "",
  7362.         topbackcolor: "",
  7363.         topbackopacity: "0",
  7364.         captionbackcolor: "",
  7365.         captionbackopacity: "1",
  7366.         buttonbarbackcolor: "",
  7367.         buttonbarbackopacity: "1",
  7368.         imageframecolor: "",
  7369.         imageframeopacity: "1",
  7370.         thumbframecolor: "rgba(255, 255, 255, .5)",
  7371.         thumbframeopacity: "",
  7372.         thumbframewidth: 0,
  7373.         thumbhoverframewidth: 2,
  7374.         thumbselectedframewidth: 10,
  7375.         thumbcornerradius: 0,
  7376.         thumbshadowcolor: "rgba(0, 0, 0, .4)",
  7377.         thumbshadowcolora: "",
  7378.         thumbshadowblur: 5,
  7379.         imageshadowcolor: "rgba(0, 0, 0, .4)",
  7380.         imageshadowcolora: "",
  7381.         imageshadowblur: 10,
  7382.         stagepadding: 0,
  7383.         imagepadding: 0,
  7384.         framewidth: 0,
  7385.         enablekeyboardcontrols: true,
  7386.         firstimageindex: -1,
  7387.         randomizeimages: false,
  7388.         showpreloader: true,
  7389.         screenmode: "AUTO",
  7390.         languagelist: 'Previous|Next|Start AutoPlay|Stop AutoPlay|Play Audio|Pause Audio|Show Thumbnails|Expand Gallery|Close Gallery|Open Image in New Window|Download Image|About|AutoPlay ON|AutoPlay OFF|Show Thumbnails|Hide Thumbnails|Show Information|Next Image|Previous Image|Hide Information|Juicebox does not display locally in $BrowserName$. <a href="http://www.juicebox.net/support/faq/#$BrowserLink$">More Info</a>.|Juicebox Error: Config XML file not found.|Juicebox Error: Cannot find div with id: "|"|Juicebox Error: Theme CSS file not found',
  7391.         imagelocking: false,
  7392.         enablelooping: false,
  7393.         changeimageonhover: false,
  7394.         maximagewidth: 1024,
  7395.         maximageheight: 768,
  7396.         imageclickmode: "NAVIGATE",
  7397.         imagescalemode: "SCALE_DOWN",
  7398.         imagepreloading: "PAGE",
  7399.         imagetransitiontime: 0.5,
  7400.         imagetransitiontype: "SLIDE",
  7401.         showimageoverlay: "AUTO",
  7402.         showimagenav: true,
  7403.         imagenavposition: "STAGE",
  7404.         showbigplaybutton: false,
  7405.         thumbsposition: "BOTTOM",
  7406.         thumbnavposition: "CENTER",
  7407.         thumbwidth: 85,
  7408.         thumbheight: 85,
  7409.         thumbpadding: 10,
  7410.         thumbseparation: 10,
  7411.         thumbpreloading: "PAGE",
  7412.         changecaptiononhover: false,
  7413.         changeimageonhover: false,
  7414.         usethumbdots: false,
  7415.         showthumbpagingtext: false,
  7416.         showsmallthumbs: true,
  7417.         smallthumbsshowtitles: false,
  7418.         smallthumbslayoutstyle: "GRID",
  7419.         smallthumbslidetime: 0.5,
  7420.         topareaheight: 50,
  7421.         buttonbarposition: "OVERLAY",
  7422.         buttonbarhalign: "RIGHT",
  7423.         showopenbutton: true,
  7424.         showexpandbutton: true,
  7425.         showinfobutton: false,
  7426.         showdownloadbutton: false,
  7427.         showsharebutton: true,
  7428.         shownavbuttons: false,
  7429.         showautoplaybutton: false,
  7430.         showaudiobutton: false,
  7431.         showthumbsbutton: true,
  7432.         showlargethumbs: true,
  7433.         gallerytitle: "",
  7434.         gallerytitleposition: "OVERLAY",
  7435.         gallerytitlehalign: "LEFT",
  7436.         captionposition: "OVERLAY",
  7437.         captionhalign: "LEFT",
  7438.         maxcaptionheight: 120,
  7439.         showimagenumber: true,
  7440.         enableautoplay: false,
  7441.         autoplayonload: false,
  7442.         displaytime: 5,
  7443.         showautoplaystatus: true,
  7444.         gonextonautoplay: false,
  7445.         autoplaythumbs: true,
  7446.         audiourlmp3: "",
  7447.         audiourlogg: "",
  7448.         loopaudio: true,
  7449.         playaudioonload: false,
  7450.         audiovolume: 0.8,
  7451.         showsmallbackbutton: false,
  7452.         backbuttonuseicon: false,
  7453.         backbuttontext: "< Back",
  7454.         backbuttonurl: "",
  7455.         backbuttonposition: "NONE",
  7456.         backbuttonhalign: "LEFT",
  7457.         usefixedlayout: false,
  7458.         showsplashpage: "AUTO",
  7459.         splashbuttontext: "View Gallery",
  7460.         splashtitle: "",
  7461.         splashimageurl: "",
  7462.         splashshowimagecount: true,
  7463.         splashdescription: "",
  7464.         enableseo: false,
  7465.         seoadditionaltext: "",
  7466.         enabledirectlinks: false,
  7467.         configurl: "config.xml",
  7468.         themeurl: m.get_js_folder_url() + "classic/theme.css",
  7469.         baseurl: "",
  7470.         useflickr: false,
  7471.         flickrusername: "",
  7472.         flickrtags: "",
  7473.         flickruserid: "",
  7474.         flickrsetid: "",
  7475.         flickrgroupid: "",
  7476.         flickrtagmode: "ALL",
  7477.         flickrsort: "DATE-POSTED-DESC",
  7478.         flickrimagesize: "LARGE",
  7479.         flickrimagecount: 50,
  7480.         flickrextraparams: "",
  7481.         flickrshowtitle: true,
  7482.         flickrshowdescription: false,
  7483.         flickrshowpagelink: false,
  7484.         flickrpagelinktext: "View on Flickr",
  7485.         theme: "classic",
  7486.         showcaption: true,
  7487.         slidecaption: false,
  7488.         maxthumbcolumns: 10,
  7489.         maxthumbrows: 1,
  7490.         thumb_load_placeholder: "<div class='jb-status-thumb-loading'><div>",
  7491.         main_load_placeholder: "<div class='jb-status-loading'></div>",
  7492.         pages_header: "",
  7493.         sync_caption_dimensions: true,
  7494.         minimagegap: 60,
  7495.         use_webkit_transform: (m.is_swipable_device() && !m.is_in_iframe() && m.is_ipad()) || e.browser.chrome,
  7496.         onload: function () {}
  7497.     };
  7498.     var g = ",onload,";
  7499.     var D = ",containerid,gallerytitle,gallerywidth,galleryheight,backgroundcolor,overlaycolor,framecolor,showopenbutton,showexpandbutton,useflickr,flickrusername,flickrtags,configurl,themeurl,baseurl,debugmode,showthumbsbutton,maximagewidth,maximageheight,";
  7500.     var j = {
  7501.         usefullscreenexpand: {
  7502.             appliedValues: [true],
  7503.             "default": false
  7504.         },
  7505.         showlargethumbs: {
  7506.             appliedValues: [false],
  7507.             "default": true
  7508.         },
  7509.         usethumbdots: {
  7510.             appliedValues: [true],
  7511.             "default": false
  7512.         },
  7513.         captionposition: {
  7514.             appliedValues: ["BELOW_IMAGE", "BOTTOM", "OVERLAY_IMAGE", "BELOW_THUMBS"],
  7515.             "default": "OVERLAY"
  7516.         },
  7517.         captionhalign: {
  7518.             appliedValues: ["CENTER", "RIGHT"],
  7519.             "default": "LEFT"
  7520.         },
  7521.         buttonbarposition: {
  7522.             appliedValues: ["TOP"],
  7523.             "default": "OVERLAY"
  7524.         },
  7525.         backbuttonposition: {
  7526.             appliedValues: ["TOP", "OVERLAY"],
  7527.             "default": "NONE"
  7528.         },
  7529.         backbuttonhalign: {
  7530.             appliedValues: ["RIGHT", "CENTER"],
  7531.             "default": "LEFT"
  7532.         },
  7533.         stagepadding: {
  7534.             appliedValues: null,
  7535.             "default": 0
  7536.         },
  7537.         topbackcolor: {
  7538.             appliedValues: null,
  7539.             "default": ""
  7540.         },
  7541.         thumbsposition: {
  7542.             appliedValues: ["TOP", "LEFT", "RIGHT"],
  7543.             "default": "BOTTOM"
  7544.         },
  7545.         thumbnavposition: {
  7546.             appliedValues: ["BOTTOM"],
  7547.             "default": "CENTER"
  7548.         },
  7549.         imageframecolor: {
  7550.             appliedValues: null,
  7551.             "default": ""
  7552.         },
  7553.         imagetransitiontype: {
  7554.             appliedValues: null,
  7555.             "default": "SLIDE"
  7556.         },
  7557.         changeimageonhover: {
  7558.             appliedValues: [true],
  7559.             "default": false
  7560.         },
  7561.         gallerytitleposition: {
  7562.             appliedValues: ["TOP", "ABOVE_THUMBS"],
  7563.             "default": "OVERLAY"
  7564.         },
  7565.         gallerytitlehalign: {
  7566.             appliedValues: ["RIGHT", "CENTER"],
  7567.             "default": "LEFT"
  7568.         }
  7569.     };
  7570.     var n = function (G) {
  7571.         if (!G) {
  7572.             return "100%"
  7573.         }
  7574.         if (typeof(G) === "number" || G.indexOf("%") <= 0) {
  7575.             return parseInt(G) + "px"
  7576.         }
  7577.         return G
  7578.     };
  7579.     var d = function (I, H) {
  7580.         if (!I) {
  7581.             return H
  7582.         }
  7583.         var G = I.split("#")[0].split("?")[0].split("/");
  7584.         if (G.length <= 0) {
  7585.             return H
  7586.         }
  7587.         if (G.length <= 1) {
  7588.             return ""
  7589.         }
  7590.         if (G[G.length - 1].toLowerCase().indexOf("theme.css") < 0) {
  7591.             return H
  7592.         }
  7593.         return G[G.length - 2]
  7594.     };
  7595.     var o = function (H, G, I) {
  7596.         if (!H || H.length <= G) {
  7597.             return I
  7598.         }
  7599.         return H[G]
  7600.     };
  7601.     var s = function (I, G) {
  7602.         if (!G) {
  7603.             return true
  7604.         }
  7605.         for (var H = 0; H < G.length; H++) {
  7606.             if (typeof(I) === "string") {
  7607.                 if (G[H].toUpperCase() === I.toUpperCase()) {
  7608.                     return true
  7609.                 }
  7610.             } else {
  7611.                 if (G[H] === I) {
  7612.                     return true
  7613.                 }
  7614.             }
  7615.         }
  7616.         return false
  7617.     };
  7618.     var z = function () {
  7619.         if (E.audiovolume < 0) {
  7620.             E.audiovolume = 0
  7621.         }
  7622.         if (E.audiovolume > 1) {
  7623.             E.audiovolume = 1
  7624.         }
  7625.         if (m.is_iphone() || m.is_ipad()) {
  7626.             E.playaudioonload = false
  7627.         }
  7628.         if (!E.showpreloader) {
  7629.             E.main_load_placeholder = E.main_load_placeholder.replace("jb-status-loading", "jb-status-no-loading")
  7630.         }
  7631.         if (E.backbuttonuseicon) {
  7632.             E.backbuttontext = " "
  7633.         }
  7634.         var H = m.is_large_screen_mode(E);
  7635.         if (H) {
  7636.             E.showsmallbackbutton = false;
  7637.             return
  7638.         }
  7639.         for (var G in E) {
  7640.             if (!j[G]) {
  7641.                 continue
  7642.             }
  7643.             if (!s(E[G], j[G].appliedValues)) {
  7644.                 continue
  7645.             }
  7646.             E[G] = j[G]["default"]
  7647.         }
  7648.         if (m.is_swipable_device()) {
  7649.             if (E.forcetouchmode) {
  7650.                 E.forcetouchmodereversed = true
  7651.             }
  7652.             E.forcetouchmode = false
  7653.         }
  7654.         E.thumbselectedframewidth = E.thumbframewidth
  7655.     };
  7656.     var a = function () {
  7657.         E.galleryheight = n(E.galleryheight);
  7658.         E.gallerywidth = n(E.gallerywidth);
  7659.         E.theme = d(E.themeurl, E.theme);
  7660.         if (E.thumbwidth < 20 || E.thumbwidth > 600) {
  7661.             E.thumbwidth = 96
  7662.         }
  7663.         if (E.thumbheight < 20 || E.thumbheight > 600) {
  7664.             E.thumbheight = 96
  7665.         }
  7666.         if (typeof(E.languagelist) === "string") {
  7667.             var H = E.languagelist.split("|");
  7668.             E.languagelist = {};
  7669.             E.languagelist.p = o(H, 0, "");
  7670.             E.languagelist.n = o(H, 1, "");
  7671.             E.languagelist.strta = o(H, 2, "");
  7672.             E.languagelist.stpa = o(H, 3, "");
  7673.             E.languagelist.plya = o(H, 4, "");
  7674.             E.languagelist.psa = o(H, 5, "");
  7675.             E.languagelist.st = o(H, 6, "");
  7676.             E.languagelist.gf = o(H, 7, "");
  7677.             E.languagelist.ef = o(H, 8, "");
  7678.             E.languagelist.oiinw = o(H, 9, "");
  7679.             E.languagelist.di = o(H, 10, "");
  7680.             E.languagelist.abt = o(H, 11, "");
  7681.             E.languagelist.aon = o(H, 12, "");
  7682.             E.languagelist.aoff = o(H, 13, "");
  7683.             E.languagelist.stlsm = o(H, 14, "");
  7684.             E.languagelist.htlsm = o(H, 15, "");
  7685.             E.languagelist.sinfo = o(H, 16, "");
  7686.             E.languagelist.gonxt = o(H, 17, "");
  7687.             E.languagelist.goprv = o(H, 18, "");
  7688.             E.languagelist.hdinfo = o(H, 19, "");
  7689.             E.languagelist.lcchm = o(H, 20, "");
  7690.             E.languagelist.ae = o(H, 21, "");
  7691.             E.languagelist.noid01 = o(H, 22, "");
  7692.             E.languagelist.noid02 = o(H, 23, "");
  7693.             E.languagelist.nothm = o(H, 24, "")
  7694.         }
  7695.         var I;
  7696.         if (E) {
  7697.             if (E.backgroundcolor) {
  7698.                 I = r(E.backgroundcolor);
  7699.                 E.backgroundcolor = I.color;
  7700.                 E.backgroundopacity = I.opacity
  7701.             }
  7702.             if (E.textcolor) {
  7703.                 I = r(E.textcolor);
  7704.                 E.textcolor = I.color
  7705.             }
  7706.             if (E.topbackcolor) {
  7707.                 I = r(E.topbackcolor);
  7708.                 E.topbackcolor = I.color;
  7709.                 E.topbackopacity = I.opacity
  7710.             }
  7711.             if (E.captionbackcolor) {
  7712.                 I = r(E.captionbackcolor);
  7713.                 E.captionbackcolor = I.color;
  7714.                 E.captionbackopacity = I.opacity
  7715.             }
  7716.             if (E.buttonbarbackcolor) {
  7717.                 I = r(E.buttonbarbackcolor);
  7718.                 E.buttonbarbackcolor = I.color;
  7719.                 E.buttonbarbackopacity = I.opacity
  7720.             }
  7721.             if (E.imageframecolor) {
  7722.                 I = r(E.imageframecolor);
  7723.                 E.imageframecolor = I.color;
  7724.                 E.imageframeopacity = I.opacity
  7725.             }
  7726.             if (E.thumbframecolor) {
  7727.                 I = r(E.thumbframecolor);
  7728.                 E.thumbframecolor = I.color;
  7729.                 E.thumbframeopacity = I.opacity
  7730.             }
  7731.             if (E.thumbshadowcolor) {
  7732.                 I = r(E.thumbshadowcolor);
  7733.                 E.thumbshadowcolora = I.color
  7734.             }
  7735.             if (E.imageshadowcolor) {
  7736.                 I = r(E.imageshadowcolor);
  7737.                 E.imageshadowcolora = I.color
  7738.             }
  7739.             var G = m.is_large_screen_mode(E);
  7740.             if (A.indexOf("maxthumbrows,") < 0) {
  7741.                 if (G) {
  7742.                     if (A.indexOf("screenmode,") > -1) {
  7743.                         E.maxthumbrows = 1
  7744.                     }
  7745.                 }
  7746.             }
  7747.             if (G) {
  7748.                 E.showsmallthumbs = true;
  7749.                 if (E.usethumbdots && E.maxthumbcolumns <= 1 && E.thumbnavposition.toUpperCase() === "BOTTOM") {
  7750.                     E.maxthumbcolumns = 2
  7751.                 }
  7752.             } else {
  7753.                 E.showthumbsbutton = true;
  7754.                 E.maxthumbcolumns = 1000;
  7755.                 E.maxthumbrows = 1000
  7756.             }
  7757.         }
  7758.     };
  7759.     var q = function (H) {
  7760.         var G = H.toString(16);
  7761.         if (G.length >= 2) {
  7762.             return G
  7763.         }
  7764.         if (G.length === 1) {
  7765.             return "0" + G
  7766.         }
  7767.         if (G.length === 0) {
  7768.             return "00"
  7769.         }
  7770.         return G
  7771.     };
  7772.     var r = function (N) {
  7773.         if (!N) {
  7774.             return {
  7775.                 color: "",
  7776.                 opacity: v(1)
  7777.             }
  7778.         }
  7779.         var L = N.toLowerCase().replace(/ /g, "");
  7780.         if (L.indexOf("rgb") !== 0) {
  7781.             return {
  7782.                 color: N,
  7783.                 opacity: v(1)
  7784.             }
  7785.         }
  7786.         L = L.replace("rgba(", "").replace("rgb(", "").replace(")", "");
  7787.         var K = L.split(",");
  7788.         if (K.length < 3 || K.length > 4) {
  7789.             return {
  7790.                 color: N,
  7791.                 opacity: v(1)
  7792.             }
  7793.         }
  7794.         var H = N;
  7795.         if (e.browser.msie && e.browser.version < 9) {
  7796.             var J = parseInt(K[0]);
  7797.             var I = parseInt(K[1]);
  7798.             var G = parseInt(K[2]);
  7799.             H = q(J) + q(I) + q(G)
  7800.         }
  7801.         if (K.length === 3) {
  7802.             return {
  7803.                 color: H,
  7804.                 opacity: v(1)
  7805.             }
  7806.         }
  7807.         var M = parseFloat(K[3]);
  7808.         if (M < 0 || M > 1) {
  7809.             return {
  7810.                 color: H,
  7811.                 opacity: v(1)
  7812.             }
  7813.         }
  7814.         return {
  7815.             color: H,
  7816.             opacity: v(M.toString())
  7817.         }
  7818.     };
  7819.     var v = function (G) {
  7820.         if (! (e.browser.msie && e.browser.version < 9)) {
  7821.             return G
  7822.         }
  7823.         if (("" + G).indexOf("filter") === 0) {
  7824.             return G
  7825.         }
  7826.         var H = e.browser.version < 8 ? 100 : parseInt(100 * G);
  7827.         return "filter:alpha(opacity=" + H + ")"
  7828.     };
  7829.     var u = function (I) {
  7830.         if (!I) {
  7831.             return
  7832.         }
  7833.         var H, J;
  7834.         for (var G in I) {
  7835.             H = G.toLowerCase();
  7836.             if (typeof E[H] == "undefined") {
  7837.                 continue
  7838.             }
  7839.             J = "," + H + ",";
  7840.             if (p === "048d7e421a20974d54321bc3563ebd52") {
  7841.                 continue
  7842.             }
  7843.             if (!f && p !== "048d7e421a02974b54391bc3463ebd52" && D.indexOf(J) < 0) {
  7844.                 continue
  7845.             }
  7846.             if (g.indexOf(J) >= 0) {
  7847.                 continue
  7848.             }
  7849.             A += H + ",";
  7850.             E[H] = t(I[G], (typeof E[H]))
  7851.         }
  7852.         a()
  7853.     };
  7854.     var p = "048d7e421a20974d54391bc3463ebd52";
  7855.     var t = function (H, G) {
  7856.         switch (G) {
  7857.         case "boolean":
  7858.             if (typeof H == "boolean") {
  7859.                 return H
  7860.             }
  7861.             return (H.toLowerCase() == "true" || H.toLowerCase() == "on" || H == "1") ? true: false;
  7862.         case "number":
  7863.             return parseFloat(H);
  7864.         default:
  7865.             return H
  7866.         }
  7867.         return H
  7868.     };
  7869.     var F = function () {
  7870.         var G = "";
  7871.         var K = ",gallerywidth,galleryheight,containerid,maxthumbrows,maxthumbcolumns,";
  7872.         var J, I;
  7873.         for (var H in E) {
  7874.             J = "," + H + ",";
  7875.             if (g.indexOf(J) >= 0) {
  7876.                 continue
  7877.             }
  7878.             if (K.indexOf(J) >= 0) {
  7879.                 continue
  7880.             }
  7881.             if (p === "048d7e421a20975d64321bc3563ebd52") {
  7882.                 continue
  7883.             }
  7884.             I = (typeof E[H] == "string") ? E[H].replace("#", "_p-s_") : E[H];
  7885.             G += H + "=" + encodeURI(I) + "&"
  7886.         }
  7887.         return G
  7888.     };
  7889.     var B = function () {
  7890.         var K = window.location.href.split("?");
  7891.         if (K.length <= 1) {
  7892.             return null
  7893.         }
  7894.         var G = K[1].split("#");
  7895.         if (G.length <= 0) {
  7896.             return null
  7897.         }
  7898.         var O = G[0].split("&");
  7899.         var L = {};
  7900.         var N, H, P, J;
  7901.         var M;
  7902.         for (var I = 0; I < O.length; I++) {
  7903.             N = O[I].split("=");
  7904.             if (N.length < 2) {
  7905.                 continue
  7906.             }
  7907.             H = N[0].toLowerCase();
  7908.             J = N[1] ? N[1].replace("_p-s_", "#") : "";
  7909.             P = decodeURI(J);
  7910.             M = typeof E[H];
  7911.             if (M == "undefined") {
  7912.                 continue
  7913.             }
  7914.             L[H] = t(P, M)
  7915.         }
  7916.         return L
  7917.     };
  7918.     var k = function (I) {
  7919.         if (!I) {
  7920.             return null
  7921.         }
  7922.         var H = {};
  7923.         var L, J;
  7924.         var G = (e.browser.msie && I.childNodes.length > 1) ? I.childNodes[1] : I.childNodes[0];
  7925.         if (!G || !G.attributes) {
  7926.             return null
  7927.         }
  7928.         var K = e(G.attributes);
  7929.         K.each(function (M, N) {
  7930.             L = N.nodeName.toLowerCase();
  7931.             J = typeof E[L];
  7932.             if (J == "undefined") {
  7933.                 return
  7934.             }
  7935.             H[L] = t(N.nodeValue, J)
  7936.         });
  7937.         return H
  7938.     };
  7939.     var y = function (J) {
  7940.         if (!J) {
  7941.             J = C
  7942.         }
  7943.         var M = function (Q, R, P) {
  7944.             if (P < 0) {
  7945.                 P = "Thu, 01 Jan 1970 00:00:00 GMT"
  7946.             } else {
  7947.                 P = ""
  7948.             }
  7949.             document.cookie = Q + "=" + escape(R) + ((P === "") ? "": ";expires=" + P) + ";path=/"
  7950.         };
  7951.         var K = function K(P) {
  7952.             if (document.cookie.length > 0) {
  7953.                 c_start = document.cookie.indexOf(P + "=");
  7954.                 if (c_start !== -1) {
  7955.                     c_start = c_start + P.length + 1;
  7956.                     c_end = document.cookie.indexOf(";", c_start);
  7957.                     if (c_end === -1) {
  7958.                         c_end = document.cookie.length
  7959.                     }
  7960.                     return unescape(document.cookie.substring(c_start, c_end))
  7961.                 }
  7962.             }
  7963.             return ""
  7964.         };
  7965.         var I = function () {
  7966.             return J + "svcrntimgi_lf"
  7967.         };
  7968.         var G = function () {
  7969.             return J + "-sv-config-"
  7970.         };
  7971.         var N = function () {
  7972.             return J + "-changed-options-"
  7973.         };
  7974.         var H = function (U) {
  7975.             M(I(), "1", null);
  7976.             var T = A.split(",");
  7977.             var S = U.skip ? "," + U.skip + ",": "";
  7978.             for (var R = 0; R < T.length; R++) {
  7979.                 if (!T[R]) {
  7980.                     continue
  7981.                 }
  7982.                 if (S.indexOf("," + T[R] + ",") >= 0) {
  7983.                     continue
  7984.                 }
  7985.                 M(G() + T[R], encodeURI(E[T[R]]))
  7986.             }
  7987.             var V = "," + A;
  7988.             var P = U.skip.split(",");
  7989.             for (var R = 0; R < P.length; R++) {
  7990.                 V.replace("," + P[R] + ",", ",")
  7991.             }
  7992.             for (var Q in U.config) {
  7993.                 if (!Q) {
  7994.                     continue
  7995.                 }
  7996.                 if (V.indexOf("," + Q + ",") < 0) {
  7997.                     V += Q + ","
  7998.                 }
  7999.                 E[Q] = U.config[Q];
  8000.                 M(G() + Q, encodeURI(E[Q]))
  8001.             }
  8002.             M(N(), V)
  8003.         };
  8004.         var L = function () {
  8005.             if (!K(I())) {
  8006.                 return
  8007.             }
  8008.             var S = K(N());
  8009.             if (!S) {
  8010.                 return
  8011.             }
  8012.             var P = S.split(",");
  8013.             for (var Q = 0; Q < P.length; Q++) {
  8014.                 if (!P[Q]) {
  8015.                     continue
  8016.                 }
  8017.                 var R = K(G() + P[Q]);
  8018.                 if (!R) {
  8019.                     continue
  8020.                 }
  8021.                 E[P[Q]] = t(decodeURI(R), typeof(E[P[Q]]))
  8022.             }
  8023.         };
  8024.         var O = function () {
  8025.             M(I(), "", -10)
  8026.         };
  8027.         return {
  8028.             saveConfig: H,
  8029.             loadSavedConfig: L,
  8030.             clearCookie: O
  8031.         }
  8032.     };
  8033.     var b = function (H, G, J) {
  8034.         if (window.location.href.indexOf("jbdbgmd=true") > 0 && l) {
  8035.             f = true
  8036.         }
  8037.         u(k(G));
  8038.         u(H);
  8039.         if (E.debugmode || f) {
  8040.             u(B())
  8041.         }
  8042.         C = J;
  8043.         var I = y(C);
  8044.         if (!m.is_new_expanded_window()) {
  8045.             I.clearCookie()
  8046.         } else {
  8047.             I.loadSavedConfig()
  8048.         }
  8049.     };
  8050.     var w = function (H, G) {
  8051.         u(k(G));
  8052.         u(H);
  8053.         if (E.debugmode || f) {
  8054.             u(B())
  8055.         }
  8056.         z()
  8057.     };
  8058.     var x = function () {
  8059.         return E
  8060.     };
  8061.     return {
  8062.         isp: c == p,
  8063.         init: b,
  8064.         sync_options: w,
  8065.         get_config: x,
  8066.         get_query_string: F,
  8067.         get_cookie_manager: y
  8068.     }
  8069. };
  8070. var juicebox_gallery_dialog = function (f) {
  8071.     var h, b;
  8072.     var a = "jb-glry-dlg";
  8073.     var i = function (m) {
  8074.         h = m.jquery;
  8075.         b = h("#" + a);
  8076.         if (b.length <= 0) {
  8077.             h("body").append(k());
  8078.             b = h("#" + a)
  8079.         }
  8080.     };
  8081.     var k = function () {
  8082.         return "<div id='" + a + "' style='display:none;position:absolute;width:100%;height:100%;left:0;top:0;'></div>"
  8083.     };
  8084.     var c = function () {
  8085.         b.hide()
  8086.     };
  8087.     var l = function () {
  8088.         c();
  8089.         b.html("");
  8090.         g(true);
  8091.         d(true)
  8092.     };
  8093.     var g = function (m) {
  8094.         if (m) {
  8095.             b.siblings(".jb-status-hiding-4-dlg").show().removeClass("jb-status-hiding-4-dlg")
  8096.         } else {
  8097.             b.siblings(":visible").addClass("jb-status-hiding-4-dlg").hide()
  8098.         }
  8099.     };
  8100.     var d = function (m) {
  8101.         if (m) {
  8102.             b.siblings().children(".jb-status-hiding-4-dlg").show().removeClass("jb-status-hiding-4-dlg")
  8103.         } else {
  8104.             b.siblings().children(".juicebox-gallery:visible").addClass("jb-status-hiding-4-dlg").hide()
  8105.         }
  8106.     };
  8107.     var j = function (n, m) {
  8108.         if (n) {
  8109.             g(false)
  8110.         } else {
  8111.             d(false)
  8112.         }
  8113.         if (m) {
  8114.             b.html(m)
  8115.         }
  8116.         b.show()
  8117.     };
  8118.     var e = function () {
  8119.         return a
  8120.     };
  8121.     i(f);
  8122.     return {
  8123.         initialize: i,
  8124.         hide_dialog: c,
  8125.         cleanup_dialog: l,
  8126.         show_dialog: j,
  8127.         get_id: e
  8128.     }
  8129. };
  8130. var juicebox_sizing_manager = function (f, O, o) {
  8131.     var N = f;
  8132.     var ar = o;
  8133.     var R = O;
  8134.     var y = N("body");
  8135.     var P = 0;
  8136.     var A = 0;
  8137.     var S = [{
  8138.         name: "HTC Panache",
  8139.         height: 535,
  8140.         width: 325
  8141.     },
  8142.     {
  8143.         name: "HTC myTouch",
  8144.         height: 535,
  8145.         width: 325
  8146.     },
  8147.     {
  8148.         name: "MB860",
  8149.         height: 615,
  8150.         width: 334
  8151.     },
  8152.     {
  8153.         name: "X325a",
  8154.         height: 640,
  8155.         width: 360
  8156.     },
  8157.     {
  8158.         name: "Z520m",
  8159.         height: 640,
  8160.         width: 360
  8161.     }];
  8162.     var k = function () {
  8163.         P = N(window).width();
  8164.         A = N(window).height()
  8165.     };
  8166.     var D = function () {
  8167.         var av;
  8168.         for (var au = 0; au < S.length; au++) {
  8169.             av = S[au];
  8170.             if (navigator.userAgent.indexOf(av.name) >= 0) {
  8171.                 if (av.additional) {
  8172.                     if (navigator.userAgent.indexOf(av.additional) >= 0) {
  8173.                         return av
  8174.                     } else {
  8175.                         continue
  8176.                     }
  8177.                 }
  8178.                 return av
  8179.             }
  8180.         }
  8181.         return null
  8182.     };
  8183.     var W = function (au) {
  8184.         var av = D();
  8185.         if (!av) {
  8186.             return {
  8187.                 height: au,
  8188.                 registered: false
  8189.             }
  8190.         }
  8191.         return {
  8192.             height: av.height,
  8193.             registered: true
  8194.         }
  8195.     };
  8196.     var ae = function (au) {
  8197.         var av = D();
  8198.         if (!av) {
  8199.             return {
  8200.                 width: au,
  8201.                 registered: false
  8202.             }
  8203.         }
  8204.         return {
  8205.             width: av.width,
  8206.             registered: true
  8207.         }
  8208.     };
  8209.     function X(av) {
  8210.         var au = x(av, "height");
  8211.         if (parseInt(au) === 0) {
  8212.             return 0
  8213.         }
  8214.         return au
  8215.     }
  8216.     function j(av) {
  8217.         var au = x(av, "width");
  8218.         if (parseInt(au) === 0) {
  8219.             return 0
  8220.         }
  8221.         return au
  8222.     }
  8223.     var ao = function (ax, aw) {
  8224.         var au = Math.max(A, P);
  8225.         var av = Math.min(A, P);
  8226.         return (ax > aw) ? au: av
  8227.     };
  8228.     var J = function (av, aw, au) {
  8229.         if (av < 3.1) {
  8230.             return 1
  8231.         }
  8232.         if (av > 3.1 && av < 4) {
  8233.             return 0
  8234.         }
  8235.         if (av < 4.1 && av >= 4) {
  8236.             if (au > aw) {
  8237.                 return 0
  8238.             }
  8239.             return ar.is_small_android() ? 58 : 0
  8240.         }
  8241.         return (au > aw) ? 68 : 58
  8242.     };
  8243.     var F = false;
  8244.     var I = 0;
  8245.     function C(aA, aF, az, au, ay) {
  8246.         var aE = aF;
  8247.         var av = true;
  8248.         if (ar.is_in_iframe()) {
  8249.             return {
  8250.                 height: N(window).height(),
  8251.                 registered: av
  8252.             }
  8253.         }
  8254.         if (ar.is_iphone()) {
  8255.             aE = aF * Z(aF, az);
  8256.             if (aA || au) {
  8257.                 if (aF > az) {
  8258.                     if (aE >= screen.height) {
  8259.                         aE = screen.height - 20
  8260.                     } else {
  8261.                         if (screen.height > 560 && screen.height < 576) {
  8262.                             aE = screen.height - 64
  8263.                         }
  8264.                     }
  8265.                 } else {
  8266.                     if (aF == screen.width) {
  8267.                         aE = screen.width
  8268.                     } else {
  8269.                         if (aE >= screen.width) {
  8270.                             aE = screen.width - 20
  8271.                         }
  8272.                     }
  8273.                 }
  8274.             }
  8275.         } else {
  8276.             if (ar.is_android()) {
  8277.                 var aB = N(window);
  8278.                 var aD = aB.height();
  8279.                 var ax = aB.width();
  8280.                 if (ar.get_android_ver() < 4 && !(aw > 3.1 && aw < 4)) {
  8281.                     aD = screen.height;
  8282.                     ax = screen.width
  8283.                 } else {
  8284.                     aD = ao(aB.height(), aB.width())
  8285.                 }
  8286.                 var aC;
  8287.                 if (aF > az) {
  8288.                     aC = W(aF);
  8289.                     aE = aC.height
  8290.                 } else {
  8291.                     aC = ae(aF);
  8292.                     aE = aC.width
  8293.                 }
  8294.                 av = aC.registered;
  8295.                 if (!av) {
  8296.                     var aw = ar.get_android_ver();
  8297.                     if (aw >= 4) {
  8298.                         if (ay) {
  8299.                             return {
  8300.                                 height: parseInt(aE) + 2,
  8301.                                 registered: av
  8302.                             }
  8303.                         }
  8304.                         aE = aB.height() + J(aw, az, aF)
  8305.                     } else {
  8306.                         if (aw > 3.1 && aw < 4) {
  8307.                             if (aB.height() > aD + 10) {
  8308.                                 aE = aB.height() + (aB.height() > aB.width() ? (au ? 2 : 50) : 2)
  8309.                             } else {
  8310.                                 if (aD > aB.height()) {
  8311.                                     aE = aB.height() + (aB.height() > aB.width() ? (au ? 2 : 0) : 2)
  8312.                                 } else {
  8313.                                     aE = aF + (au ? 54 : 50)
  8314.                                 }
  8315.                             }
  8316.                         } else {
  8317.                             if (aw >= 2.3) {
  8318.                                 if (aF > az) {
  8319.                                     aE = aC.height + 5
  8320.                                 } else {
  8321.                                     aE = aC.width + 5
  8322.                                 }
  8323.                             } else {
  8324.                                 aE = aF + 5
  8325.                             }
  8326.                         }
  8327.                     }
  8328.                 } else {
  8329.                     if (ar.get_android_ver() >= 4 && au) {
  8330.                         aE += 5
  8331.                     }
  8332.                 }
  8333.             } else {
  8334.                 if (ar.is_mobile_ie()) {
  8335.                     if (aF > az) {
  8336.                         aE = parseInt(1.015 * aF)
  8337.                     } else {
  8338.                         aE = parseInt(0.77 * aF)
  8339.                     }
  8340.                 }
  8341.             }
  8342.         }
  8343.         return {
  8344.             height: aE,
  8345.             registered: av
  8346.         }
  8347.     }
  8348.     var r = true;
  8349.     var H = X(y.attr("style"));
  8350.     var Y = j(y.attr("style"));
  8351.     var p = (H && parseInt(H) > 0);
  8352.     var at = (Y && parseInt(Y) > 0);
  8353.     var h = function (au) {
  8354.         if (p) {
  8355.             return false
  8356.         }
  8357.         if (au.galleryheight.indexOf("%") < 0) {
  8358.             return false
  8359.         }
  8360.         if (((r && !L(au.gallerywidth, au.galleryheight)) || c(au)) && !(ar.is_iphone() && i(au))) {
  8361.             return false
  8362.         }
  8363.         return true
  8364.     };
  8365.     var a = function (au) {
  8366.         return false
  8367.     };
  8368.     var c = function (au) {
  8369.         return q().heightFound && au.galleryheight.indexOf("%") > 0
  8370.     };
  8371.     var af = function (au) {
  8372.         return q().widthFound && au.galleryheight.indexOf("%") > 0
  8373.     };
  8374.     var b = function (av, au) {
  8375.         var aw = N(window);
  8376.         if (au || h(av)) {
  8377.             y.height(C(au, aw.height(), aw.width()).height)
  8378.         }
  8379.         if (au || a(av)) {
  8380.             y.width(aw.width())
  8381.         }
  8382.     };
  8383.     function Z(av, au) {
  8384.         if (!ar.is_iphone() || ar.is_iphone_chrome()) {
  8385.             return 1
  8386.         }
  8387.         return (av > au) ? 1.18 : 1.3
  8388.     }
  8389.     var L = function (av, au) {
  8390.         if (av === "100%" && au === "100%" && R.width() == N("body").width() && q().percentHeight === 0 && (Q().height == 0 || R.height() == N("body").height() || (N("body").height() === 0 && ar.is_ie8()))) {
  8391.             return true
  8392.         }
  8393.         return false
  8394.     };
  8395.     var i = function (av) {
  8396.         var au = ar.is_page_scrolling();
  8397.         if (L(av.gallerywidth, av.galleryheight) && (ar.is_small_android() || ar.is_iphone() || N.browser.msie || (!au.v_scrolling && !au.h_scrolling))) {
  8398.             return true
  8399.         }
  8400.         return false
  8401.     };
  8402.     function x(ay, av) {
  8403.         if (!ay || !av) {
  8404.             return ""
  8405.         }
  8406.         var au = ay.split(";");
  8407.         var aw, aB, aA, az, ax;
  8408.         for (ax = 0; ax < au.length; ax++) {
  8409.             aB = N.trim(au[ax]);
  8410.             if (!aB) {
  8411.                 continue
  8412.             }
  8413.             aw = aB.split(":");
  8414.             if (aw.length !== 2) {
  8415.                 continue
  8416.             }
  8417.             aA = N.trim(aw[0]);
  8418.             az = N.trim(aw[1]);
  8419.             if (!aA) {
  8420.                 continue
  8421.             }
  8422.             if (aA.toLowerCase() === av.toLowerCase()) {
  8423.                 return az
  8424.             }
  8425.         }
  8426.         return ""
  8427.     }
  8428.     var l = false;
  8429.     var ai = 0;
  8430.     var E = 0;
  8431.     var q = function () {
  8432.         if (l) {
  8433.             return {
  8434.                 heightFound: ai > 0,
  8435.                 widthFound: E > 0,
  8436.                 percentHeight: ai,
  8437.                 percentWidth: E
  8438.             }
  8439.         }
  8440.         l = true;
  8441.         R.parents().each(function (av, ay) {
  8442.             if (ai > 0 && E > 0) {
  8443.                 return
  8444.             }
  8445.             var ax = ay.nodeName.toUpperCase();
  8446.             if (ax === "BODY") {
  8447.                 return
  8448.             }
  8449.             style = N(ay).attr("style");
  8450.             var aw = X(style);
  8451.             var au = j(style);
  8452.             if (!au && !aw) {
  8453.                 return
  8454.             }
  8455.             if (aw.indexOf("%") > 0 || parseInt(aw) > 0) {
  8456.                 ai = parseInt(aw)
  8457.             }
  8458.             if (au.indexOf("%") > 0 || parseInt(au) > 0) {
  8459.                 E = parseInt(au)
  8460.             }
  8461.         });
  8462.         return {
  8463.             heightFound: ai > 0,
  8464.             widthFound: E > 0,
  8465.             percentHeight: ai,
  8466.             percentWidth: E
  8467.         }
  8468.     };
  8469.     var m = false;
  8470.     var al = 0;
  8471.     var s = 0;
  8472.     var Q = function () {
  8473.         if (m) {
  8474.             return {
  8475.                 height: al,
  8476.                 parentHeight: s
  8477.             }
  8478.         }
  8479.         al = R.height();
  8480.         s = R.parent().height();
  8481.         m = true;
  8482.         return {
  8483.             height: al,
  8484.             parentHeight: s
  8485.         }
  8486.     };
  8487.     var am = 0;
  8488.     var an = function () {
  8489.         var av = R.height();
  8490.         var au = am;
  8491.         am = av;
  8492.         return {
  8493.             newHeight: av,
  8494.             oldHeight: au
  8495.         }
  8496.     };
  8497.     var M = false;
  8498.     var w = function () {
  8499.         var au = an();
  8500.         if (N.browser.msie) {
  8501.             if (N.browser.version < 8) {
  8502.                 if (Q().height === 0) {
  8503.                     if (au.newHeight > 0) {
  8504.                         return true
  8505.                     }
  8506.                 } else {
  8507.                     if (Q().height === au.newHeight && au.newHeight > 110) {
  8508.                         return true
  8509.                     }
  8510.                 }
  8511.                 return false
  8512.             } else {
  8513.                 if (ar.is_ie8()) {
  8514.                     if (R.height() <= 0 && R.parent().height() > 0 && R.parent().height() === Q().parentHeight) {
  8515.                         M = true;
  8516.                         return true
  8517.                     }
  8518.                     if (M) {
  8519.                         return true
  8520.                     }
  8521.                     return false
  8522.                 }
  8523.             }
  8524.         }
  8525.         return Q().parentHeight > 110 && au.newHeight > 110
  8526.     };
  8527.     var g = function (au, av, az, aw) {
  8528.         if (av) {
  8529.             var ay = N(window);
  8530.             var ax = C(av, ay.height(), ay.width(), az, aw);
  8531.             return ax.height;
  8532.             return winh
  8533.         }
  8534.         return ag(au, av)
  8535.     };
  8536.     var ag = function (av, ax) {
  8537.         var au = parseInt(av.galleryheight);
  8538.         if (av.galleryheight.indexOf("%") < 0) {
  8539.             return au
  8540.         }
  8541.         if (!q().heightFound && w()) {
  8542.             if (ar.is_ie8() && R.height() < 10 && R.parent().height() > 10) {
  8543.                 return R.parent().height()
  8544.             }
  8545.             return R.height()
  8546.         }
  8547.         var az = 1;
  8548.         var aw = 0;
  8549.         var ay;
  8550.         R.parents().each(function (aC, aE) {
  8551.             var aD = aE.nodeName.toUpperCase();
  8552.             if (aD === "BODY") {
  8553.                 return
  8554.             }
  8555.             ay = N(aE).attr("style");
  8556.             var aB = X(ay);
  8557.             if (aB.toLowerCase().indexOf("%") < 0 && parseInt(aB) > 0) {
  8558.                 aw = parseInt(aB)
  8559.             }
  8560.             if (!aB || aw > 0) {
  8561.                 return
  8562.             }
  8563.             if (aB.indexOf("%") > 0) {
  8564.                 az *= (parseInt(aB) / 100)
  8565.             }
  8566.         });
  8567.         var aA = N(window);
  8568.         if (aw === 0) {
  8569.             aw = C(ax, aA.height(), aA.width()).height
  8570.         }
  8571.         if (!au) {
  8572.             au = 100
  8573.         }
  8574.         au /= 100;
  8575.         return az * au * aw
  8576.     };
  8577.     var ad = function (au, av, ax) {
  8578.         if (av) {
  8579.             var aw = N(window).width();
  8580.             if (ax && ar.is_android() && ar.get_android_ver() >= 4.1) {
  8581.                 aw += 2
  8582.             }
  8583.             return aw
  8584.         }
  8585.         return B(au)
  8586.     };
  8587.     var B = function (au) {
  8588.         var az = parseInt(au.gallerywidth);
  8589.         if (au.gallerywidth.indexOf("%") < 0) {
  8590.             return az
  8591.         }
  8592.         if (!q().widthFound) {
  8593.             return R.width()
  8594.         }
  8595.         var ax = 1;
  8596.         var av = 0;
  8597.         var aw;
  8598.         R.parents().each(function (aB, aD) {
  8599.             var aC = aD.nodeName.toUpperCase();
  8600.             if (aC === "BODY") {
  8601.                 return
  8602.             }
  8603.             aw = N(aD).attr("style");
  8604.             var aA = j(aw);
  8605.             if (aA.toLowerCase().indexOf("%") < 0 && parseInt(aA) > 0) {
  8606.                 av = parseInt(aA)
  8607.             }
  8608.             if (!aA || av > 0) {
  8609.                 return
  8610.             }
  8611.             if (aA.indexOf("%") > 0) {
  8612.                 ax *= (parseInt(aA) / 100)
  8613.             }
  8614.         });
  8615.         var ay = N(window);
  8616.         if (av === 0) {
  8617.             av = ay.width()
  8618.         }
  8619.         if (!az) {
  8620.             az = 100
  8621.         }
  8622.         az /= 100;
  8623.         return ax * az * av
  8624.     };
  8625.     var ap = function (av, ax, aw) {
  8626.         var ay = z(av, ax, aw);
  8627.         var au = aw.thumbheight + aw.thumbpadding;
  8628.         return ay.rows * au + aw.thumbpadding
  8629.     };
  8630.     var ab = function (aw) {
  8631.         if (!ar.is_large_screen_mode(aw)) {
  8632.             return 0
  8633.         }
  8634.         var av = aw.thumbsposition.toUpperCase();
  8635.         if (av != "LEFT" && av != "RIGHT") {
  8636.             return 0
  8637.         }
  8638.         var au = aw.thumbwidth + aw.thumbpadding;
  8639.         var ay = aw.thumbnavposition.toUpperCase() != "BOTTOM" ? 128 : 0;
  8640.         var ax = aw.maxthumbcolumns > 0 ? aw.maxthumbcolumns: 1;
  8641.         return au * ax + ay
  8642.     };
  8643.     var u = function (av) {
  8644.         if (!ar.is_large_screen_mode(av)) {
  8645.             return 0
  8646.         }
  8647.         var au = av.thumbsposition.toUpperCase();
  8648.         if (au === "LEFT" || au === "RIGHT") {
  8649.             return 0
  8650.         }
  8651.         return av.thumbheight + 2 * av.thumbpadding
  8652.     };
  8653.     var G = function (au, av) {
  8654.         if (au.captionposition.toUpperCase() === "NONE") {
  8655.             return 0
  8656.         }
  8657.         if (!av || av <= 0) {
  8658.             return au.maxcaptionheight
  8659.         }
  8660.         return au.maxcaptionheight > av ? av: au.maxcaptionheight
  8661.     };
  8662.     var v = function (av, aw) {
  8663.         var au;
  8664.         if (aw) {
  8665.             au = aw
  8666.         } else {
  8667.             au = av.captionposition.toUpperCase()
  8668.         }
  8669.         if ("BOTTOM,NONE,BELOW_IMAGE,OVERLAY_IMAGE,BELOW_THUMBS".indexOf(au) >= 0) {
  8670.             return false
  8671.         }
  8672.         return true
  8673.     };
  8674.     var t = 30;
  8675.     var e = 35;
  8676.     var aa = 75;
  8677.     var aq = function (aX, a1, av, aA, aB, aV, az, aY) {
  8678.         var a7 = U(aX, a1, aY);
  8679.         var ax = ab(aY);
  8680.         var au = 2 * a7;
  8681.         if (au > aX - 60 || au > a1 - 60) {
  8682.             au = 0;
  8683.             a7 = 0
  8684.         }
  8685.         var aH = a7;
  8686.         var aO = a7;
  8687.         var aS = au;
  8688.         var aL = au;
  8689.         aS = 2 * aH;
  8690.         aL = 2 * aO;
  8691.         var aG, aC, aD, aR, aQ, aJ, aw, aE, aW, aP, a4, a8, aF;
  8692.         var a0 = aH,
  8693.         a2 = 0,
  8694.         aU = 0,
  8695.         aI = aO;
  8696.         var a3 = aY.captionposition.toUpperCase();
  8697.         var aT = aY.thumbnavposition.toUpperCase() === "BOTTOM" ? aa: 0;
  8698.         if (aV) {
  8699.             a2 = aY.topareaheight;
  8700.             aU = aX - aL
  8701.         }
  8702.         var a6 = aY.thumbsposition.toUpperCase();
  8703.         var aK = aY.thumbpadding / 2;
  8704.         var aN = az + (2 * aK);
  8705.         aG = ((aY.showthumbpagingtext && aT <= 0) ? aN + (aB ? e: 15) : aN) + (aB ? 0 : 25) + aT;
  8706.         var aZ = aY.gallerytitleposition.toUpperCase();
  8707.         if (aZ === "ABOVE_THUMBS") {
  8708.             if (a6 != "LEFT" && a6 != "RIGHT") {
  8709.                 aG += t
  8710.             }
  8711.         }
  8712.         aQ = a1 - aG - a0 - a2 - aH;
  8713.         var ay = aY.captionposition.toUpperCase();
  8714.         aF = 0;
  8715.         var ba = G(aY, a1 - a0 - a2 - aH);
  8716.         aW = ba;
  8717.         var a9 = false;
  8718.         if (a6 === "TOP") {
  8719.             aw = a1 - aH - aQ;
  8720.             aD = a0 + a2 + aK
  8721.         } else {
  8722.             if (a6 === "LEFT") {
  8723.                 a9 = true
  8724.             } else {
  8725.                 if (a6 === "RIGHT") {
  8726.                     a9 = true
  8727.                 } else {
  8728.                     aw = a0 + a2;
  8729.                     aD = a1 - aH - aG + aK
  8730.                 }
  8731.             }
  8732.         }
  8733.         if (a9) {
  8734.             aD = a0 + a2;
  8735.             aw = a0 + a2;
  8736.             aQ = a1 - a0 - a2 - aH;
  8737.             aG = aQ - (a3 === "BOTTOM" ? aW: 0)
  8738.         }
  8739.         if (a3 === "BELOW_IMAGE" || a3 === "BOTTOM") {
  8740.             a4 = a1 - aH - aW
  8741.         } else {
  8742.             if (a3 === "BELOW_THUMBS") {
  8743.                 if (a9) {
  8744.                     a4 = (aG) / 2 + ap((a9 ? ax: aX - aL), aj(aY, aG), aY) / 2 + (aY.showthumbpagingtext && aT <= 0 ? e: 0) + aT
  8745.                 } else {
  8746.                     a4 = ap((a9 ? ax: aX - aL), aG - aj(aY, aG), aY) + (aY.showthumbpagingtext && aT <= 0 ? e: 0) - parseInt(aY.thumbpadding / 2) + aT
  8747.                 }
  8748.             } else {
  8749.                 a4 = aQ - aW - a2
  8750.             }
  8751.         }
  8752.         if (av && aA) {
  8753.             aC = aX - aL;
  8754.             aR = aO;
  8755.             aJ = aC;
  8756.             aE = aO;
  8757.             if (a9) {
  8758.                 aC = ax;
  8759.                 aJ = aX - aL - aC - aY.thumbseparation
  8760.             }
  8761.             if (a6 === "LEFT") {
  8762.                 aR = aO;
  8763.                 aE = aR + aC + aY.thumbseparation
  8764.             } else {
  8765.                 if (a6 === "RIGHT") {
  8766.                     aE = aO;
  8767.                     aR = aE + aJ + aY.thumbseparation
  8768.                 }
  8769.             }
  8770.             aP = aX - aL;
  8771.             a8 = aO;
  8772.             if (ay === "BOTTOM" || (!a9 && a3 === "BELOW_THUMBS" && a6 != "TOP")) {
  8773.                 if (a3 === "BELOW_THUMBS") {
  8774.                     a8 = 0;
  8775.                     aG += aW;
  8776.                     if (!a9) {
  8777.                         a4 = aG - aW
  8778.                     }
  8779.                 } else {
  8780.                     a4 = a1 - aW - aH
  8781.                 }
  8782.                 aQ -= aW;
  8783.                 if (a6 != "TOP") {
  8784.                     aD -= aW
  8785.                 }
  8786.                 if (aD < 0) {
  8787.                     aD = 0
  8788.                 }
  8789.             } else {
  8790.                 if (ay === "BELOW_IMAGE") {
  8791.                     aW = aQ;
  8792.                     aQ -= ba;
  8793.                     a4 = aw;
  8794.                     aP = aJ;
  8795.                     a8 = aE
  8796.                 } else {
  8797.                     if (a3 === "BELOW_THUMBS") {
  8798.                         aW = ba;
  8799.                         a8 = 0;
  8800.                         if (a9) {
  8801.                             aP = aC
  8802.                         }
  8803.                         a8 = 0;
  8804.                         if (a6 === "TOP") {
  8805.                             aQ -= aW;
  8806.                             aw += aW
  8807.                         }
  8808.                         if (!a9) {
  8809.                             aG += aW
  8810.                         }
  8811.                     } else {
  8812.                         aF = (a6 === "TOP" ? 0 : aG) + aH;
  8813.                         var aM = aQ - aW;
  8814.                         if (aM > 0) {
  8815.                             a4 = aw + aM
  8816.                         } else {
  8817.                             a4 = aw
  8818.                         }
  8819.                         if (ay === "OVERLAY_IMAGE") {
  8820.                             aP = aJ;
  8821.                             a8 = aE
  8822.                         }
  8823.                     }
  8824.                 }
  8825.             }
  8826.         } else {
  8827.             var a5 = a0 + a2;
  8828.             aG = a1 - a5;
  8829.             aC = aX - aL;
  8830.             aD = aH + a5;
  8831.             aR = aO;
  8832.             aQ = a1 - a5 - aH;
  8833.             aW = aY.maxcaptionheight > aQ ? aQ: aY.maxcaptionheight;
  8834.             aJ = aX - aL;
  8835.             aw = a5;
  8836.             aE = aO;
  8837.             aP = aX - aL;
  8838.             a8 = aO;
  8839.             if (ay === "BOTTOM") {
  8840.                 aQ -= aW
  8841.             } else {
  8842.                 if (ay === "BELOW_IMAGE") {
  8843.                     aQ -= aW;
  8844.                     a4 = aw
  8845.                 } else {
  8846.                     var aM = aQ - aW;
  8847.                     if (aM > 0) {
  8848.                         a4 = aw + aM
  8849.                     } else {
  8850.                         a4 = aw
  8851.                     }
  8852.                     aF = aH
  8853.                 }
  8854.             }
  8855.         }
  8856.         return {
  8857.             top_panel_height: a2,
  8858.             top_panel_width: aU,
  8859.             top_panel_left: aI,
  8860.             top_panel_top: a0,
  8861.             index_panel_height: aG,
  8862.             index_panel_width: aC,
  8863.             index_panel_top: aD,
  8864.             index_panel_left: aR,
  8865.             detail_panel_height: aQ,
  8866.             detail_panel_width: aJ,
  8867.             detail_panel_top: aw,
  8868.             detail_panel_left: aE,
  8869.             caption_panel_height: aW,
  8870.             caption_panel_width: aP,
  8871.             caption_panel_left: a8,
  8872.             caption_panel_top: a4,
  8873.             caption_panel_bottom: aF,
  8874.             is_sideway_layout: a9
  8875.         }
  8876.     };
  8877.     var U = function (au, ay, ax) {
  8878.         var aw = Math.min(au, ay);
  8879.         if (ax.stagepadding * 2 + 160 > aw) {
  8880.             var av = parseInt((aw - 160) / 2);
  8881.             return av >= 0 ? av: 0
  8882.         }
  8883.         return ax.stagepadding
  8884.     };
  8885.     var ak = function (ax, au, aw) {
  8886.         var av = Math.min(ax, au);
  8887.         if (aw.imagepadding * 2 + 60 > av) {
  8888.             if (aw.framewidth > 0 && aw.framewidth * 2 >= 60) {
  8889.                 return parseInt((av - 60) / 4)
  8890.             }
  8891.             return parseInt((av - 60) / 2)
  8892.         }
  8893.         return aw.imagepadding
  8894.     };
  8895.     var T = function (ax, au, aw) {
  8896.         var ay = 10;
  8897.         var av = Math.min(ax, au);
  8898.         if (aw.framewidth * 2 + ay > av) {
  8899.             if (aw.imagepadding > 0 && aw.imagepadding * 2 >= ay) {
  8900.                 return parseInt((av - ay) / 4)
  8901.             }
  8902.             return parseInt((av - ay) / 2)
  8903.         }
  8904.         if (2 * aw.imagepadding + 2 * aw.framewidth + ay > av) {
  8905.             return 0
  8906.         }
  8907.         return aw.framewidth
  8908.     };
  8909.     var ac = function (aA, aG, aF, aE, aw) {
  8910.         var aD, av, aC, az, ay, aB;
  8911.         var au = aG / aE;
  8912.         var ax = aA / aF;
  8913.         if (aG <= 0 || aA <= 0 || aE <= 0 || aF <= 0) {
  8914.             return {}
  8915.         }
  8916.         if (au >= 1 && ax >= 1) {
  8917.             aC = "auto";
  8918.             az = "auto";
  8919.             ay = aG;
  8920.             aB = aA;
  8921.             aD = parseInt((aA - aF) / 2);
  8922.             av = parseInt((aG - aE) / 2)
  8923.         } else {
  8924.             if (au < ax) {
  8925.                 aC = aE;
  8926.                 az = "auto";
  8927.                 ay = aE;
  8928.                 aB = parseInt(ay * aA / aG);
  8929.                 av = 0;
  8930.                 aD = parseInt((aB - aF) / 2)
  8931.             } else {
  8932.                 az = aF;
  8933.                 aC = "auto";
  8934.                 aB = aF;
  8935.                 ay = parseInt(aB * aG / aA);
  8936.                 aD = 0;
  8937.                 av = parseInt((ay - aE) / 2)
  8938.             }
  8939.         }
  8940.         var aH = {
  8941.             imageTop: -1 * aD,
  8942.             imageLeft: -1 * av,
  8943.             imageWidth: aC,
  8944.             imageHeight: az,
  8945.             imageExpectedWidth: ay,
  8946.             imageExpectedHeight: aB
  8947.         };
  8948.         if (aw) {
  8949.             aw(aH)
  8950.         } else {
  8951.             return aH
  8952.         }
  8953.     };
  8954.     var ah = function (ax, aw, av, ay) {
  8955.         ax = parseInt(ax);
  8956.         aw = parseInt(aw);
  8957.         var au = new Image();
  8958.         au.onload = function () {
  8959.             ac(au.height, au.width, aw, ax, ay)
  8960.         };
  8961.         au.src = av
  8962.     };
  8963.     var K = function (aw, aA, ax, az, aC, au) {
  8964.         var aB = au ? 0 : 2 * (ak(aA, ax, az) + T(aA, ax, az));
  8965.         aA -= aB;
  8966.         ax -= aB;
  8967.         if (!aw || !aw.width || !aw.height) {
  8968.             return {
  8969.                 width: "auto",
  8970.                 height: "auto"
  8971.             }
  8972.         }
  8973.         var av = aA / aw.width;
  8974.         var ay = ax / aw.height;
  8975.         var aD = 0;
  8976.         if (aC === "SCALE") {
  8977.             aD = 0
  8978.         } else {
  8979.             if (aC === "FILL") {
  8980.                 aD = 3
  8981.             } else {
  8982.                 if (aC === "STRETCH") {
  8983.                     aD = 4
  8984.                 } else {
  8985.                     if (aC === "NONE") {
  8986.                         aD = 2
  8987.                     } else {
  8988.                         if (av < 1 || ay < 1) {
  8989.                             aD = 0
  8990.                         } else {
  8991.                             aD = 1
  8992.                         }
  8993.                     }
  8994.                 }
  8995.             }
  8996.         }
  8997.         switch (aD) {
  8998.         case 0:
  8999.             if (av > ay) {
  9000.                 return {
  9001.                     width: "auto",
  9002.                     height: ax + "px"
  9003.                 }
  9004.             } else {
  9005.                 return {
  9006.                     width: aA + "px",
  9007.                     height: "auto"
  9008.                 }
  9009.             }
  9010.             break;
  9011.         case 1:
  9012.             return {
  9013.                 width:
  9014.                 aw.width + "px",
  9015.                 height: aw.height + "px"
  9016.             };
  9017.             break;
  9018.         case 2:
  9019.             return {
  9020.                 width:
  9021.                 "auto",
  9022.                 height: "auto"
  9023.             };
  9024.             break;
  9025.         case 3:
  9026.             if (av > ay) {
  9027.                 return {
  9028.                     width: aA + "px",
  9029.                     height: "auto",
  9030.                     expectedWidth: aA,
  9031.                     expectedHeight: (aA * aw.height / aw.width)
  9032.                 }
  9033.             } else {
  9034.                 return {
  9035.                     width: "auto",
  9036.                     height: ax + "px",
  9037.                     expectedWidth: (ax * aw.width / aw.height),
  9038.                     expectedHeight: ax
  9039.                 }
  9040.             }
  9041.             break;
  9042.         case 4:
  9043.             return {
  9044.                 width:
  9045.                 aA + "px",
  9046.                 height: ax + "px"
  9047.             };
  9048.             break
  9049.         }
  9050.     };
  9051.     var n = function (aF, aK, au, ax, aH, aI) {
  9052.         var ay = K(aF, aK, au, ax, (aH ? aH: ax.imagescalemode.toUpperCase()), aI);
  9053.         var aB = ay.width;
  9054.         var aL = ay.height;
  9055.         var aA = aI ? 0 : ak(aK, au, ax);
  9056.         var aD = aI ? 0 : T(aK, au, ax);
  9057.         var aM = aA + aD;
  9058.         var aC = 2 * aM;
  9059.         if (aB === "auto" && aL === "auto") {
  9060.             aL = aF.height;
  9061.             aB = aF.width
  9062.         } else {
  9063.             if (aB === "auto") {
  9064.                 aB = parseInt(aL) * (aF.width / aF.height)
  9065.             } else {
  9066.                 if (aL === "auto") {
  9067.                     aL = parseInt(aB) * (aF.height / aF.width)
  9068.                 }
  9069.             }
  9070.         }
  9071.         aB = parseInt(aB);
  9072.         aL = parseInt(aL);
  9073.         var aw = parseInt((aK - aB) / 2) - aD;
  9074.         var aE = parseInt((au - aL) / 2) - aD;
  9075.         var aG = aw;
  9076.         var av = aE;
  9077.         if (aw < aA) {
  9078.             aw = aA
  9079.         }
  9080.         if (aE < aA) {
  9081.             aE = aA
  9082.         }
  9083.         var aJ = aK - aC < parseInt(aB) ? aK - aC: parseInt(aB);
  9084.         var az = au - aC < parseInt(aL) ? au - aC: parseInt(aL);
  9085.         return {
  9086.             width: parseInt(aB),
  9087.             height: parseInt(aL),
  9088.             left: aw,
  9089.             top: aE,
  9090.             frameWidth: aJ,
  9091.             frameHeight: az,
  9092.             unadjtop: av,
  9093.             unadjleft: aG
  9094.         }
  9095.     };
  9096.     var z = function (au, aE, av, az) {
  9097.         if (aE < 0) {
  9098.             aE = 0
  9099.         }
  9100.         var aC = 0,
  9101.         ay = 0;
  9102.         var aA = 0;
  9103.         var aB = av.thumbwidth + av.thumbpadding;
  9104.         var aD = av.thumbheight + av.thumbpadding;
  9105.         var ax = ar.is_large_screen_mode(av) ? 45 : aB;
  9106.         aA = au - (av.usethumbdots ? 60 : 2 * ax);
  9107.         var aw = av.thumbsposition.toUpperCase();
  9108.         if (aw === "LEFT" || aw === "RIGHT") {
  9109.             aC = av.maxthumbcolumns
  9110.         } else {
  9111.             if (aC == 0 && au > 0) {
  9112.                 aC = parseInt(aA / aB);
  9113.                 if (!ar.is_large_screen_mode(av) && (az || av.forcetouchmode || av.forcetouchmodereversed)) {
  9114.                     if (aE > au) {
  9115.                         if (aC == 1) {
  9116.                             aC++
  9117.                         }
  9118.                     } else {
  9119.                         if (aC < 4 && (ar.is_swipable_device() || av.forcetouchmode)) {
  9120.                             aC++
  9121.                         }
  9122.                     }
  9123.                 }
  9124.             }
  9125.         }
  9126.         if (aC <= 0) {
  9127.             aC = 1
  9128.         }
  9129.         if (aC > av.maxthumbcolumns) {
  9130.             aC = av.maxthumbcolumns
  9131.         }
  9132.         if (ay == 0 && aE > 0) {
  9133.             ay = parseInt(aE / aD);
  9134.             if (!ar.is_large_screen_mode(av) && (az || av.forcetouchmode || av.forcetouchmodereversed)) {
  9135.                 if (aE > au) {
  9136.                     if (ay <= 3 && (ay != 1 && aC < 5)) {
  9137.                         ay++
  9138.                     } else {
  9139.                         if (ar.is_small_android() && ar.get_android_ver() >= 2.3 && ay == 5) {
  9140.                             ay = 4
  9141.                         } else {
  9142.                             if (ar.is_iphone() && ay == 4 && !(screen.height > 560 && screen.height < 576) && !screen.height != 480) {
  9143.                                 ay = 3
  9144.                             }
  9145.                         }
  9146.                     }
  9147.                 } else {
  9148.                     if (ay == 1 && aC <= 5) {
  9149.                         ay++
  9150.                     } else {
  9151.                         if (ar.is_small_android() && ar.get_android_ver() >= 2.3 && ay == 3) {
  9152.                             ay = 2
  9153.                         } else {
  9154.                             if (ay === 0 && (ar.is_small_android() || ar.is_iphone())) {
  9155.                                 ay = 2
  9156.                             }
  9157.                         }
  9158.                     }
  9159.                     if (ar.is_iphone() && ay === 3) {
  9160.                         ay--
  9161.                     }
  9162.                     if (av.forcetouchmode && ay === 3) {
  9163.                         ay--
  9164.                     }
  9165.                 }
  9166.             }
  9167.         }
  9168.         if (ay <= 0 || av.usethumbdots) {
  9169.             ay = 1
  9170.         }
  9171.         if (ay > av.maxthumbrows) {
  9172.             ay = av.maxthumbrows
  9173.         }
  9174.         return {
  9175.             columns: aC,
  9176.             rows: ay
  9177.         }
  9178.     };
  9179.     var aj = function (av, au) {
  9180.         var ay = av.thumbnavposition.toUpperCase();
  9181.         var aw = av.captionposition.toUpperCase();
  9182.         var ax = ar.is_side_layout(av);
  9183.         if (av.gallerytitleposition.toUpperCase() === "ABOVE_THUMBS" && aw != "BELOW_THUMBS" || !ar.is_large_screen_mode(av)) {
  9184.             au -= t
  9185.         }
  9186.         if (aw === "BELOW_THUMBS") {
  9187.             au -= G(av);
  9188.             if (ax && ay != "BOTTOM") {
  9189.                 au -= G(av)
  9190.             }
  9191.         }
  9192.         if (av.showthumbpagingtext && ay != "BOTTOM") {
  9193.             au -= (ax ? 2 : 1) * e
  9194.         }
  9195.         if (ay === "BOTTOM") {
  9196.             au -= (ax ? 2 : 1) * aa
  9197.         }
  9198.         au -= av.thumbpadding / 2;
  9199.         return au
  9200.     };
  9201.     var d = function (ax, au, av, aw) {
  9202.         au = aj(av, au);
  9203.         return z(ax, au, av, aw)
  9204.     };
  9205.     var V = function (aH, aF, aK, au, aC, aG) {
  9206.         var aB = aK.thumbwidth + aK.thumbpadding;
  9207.         var aA = aK.thumbheight + aK.thumbpadding;
  9208.         var aJ = aC * aA + aK.thumbpadding;
  9209.         var az = au * aB + aK.thumbpadding;
  9210.         var aI = aK.captionposition.toUpperCase();
  9211.         var ax = U(R.width(), R.height(), aK);
  9212.         var av = (aI === "BOTTOM" ? ax: 0) + parseInt((aF - aJ) / 2 - (ar.is_side_layout(aK) ? aK.thumbpadding: 0) / 2 + aK.thumbpadding / 2);
  9213.         if (!ar.is_side_layout(aK)) {
  9214.             av = 0
  9215.         } else {
  9216.             if (av < 0) {
  9217.                 av = 0
  9218.             }
  9219.         }
  9220.         var aL = parseInt((aH - az) / 2);
  9221.         var ay = aK.gallerytitleposition.toUpperCase();
  9222.         var aw = aK.thumbnavposition.toUpperCase();
  9223.         var aE = ar.is_large_screen_mode(aK);
  9224.         var aD = false;
  9225.         if (ar.is_side_layout(aK)) {
  9226.             if (!aD) {
  9227.                 if (av < 0) {
  9228.                     av = 0
  9229.                 }
  9230.             }
  9231.         } else {
  9232.             if (ay === "ABOVE_THUMBS") {
  9233.                 av += t
  9234.             }
  9235.         }
  9236.         return {
  9237.             top: av,
  9238.             left: aL,
  9239.             width: az,
  9240.             height: (aD || !aE) ? "100%": aJ
  9241.         }
  9242.     };
  9243.     return {
  9244.         get_gallery_height: g,
  9245.         get_gallery_width: ad,
  9246.         is_fullscreen_mode: i,
  9247.         is_gallery_fully_filled: L,
  9248.         try_set_body_size: b,
  9249.         get_containers_size_and_position: aq,
  9250.         get_stage_padding: U,
  9251.         get_image_padding: ak,
  9252.         get_image_framewidth: T,
  9253.         position_2_fill_image: ah,
  9254.         force_height_calculation: c,
  9255.         force_width_calculation: af,
  9256.         get_initial_size: k,
  9257.         get_initial_win_size: ao,
  9258.         get_side_panel_width: ab,
  9259.         get_container_image_size_info: ac,
  9260.         suggested_image_size: K,
  9261.         get_image_display_size: n,
  9262.         get_thumb_size_info: d,
  9263.         get_thumbs_show_area_size_info: V,
  9264.         constTitleHeight4AboveThumbs: t,
  9265.         constTitleHeight4AboveThumbs: t,
  9266.         constIndexNavHeight: aa,
  9267.         get_android_additional_height: J
  9268.     }
  9269. };
  9270. var juicebox_flickr_image_loader = function (d, o, f) {
  9271.     var G = o.get_config();
  9272.     var g = 50;
  9273.     var p = f;
  9274.     var D = 0;
  9275.     var m = 1;
  9276.     var l = 0;
  9277.     var A = "http://api.flickr.com/services/rest/?method=";
  9278.     var x = "&api_key=b40dc56c795c0103c6170731e6271e04";
  9279.     var s = {
  9280.         FLICKR_SEARCH: "flickr.photos.search",
  9281.         FLICKR_INTERESTINGNESS: "flickr.interestingness.getList",
  9282.         FLICKR_SET: "flickr.photosets.getPhotos",
  9283.         FLICKR_GROUP: "flickr.groups.pools.getPhotos",
  9284.         FLICKR_FIND_USER: "flickr.people.findByUsername",
  9285.         FLICKR_PHOTO_INFO: "flickr.photos.getInfo",
  9286.         FLICKR_PEOPLE_FIND: "flickr.people.findByUsername"
  9287.     };
  9288.     function z(H) {
  9289.         return A + s[H] + x
  9290.     }
  9291.     function u(H) {
  9292.         return z("FLICKR_SEARCH") + (G.flickrtags ? "&tags=" + G.flickrtags: "") + (G.flickruserid ? "&user_id=" + G.flickruserid: "") + "&page=" + m + "&per_page=" + H + "&sort=" + G.flickrsort.toLowerCase() + "&tag_mode=" + G.flickrtagmode.toLowerCase() + (G.flickrextraparams ? "&" + G.flickrextraparams.replace(/,/g, "&") : "") + "&media=photos&extras=url_sq,url_m,url_l,url_o,original_format&format=json&jsoncallback=?"
  9293.     }
  9294.     function r(H) {
  9295.         return z("FLICKR_SET") + "&photoset_id=" + G.flickrsetid + (G.flickrtags ? "&tags=" + G.flickrtags: "") + "&page=" + m + "&per_page=" + H + "&tag_mode=" + G.flickrtagmode.toLowerCase() + "&media=photos&extras=url_sq,url_m,url_l,url_o,original_format&format=json&jsoncallback=?"
  9296.     }
  9297.     function e(H) {
  9298.         return z("FLICKR_GROUP") + "&group_id=" + G.flickrgroupid + (G.flickrtags ? "&tags=" + G.flickrtags: "") + "&page=" + m + "&per_page=" + H + "&tag_mode=" + G.flickrtagmode.toLowerCase() + "&extras=url_sq,url_m,url_l,url_o,original_format&format=json&jsoncallback=?"
  9299.     }
  9300.     function n(H) {
  9301.         return z("FLICKR_INTERESTINGNESS") + "&page=" + m + "&per_page=" + H + "&extras=url_sq, url_m, url_l,url_o,original_format&format=json&jsoncallback=?"
  9302.     }
  9303.     function F() {
  9304.         return z("FLICKR_PEOPLE_FIND") + "&username=" + G.flickrusername + "&format=json&jsoncallback=?"
  9305.     }
  9306.     function q(H) {
  9307.         if (!o.isp) {
  9308.             if (G.flickrtags || G.flickrusername) {
  9309.                 return u(H)
  9310.             } else {
  9311.                 return n(H)
  9312.             }
  9313.         }
  9314.         if (G.flickrsetid) {
  9315.             return r(H)
  9316.         } else {
  9317.             if (G.flickrgroupid) {
  9318.                 return e(H)
  9319.             } else {
  9320.                 if (G.flickruserid) {
  9321.                     return u(H)
  9322.                 } else {
  9323.                     if (G.flickrusername) {
  9324.                         return u(H)
  9325.                     } else {
  9326.                         if (G.flickrtags) {
  9327.                             return u(H)
  9328.                         } else {
  9329.                             return n(H)
  9330.                         }
  9331.                     }
  9332.                 }
  9333.             }
  9334.         }
  9335.     }
  9336.     function b(I, H) {
  9337.         return "http://www.flickr.com/photos/" + I + "/" + H
  9338.     }
  9339.     function k(J, K, I, H) {
  9340.         return "http://farm" + J + ".static.flickr.com/" + K + "/" + H + "_" + I + "_s.jpg"
  9341.     }
  9342.     function i(J, K, I, H) {
  9343.         return "http://farm" + J + ".static.flickr.com/" + K + "/" + H + "_" + I + ".jpg"
  9344.     }
  9345.     function y(J, K, I, H) {
  9346.         return "http://farm" + J + ".static.flickr.com/" + K + "/" + H + "_" + I + "_b.jpg"
  9347.     }
  9348.     function c(J, K, I, H) {
  9349.         return "http://farm" + J + ".static.flickr.com/" + K + "/" + H + "_" + I + "_o.jpg"
  9350.     }
  9351.     var h = function (J, L) {
  9352.         var N, K, M;
  9353.         var H = "";
  9354.         var I = [];
  9355.         if (o.isp) {
  9356.             if (J.photos) {
  9357.                 N = J.photos.photo
  9358.             } else {
  9359.                 if (J.photoset) {
  9360.                     N = J.photoset.photo;
  9361.                     H = J.photoset.owner
  9362.                 }
  9363.             }
  9364.         } else {
  9365.             N = J.photos.photo
  9366.         }
  9367.         if (N.length == 0) {
  9368.             p("Flickr Images Not Found")
  9369.         }
  9370.         for (K = 0; K < N.length && K < D; K += 1) {
  9371.             M = {
  9372.                 flickrPhotoId: N[K].id,
  9373.                 thumbURL: k(N[K].farm, N[K].server, N[K].secret, N[K].id),
  9374.                 imageFullURL: b(N[K].owner || H, N[K].id),
  9375.                 imageURL: b(N[K].owner || H, N[K].id),
  9376.                 linkTarget: "_blank",
  9377.                 caption: N[K].title || "",
  9378.                 description: "",
  9379.                 preloadedImage: null,
  9380.                 preloaded: false
  9381.             };
  9382.             if (G.flickrimagesize.toLowerCase() === "original" && N[K].url_o) {
  9383.                 M.imageURL = N[K].url_o
  9384.             } else {
  9385.                 if ((G.flickrimagesize.toLowerCase() === "large" || G.flickrimagesize.toLowerCase() === "original") && N[K].url_l) {
  9386.                     M.imageURL = N[K].url_l
  9387.                 } else {
  9388.                     M.imageURL = N[K].url_m
  9389.                 }
  9390.             }
  9391.             I.push(M);
  9392.             if (typeof(L) === "function") {
  9393.                 v(K, N[K].id, L)
  9394.             }
  9395.         }
  9396.         return I
  9397.     };
  9398.     var B = function (H) {
  9399.         if (!H || !H.photo) {
  9400.             return null
  9401.         }
  9402.         var I = H.photo;
  9403.         return {
  9404.             id: I.id,
  9405.             title: I.title._content,
  9406.             description: I.description._content.replace(/\n/g, "<br/>")
  9407.         }
  9408.     };
  9409.     var j = function (I) {
  9410.         var H = F();
  9411.         d.ajax({
  9412.             url: H,
  9413.             dataType: "json",
  9414.             success: function (J) {
  9415.                 if (J.stat === "ok") {
  9416.                     G.flickruserid = J.user.id;
  9417.                     if (I) {
  9418.                         I()
  9419.                     }
  9420.                 } else {
  9421.                     p("Cannot find Flickr User: " + G.flickrusername)
  9422.                 }
  9423.             },
  9424.             error: function (L, J, K) {
  9425.                 p("Cannot find Flickr User: " + G.flickrusername)
  9426.             }
  9427.         })
  9428.     };
  9429.     var E = function (J, I) {
  9430.         D = (o.isp ? parseInt(G.flickrimagecount) : g);
  9431.         var H = q(D);
  9432.         d.ajax({
  9433.             url: H,
  9434.             dataType: "json",
  9435.             success: function (K) {
  9436.                 if (K.photos) {
  9437.                     D = Math.min(K.photos.total, D);
  9438.                     l = K.photos.pages
  9439.                 } else {
  9440.                     if (K.photoset) {
  9441.                         D = Math.min(K.photoset.total, D);
  9442.                         l = K.photoset.pages
  9443.                     }
  9444.                 }
  9445.                 if (K.stat === "ok") {
  9446.                     if (J) {
  9447.                         J(h(K, I))
  9448.                     }
  9449.                 } else {
  9450.                     p("Flickr Images Not Found")
  9451.                 }
  9452.             },
  9453.             error: function (M, K, L) {
  9454.                 p("Flickr Images Not Found")
  9455.             }
  9456.         })
  9457.     };
  9458.     var C = function (H) {
  9459.         return z("FLICKR_PHOTO_INFO") + "&format=json&photo_id=" + H + "&jsoncallback=?"
  9460.     };
  9461.     var v = function (J, I, K) {
  9462.         if (!G.flickrshowdescription) {
  9463.             return
  9464.         }
  9465.         var H = C(I);
  9466.         d.ajax({
  9467.             url: H,
  9468.             dataType: "json",
  9469.             success: function (L) {
  9470.                 if (L.stat === "ok") {
  9471.                     if (K) {
  9472.                         K(J, B(L))
  9473.                     }
  9474.                 }
  9475.             },
  9476.             error: function (N, L, M) {}
  9477.         })
  9478.     };
  9479.     var t = function (I, H) {
  9480.         if (G.flickrusername) {
  9481.             j(function () {
  9482.                 E(I, H)
  9483.             })
  9484.         } else {
  9485.             E(I, H)
  9486.         }
  9487.     };
  9488.     var w = function (J, H, I) {
  9489.         if (!G.flickrshowdescription) {
  9490.             return
  9491.         }
  9492.         if (typeof(I) === "function") {
  9493.             v(J, H, I)
  9494.         }
  9495.     };
  9496.     var a = function (H, I, K) {
  9497.         if (!G.flickrshowdescription) {
  9498.             return
  9499.         }
  9500.         if (typeof(K) !== "function") {
  9501.             return
  9502.         }
  9503.         if (I.to >= H.length) {
  9504.             I.to = H.length - 1
  9505.         }
  9506.         if (I.from < 0) {
  9507.             I.from = 0
  9508.         }
  9509.         for (var J = I.from; J <= I.to; J++) {
  9510.             if (H[J].detail_loaded) {
  9511.                 continue
  9512.             }
  9513.             w(J, H[J].flickrPhotoId, K)
  9514.         }
  9515.     };
  9516.     return {
  9517.         get_images: t,
  9518.         load_flickr_images_detail: a
  9519.     }
  9520. };
  9521. var juicebox_gallery_manager = function () {
  9522.     var g = [];
  9523.     var a = 0;
  9524.     var f;
  9525.     var k = function (m) {
  9526.         f = m
  9527.     };
  9528.     var h = function (m) {
  9529.         m.position = g.length;
  9530.         m.loaded = 0;
  9531.         m.thumb_loaded = 0;
  9532.         m.width = null;
  9533.         m.height = null;
  9534.         m.thumb_width = null;
  9535.         m.thumb_height = null;
  9536.         m.order = parseInt(1000 * Math.random());
  9537.         g[g.length] = m;
  9538.         a = g.length
  9539.     };
  9540.     var i = function (m) {
  9541.         return g[m]
  9542.     };
  9543.     var d = function () {
  9544.         return g
  9545.     };
  9546.     var c = function (m) {
  9547.         m = parseInt(m);
  9548.         if (!f.enablelooping && m >= g.length - 1) {
  9549.             return null
  9550.         }
  9551.         return g[m < g.length - 1 ? m + 1 : 0]
  9552.     };
  9553.     var l = function (m) {
  9554.         m = parseInt(m);
  9555.         if (!f.enablelooping && m <= 0) {
  9556.             return null
  9557.         }
  9558.         return g[m > 0 ? m - 1 : g.length - 1]
  9559.     };
  9560.     var e = function (m) {
  9561.         g[m.position] = m
  9562.     };
  9563.     var j = function (n, m) {
  9564.         return g.slice(n, m)
  9565.     };
  9566.     var b = function () {
  9567.         g = g.sort(function (o, n) {
  9568.             return o.order - n.order
  9569.         });
  9570.         for (var m = 0; m < g.length; m++) {
  9571.             g[m].position = m
  9572.         }
  9573.     };
  9574.     var a = function () {
  9575.         return g.length
  9576.     };
  9577.     return {
  9578.         add_image: h,
  9579.         length: a,
  9580.         get_range: j,
  9581.         get_image: i,
  9582.         get_images: d,
  9583.         update_image: e,
  9584.         get_previous_image: l,
  9585.         get_next_image: c,
  9586.         sort_images: b,
  9587.         init: k
  9588.     }
  9589. };
  9590. var juicebox_gallery_splash_panel = function () {
  9591.     var b, c, f, a, e, g, p, n, k;
  9592.     var o, m, s;
  9593.     var l = function (t) {
  9594.         b = t.jquery;
  9595.         c = t.document_id;
  9596.         f = t.container;
  9597.         e = t.config;
  9598.         g = t.utils;
  9599.         p = t.sizing;
  9600.         a = t.glymng;
  9601.         n = t.finish_draw_event_callback;
  9602.         k = t.view_gallery_event_callback;
  9603.         o = t.current_width;
  9604.         m = t.current_height;
  9605.         s = t.splashImageUrl
  9606.     };
  9607.     var r = function (t) {
  9608.         return b(g.get_query_path(c, t))
  9609.     };
  9610.     var j = function () {
  9611.         if (!e.splashdescription) {
  9612.             return ""
  9613.         }
  9614.         return "<p class='jb-splash-desc'>" + e.splashdescription + "</p>"
  9615.     };
  9616.     var d = function () {
  9617.         var t = "style='display:none;position:absolute;left:0;top:0;width:" + o + "px;height:" + m + "px'";
  9618.         return "<table><tr><td class='jb-splash-holder'><img src='" + s + "' " + t + "/>                     <div class='jb-splash-background' " + t + "></div>                     <div class='jb-splash'>                     <div class='jb-splash-info jb-layer' layer='100' style='z-index:100;'>                         <h3>" + (e.splashtitle ? e.splashtitle: e.gallerytitle) + "</h3>                         " + (e.splashshowimagecount ? "<p class='jb-splash-cnt'>" + a.length() + " Image" + (a.length() > 1 ? "s": "") + "</p>": "") + j() + "<a class='jb-splash-view-glry' href='#'>" + e.splashbuttontext + "</a>                     </div>                 </div></td></tr></table>"
  9619.     };
  9620.     var h = function () {
  9621.         f.html(d());
  9622.         p.position_2_fill_image(f.width(), f.height(), s, function (t) {
  9623.             r(".jb-splash-holder img").css({
  9624.                 top: t.imageTop,
  9625.                 left: t.imageLeft,
  9626.                 width: t.imageWidth,
  9627.                 height: t.imageHeight
  9628.             }).show()
  9629.         });
  9630.         r(".jb-splash-view-glry, .jb-splash, .jb-splash-background").click(function () {
  9631.             k();
  9632.             return false
  9633.         });
  9634.         if (typeof(n) === "function") {
  9635.             n()
  9636.         }
  9637.     };
  9638.     var q = function () {};
  9639.     var i = function () {
  9640.         f.html("")
  9641.     };
  9642.     return {
  9643.         initialize: l,
  9644.         draw: h,
  9645.         resize: q,
  9646.         purge: i
  9647.     }
  9648. };
  9649. var juicebox_gallery_index_panel = function (L) {
  9650.     var ak, d, aq, Q, aa, ac, ay, al;
  9651.     var z = L;
  9652.     var aw = 0;
  9653.     var aA = 1;
  9654.     var E = 0,
  9655.     P = 0;
  9656.     var U = 0;
  9657.     var v = 0;
  9658.     var S = 86;
  9659.     var ai = 86;
  9660.     var J = 96;
  9661.     var am = 96;
  9662.     var r = 5;
  9663.     var n = true;
  9664.     var h = false;
  9665.     var e = "jb-tbn-current";
  9666.     var W = "jb-tbn-prev";
  9667.     var ab = "jb-tbn-next";
  9668.     var l = 0;
  9669.     var H = 0;
  9670.     var ap = 0;
  9671.     var G = 0;
  9672.     var j = 0;
  9673.     var a = false;
  9674.     var ao = false;
  9675.     var x = "display:none;";
  9676.     var B = 11;
  9677.     var F = function (aC) {
  9678.         return ak(z.get_query_path(d, aC))
  9679.     };
  9680.     var T = function () {
  9681.         if (v == 0) {
  9682.             v = F("").height()
  9683.         }
  9684.         E = 0;
  9685.         P = 0;
  9686.         var aC = ac.get_thumb_size_info(U, v, aa, h);
  9687.         E = aC.columns;
  9688.         P = aC.rows;
  9689.         aA = Math.ceil(Q.length() / (P * E))
  9690.     };
  9691.     var A = function () {
  9692.         return ac.get_thumbs_show_area_size_info(U, v, aa, E, P, F("").height())
  9693.     };
  9694.     var av = function () {
  9695.         var aC = (aw + 1) * E * P - 1;
  9696.         if (aC >= Q.length()) {
  9697.             aC = Q.length() - 1
  9698.         }
  9699.         if (aC < 0) {
  9700.             aC = 0
  9701.         }
  9702.         return {
  9703.             from: aw * E * P,
  9704.             to: aC
  9705.         }
  9706.     };
  9707.     var k = function (aC) {
  9708.         if (aC.usethumbdots) {
  9709.             S = 20;
  9710.             ai = 20
  9711.         } else {
  9712.             S = aC.thumbwidth;
  9713.             ai = aC.thumbheight
  9714.         }
  9715.         r = aC.thumbpadding / 2;
  9716.         J = S + (2 * r);
  9717.         am = ai + (2 * r)
  9718.     };
  9719.     var V = function (aD, aC) {
  9720.         ak = aD.jquery;
  9721.         h = aC;
  9722.         d = aD.document_id;
  9723.         aq = aD.container;
  9724.         aa = aD.config;
  9725.         z = aD.utils;
  9726.         ac = aD.sizing;
  9727.         Q = aD.glymng;
  9728.         ay = aD.finish_draw_event_callback;
  9729.         al = aD.touch_event_callback;
  9730.         U = aD.current_width;
  9731.         v = aD.current_height;
  9732.         k(aa);
  9733.         T();
  9734.         o();
  9735.         ae();
  9736.         C();
  9737.         if (z.ship || !aa.usethumbdots || P > 1) {
  9738.             B = 0
  9739.         }
  9740.     };
  9741.     var o = function () {
  9742.         var aD = "",
  9743.         aC = "";
  9744.         if (aa.gallerytitle) {
  9745.             if (aa.gallerytitleposition.toUpperCase() != "ABOVE_THUMBS") {
  9746.                 aD = "<div class='jb-idx-title' style='position: absolute;display:none;'>" + aa.gallerytitle + "</div>"
  9747.             } else {
  9748.                 aD = z.get_gallery_title_html(aa)
  9749.             }
  9750.         }
  9751.         if (aa.captionposition.toUpperCase() === "BELOW_THUMBS") {
  9752.             aC = z.get_caption_html()
  9753.         }
  9754.         aq.html(aD + "<div class='jb-idx-show-area' style='overflow:hidden;margin:0;padding:0;position:absolute;'></div>" + (aa.showthumbpagingtext ? "<div class='jb-idx-thb-list-page-number' style='position: absolute;'></div>": "") + aC)
  9755.     };
  9756.     var ae = function () {
  9757.         var aE = function (aF) {
  9758.             if (a) {
  9759.                 return
  9760.             }
  9761.             aF.preventDefault();
  9762.             G = 0;
  9763.             j = 0;
  9764.             if (!ao) {
  9765.                 ao = true;
  9766.                 H = aF.originalEvent.touches[0].pageX;
  9767.                 ap = aF.originalEvent.touches[0].pageX
  9768.             }
  9769.         };
  9770.         var aC = function (aF) {
  9771.             if (a || !ao) {
  9772.                 return
  9773.             }
  9774.             aF.preventDefault();
  9775.             G = aF.originalEvent.touches[0].pageX - H;
  9776.             F("table.jb-idx-thb-container").animate({
  9777.                 left: "+=" + (aF.originalEvent.touches[0].pageX - ap),
  9778.                 avoidTransforms: !aa.use_webkit_transform,
  9779.                 useTranslate3d: true
  9780.             },
  9781.             0);
  9782.             ap = aF.originalEvent.touches[0].pageX;
  9783.             j = aF.originalEvent.touches[0].pageX - H
  9784.         };
  9785.         var aD = function (aG) {
  9786.             if (a || !ao) {
  9787.                 return
  9788.             }
  9789.             ao = false;
  9790.             var aF = 1005 * aa.imagetransitiontime;
  9791.             if (G > 5) {
  9792.                 if (m() && !aa.enablelooping) {
  9793.                     O(G)
  9794.                 } else {
  9795.                     af(Math.abs(G), null, U, v)
  9796.                 }
  9797.                 aG.preventDefault()
  9798.             } else {
  9799.                 if (G < -5) {
  9800.                     if (au() && !aa.enablelooping) {
  9801.                         O(G)
  9802.                     } else {
  9803.                         g(Math.abs(G), null, U, v)
  9804.                     }
  9805.                     aG.preventDefault()
  9806.                 } else {
  9807.                     if (Math.abs(j) < 5) {
  9808.                         if (aa.forcetouchmode) {
  9809.                             if (ak(aG.target).attr("position") != null) {
  9810.                                 ay(ak(aG.target).attr("position"))
  9811.                             } else {
  9812.                                 if (ak(aG.target).parent().attr("position") != null) {
  9813.                                     ay(ak(aG.target).parent().attr("position"))
  9814.                                 }
  9815.                             }
  9816.                         } else {
  9817.                             if (ak(aG.target).parent().attr("position") != null) {
  9818.                                 ay(ak(aG.target).parent().attr("position"))
  9819.                             }
  9820.                         }
  9821.                     }
  9822.                 }
  9823.             }
  9824.         };
  9825.         aq.bind("touchstart", aE).bind("touchmove", aC).bind("touchend", aD);
  9826.         if (aa.forcetouchmode) {
  9827.             F(" .jb-idx-thumb, .jb-idx-thb-frame").mousedown(function (aG) {
  9828.                 if (aG.which !== 1) {
  9829.                     return
  9830.                 }
  9831.                 var aF = {
  9832.                     originalEvent: {
  9833.                         touches: [{}]
  9834.                     }
  9835.                 };
  9836.                 aG.preventDefault();
  9837.                 aF.preventDefault = function () {};
  9838.                 aF.originalEvent.touches[0].pageX = aG.screenX;
  9839.                 aF.originalEvent.touches[0].pageY = aG.screenY;
  9840.                 ak(this).children(".jb-idx-thb-frame").css(az());
  9841.                 aE(aF)
  9842.             }).mousemove(function (aG) {
  9843.                 if (aG.which !== 1) {
  9844.                     ao = false;
  9845.                     return
  9846.                 }
  9847.                 if (!ao) {
  9848.                     return
  9849.                 }
  9850.                 var aF = {
  9851.                     originalEvent: {
  9852.                         touches: [{}]
  9853.                     }
  9854.                 };
  9855.                 aF.preventDefault = function () {};
  9856.                 aF.originalEvent.touches[0].pageX = aG.screenX;
  9857.                 aF.originalEvent.touches[0].pageY = aG.screenY;
  9858.                 aC(aF)
  9859.             }).mouseup(function (aG) {
  9860.                 if (!ao) {
  9861.                     return
  9862.                 }
  9863.                 var aF = {};
  9864.                 aF.preventDefault = function () {};
  9865.                 aF.target = this;
  9866.                 aD(aF)
  9867.             }).mouseout(function (aG) {
  9868.                 if (!ao) {
  9869.                     return
  9870.                 }
  9871.                 var aF = {};
  9872.                 aF.preventDefault = function () {};
  9873.                 aF.target = this;
  9874.                 aD(aF)
  9875.             })
  9876.         }
  9877.     };
  9878.     var p = function () {
  9879.         var aD = E * J;
  9880.         var aC = P * am;
  9881.         return {
  9882.             height: aC,
  9883.             width: aD
  9884.         }
  9885.     };
  9886.     var aj = function (aI, aH, aE, aO, aD) {
  9887.         var aK = P * E * aI;
  9888.         var aL = P * E * (aI + 1);
  9889.         var aC = "page_" + aI;
  9890.         var aM;
  9891.         if (Q.length() < E) {
  9892.             aM = Q.length() * J
  9893.         } else {
  9894.             aM = E * J
  9895.         }
  9896.         aH.append("<table class='jb-idx-thb-container jb-classifier-thumb-area table_page_" + aI + " " + (aD ? aD: "") + "' style='left:" + aE + "px;" + (z.is_side_layout(aa) ? "height:100%;": "") + "' ><tr><td style='text-align:center !important;width:auto !important;'><div class='jb-idx-thb-list' style='text-align:center !important;width:" + aM + "px;margin-left: auto;margin-right: auto; margin-top:0; margin-bottom:0; padding:0;' ></div></td></tr></table>");
  9897.         var aG = F(".table_page_" + aI + (aD ? "." + aD: "") + " .jb-idx-thb-list");
  9898.         var aN = "";
  9899.         var aJ = Q.get_range(aK, aL);
  9900.         for (var aF = 0; aF < aJ.length; aF++) {
  9901.             aN = Z(aJ[aF], aG, aN)
  9902.         }
  9903.         aG.append(aN)
  9904.     };
  9905.     var s = function (aC) {
  9906.         if (z.is_earlier_ie()) {
  9907.             return ""
  9908.         }
  9909.         return aC.thumbcornerradius > 0 && aC.thumbcornerradius <= Math.min(aC.thumbwidth, aC.thumbheight) ? "border-radius:" + aC.thumbcornerradius + "px;": ""
  9910.     };
  9911.     var ar = function () {
  9912.         if (aa.usethumbdots) {
  9913.             return "width:" + (J) + "px;height:" + (am) + "px;padding:0;margin:" + B + "px 0 0 0;"
  9914.         }
  9915.         return "overflow:hidden;width:" + (S) + "px;height:" + (ai) + "px;padding:0;margin:" + (B + r) + "px " + parseInt(r) + "px " + r + "px " + parseInt(r) + "px;" + s(aa)
  9916.     };
  9917.     var f = function (aD, aC) {
  9918.         if (aa.usethumbdots) {
  9919.             return "padding:0;margin:" + r + "px;width:" + (S) + "px;height:" + (ai) + "px;"
  9920.         }
  9921.         return (aC ? "display:inline;": "") + "display:inline;position:relative;padding:0;left:" + aD.left + "px;top:" + aD.top + "px;width:" + aD.thumb_width + "px;height:" + aD.thumb_height + "px;"
  9922.     };
  9923.     var C = function () {
  9924.         var aE = aa.thumbpreloading.toUpperCase();
  9925.         if (aE != "ALL") {
  9926.             return
  9927.         }
  9928.         var aC = Q.get_images();
  9929.         for (var aD = 0; aD < aC.length; aD++) {
  9930.             Y(aC[aD])
  9931.         }
  9932.     };
  9933.     var y = function () {
  9934.         return aa.thumbframecolor ? z.format_color(aa.thumbframecolor) : ""
  9935.     };
  9936.     var w = function (aC) {
  9937.         if (aC) {
  9938.             return aa.thumbframecolor && aa.thumbselectedframewidth ? "border-color:" + z.format_color(aa.thumbframecolor) + ";": "" + (z.is_ie8() ? aa.thumbframeopacity + ";": "")
  9939.         }
  9940.         return aa.thumbframecolor && aa.thumbframewidth ? "border-color:" + z.format_color(aa.thumbframecolor) + ";": "" + (z.is_ie8() ? aa.thumbframeopacity + ";": "")
  9941.     };
  9942.     var c = function (aF) {
  9943.         if (aa.usethumbdots) {
  9944.             return ""
  9945.         }
  9946.         var aC = ak("#" + d + "_thumb_" + aF.position + ".jb-thm-thumb-selected").length > 0 && z.is_large_screen_mode(aa);
  9947.         var aD = aC ? w() : "";
  9948.         var aE = aC ? aa.thumbselectedframewidth: aa.thumbframewidth;
  9949.         var aG = aC ? aa.thumbselectedframewidth: aa.thumbframewidth;
  9950.         return '<div class="jb-idx-thb-frame" style="position:absolute;border-style:solid;' + aD + ";border-width:" + aG + "px;width:" + (S - 2 * aE) + "px;height:" + (ai - 2 * aE) + "px;left:0px;top:0;" + w(aC) + s(aa) + '"></div>'
  9951.     };
  9952.     var Y = function (aC) {
  9953.         if (aC.isPreloadingThumbnail) {
  9954.             return
  9955.         }
  9956.         aC.isPreloadingThumbnail = true;
  9957.         ac.position_2_fill_image(S, ai, aC.thumbURL, function (aD) {
  9958.             aC.thumb_loaded = 1;
  9959.             if (S === ai && aD.imageExpectedWidth === aD.imageExpectedHeight) {
  9960.                 aC.thumb_width = S;
  9961.                 aC.thumb_height = ai;
  9962.                 aC.imageExpectedWidth = ai;
  9963.                 aC.imageExpectedHeight = ai;
  9964.                 aC.top = 0;
  9965.                 aC.left = 0
  9966.             } else {
  9967.                 aC.thumb_width = aD.imageWidth;
  9968.                 aC.thumb_height = aD.imageHeight;
  9969.                 aC.imageExpectedWidth = aD.imageExpectedWidth;
  9970.                 aC.imageExpectedHeight = aD.imageExpectedHeight;
  9971.                 aC.top = aD.imageTop;
  9972.                 aC.left = aD.imageLeft
  9973.             }
  9974.             if (n) {
  9975.                 ak("#" + d + "_thumb_" + aC.position).html("<img class='jb-thm-thumb-image' src='" + aC.thumbURL + "' style='" + x + f(aC, true) + s(aa) + "'>" + c(aC));
  9976.                 ak("#" + d + "_thumb_" + aC.position + " img").fadeIn(400)
  9977.             } else {
  9978.                 ak("#" + d + "_thumb_" + aC.position).html("<img class='jb-thm-thumb-image' src='" + aC.thumbURL + "' style='" + f(aC, false) + s(aa) + "'>" + c(aC))
  9979.             }
  9980.             Q.update_image(aC);
  9981.             ak("#" + d + "_thumb_" + aC.position + " img").disableSelection()
  9982.         })
  9983.     };
  9984.     var ax = function (aC) {
  9985.         if (z.is_earlier_ie()) {
  9986.             return ""
  9987.         }
  9988.         if (z.is_small_android() || z.is_iphone()) {
  9989.             return "-webkit-box-shadow: 0px 0px " + aC.thumbshadowblur + "px " + z.format_color(aC.thumbshadowcolora) + ";"
  9990.         }
  9991.         return "box-shadow: 0px 0px " + aC.thumbshadowblur + "px " + aC.thumbshadowcolor + ";"
  9992.     };
  9993.     var Z = function (aE, aD, aC) {
  9994.         if (aa.usethumbdots) {
  9995.             return aC + "<div position='" + aE.position + "' id='" + d + "_thumb_" + aE.position + "' class='jb-idx-thumb jb-thm-thumb-dot' style='" + ar() + "'><div class='jb-thm-thumb-image' style='" + f(aE) + "'></div></div>"
  9996.         }
  9997.         if (aE.thumb_loaded) {
  9998.             return aC + "<div position='" + aE.position + "' id='" + d + "_thumb_" + aE.position + "' class='jb-idx-thumb' style='" + ar() + ax(aa) + "'><img class='jb-thm-thumb-image' src='" + aE.thumbURL + "' style='" + f(aE) + s(aa) + "'>" + c(aE) + "</div>"
  9999.         } else {
  10000.             aD.append(aC);
  10001.             aC = "";
  10002.             aD.append("<div position='" + aE.position + "' id='" + d + "_thumb_" + aE.position + "' class='jb-idx-thumb' style='" + ar() + ax(aa) + "'>" + aa.thumb_load_placeholder + "</div>");
  10003.             Y(aE);
  10004.             return ""
  10005.         }
  10006.     };
  10007.     var at = function () {
  10008.         return (aw <= 0) ? aA - 1 : aw - 1
  10009.     };
  10010.     var N = function () {
  10011.         return (aw >= aA - 1) ? 0 : aw + 1
  10012.     };
  10013.     var I = function () {
  10014.         an(aw)
  10015.     };
  10016.     var ah = function (aC) {
  10017.         if (aC < 0 || aC >= aA) {
  10018.             return
  10019.         }
  10020.         M(aC)
  10021.     };
  10022.     var ag = function (aC, aD, aG, aE) {
  10023.         if (aD) {
  10024.             U = aD
  10025.         }
  10026.         if (aG) {
  10027.             v = aG
  10028.         }
  10029.         T();
  10030.         var aF = parseInt(aC / (E * P));
  10031.         M(aF, aE);
  10032.         q(aC);
  10033.         if (!z.is_large_screen_mode(aa)) {
  10034.             F(".jb-idx-title").show()
  10035.         }
  10036.     };
  10037.     var u = function () {
  10038.         an(at())
  10039.     };
  10040.     var K = function () {
  10041.         an(N())
  10042.     };
  10043.     var q = function (aD) {
  10044.         l = aD;
  10045.         var aE = S - (2 * aa.thumbselectedframewidth);
  10046.         var aG = ai - (2 * aa.thumbselectedframewidth);
  10047.         var aH = S - (2 * aa.thumbframewidth);
  10048.         var aC = ai - (2 * aa.thumbframewidth);
  10049.         F(".jb-idx-thumb").removeClass("jb-thm-thumb-selected");
  10050.         F(".jb-idx-thumb .jb-idx-thb-frame").css({
  10051.             width: aH + "px",
  10052.             height: aC + "px",
  10053.             "border-width": aa.thumbframewidth
  10054.         });
  10055.         var aF = ak("#" + d + "_thumb_" + aD).addClass("jb-thm-thumb-selected").addClass("jb-thumb-visited");
  10056.         ak("#" + d + "_thumb_" + aD + " .jb-idx-thb-frame").css({
  10057.             width: aE + "px",
  10058.             height: aG + "px",
  10059.             "border-width": aa.thumbselectedframewidth + "px",
  10060.             "border-color": y()
  10061.         });
  10062.         if (aa.thumbframecolor) {
  10063.             aF.children(".jb-idx-thb-frame").css({
  10064.                 "border-color": z.format_color(aa.thumbframecolor)
  10065.             })
  10066.         }
  10067.     };
  10068.     var az = function () {
  10069.         return {
  10070.             height: aa.thumbheight - 2 * aa.thumbselectedframewidth,
  10071.             width: aa.thumbwidth - 2 * aa.thumbselectedframewidth,
  10072.             "border-width": aa.thumbselectedframewidth,
  10073.             "border-color": z.format_color(aa.thumbframecolor)
  10074.         }
  10075.     };
  10076.     var M = function (aH, aG) {
  10077.         F(" .jb-idx-thb-container").remove();
  10078.         var aL = F(".jb-idx-show-area");
  10079.         var aO = A();
  10080.         aL.css({
  10081.             top: aO.top,
  10082.             left: aO.left,
  10083.             width: aO.width,
  10084.             height: aO.height
  10085.         });
  10086.         if (F(".table_page_" + aH).length == 0) {
  10087.             aj(aH, aL, 0, v, e)
  10088.         }
  10089.         var aD = A().width + 2 * ac.get_stage_padding(F("").width(), F("").height(), aa);
  10090.         if (aa.enablelooping || aH < aA - 1) {
  10091.             var aN = (aH >= aA - 1) ? 0 : aH + 1;
  10092.             aj(aN, aL, +aD, v, ab)
  10093.         }
  10094.         if (aa.enablelooping || aH > 0) {
  10095.             var aJ = (aH <= 0) ? aA - 1 : aH - 1;
  10096.             aj(aJ, aL, -aD, v, W)
  10097.         }
  10098.         t(aH);
  10099.         q(l);
  10100.         var aI = F(" .jb-idx-thumb");
  10101.         if (!aa.forcetouchmode) {
  10102.             var aE = function (aP) {
  10103.                 var aQ = F(".jb-idx-thb-list div.jb-idx-thumb .jb-thm-thumb-image");
  10104.                 aQ.stop(true, true).show();
  10105.                 if (!z.is_earlier_ie()) {
  10106.                     aQ.css({
  10107.                         opacity: 1
  10108.                     })
  10109.                 }
  10110.                 ay(aP)
  10111.             };
  10112.             aI.click(function (aP) {
  10113.                 if (a) {
  10114.                     return false
  10115.                 }
  10116.                 n = false;
  10117.                 aP.preventDefault();
  10118.                 aE(ak(this).attr("position"));
  10119.                 return false
  10120.             });
  10121.             if (!B) {
  10122.                 aI.mousedown(function (aP) {
  10123.                     if (aP.preventDefault) {
  10124.                         aP.preventDefault()
  10125.                     }
  10126.                     ak(this).children(".jb-idx-thb-frame").css(az())
  10127.                 }).bind("touchstart", function () {
  10128.                     ak(this).children(".jb-idx-thb-frame").css(az())
  10129.                 });
  10130.                 ak(".jb-idx-thb-frame").mousedown(function (aP) {
  10131.                     if (aP.preventDefault) {
  10132.                         aP.preventDefault()
  10133.                     }
  10134.                     ak(this).css(az())
  10135.                 })
  10136.             }
  10137.             if (aa.changeimageonhover) {
  10138.                 aI.mouseenter(function () {
  10139.                     var aP = ak(this).attr("position");
  10140.                     aE(aP)
  10141.                 },
  10142.                 null)
  10143.             }
  10144.         } else {
  10145.             ae()
  10146.         }
  10147.         if (aa.thumbframecolor) {
  10148.             var aM = S - 2 * aa.thumbhoverframewidth;
  10149.             var aF = ai - 2 * aa.thumbhoverframewidth;
  10150.             var aC = S - 2 * aa.thumbframewidth;
  10151.             var aK = ai - 2 * aa.thumbframewidth;
  10152.             aI.hover(function () {
  10153.                 var aP = ak(this);
  10154.                 if (aP.is(".jb-thm-thumb-selected")) {
  10155.                     return
  10156.                 }
  10157.                 aP.children(".jb-idx-thb-frame").css({
  10158.                     width: aM,
  10159.                     height: aF,
  10160.                     "border-color": z.format_color(aa.thumbframecolor),
  10161.                     "border-width": aa.thumbhoverframewidth
  10162.                 })
  10163.             },
  10164.             function () {
  10165.                 var aP = ak(this);
  10166.                 if (aP.is(".jb-thm-thumb-selected")) {
  10167.                     return
  10168.                 }
  10169.                 aP.children(".jb-idx-thb-frame").css({
  10170.                     width: aC,
  10171.                     height: aK,
  10172.                     "border-color": aa.thumbframewidth ? z.format_color(aa.thumbframecolor) : "transparent",
  10173.                     "border-width": aa.thumbframewidth
  10174.                 })
  10175.             })
  10176.         }
  10177.         F(".jb-classifier-thumb-area").disableSelection();
  10178.         aw = aH;
  10179.         if (typeof al == "function") {
  10180.             al(aG)
  10181.         }
  10182.     };
  10183.     var aB = function () {
  10184.         var aD = Q.length();
  10185.         if (P * E <= aD) {
  10186.             return {
  10187.                 row: P,
  10188.                 col: E
  10189.             }
  10190.         }
  10191.         if (E >= aD) {
  10192.             return {
  10193.                 row: 1,
  10194.                 col: aD
  10195.             }
  10196.         }
  10197.         var aC = (aD % E == 0 ? 0 : 1);
  10198.         return {
  10199.             row: parseInt(aD / E) + aC,
  10200.             col: E
  10201.         }
  10202.     };
  10203.     var t = function (aH) {
  10204.         var aG = A();
  10205.         var aE = aB();
  10206.         var aD = aE.row * (am);
  10207.         var aF = (v - aD) / 2 - 30;
  10208.         if (v <= aF || aF < 0) {
  10209.             aF = 0
  10210.         }
  10211.         var aC = parseInt((U - (aE.col * J)) / 2 + parseInt(r / 2));
  10212.         if (aC < 0) {
  10213.             aC = 0
  10214.         }
  10215.         F(".jb-idx-title").css({
  10216.             left: aC + "px",
  10217.             top: aF + "px"
  10218.         });
  10219.         var aJ = U / 2 - 33;
  10220.         if (aJ < aC) {
  10221.             aJ = aC
  10222.         }
  10223.         var aI;
  10224.         if (z.is_large_screen_mode(aa)) {
  10225.             aI = parseInt(aG.top + aD + aa.thumbpadding);
  10226.             if (aa.usethumbdots && aa.showthumbpagingtext) {
  10227.                 aI += (z.is_side_layout(aa) ? 25 : -10)
  10228.             }
  10229.         } else {
  10230.             aI = parseInt(aG.top + aD + aa.thumbpadding / 2 + (v - aD > 0 && aa.thumbnavposition.toUpperCase() != "BOTTOM" ? (v - aD) / 2 : 0))
  10231.         }
  10232.         if (aI <= 0) {
  10233.             aI = 0
  10234.         }
  10235.         F(".jb-idx-thb-list-page-number").css({
  10236.             left: aJ + "px",
  10237.             top: aI + "px"
  10238.         }).html("Page " + (aH + 1) + " of " + aA);
  10239.         if (aa.textcolor) {
  10240.             F(".jb-idx-title, .jb-idx-thb-list-page-number").css({
  10241.                 color: z.format_color(aa.textcolor)
  10242.             })
  10243.         }
  10244.     };
  10245.     var an = function (aC) {
  10246.         T();
  10247.         M(aC)
  10248.     };
  10249.     var O = function (aD) {
  10250.         if (!aD) {
  10251.             return
  10252.         }
  10253.         var aC = 1000 * aa.smallthumbslidetime;
  10254.         aC = aC * ((400 - aD / 2) / 400);
  10255.         q(l);
  10256.         F("table.jb-idx-thb-container").animate({
  10257.             left: "+=" + ( - aD),
  10258.             avoidTransforms: !aa.use_webkit_transform,
  10259.             useTranslate3d: true
  10260.         },
  10261.         aC, "", null)
  10262.     };
  10263.     var ad = function (aH, aF, aJ, aI, aC) {
  10264.         var aD = -1;
  10265.         if (aI) {
  10266.             U = aI
  10267.         }
  10268.         if (aC) {
  10269.             v = aC
  10270.         }
  10271.         var aK = function (aL) {
  10272.             if (aL) {
  10273.                 a = false
  10274.             } else {
  10275.                 if (a) {
  10276.                     if (aH) {
  10277.                         if (aD === N()) {
  10278.                             K()
  10279.                         }
  10280.                     } else {
  10281.                         if (aD === at()) {
  10282.                             u()
  10283.                         }
  10284.                     }
  10285.                     a = false;
  10286.                     aD = -1;
  10287.                     if (typeof aJ == "function") {
  10288.                         aJ()
  10289.                     }
  10290.                 }
  10291.             }
  10292.         };
  10293.         if (!a) {
  10294.             aD = aH ? N() : at();
  10295.             if (typeof(aF) == "undefined") {
  10296.                 aF = 0
  10297.             }
  10298.             a = true;
  10299.             var aE = 1000 * aa.smallthumbslidetime;
  10300.             if (aF > 0) {
  10301.                 aE = aE * ((400 - aF / 2) / 400)
  10302.             }
  10303.             var aG = A().width + 2 * ac.get_stage_padding(F("").width(), F("").height(), aa);
  10304.             F("table.jb-idx-thb-container").animate({
  10305.                 left: (aH ? "-=": "+=") + (aG - aF),
  10306.                 avoidTransforms: !aa.use_webkit_transform,
  10307.                 useTranslate3d: true
  10308.             },
  10309.             aE, "easeOutQuart", aK)
  10310.         } else {
  10311.             aK(true)
  10312.         }
  10313.     };
  10314.     var g = function (aF, aE, aC, aD) {
  10315.         ad(true, aF, aE, aC, aD)
  10316.     };
  10317.     var af = function (aF, aE, aC, aD) {
  10318.         ad(false, aF, aE, aC, aD)
  10319.     };
  10320.     var i = function (aC, aD) {
  10321.         a = false
  10322.     };
  10323.     var au = function () {
  10324.         if (aw + 1 >= aA) {
  10325.             return true
  10326.         }
  10327.         return false
  10328.     };
  10329.     var m = function () {
  10330.         if (aw <= 0) {
  10331.             return true
  10332.         }
  10333.         return false
  10334.     };
  10335.     var D = function () {
  10336.         return aw
  10337.     };
  10338.     var R = function (aC) {
  10339.         if (aC) {
  10340.             F(".jb-idx-title").show();
  10341.             F(".jb-classifier-link-wrapper.jb-classifier-thumb-area").show()
  10342.         } else {
  10343.             F(".jb-idx-title").hide();
  10344.             F(".jb-classifier-link-wrapper.jb-classifier-thumb-area").hide()
  10345.         }
  10346.     };
  10347.     var b = function () {
  10348.         return P * am
  10349.     };
  10350.     var X = function (aC) {
  10351.         a = true;
  10352.         window.setTimeout(function () {
  10353.             a = false
  10354.         },
  10355.         aC)
  10356.     };
  10357.     return {
  10358.         initialize: V,
  10359.         show_current_page: I,
  10360.         show_prev_page: u,
  10361.         show_next_page: K,
  10362.         move_to_next_page: g,
  10363.         move_to_prev_page: af,
  10364.         show_page_4_image_position: ag,
  10365.         show_page_by_page_index: ah,
  10366.         is_last_page: au,
  10367.         is_first_page: m,
  10368.         get_index: D,
  10369.         repaint: i,
  10370.         get_thumblist_size: p,
  10371.         display_gallery_top: R,
  10372.         get_image_index_range: av,
  10373.         set_thumbnail_visited: q,
  10374.         get_thumb_height: b,
  10375.         yield_4_transition: X,
  10376.         synchronize_config: k,
  10377.         get_show_area_position: A
  10378.     }
  10379. };
  10380. var juicebox_gallery_detail_panel = function (g) {
  10381.     var M, aa, E, Q, af, b, X, d, C, w, A;
  10382.     var V, K;
  10383.     var Z;
  10384.     var e = g;
  10385.     var r = null;
  10386.     var m = -1;
  10387.     var q = 0;
  10388.     var k, Y;
  10389.     var i;
  10390.     var F = false;
  10391.     var L = false;
  10392.     var c = 12;
  10393.     var W = 18;
  10394.     var ab = function (aj) {
  10395.         L = true;
  10396.         M = aj.jquery;
  10397.         aa = aj.document_id;
  10398.         E = aj.container;
  10399.         Z = aj.caption_container;
  10400.         af = aj.config;
  10401.         b = aj.utils;
  10402.         X = aj.sizing;
  10403.         Q = aj.glymng;
  10404.         d = aj.before_draw_event_callback;
  10405.         C = aj.finish_draw_event_callback;
  10406.         w = aj.touch_event_callback;
  10407.         A = aj.caption_complete_callback;
  10408.         i = 1000 * af.imagetransitiontime;
  10409.         V = aj.onHidingImage;
  10410.         K = aj.onShowingImage;
  10411.         k = aj.current_width;
  10412.         Y = aj.current_height;
  10413.         B(0)
  10414.     };
  10415.     var ai = function (aj) {
  10416.         return M(b.get_query_path(aa, aj))
  10417.     };
  10418.     var O = function () {
  10419.         if (!r) {
  10420.             return 0
  10421.         }
  10422.         return r.position
  10423.     };
  10424.     var H = function () {
  10425.         return r
  10426.     };
  10427.     var B = function (aj) {
  10428.         r = Q.get_image(aj)
  10429.     };
  10430.     var ag = function (am, al) {
  10431.         if (!am) {
  10432.             am = af.captionposition.toUpperCase()
  10433.         }
  10434.         if (am === "BOTTOM" || am === "NONE" || am === "BELOW_IMAGE") {
  10435.             return
  10436.         }
  10437.         if (typeof(A) != "function") {
  10438.             return
  10439.         }
  10440.         var ao = ai(".caption_" + al + " a");
  10441.         var aj = ai(".caption_" + al + " .jb-caption").height();
  10442.         if (ao.length > 0 && aj === 0) {
  10443.             aj = 50
  10444.         }
  10445.         aj = (aj && ao.length > 0 ? aj + 2 * c: 0);
  10446.         if (am != "OVERLAY_IMAGE") {
  10447.             A(Y - aj)
  10448.         } else {
  10449.             var ak = Q.get_image(al);
  10450.             if (!ak.loaded) {
  10451.                 return
  10452.             }
  10453.             var an = X.get_image_display_size(ak, k, Y, af);
  10454.             A((an.top + an.height + X.get_image_framewidth(k, Y, af)) - aj)
  10455.         }
  10456.     };
  10457.     var J = function (au, aq, am, az, al) {
  10458.         var ax = m > -1 ? m: r.position;
  10459.         var ay = -1;
  10460.         if (typeof(az) != "undefined") {
  10461.             ay = az
  10462.         } else {
  10463.             if (au && Q.get_next_image(ax)) {
  10464.                 ay = Q.get_next_image(ax).position
  10465.             } else {
  10466.                 if (!au && Q.get_previous_image(ax)) {
  10467.                     ay = Q.get_previous_image(ax).position
  10468.                 }
  10469.             }
  10470.         }
  10471.         if (ay < 0) {
  10472.             return
  10473.         }
  10474.         var at;
  10475.         var ar = af.captionposition.toUpperCase();
  10476.         if (typeof(am) === "undefined") {
  10477.             am = true
  10478.         }
  10479.         if (ar === "NONE" || (",BOTTOM,BELOW_IMAGE,OVERLAY_IMAGE,BELOW_THUMBS,".indexOf("," + ar + ",") < 0 && af.showimageoverlay.toUpperCase() === "NEVER")) {
  10480.             am = false
  10481.         }
  10482.         var aw = function (aB) {
  10483.             if (!af.slidecaption && (am || ar === "BOTTOM" || ar === "BELOW_IMAGE")) {
  10484.                 Z.fadeIn(aB);
  10485.                 ai(".jb-cap-frame.jb-status-fading").fadeIn(aB);
  10486.                 if (ar != "BOTTOM" && ar != "BELOW_IMAGE" && ar != "NONE") {
  10487.                     window.setTimeout(function () {
  10488.                         ag(ar, ay)
  10489.                     },
  10490.                     aB + 50)
  10491.                 }
  10492.             }
  10493.         };
  10494.         var ap = function (aC) {
  10495.             var aB = af.captionposition.toUpperCase();
  10496.             if (am) {
  10497.                 an.addClass("jb-status-fading").fadeOut(aB === "BELOW_IMAGE" || aB === "OVERLAY_IMAGE" || (M.browser.msie && M.browser.version >= 7 && M.browser.version < 8) ? 0 : aC)
  10498.             } else {
  10499.                 an.removeClass("jb-status-fading")
  10500.             }
  10501.         };
  10502.         var av = function (aB) {
  10503.             d(ay);
  10504.             z(ay, aB, null, am, true);
  10505.             C(ay);
  10506.             aw(aB);
  10507.             m = -1
  10508.         };
  10509.         var aA = function (aC) {
  10510.             var aB = m > -1 ? m: ay;
  10511.             if (!al) {
  10512.                 d(aB)
  10513.             }
  10514.             z(aB, 0, null, am, true);
  10515.             if (!al) {
  10516.                 C(aB)
  10517.             }
  10518.             aw(aC);
  10519.             m = -1
  10520.         };
  10521.         if (m > -1) {
  10522.             at = ai(" .jb-panel-detail .jb-dt-main-frame, .jb-cap-frame");
  10523.             at.stop(false, false);
  10524.             if (q) {
  10525.                 window.clearTimeout(q);
  10526.                 q = 0
  10527.             }
  10528.             aA()
  10529.         }
  10530.         var ak = af.imagetransitiontype.toUpperCase();
  10531.         if (typeof(aq) == "undefined") {
  10532.             aq = 0
  10533.         }
  10534.         m = ay;
  10535.         var ao = 1000 * af.imagetransitiontime;
  10536.         if (aq > 0) {
  10537.             ao = ao * ((400 - aq / 2) / 400)
  10538.         }
  10539.         var aj = parseInt(k) + parseInt(af.minimagegap) + (2 * X.get_stage_padding(ai("").width(), ai("").height(), af));
  10540.         d(ay);
  10541.         var an = ai(".jb-cap-frame.caption_" + ax);
  10542.         at = ai(" .jb-panel-detail .jb-dt-main-frame");
  10543.         at.stop();
  10544.         if (b.is_swipable_device() && az == null) {
  10545.             at.animate({
  10546.                 left: (au ? "-=": "+=") + (aj - aq),
  10547.                 avoidTransforms: !af.use_webkit_transform,
  10548.                 useTranslate3d: true
  10549.             },
  10550.             ao, "easeOutQuart", function () {
  10551.                 aA(ao / 2)
  10552.             });
  10553.             ap(ao / 2)
  10554.         } else {
  10555.             if (ak === "NONE" || al) {
  10556.                 an.fadeOut(0);
  10557.                 aA(0)
  10558.             } else {
  10559.                 if (ak === "CROSS_FADE") {
  10560.                     at = ai(".jb-dt-main-image-" + ax);
  10561.                     E.append(ah(Q.get_image(ay), 0, true, false, 1));
  10562.                     at.fadeOut(ao, function () {
  10563.                         aA(0)
  10564.                     });
  10565.                     ap(ao)
  10566.                 } else {
  10567.                     if (ak === "FADE" || (az && ak != "FADE" && ak != "CROSS_FADE" && ak != "NONE")) {
  10568.                         if (at.length > 0) {
  10569.                             at.fadeOut(ao / 2);
  10570.                             q = window.setTimeout(function () {
  10571.                                 av(ao / 2)
  10572.                             },
  10573.                             ao / 2)
  10574.                         } else {
  10575.                             q = window.setTimeout(function () {
  10576.                                 av(ao / 2)
  10577.                             },
  10578.                             ao / 2)
  10579.                         }
  10580.                         ap(ao / 2)
  10581.                     } else {
  10582.                         at.animate({
  10583.                             left: (au ? "-=": "+=") + (aj - aq),
  10584.                             avoidTransforms: !af.use_webkit_transform,
  10585.                             useTranslate3d: true
  10586.                         },
  10587.                         ao, "easeOutQuart", function () {
  10588.                             aA(ao / 2)
  10589.                         });
  10590.                         ap(ao / 2)
  10591.                     }
  10592.                 }
  10593.             }
  10594.         }
  10595.         if (typeof(V) === "function") {
  10596.             V(ao / 2)
  10597.         }
  10598.     };
  10599.     var p = function (ak, aj) {
  10600.         J(true, ak, aj)
  10601.     };
  10602.     var j = function (am) {
  10603.         if (!am) {
  10604.             return
  10605.         }
  10606.         var ak = 1000 * af.imagetransitiontime;
  10607.         ak = ak * ((400 - am / 2) / 400);
  10608.         var aj = parseInt(k) + parseInt(af.minimagegap);
  10609.         var al;
  10610.         al = ai(" .jb-panel-detail .jb-dt-main-frame");
  10611.         al.stop();
  10612.         al.animate({
  10613.             left: "+=" + ( - am),
  10614.             avoidTransforms: !af.use_webkit_transform,
  10615.             useTranslate3d: true
  10616.         },
  10617.         ak, "", null)
  10618.     };
  10619.     var v = function (ak, aj) {
  10620.         J(false, ak, aj)
  10621.     };
  10622.     var z = function (au, at, aq, am, az) {
  10623.         if (typeof(am) === "undefined") {
  10624.             am = true
  10625.         }
  10626.         var an = parseInt(k) + parseInt(af.minimagegap) + (2 * X.get_stage_padding(ai("").width(), ai("").height(), af));
  10627.         r = Q.get_image(au);
  10628.         m = -1;
  10629.         var ax = ai(".jb-panel-detail");
  10630.         if (ax.length > 0 && !ax.is(":visible")) {
  10631.             ax.show()
  10632.         }
  10633.         var ar = Q.get_image(au);
  10634.         var aj = Q.get_previous_image(au);
  10635.         var ao = Q.get_next_image(au);
  10636.         var av = at > 0;
  10637.         var al = af.imagetransitiontype.toUpperCase();
  10638.         if (al != "FADE" && al != "CROSS_FADE" && al != "NONE") {
  10639.             E.children(":not(.jb-dt-main-image-" + au + ")").remove()
  10640.         } else {
  10641.             E.children().remove()
  10642.         }
  10643.         var ap = E.children(".jb-dt-main-image-" + au);
  10644.         if (ap.length <= 0) {
  10645.             E.append(ah(ar, 0, true, av));
  10646.             ap = E.children(".jb-dt-main-image-" + (ar ? ar.position: ""))
  10647.         } else {
  10648.             ap.css({
  10649.                 left: 0
  10650.             })
  10651.         }
  10652.         if (ar.loaded && typeof(K) === "function" && af.imagenavposition.toUpperCase() === "IMAGE") {
  10653.             var aw = X.get_image_display_size(ar, k, Y, af);
  10654.             K(aw, i / 2)
  10655.         }
  10656.         ap.before(ah(aj, -an, false, false));
  10657.         ap.after(ah(ao, an, false, false));
  10658.         if (!ap.is(":visible")) {
  10659.             ap.fadeIn()
  10660.         }
  10661.         if (ap.css("opacity") == 0) {
  10662.             ap.fadeIn()
  10663.         }
  10664.         var ak = Z.width();
  10665.         var ay = Z.height();
  10666.         if (am === true) {
  10667.             if (av || az) {
  10668.                 if (M.browser.msie || b.is_firefox3()) {
  10669.                     Z.hide()
  10670.                 } else {
  10671.                     Z.fadeOut(0)
  10672.                 }
  10673.             } else {
  10674.                 Z.fadeIn(0)
  10675.             }
  10676.         } else {
  10677.             Z.hide()
  10678.         }
  10679.         G(ar);
  10680.         var aA = ak + parseInt(af.minimagegap) + X.get_side_panel_width(af);
  10681.         Z.html(l(aj, ak, ay, -aA) + l(ar, ak, ay, 0) + l(ao, ak, ay, aA));
  10682.         ag("", ar.position);
  10683.         if (af.textcolor) {
  10684.             ai(".jb-cap-frame a").css({
  10685.                 color: b.format_color(af.textcolor)
  10686.             })
  10687.         }
  10688.         if (af.captionbackcolor) {
  10689.             if (b.is_earlier_ie()) {
  10690.                 ai(".jb-caption").css({
  10691.                     "background-color": b.format_color(af.captionbackcolor),
  10692.                     filter: af.captionbackopacity.replace("filter:", "")
  10693.                 })
  10694.             } else {
  10695.                 ai(".jb-caption").css({
  10696.                     "background-color": b.format_color(af.captionbackcolor)
  10697.                 })
  10698.             }
  10699.         }
  10700.         if (at > 0) {
  10701.             ai(".jb-dt-main-image-" + ar.position).fadeIn(at);
  10702.             if (am) {
  10703.                 Z.fadeIn(at)
  10704.             }
  10705.             if (typeof(aq) === "function") {
  10706.                 window.setTimeout(function () {
  10707.                     aq()
  10708.                 },
  10709.                 at)
  10710.             }
  10711.         }
  10712.     };
  10713.     var D = function (ak, aj) {
  10714.         if (!ak) {
  10715.             ai(".jb-dt-main-image-" + r.position).hide();
  10716.             return
  10717.         }
  10718.         ai(".jb-dt-main-image-" + r.position).fadeOut(ak);
  10719.         if (af.captionposition.toUpperCase() === "BELOW_IMAGE") {
  10720.             Z.fadeOut(0)
  10721.         } else {
  10722.             Z.fadeOut(ak)
  10723.         }
  10724.         if (typeof(aj) === "function") {
  10725.             window.setTimeout(function () {
  10726.                 aj()
  10727.             },
  10728.             ak)
  10729.         }
  10730.     };
  10731.     var a = function (aj) {
  10732.         if (aj >= Q.length()) {
  10733.             aj = Q.length() - 1
  10734.         }
  10735.         if (aj < 0) {
  10736.             return 0
  10737.         }
  10738.         return aj
  10739.     };
  10740.     var S = function (ak, am) {
  10741.         var aj = Q.get_range(a(ak), a(am));
  10742.         for (var al = 0; al < aj.length; al++) {
  10743.             U(aj[al])
  10744.         }
  10745.     };
  10746.     var G = function (am) {
  10747.         if (!am.loaded) {
  10748.             return
  10749.         }
  10750.         var ak = af.captionposition.toUpperCase();
  10751.         if (ak !== "OVERLAY_IMAGE") {
  10752.             if (ak === "BELOW_THUMBS") {
  10753.                 return
  10754.             }
  10755.             if (ak === "BELOW_IMAGE") {
  10756.                 Z.css({
  10757.                     overflow: "visible"
  10758.                 })
  10759.             }
  10760.             return
  10761.         }
  10762.         var al = X.get_image_display_size(am, k, Y, af);
  10763.         var an = al.top + al.frameHeight - af.maxcaptionheight + af.framewidth;
  10764.         if (an < 0) {
  10765.             an = 0
  10766.         }
  10767.         var ao = parseInt(E.css("top"));
  10768.         an += ao;
  10769.         var aj = parseInt(ai("").height()) - ao - al.top - al.frameHeight - af.framewidth;
  10770.         Z.css({
  10771.             top: an,
  10772.             bottom: aj,
  10773.             overflow: "hidden"
  10774.         })
  10775.     };
  10776.     var T = function (ak, aj) {
  10777.         if (!ak) {
  10778.             ak = af.captionposition.toUpperCase()
  10779.         }
  10780.         if (ak != "BELOW_THUMBS" || !b.is_side_layout(af)) {
  10781.             return W
  10782.         }
  10783.         var am = e.get_show_area_position();
  10784.         var al = am.left + af.thumbpadding - (aj ? 72 : 0);
  10785.         if (al < W) {
  10786.             al = W
  10787.         }
  10788.         return al
  10789.     };
  10790.     var ae = function (ao) {
  10791.         var am = ai(".caption_" + ao.position + " .jb-caption").height(),
  10792.         aj;
  10793.         var al = af.captionposition.toUpperCase();
  10794.         var ak = 140;
  10795.         if (al != "OVERLAY_IMAGE") {
  10796.             aj = ak
  10797.         } else {
  10798.             if (ao.loaded) {
  10799.                 if (!ac(ao)) {
  10800.                     aj = 0;
  10801.                     am = 0
  10802.                 } else {
  10803.                     var an = X.get_image_display_size(ao, k, Y, af);
  10804.                     aj = an.width;
  10805.                     am = an.height
  10806.                 }
  10807.             } else {
  10808.                 return null
  10809.             }
  10810.         }
  10811.         if (aj < 100 || am < ai(".caption_" + ao.position + " .jb-caption").height()) {
  10812.             return {
  10813.                 display: "none"
  10814.             }
  10815.         } else {
  10816.             if (aj < ak) {
  10817.                 return {
  10818.                     display: "block",
  10819.                     padding: "0"
  10820.                 }
  10821.             } else {
  10822.                 return {
  10823.                     display: ac(ao) ? "block": "none",
  10824.                     "padding-top": c + "px",
  10825.                     "padding-right": T(al, true) + "px",
  10826.                     "padding-left": T(al) + "px",
  10827.                     "padding-bottom": (h() ? c: (c + 18)) + "px"
  10828.                 }
  10829.             }
  10830.         }
  10831.     };
  10832.     var I = function (am) {
  10833.         var al = ae(am);
  10834.         if (!al) {
  10835.             return ""
  10836.         }
  10837.         var aj = "";
  10838.         for (var ak in al) {
  10839.             if (!ak) {
  10840.                 continue
  10841.             }
  10842.             aj += ak + ":" + al[ak] + ";"
  10843.         }
  10844.         return aj
  10845.     };
  10846.     var s = function (an) {
  10847.         if (!an) {
  10848.             return
  10849.         }
  10850.         var ak = af.captionposition.toUpperCase();
  10851.         if (ak !== "BELOW_IMAGE" && ak !== "OVERLAY_IMAGE") {
  10852.             return
  10853.         }
  10854.         var al = parseInt(Z.width()) + parseInt(af.minimagegap) + X.get_side_panel_width(af);
  10855.         var am = (an.position - r.position) * al;
  10856.         var aj = ae(an);
  10857.         if (aj) {
  10858.             ai(".caption_" + an.position + " .jb-caption").css(aj)
  10859.         }
  10860.         ai(".jb-cap-frame.caption_" + an.position).attr("style", P(an, Z.width(), Z.height(), am))
  10861.     };
  10862.     var o = function () {
  10863.         var aj = af.captionposition.toUpperCase();
  10864.         return (aj != "BELOW_IMAGE" && aj != "BOTTOM") ? false: true
  10865.     };
  10866.     var P = function (ak, ar, an, aj) {
  10867.         var al = o();
  10868.         var at = "position:absolute;";
  10869.         var au, am;
  10870.         var ap = af.captionposition.toUpperCase();
  10871.         if (!ak.loaded && (ap === "BELOW_IMAGE" || ap === "OVERLAY_IMAGE")) {
  10872.             au = (ap === "OVERLAY_IMAGE") ? "": "top:" + (an - af.maxcaptionheight > 0 ? an - af.maxcaptionheight: 0) + "px;";
  10873.             return at + (al ? "height:100%;": "") + "width:100%;left:" + aj + "px;display:none;" + au
  10874.         } else {
  10875.             if ((ap !== "OVERLAY_IMAGE" && !al) || !ak.loaded || ap === "BOTTOM") {
  10876.                 return at + (al ? "height:100%;": "") + "width:" + ar + "px;left:" + aj + "px;"
  10877.             }
  10878.         }
  10879.         var aq = X.get_image_display_size(ak, k, Y, af);
  10880.         var ao = X.get_image_framewidth(k, Y, af);
  10881.         if (ap === "OVERLAY_IMAGE") {
  10882.             au = "";
  10883.             am = "width:" + (aq.width) + "px;";
  10884.             aj += ao
  10885.         } else {
  10886.             au = "top:" + (aq.top + aq.frameHeight + 2 * ao + X.get_image_padding(k, Y, af)) + "px;";
  10887.             am = "width:" + (aq.frameWidth + 2 * ao) + "px;"
  10888.         }
  10889.         return at + am + "height:100%;padding:0;margin:0;left:" + (aq.left + aj) + "px;" + au
  10890.     };
  10891.     var U = function (ak, al) {
  10892.         if (ak.isPreloading || ak.loaded) {
  10893.             return
  10894.         }
  10895.         var aj = new Image();
  10896.         ak.isPreloading = true;
  10897.         aj.onload = function () {
  10898.             ak.loaded = true;
  10899.             ak.width = aj.width;
  10900.             ak.height = aj.height;
  10901.             Q.update_image(ak);
  10902.             var an = ai(".jb-panel-detail .jb-dt-main-image-" + ak.position);
  10903.             if (an.length > 0) {
  10904.                 var am = function () {
  10905.                     an.html(x(ak, al, r.position === ak.position));
  10906.                     var ao = ai(".jb-panel-detail .jb-dt-main-image-" + ak.position + " img");
  10907.                     ao.disableSelection();
  10908.                     if (r.position === ak.position) {
  10909.                         if (M.browser.opera) {
  10910.                             ao.fadeIn(i);
  10911.                             window.setTimeout(function () {
  10912.                                 G(ak);
  10913.                                 s(ak);
  10914.                                 ag("", ak.position)
  10915.                             },
  10916.                             i)
  10917.                         } else {
  10918.                             ao.fadeIn(i, function () {
  10919.                                 G(ak);
  10920.                                 s(ak);
  10921.                                 ag("", ak.position)
  10922.                             })
  10923.                         }
  10924.                     }
  10925.                 };
  10926.                 if (b.is_swipable_device()) {
  10927.                     window.setTimeout(am, 100)
  10928.                 } else {
  10929.                     am()
  10930.                 }
  10931.             } else {
  10932.                 window.setTimeout(function () {
  10933.                     ai(".jb-panel-detail .jb-dt-main-image-" + ak.position).html(x(ak, al, r.position === ak.position));
  10934.                     if (r.position === ak.position) {
  10935.                         ai(".jb-panel-detail .jb-dt-main-image-" + ak.position + " img").fadeIn(i, function () {
  10936.                             G(ak);
  10937.                             s(ak);
  10938.                             ag("", ak.position)
  10939.                         })
  10940.                     }
  10941.                 },
  10942.                 100)
  10943.             }
  10944.         };
  10945.         aj.src = ak.imageURL
  10946.     };
  10947.     var ah = function (al, ak, aj, am, aq) {
  10948.         if (!al) {
  10949.             return ""
  10950.         }
  10951.         var ap = "";
  10952.         if (ak === 0 && af.imagetransitiontype.toUpperCase() === "CROSS_FADE") {
  10953.             if (!aq) {
  10954.                 aq = 2
  10955.             }
  10956.             ap = "z-index:" + aq + ";"
  10957.         }
  10958.         var ar = af.showpreloader ? "<div class='jb-status-loading' style='position:absolute;top:0;left:0;width:" + k + "px;height:" + Y + "px;padding:0;margin:0;" + ap + "'></div>": "";
  10959.         var ao;
  10960.         if (al.loaded) {
  10961.             ar = x(al, aj)
  10962.         } else {
  10963.             U(al, aj)
  10964.         }
  10965.         var an = N(k, Y, X.suggested_image_size(al, k, Y, af, af.imagescalemode.toUpperCase()));
  10966.         return "<div class='jb-dt-main-frame jb-dt-main-image-" + al.position + "' style='height:" + Y + "px;width:" + k + "px;left:" + ak + "px;" + ad(am) + ap + "'>" + ar + "</div>"
  10967.     };
  10968.     var ad = function (aj) {
  10969.         if (!aj) {
  10970.             return ""
  10971.         }
  10972.         if (M.browser.msie || b.is_firefox3()) {
  10973.             return "display:none;"
  10974.         }
  10975.         return "opacity:0;"
  10976.     };
  10977.     var ac = function (ak) {
  10978.         if (!ak) {
  10979.             return ""
  10980.         }
  10981.         var ar, ao, ap = "";
  10982.         if (af.useflickr) {
  10983.             ar = af.flickrshowtitle ? ak.caption: "";
  10984.             ao = (af.flickrshowdescription && ak.description) ? ak.description: "";
  10985.             ap = af.flickrshowpagelink ? '<p class="jb-cap-content jb-caption-link"><a href="' + ak.imageFullURL + '" target="_blank"  style="' + u() + ';">' + (af.flickrpagelinktext ? af.flickrpagelinktext: ak.caption) + "</a>&nbsp</p>": ""
  10986.         } else {
  10987.             ar = ak.title ? ak.title: "";
  10988.             ao = ak.caption ? ak.caption: ""
  10989.         }
  10990.         var aj = af.captionhalign.toUpperCase();
  10991.         var al = "";
  10992.         if (aj === "CENTER") {
  10993.             al = "text-align:center;"
  10994.         } else {
  10995.             if (aj === "RIGHT") {
  10996.                 al = "text-align:right;"
  10997.             }
  10998.         }
  10999.         var aq = M.trim(ar) ? '<p class="jb-cap-content jb-caption-title" style="' + al + '">' + ar + "&nbsp</p>": "";
  11000.         var am = M.trim(ao) ? '<p class="jb-caption-desc" style="' + al + (af.showimagenumber ? "": "margin-right:0;") + (ar ? "margin-top:10px;": "margin-top:0;") + '">' + ao + "</p>": "";
  11001.         var an = af.showimagenumber ? "<div class='jbac-number jb-classifier-layer' layer='2000' style='z-index:2000;" + ((b.ship || !F) ? "": "padding-bottom:20px;") + u() + "'>" + (ak.position + 1) + " / " + Q.length() + "</div>": "";
  11002.         return an + aq + am + ap
  11003.     };
  11004.     var h = function () {
  11005.         return (b.ship || !F)
  11006.     };
  11007.     var u = function () {
  11008.         if (!af.textcolor) {
  11009.             return ""
  11010.         }
  11011.         return "color:" + b.format_color(af.textcolor)
  11012.     };
  11013.     var l = function (ap, al, ak, ao) {
  11014.         if (!ap) {
  11015.             return ""
  11016.         }
  11017.         var an = ac(ap);
  11018.         var am = af.maxcaptionheight - (2 * c);
  11019.         if (!h()) {
  11020.             am -= 18
  11021.         }
  11022.         if (am <= 0) {
  11023.             am = af.maxcaptionheight > ak ? ak: af.maxcaptionheight
  11024.         }
  11025.         var aq = "<div layer='1000' class='jb-caption jb-classifier-layer' style='overflow:hidden;z-index:1000;" + I(ap) + "max-height:" + am + "px;" + (an ? "": "display:none;") + u() + "'>" + an + "</div>";
  11026.         var aj = " class='jb-cap-frame caption_" + ap.position + "' style='" + (an ? P(ap, al, ak, ao) : "display:none;") + "'";
  11027.         if (o()) {
  11028.             return "<div" + aj + ">" + aq + "</div>"
  11029.         } else {
  11030.             return "<table" + aj + "><tr><td>" + aq + "</td></tr></table>"
  11031.         }
  11032.     };
  11033.     var f = function (ak) {
  11034.         if (b.ship) {
  11035.             return
  11036.         }
  11037.         F = ak;
  11038.         var aj = af.maxcaptionheight - (2 * c);
  11039.         if (!h()) {
  11040.             aj -= 18
  11041.         }
  11042.         if (aj <= 0) {
  11043.             aj = af.maxcaptionheight > Z.height() ? Z.height() : af.maxcaptionheight
  11044.         }
  11045.         var am = ak ? c + 18 : c;
  11046.         var al = ak ? "20px": "";
  11047.         ai(".jb-cap-frame .jb-caption").css({
  11048.             "padding-bottom": am,
  11049.             "max-height": aj
  11050.         });
  11051.         ai(".jb-cap-frame .jbac-number").css({
  11052.             "padding-bottom": al
  11053.         })
  11054.     };
  11055.     var y = function (al) {
  11056.         var aj = ai(".caption_" + al.position + " .jb-caption");
  11057.         var ak = ac(al);
  11058.         if (ak) {
  11059.             aj.css({
  11060.                 display: ""
  11061.             })
  11062.         } else {
  11063.             aj.hide()
  11064.         }
  11065.         aj.html(ak)
  11066.     };
  11067.     var R = function (aj) {
  11068.         if (b.is_earlier_ie()) {
  11069.             return ""
  11070.         }
  11071.         if (b.is_small_android() || b.is_iphone()) {
  11072.             return "-webkit-box-shadow: 0px 0px " + aj.imageshadowblur + "px " + b.format_color(aj.imageshadowcolora) + ";"
  11073.         }
  11074.         return "box-shadow: 0px 0px " + aj.imageshadowblur + "px " + aj.imageshadowcolor + ";"
  11075.     };
  11076.     var x = function (al, ak, au) {
  11077.         if (!al) {
  11078.             return ""
  11079.         }
  11080.         var ao = X.get_image_display_size(al, k, Y, af);
  11081.         var aj = X.suggested_image_size(al, k, Y, af, af.imagescalemode.toUpperCase());
  11082.         var at = "";
  11083.         var aq = false;
  11084.         var ap = 0;
  11085.         var ar = 0;
  11086.         if (aj.height === "auto" && ao.frameHeight < ao.height) {
  11087.             ap = "-" + parseInt((ao.height - ao.frameHeight) / 2) + "px";
  11088.             aq = true
  11089.         }
  11090.         if (aj.width === "auto" && ao.frameWidth < ao.width) {
  11091.             ar = "-" + parseInt((ao.width - ao.frameWidth) / 2) + "px";
  11092.             aq = true
  11093.         }
  11094.         if (b.is_adobe_air() && af.imagescalemode.toUpperCase() === "FILL") {
  11095.             aj.height = aj.expectedHeight + "px";
  11096.             aj.width = aj.expectedWidth + "px"
  11097.         }
  11098.         var an = "<div class='jb-dt-main-image' style='position:absolute;top:" + ao.top + "px;left:" + ao.left + "px;height:" + ao.frameHeight + "px;width:" + ao.frameWidth + "px;padding:0;overflow:hidden;border:none;" + (af.imageframecolor ? "border-color:" + b.format_color(af.imageframecolor) + ";" + (b.is_earlier_ie() ? af.frameopacity + ";": "") : "") + R(af) + "'><img style='${0}$height:" + aj.height + ";width:" + aj.width + ";" + at + ad(au) + "'  src='" + al.imageURL + "'></div>";
  11099.         var am = X.get_image_framewidth(k, Y, af);
  11100.         if (am) {
  11101.             an = an.replace("border:none;", "border-style:solid;border-width:" + am + "px;")
  11102.         }
  11103.         if (al.position === r.position && typeof(K) === "function") {
  11104.             K(ao, i / 2)
  11105.         }
  11106.         if (aq) {
  11107.             return an.replace("${0}$", "display:inline;position:relative;top:" + ap + ";left:" + ar + ";")
  11108.         }
  11109.         return an.replace("${0}$", "")
  11110.     };
  11111.     var N = function (ao, ap, am) {
  11112.         var ak = parseInt(am.width);
  11113.         var an = parseInt(am.height);
  11114.         var aj = !ak || ao > ak ? "auto": ao + "px";
  11115.         var al = !an || ap > an ? "auto": ap + "px";
  11116.         return {
  11117.             width: aj,
  11118.             height: al
  11119.         }
  11120.     };
  11121.     var n = function (al, am, ar, ak) {
  11122.         if (!al) {
  11123.             return
  11124.         }
  11125.         var aq = ",BELOW_THUMBS,";
  11126.         var ap = ",BOTTOM,BELOW_IMAGE,OVERLAY_IMAGE" + aq;
  11127.         var an = "," + af.captionposition.toUpperCase() + ",";
  11128.         E.children().remove();
  11129.         var ao = Z.is(":visible") || aq.indexOf(an) > -1;
  11130.         var aj = af.showimageoverlay.toUpperCase();
  11131.         if (aj === "NEVER") {
  11132.             if (ap.indexOf(an) < 0) {
  11133.                 ao = false
  11134.             }
  11135.         }
  11136.         z(al.position, 0, null, ao);
  11137.         return
  11138.     };
  11139.     var t = function (aj, ak) {
  11140.         k = aj;
  11141.         Y = ak;
  11142.         ai(".jb-dt-main-frame").css({
  11143.             width: aj,
  11144.             height: ak
  11145.         });
  11146.         n(r, aj, ak, 0);
  11147.         G(r);
  11148.         s(r);
  11149.         ag("", r.position);
  11150.         var al = Q.get_previous_image(r.position);
  11151.         al = Q.get_next_image(r.position)
  11152.     };
  11153.     return {
  11154.         get_photo_position: O,
  11155.         move_2_next_photo: p,
  11156.         move_2_previous_photo: v,
  11157.         initialize: ab,
  11158.         populate_photo_html: z,
  11159.         repaint: t,
  11160.         get_current_photo: H,
  11161.         preload_images: S,
  11162.         fadeout_current_image: D,
  11163.         repopulate_caption_html: y,
  11164.         move_back: j,
  11165.         set_caption_height_mode: f,
  11166.         is_initialized: function () {
  11167.             return L
  11168.         },
  11169.         change_2_photo: J
  11170.     }
  11171. };
  11172. var juicebox_utils = new juice_box_utils(juicebox_lib.jQuery);
  11173. var juicebox_instances = [];
  11174. var juicebox_instance_count = 0;
  11175. var juicebox = function (_config) {
  11176.     var $ = juicebox_lib.jQuery;
  11177.     var utils = juicebox_utils;
  11178.     var gallery_manager = new juicebox_gallery_manager();
  11179.     var index_panel = new juicebox_gallery_index_panel(utils);
  11180.     var detail_panel = new juicebox_gallery_detail_panel(index_panel);
  11181.     var config_manager = new juicebox_config_manager($, utils);
  11182.     var flickr_loader = null;
  11183.     var dialog = null;
  11184.     var sizing = null;
  11185.     var switching_2_thumbnail = false;
  11186.     var overlay_visible = true;
  11187.     var in_the_transitioning = false;
  11188.     var is_index_visible = true;
  11189.     var is_detail_visible = false;
  11190.     var is_switching_image = false;
  11191.     var hide_thumbnails_in_lsm = false;
  11192.     var transTimer = 0;
  11193.     var audioPlayer;
  11194.     var instance_id;
  11195.     var document_id = (new Date()).valueOf();
  11196.     config_manager.init(_config, null, "ck-s-");
  11197.     var config = config_manager.get_config();
  11198.     var backgroundImageWidth = 0;
  11199.     var backgroundImageHeight = 0;
  11200.     var backgroundUrl = "";
  11201.     gallery_manager.init(config);
  11202.     var image_change_speed = 1000 * config.imagetransitiontime;
  11203.     var theme_cls = "jcbx-glry-classic";
  11204.     var themeUrl = "";
  11205.     var current_width = null;
  11206.     var current_height = null;
  11207.     var is_full_screen_mode = false;
  11208.     var start_x;
  11209.     var last_x;
  11210.     var delta_x;
  11211.     var start_y;
  11212.     var last_y;
  11213.     var delta_y;
  11214.     var in_navigation = false;
  11215.     var right_button_offset = null;
  11216.     var current_page = null;
  11217.     var total_page_count = null;
  11218.     var fullScreenPersistor = {
  11219.         parent_gallery_param: _config.persistor_param,
  11220.         is_full_screen: ((_config.fullscreen_displaying_mode) ? true: false),
  11221.         parent_gallery: _config.parent_gallery,
  11222.         initial_body_css_inline_style: (_config.initial_body_css_inline_style ? _config.initial_body_css_inline_style: ""),
  11223.         scroll_position: (_config.scroll_position ? _config.scroll_position: {}),
  11224.         initial_height: 0,
  11225.         initial_width: 0
  11226.     };
  11227.     var correct_path = function (path) {
  11228.         if (!path) {
  11229.             return ""
  11230.         }
  11231.         return utils.concate_path(config.baseurl, path)
  11232.     };
  11233.     var _ = function (path) {
  11234.         return $(utils.get_query_path(document_id, path))
  11235.     };
  11236.     var need_top_panel = function () {
  11237.         if (!utils.is_large_screen_mode(config)) {
  11238.             return false
  11239.         }
  11240.         var bbpos = config.backbuttonposition.toUpperCase();
  11241.         if (config.gallerytitleposition.toUpperCase() === "TOP" || config.buttonbarposition.toUpperCase() === "TOP" || bbpos === "TOP") {
  11242.             return true
  11243.         }
  11244.         return false
  11245.     };
  11246.     var is_caption_overlap = function () {
  11247.         var cappos = config.captionposition.toUpperCase();
  11248.         if (cappos != "BOTTOM" && cappos != "BELOW_IMAGE" && cappos != "NONE" && cappos != "BELOW_THUMBS") {
  11249.             return true
  11250.         }
  11251.         if (cappos === "NONE") {
  11252.             return false
  11253.         }
  11254.         if (! (is_index_visible && is_detail_visible)) {
  11255.             return true
  11256.         }
  11257.         return false
  11258.     };
  11259.     var set_containers_size_and_position = function (expected_size) {
  11260.         var pos = detail_panel.get_current_photo().position;
  11261.         set_toucharea_height(pos, expected_size);
  11262.         _(".jb-panel-index").css({
  11263.             width: expected_size.index_panel_width,
  11264.             height: expected_size.index_panel_height,
  11265.             top: expected_size.index_panel_top,
  11266.             left: expected_size.index_panel_left
  11267.         });
  11268.         _(".jb-panel-detail").css({
  11269.             width: expected_size.detail_panel_width,
  11270.             height: expected_size.detail_panel_height,
  11271.             top: expected_size.detail_panel_top,
  11272.             left: expected_size.detail_panel_left
  11273.         });
  11274.         var cpppos = config.captionposition.toUpperCase();
  11275.         var caphover = !utils.is_earlier_ie() && (cpppos != "NONE" && cpppos != "BOTTOM" && cpppos != "BELOW_IMAGE" && cpppos != "BELOW_THUMBS");
  11276.         var captionArea = _(".jb-area-caption");
  11277.         var capHeight = expected_size.caption_panel_height;
  11278.         if (! ($.browser.msie && $.browser.version <= 8) && (utils.is_large_screen_mode(config) && (hide_thumbnails_in_lsm || caphover) || !utils.is_large_screen_mode(config))) {
  11279.             capHeight = "100%"
  11280.         }
  11281.         var capTop = expected_size.caption_panel_top;
  11282.         if (cpppos === "BELOW_THUMBS" && !($.browser.msie && $.browser.version < 7)) {
  11283.             capHeight = "auto"
  11284.         }
  11285.         captionArea.css({
  11286.             width: expected_size.caption_panel_width,
  11287.             height: capHeight,
  11288.             top: capTop,
  11289.             left: expected_size.caption_panel_left,
  11290.             bottom: expected_size.caption_panel_bottom
  11291.         });
  11292.         _(".jb-panel-top").css({
  11293.             width: expected_size.top_panel_width,
  11294.             height: expected_size.top_panel_height,
  11295.             top: expected_size.top_panel_top,
  11296.             left: expected_size.top_panel_left
  11297.         })
  11298.     };
  11299.     var setup_layout = function (glry_width, glry_height, show_detail) {
  11300.         if (utils.is_large_screen_mode(config)) {
  11301.             if (hide_thumbnails_in_lsm) {
  11302.                 is_index_visible = false
  11303.             } else {
  11304.                 is_index_visible = true
  11305.             }
  11306.             is_detail_visible = true;
  11307.             _("").addClass("jb-flag-large-screen-mode")
  11308.         } else {
  11309.             if (show_detail) {
  11310.                 is_index_visible = false;
  11311.                 is_detail_visible = true
  11312.             } else {
  11313.                 is_index_visible = true;
  11314.                 is_detail_visible = false
  11315.             }
  11316.             _("").removeClass("jb-flag-large-screen-mode")
  11317.         }
  11318.     };
  11319.     var need_full_screen_button = function () {
  11320.         if (!utils.is_in_iframe() && config.usefullscreenexpand && utils.exit_support_real_fullscreen()) {
  11321.             return true
  11322.         }
  11323.         if (!utils.is_in_iframe() && (fullScreenPersistor.is_full_screen || utils.is_new_expanded_window())) {
  11324.             return true
  11325.         }
  11326.         if (config.showexpandbutton && (!is_full_screen_mode) && (!utils.is_in_iframe())) {
  11327.             return true
  11328.         }
  11329.         return false
  11330.     };
  11331.     var show_audio_button = function () {
  11332.         if (!config.showaudiobutton || utils.is_earlier_ie()) {
  11333.             return false
  11334.         }
  11335.         return true
  11336.     };
  11337.     var apply_show_options = function (ini, countonly, panelVisibilityOverwritten) {
  11338.         var show_thumb_button_bar = false;
  11339.         var show_detail_button_bar = false;
  11340.         var detailButtonCount = 0;
  11341.         var indexButtonCount = 0;
  11342.         if (ini) {
  11343.             if (!check_open_image_directly() && !panelVisibilityOverwritten) {
  11344.                 if (!config.showsmallthumbs) {
  11345.                     is_detail_visible = true;
  11346.                     is_index_visible = false
  11347.                 }
  11348.                 if (is_index_visible) {
  11349.                     show_thumbnails(0)
  11350.                 }
  11351.                 if (is_detail_visible && !fullScreenPersistor.is_full_screen) {
  11352.                     show_main_image(0, image_change_speed)
  11353.                 }
  11354.             }
  11355.         }
  11356.         var gp1v = false;
  11357.         var gp2v = false;
  11358.         var gp3v = false;
  11359.         if (!config.showsmallthumbs || !config.showthumbsbutton || (!utils.is_large_screen_mode(config) && is_index_visible)) {
  11360.             _(".jb-bb-btn-de-show-list").hide()
  11361.         } else {
  11362.             show_detail_button_bar = true;
  11363.             gp1v = true;
  11364.             detailButtonCount++
  11365.         }
  11366.         if (!config.showcaption) {
  11367.             _(".jb-caption").hide()
  11368.         }
  11369.         if (!config.showsmallthumbs || (!config.showthumbsbutton && utils.is_large_screen_mode(config))) {
  11370.             _(".jb-bb-btn-de-show-list").hide()
  11371.         } else {
  11372.             show_detail_button_bar = true;
  11373.             gp1v = true;
  11374.             if (detailButtonCount <= 0) {
  11375.                 detailButtonCount++
  11376.             }
  11377.         }
  11378.         if (!config.showopenbutton) {
  11379.             _(".jb-bb-btn-open-url").hide()
  11380.         } else {
  11381.             show_detail_button_bar = true;
  11382.             gp1v = true;
  11383.             detailButtonCount++
  11384.         }
  11385.         if (!config.showautoplaybutton) {
  11386.             _(".jb-bb-btn-auto-play").hide()
  11387.         } else {
  11388.             show_detail_button_bar = true;
  11389.             gp2v = true;
  11390.             detailButtonCount++
  11391.         }
  11392.         if (!show_audio_button()) {
  11393.             _(".jb-bb-btn-audio").hide()
  11394.         } else {
  11395.             show_detail_button_bar = true;
  11396.             gp3v = true;
  11397.             detailButtonCount++
  11398.         }
  11399.         if (!need_full_screen_button()) {
  11400.             _(".jb-bb-btn-full-screen").hide()
  11401.         } else {
  11402.             gp1v = true;
  11403.             if (is_index_visible && !utils.is_large_screen_mode(config)) {
  11404.                 show_thumb_button_bar = true;
  11405.                 indexButtonCount++
  11406.             } else {
  11407.                 show_detail_button_bar = true;
  11408.                 detailButtonCount++
  11409.             }
  11410.         }
  11411.         if (!config.showinfobutton) {
  11412.             _(".jb-bb-btn-show-info").hide()
  11413.         } else {
  11414.             show_detail_button_bar = true;
  11415.             gp3v = true;
  11416.             detailButtonCount++
  11417.         }
  11418.         if (!config.shownavbuttons) {
  11419.             _(".jb-bb-btn-top-nav").hide()
  11420.         } else {
  11421.             show_detail_button_bar = true;
  11422.             gp2v = true;
  11423.             detailButtonCount++
  11424.         }
  11425.         if (countonly) {
  11426.             return {
  11427.                 detailButtonCount: detailButtonCount,
  11428.                 indexButtonCount: indexButtonCount
  11429.             }
  11430.         }
  11431.         var showimageoverlay = config.showimageoverlay.toUpperCase();
  11432.         var btnPos = config.buttonbarposition.toUpperCase();
  11433.         if (!show_detail_button_bar || btnPos === "NONE") {
  11434.             _(".jb-classifier-link-wrapper.jb-classifier-detail-area").remove()
  11435.         } else {
  11436.             if (config.showinfobutton || overlay_visible || btnPos === "TOP" || showimageoverlay === "ALWAYS") {
  11437.                 if (is_detail_visible) {
  11438.                     _(".jb-classifier-link-wrapper.jb-classifier-detail-area").show()
  11439.                 }
  11440.                 _(".jb-classifier-link-wrapper.jb-classifier-detail-area .jb-bb-bar").show()
  11441.             } else {
  11442.                 _(".jb-classifier-link-wrapper.jb-classifier-detail-area").hide();
  11443.                 _(".jb-classifier-link-wrapper.jb-classifier-detail-area .jb-bb-bar").hide()
  11444.             }
  11445.         }
  11446.         if (!show_thumb_button_bar) {
  11447.             _(".jb-classifier-link-wrapper.jb-classifier-thumb-area .jb-bb-bar").hide()
  11448.         } else {
  11449.             _(".jb-classifier-link-wrapper.jb-classifier-thumb-area .jb-bb-bar").show()
  11450.         }
  11451.         if (gp1v && gp2v) {
  11452.             _(".jb-bb-splitter-1").show()
  11453.         } else {
  11454.             _(".jb-bb-splitter-1").hide()
  11455.         }
  11456.         if (gp3v && (gp2v || gp1v)) {
  11457.             _(".jb-bb-splitter-2").show()
  11458.         } else {
  11459.             _(".jb-bb-splitter-2").hide()
  11460.         }
  11461.     };
  11462.     var show_hide_controls = function (control, show, delay) {
  11463.         if (delay) {
  11464.             control.stop(false, true);
  11465.             if (show) {
  11466.                 if (!control.is(":visible") || control.css("opacity") == 0 || utils.is_swipable_device()) {
  11467.                     control.fadeIn(delay)
  11468.                 }
  11469.             } else {
  11470.                 control.fadeOut(delay)
  11471.             }
  11472.             return
  11473.         }
  11474.         if (show) {
  11475.             control.css("opacity", 1).show()
  11476.         } else {
  11477.             control.hide()
  11478.         }
  11479.     };
  11480.     var is_title_with_overlay = function () {
  11481.         if (!utils.is_large_screen_mode(config) || !is_detail_visible) {
  11482.             return false
  11483.         }
  11484.         var galleryTitlePosition = config.gallerytitleposition.toUpperCase();
  11485.         if (galleryTitlePosition === "NONE" || galleryTitlePosition === "TOP") {
  11486.             return false
  11487.         }
  11488.         return true
  11489.     };
  11490.     var concatenate_tags_string = function (arytags) {
  11491.         if (!arytags) {
  11492.             return ""
  11493.         }
  11494.         var ret = "";
  11495.         for (var i = 0; i < arytags.length; i++) {
  11496.             if (!arytags[i]) {
  11497.                 continue
  11498.             }
  11499.             if (ret) {
  11500.                 ret += (", " + arytags[i])
  11501.             } else {
  11502.                 ret = arytags[i]
  11503.             }
  11504.         }
  11505.         return ret
  11506.     };
  11507.     var set_overlay_visible = function (show) {
  11508.         var showimageoverlay = config.showimageoverlay.toUpperCase();
  11509.         if (showimageoverlay === "ALWAYS") {
  11510.             overlay_visible = true
  11511.         } else {
  11512.             if (showimageoverlay === "NEVER") {
  11513.                 overlay_visible = false
  11514.             } else {
  11515.                 overlay_visible = show
  11516.             }
  11517.         }
  11518.     };
  11519.     var show_count = 0;
  11520.     var show_hide_overlay = function (show, delay) {
  11521.         set_overlay_visible(show);
  11522.         if (utils.is_ipad()) {
  11523.             if (delay > 0 && show) {
  11524.                 window.setTimeout(function () {
  11525.                     _(".jb-classifier-show-on-over .jb-cap-frame").css("display", "")
  11526.                 },
  11527.                 10)
  11528.             }
  11529.             show_hide_controls(_(".jb-classifier-show-on-over, .jb-classifier-show-on-over .jb-cap-frame"), overlay_visible, delay)
  11530.         } else {
  11531.             if ($.browser.msie && overlay_visible) {
  11532.                 _(".jb-classifier-show-on-over .jb-bb-bar").show()
  11533.             }
  11534.             show_hide_controls(_(".jb-classifier-show-on-over"), overlay_visible, delay)
  11535.         }
  11536.     };
  11537.     var overlayTimer = 0;
  11538.     var set_overlay = function (show, delay) {
  11539.         if (is_switching_image) {
  11540.             return
  11541.         }
  11542.         if (!_(" .jb-panel-detail").is(":visible")) {
  11543.             return
  11544.         }
  11545.         if (switching_2_thumbnail) {
  11546.             return
  11547.         }
  11548.         if (overlayTimer) {
  11549.             window.clearTimeout(overlayTimer);
  11550.             overlayTimer = 0
  11551.         }
  11552.         overlayTimer = window.setTimeout(function () {
  11553.             overlayTimer = 0;
  11554.             show_hide_overlay(show, ($.browser.msie && $.browser.version >= 7 && $.browser.version < 8) ? 0 : delay)
  11555.         },
  11556.         100)
  11557.     };
  11558.     var check_open_image_directly = function () {
  11559.         var cntSize = sizing.get_containers_size_and_position(current_width, current_height, is_index_visible, is_detail_visible, config_manager.isp, need_top_panel(), index_panel.get_thumb_height(), config);
  11560.         if (config.enabledirectlinks) {
  11561.             var urlhash = window.location.href.split("#");
  11562.             var directPicIdx = (urlhash.length >= 2) ? parseInt(urlhash[1]) : -1;
  11563.             if (directPicIdx > 0 && directPicIdx <= gallery_manager.length()) {
  11564.                 show_main_image(directPicIdx - 1, image_change_speed, true);
  11565.                 is_detail_visible = true;
  11566.                 is_index_visible = false;
  11567.                 return true
  11568.             }
  11569.         }
  11570.         if (config.firstimageindex > 0 && config.firstimageindex <= gallery_manager.length()) {
  11571.             show_main_image(config.firstimageindex - 1, image_change_speed, true);
  11572.             is_detail_visible = true;
  11573.             is_index_visible = false;
  11574.             return true
  11575.         }
  11576.         return false
  11577.     };
  11578.     var set_hash_changed_event = function () {
  11579.         if (!config.enabledirectlinks) {
  11580.             return
  11581.         }
  11582.         var originalIdx = -1;
  11583.         var directGo2 = function () {
  11584.             var urlhash = window.location.href.split("#");
  11585.             var directPicIdx = (urlhash.length >= 2) ? parseInt(urlhash[1]) : -1;
  11586.             if (directPicIdx > 0 && directPicIdx <= gallery_manager.length() && originalIdx != directPicIdx) {
  11587.                 originalIdx = directPicIdx;
  11588.                 show_main_image(directPicIdx - 1, 0, false, true)
  11589.             }
  11590.         };
  11591.         if ($.browser.msie && $.browser.version < 8) {
  11592.             window.setInterval(directGo2, 800)
  11593.         } else {
  11594.             $(window).bind("hashchange", directGo2)
  11595.         }
  11596.     };
  11597.     var splash_is_set = function () {
  11598.         var ssp = config.showsplashpage.toUpperCase();
  11599.         if (ssp === "NEVER") {
  11600.             return false
  11601.         } else {
  11602.             if (ssp === "ALWAYS") {
  11603.                 return true
  11604.             } else {
  11605.                 if (!utils.is_large_screen_mode(config) && !is_full_screen_mode) {
  11606.                     return true
  11607.                 }
  11608.             }
  11609.         }
  11610.         return false
  11611.     };
  11612.     var need_show_splash_page = function () {
  11613.         if (fullScreenPersistor.is_full_screen || utils.is_new_expanded_window()) {
  11614.             return false
  11615.         }
  11616.         return splash_is_set()
  11617.     };
  11618.     var show_splash_page = function () {
  11619.         if (gallery_manager.length() <= 0) {
  11620.             return
  11621.         }
  11622.         utils.add_viewport_meta_tag_4_device(sizing.is_gallery_fully_filled(config.gallerywidth, config.galleryheight) || utils.is_new_expanded_window() || ((utils.is_iphone() || utils.is_ipad()) && config.expandinnewpage.toUpperCase() === "FALSE"));
  11623.         current_width = get_gallery_width();
  11624.         current_height = get_gallery_height();
  11625.         if (need_show_splash_page()) {
  11626.             _(".jb-classifier-detail-area").hide();
  11627.             var splashImageUrl = (config.splashimageurl ? correct_path(config.splashimageurl) : gallery_manager.get_image(0).imageURL);
  11628.             var splash = new juicebox_gallery_splash_panel();
  11629.             var params = get_panel_params();
  11630.             params.splashImageUrl = splashImageUrl;
  11631.             params.finish_draw_event_callback = null;
  11632.             params.view_gallery_event_callback = function () {
  11633.                 full_screen()
  11634.             };
  11635.             splash.initialize(params);
  11636.             splash.draw();
  11637.             hide_url_bar()
  11638.         } else {
  11639.             after_loading_images();
  11640.             set_gallery_title()
  11641.         }
  11642.     };
  11643.     var get_panel_params = function () {
  11644.         return {
  11645.             jquery: $,
  11646.             document_id: document_id,
  11647.             container: _(" .jb-panel-index>.jb-idx-thumbnail-container"),
  11648.             config: config,
  11649.             utils: utils,
  11650.             glymng: gallery_manager,
  11651.             sizing: sizing,
  11652.             finish_draw_event_callback: switch_2_main_image,
  11653.             touch_event_callback: after_page_changed,
  11654.             caption_complete_callback: set_touch_component_height,
  11655.             current_width: current_width,
  11656.             current_height: current_height
  11657.         }
  11658.     };
  11659.     var set_nav_btn_position = function (cntSize) {
  11660.         if (config.imagenavposition.toUpperCase() != "IMAGE") {
  11661.             _(".jb-navigation.jb-classifier-detail-area .jbn-nav-button").css("top", (cntSize.detail_panel_height / 2 - _(".jbn-right-button").height() / 2) + "px")
  11662.         }
  11663.         var thmbnavpos = config.thumbnavposition.toUpperCase();
  11664.         var topadj = (!cntSize.is_sideway_layout && config.gallerytitleposition.toUpperCase() === "ABOVE_THUMBS" && thmbnavpos != "BOTTOM" ? sizing.constTitleHeight4AboveThumbs: 0);
  11665.         if (utils.is_large_screen_mode(config)) {
  11666.             var thumbnavtop = index_panel.get_thumb_height() / 2 - 27;
  11667.             var spos = index_panel.get_show_area_position();
  11668.             var stgpd = sizing.get_stage_padding(current_width, current_height, config);
  11669.             if (thmbnavpos === "BOTTOM") {
  11670.                 thumbnavtop = spos.top + index_panel.get_thumb_height() + 8
  11671.             } else {
  11672.                 if (cntSize.is_sideway_layout) {
  11673.                     var cappos = config.captionposition.toUpperCase();
  11674.                     thumbnavtop = (current_height - cntSize.top_panel_height - 2 * stgpd - (cappos === "BOTTOM" ? cntSize.caption_panel_height: 0)) / 2 - 24 + (cappos === "BOTTOM" ? stgpd: 0)
  11675.                 }
  11676.             }
  11677.             if (config.usethumbdots) {
  11678.                 var thmnavpos = config.thumbnavposition.toUpperCase();
  11679.                 if (cntSize.is_sideway_layout) {
  11680.                     if (thmnavpos === "BOTTOM") {
  11681.                         topadj += 20
  11682.                     } else {
  11683.                         topadj -= 3
  11684.                     }
  11685.                 }
  11686.                 if (config.showthumbpagingtext && thmnavpos === "BOTTOM") {
  11687.                     topadj += 10
  11688.                 }
  11689.             } else {
  11690.                 if (thumbnavtop < stgpd) {
  11691.                     thumbnavtop = stgpd
  11692.                 }
  11693.             }
  11694.             _(".jb-navigation.jb-classifier-thumb-area .jbn-nav-button").css("top", (thumbnavtop + topadj) + "px")
  11695.         } else {
  11696.             _(".jb-navigation.jb-classifier-thumb-area .jbn-nav-button").css("top", ((cntSize.index_panel_height / 2 - _(".jbn-right-button").height() / 2) + topadj) + "px")
  11697.         }
  11698.     };
  11699.     var adjust_title_button_bar_position = function (sizeinfo) {
  11700.         var galleryTitlePosition = config.gallerytitleposition.toUpperCase();
  11701.         var buttonbarPosition = config.buttonbarposition.toUpperCase();
  11702.         var stgpding = sizing.get_stage_padding(current_width, current_height, config);
  11703.         var ort = 10 + stgpding;
  11704.         var tp = config.thumbpadding;
  11705.         var cntSize = sizeinfo ? sizeinfo: sizing.get_containers_size_and_position(current_width, current_height, is_index_visible, is_detail_visible, config_manager.isp, need_top_panel(), index_panel.get_thumb_height(), config);
  11706.         var rt = ort;
  11707.         var lft = rt,
  11708.         rht = rt;
  11709.         var ttha = config.gallerytitlehalign.toUpperCase();
  11710.         var isleft = true;
  11711.         var topp = 0;
  11712.         if (ttha === "RIGHT") {
  11713.             isleft = false
  11714.         }
  11715.         topp = tp + cntSize.detail_panel_top;
  11716.         if (galleryTitlePosition === "TOP") {
  11717.             topp = tp - 3 + cntSize.top_panel_top
  11718.         } else {
  11719.             if (galleryTitlePosition === "ABOVE_THUMBS") {
  11720.                 var thumbsize = index_panel.get_show_area_position();
  11721.                 var titleHt = parseInt($(".jb-area-large-mode-title").css("font-size"));
  11722.                 if (cntSize.is_sideway_layout) {
  11723.                     topp = parseInt(thumbsize.top - titleHt - config.thumbpadding)
  11724.                 } else {
  11725.                     topp = parseInt((thumbsize.top - titleHt) / 2)
  11726.                 }
  11727.                 if (topp < 0) {
  11728.                     topp = 0
  11729.                 }
  11730.                 lft = thumbsize.left + config.thumbpadding;
  11731.                 rht = lft
  11732.             }
  11733.         }
  11734.         var tmbpos = config.thumbsposition.toUpperCase();
  11735.         var is4SideLayout = galleryTitlePosition === "ABOVE_THUMBS" && (tmbpos === "LEFT" || tmbpos === "RIGHT") ? true: false;
  11736.         var cssattrs;
  11737.         if (ttha === "CENTER") {
  11738.             if ($.browser.msie && $.browser.version < 7) {
  11739.                 cssattrs = {
  11740.                     left: stgpding,
  11741.                     top: topp,
  11742.                     width: "100%",
  11743.                     height: "auto",
  11744.                     "text-align": "center",
  11745.                     overflow: "visible",
  11746.                     "white-space": "normal"
  11747.                 }
  11748.             } else {
  11749.                 if (is4SideLayout && galleryTitlePosition != "ABOVE_THUMBS") {
  11750.                     lft = stgpding - parseInt(_(".jb-area-large-mode-title").css("padding-left"));
  11751.                     if (galleryTitlePosition === "ABOVE_THUMBS" && tmbpos === "RIGHT") {
  11752.                         lft = cntSize.index_panel_left - config.thumbseparation
  11753.                     }
  11754.                     rht = stgpding + (tmbpos === "RIGHT" ? 0 : cntSize.detail_panle_left)
  11755.                 }
  11756.                 if (is_index_visible) {
  11757.                     cssattrs = {
  11758.                         left: lft,
  11759.                         top: topp,
  11760.                         right: rht,
  11761.                         height: "auto",
  11762.                         "text-align": "center",
  11763.                         overflow: "visible",
  11764.                         "white-space": "normal"
  11765.                     }
  11766.                 } else {
  11767.                     cssattrs = {
  11768.                         left: lft,
  11769.                         top: topp,
  11770.                         right: rht,
  11771.                         height: "auto",
  11772.                         "text-align": "center",
  11773.                         overflow: "hidden",
  11774.                         "white-space": "nowrap"
  11775.                     }
  11776.                 }
  11777.             }
  11778.         } else {
  11779.             if (isleft) {
  11780.                 if (is4SideLayout && tmbpos === "RIGHT" && galleryTitlePosition != "ABOVE_THUMBS") {
  11781.                     lft = cntSize.index_panel_left
  11782.                 }
  11783.                 if (is_index_visible) {
  11784.                     cssattrs = {
  11785.                         left: lft,
  11786.                         right: "auto",
  11787.                         height: "auto",
  11788.                         top: topp,
  11789.                         "text-align": "left",
  11790.                         overflow: "visible",
  11791.                         "white-space": "normal"
  11792.                     }
  11793.                 } else {
  11794.                     cssattrs = {
  11795.                         left: lft,
  11796.                         right: "auto",
  11797.                         height: "auto",
  11798.                         top: topp,
  11799.                         "text-align": "left",
  11800.                         overflow: "hidden",
  11801.                         "white-space": "nowrap"
  11802.                     }
  11803.                 }
  11804.             } else {
  11805.                 if (is4SideLayout && galleryTitlePosition != "ABOVE_THUMBS") {
  11806.                     if (tmbpos === "LEFT") {
  11807.                         rht += (current_width - cntSize.detail_panel_left)
  11808.                     } else {
  11809.                         rht -= 10
  11810.                     }
  11811.                 }
  11812.                 if (is_index_visible) {
  11813.                     cssattrs = {
  11814.                         left: "auto",
  11815.                         right: rht,
  11816.                         top: topp,
  11817.                         height: "auto",
  11818.                         "text-align": "right",
  11819.                         overflow: "visible",
  11820.                         "white-space": "normal"
  11821.                     }
  11822.                 } else {
  11823.                     cssattrs = {
  11824.                         left: "auto",
  11825.                         right: rht,
  11826.                         top: topp,
  11827.                         height: "auto",
  11828.                         "text-align": "right",
  11829.                         overflow: "hidden",
  11830.                         "white-space": "nowrap"
  11831.                     }
  11832.                 }
  11833.             }
  11834.         }
  11835.         _(".jb-area-large-mode-title").css(cssattrs);
  11836.         var bbha = config.buttonbarhalign.toUpperCase();
  11837.         isleft = false;
  11838.         rt = ort;
  11839.         if (bbha === "CENTER") {
  11840.             isleft = true;
  11841.             var btncnt = apply_show_options(false, true);
  11842.             var wd = 28 * btncnt.detailButtonCount + 8;
  11843.             rt = parseInt((cntSize.detail_panel_width - wd) / 2)
  11844.         } else {
  11845.             if (bbha === "LEFT") {
  11846.                 isleft = true
  11847.             }
  11848.         }
  11849.         topp = tp + cntSize.detail_panel_top;
  11850.         if (buttonbarPosition === "TOP") {
  11851.             topp = tp - 3 + cntSize.top_panel_top
  11852.         }
  11853.         if (isleft) {
  11854.             if ($.browser.msie && $.browser.version < 8) {
  11855.                 var btncnt = apply_show_options(false, true);
  11856.                 var wd = 28 * btncnt.detailButtonCount + 28;
  11857.                 _(".jb-classifier-link-wrapper.jb-classifier-detail-area").css({
  11858.                     left: rt,
  11859.                     top: topp,
  11860.                     width: wd
  11861.                 })
  11862.             } else {
  11863.                 _(".jb-classifier-link-wrapper.jb-classifier-detail-area").css({
  11864.                     left: rt,
  11865.                     top: topp
  11866.                 })
  11867.             }
  11868.         } else {
  11869.             _(".jb-classifier-link-wrapper.jb-classifier-detail-area").css({
  11870.                 right: rt,
  11871.                 top: topp
  11872.             })
  11873.         }
  11874.     };
  11875.     var link_overlays = function () {
  11876.         if (!need_top_panel()) {
  11877.             _(".jb-panel-top").remove()
  11878.         } else {
  11879.             _(".jb-panel-top").show()
  11880.         }
  11881.         if (!need_full_screen_button()) {
  11882.             _(".jb-bb-btn-full-screen").remove()
  11883.         }
  11884.         if (!config.showsmallthumbs || !config.showthumbsbutton) {
  11885.             _(".jb-bb-btn-de-show-list").remove()
  11886.         }
  11887.         var ov = config.captionposition.toUpperCase();
  11888.         var areaCap = _(".jb-area-caption").css("max-height", config.maxcaptionheight);
  11889.         if (ov === "NONE") {
  11890.             areaCap.remove()
  11891.         } else {
  11892.             if (ov === "BELOW_IMAGE" || ov === "BOTTOM" || ov === "BELOW_THUMBS") {
  11893.                 areaCap.removeClass("jb-classifier-show-on-over").addClass("jb-flag-size-fixed")
  11894.             } else {
  11895.                 areaCap.addClass("jb-classifier-show-on-over")
  11896.             }
  11897.         }
  11898.         var gobackbtn = _(".jb-go-back");
  11899.         if (!show_back_button()) {
  11900.             gobackbtn.remove()
  11901.         } else {
  11902.             ov = config.backbuttonposition.toUpperCase();
  11903.             if (ov === "OVERLAY") {
  11904.                 gobackbtn.addClass("jb-classifier-show-on-over")
  11905.             } else {
  11906.                 gobackbtn.removeClass("jb-classifier-show-on-over")
  11907.             }
  11908.             if (config.showsmallbackbutton) {
  11909.                 gobackbtn.addClass("jb-classifier-detail-area")
  11910.             }
  11911.             if (config.backbuttonuseicon) {
  11912.                 gobackbtn.addClass("jb-go-back-icon-frame");
  11913.                 gobackbtn.children("a").addClass("jb-go-back-icon")
  11914.             }
  11915.         }
  11916.         ov = config.buttonbarposition.toUpperCase();
  11917.         var btnsel = ($.browser.msie ? ".jb-classifier-link-wrapper.jb-classifier-detail-area": ".jb-classifier-link-wrapper.jb-classifier-detail-area, .jb-classifier-link-wrapper.jb-classifier-detail-area .jb-bb-bar");
  11918.         if (ov === "NONE") {
  11919.             _(".jb-classifier-link-wrapper.jb-classifier-detail-area").remove()
  11920.         } else {
  11921.             if (ov === "TOP" || config.showinfobutton) {
  11922.                 _(btnsel).removeClass("jb-classifier-show-on-over")
  11923.             } else {
  11924.                 if (config.showimageoverlay.toUpperCase() === "NEVER") {
  11925.                     _(".jb-classifier-link-wrapper.jb-classifier-detail-area").remove()
  11926.                 } else {
  11927.                     _(btnsel).addClass("jb-classifier-show-on-over")
  11928.                 }
  11929.             }
  11930.         }
  11931.         ov = config.gallerytitleposition.toUpperCase();
  11932.         if (ov === "NONE") {
  11933.             _(".jb-area-large-mode-title").remove()
  11934.         } else {
  11935.             if (ov === "TOP") {
  11936.                 _(".jb-area-large-mode-title").removeClass("jb-classifier-show-on-over")
  11937.             } else {
  11938.                 _(".jb-area-large-mode-title").addClass("jb-classifier-show-on-over")
  11939.             }
  11940.         }
  11941.         if (!need_image_nav_button()) {
  11942.             _(".jb-navigation .jbn-nav-button").remove()
  11943.         }
  11944.         if (config.topbackcolor) {
  11945.             if (utils.is_earlier_ie()) {
  11946.                 _(".jb-panel-top").css({
  11947.                     "background-color": utils.format_color(config.topbackcolor),
  11948.                     filter: config.topbackopacity.replace("filter:", "")
  11949.                 })
  11950.             } else {
  11951.                 _(".jb-panel-top").css({
  11952.                     "background-color": utils.format_color(config.topbackcolor)
  11953.                 })
  11954.             }
  11955.         }
  11956.         if (config.buttonbarbackcolor) {
  11957.             if (utils.is_earlier_ie()) {
  11958.                 _(".jb-bb-bar").css({
  11959.                     "background-color": utils.format_color(config.buttonbarbackcolor),
  11960.                     filter: config.buttonbarbackopacity.replace("filter:", "")
  11961.                 })
  11962.             } else {
  11963.                 _(".jb-bb-bar").css({
  11964.                     "background-color": utils.format_color(config.buttonbarbackcolor)
  11965.                 })
  11966.             }
  11967.         }
  11968.     };
  11969.     var test_remove_title_and_caption = function () {
  11970.         if (config.gallerytitleposition.toUpperCase() === "ABOVE_THUMBS") {
  11971.             _(".jb-area-large-mode-title").remove()
  11972.         }
  11973.         if (config.captionposition.toUpperCase() === "BELOW_THUMBS") {
  11974.             _(".jb-area-caption").remove()
  11975.         }
  11976.     };
  11977.     var hide_image_nav_if_needed = function (delay) {
  11978.         if (config.imagenavposition.toUpperCase() != "IMAGE") {
  11979.             return
  11980.         }
  11981.         _(".jb-classifier-detail-area .jbn-nav-button div").fadeOut(delay)
  11982.     };
  11983.     var unhide_image_nav_if_necessary = function () {
  11984.         if (config.imagenavposition.toUpperCase() != "IMAGE") {
  11985.             return
  11986.         }
  11987.         set_image_nav()
  11988.     };
  11989.     var move_back_image_after_touch = function (delta) {
  11990.         detail_panel.move_back(delta_x);
  11991.         if (config.imagenavposition.toUpperCase() != "IMAGE") {
  11992.             return
  11993.         }
  11994.         window.setTimeout(function () {
  11995.             unhide_image_nav_if_necessary()
  11996.         },
  11997.         500 * config.imagetransitiontime)
  11998.     };
  11999.     var initialize_panels = function () {
  12000.         test_remove_title_and_caption();
  12001.         setup_layout(current_width, current_height, is_detail_visible);
  12002.         var thumbpanelheigh = config.maxthumbrows * (config.thumbheight + config.thumbpadding);
  12003.         if (utils.is_side_layout(config)) {
  12004.             thumbpanelheigh = 10
  12005.         }
  12006.         var cntSize = sizing.get_containers_size_and_position(current_width, current_height, is_index_visible, is_detail_visible, config_manager.isp, need_top_panel(), thumbpanelheigh, config);
  12007.         var params = get_panel_params();
  12008.         params.current_width = cntSize.index_panel_width;
  12009.         params.current_height = cntSize.index_panel_height;
  12010.         index_panel.initialize(params, is_full_screen_mode || fullScreenPersistor.is_full_screen);
  12011.         params.container = _(" .jb-panel-detail");
  12012.         params.caption_container = _(".jb-area-caption");
  12013.         params.current_width = cntSize.detail_panel_width;
  12014.         params.current_height = cntSize.detail_panel_height;
  12015.         params.before_draw_event_callback = before_show_main_image;
  12016.         params.finish_draw_event_callback = after_show_main_image;
  12017.         params.onHidingImage = function (delay) {
  12018.             hide_image_nav_if_needed(delay)
  12019.         };
  12020.         params.onShowingImage = function (imagePosition, delay) {
  12021.             if (config.imagenavposition.toUpperCase() != "IMAGE") {
  12022.                 return
  12023.             }
  12024.             var top = imagePosition.top + (imagePosition.height / 2) - _(".jbn-nav-button").height() / 2 + config.framewidth;
  12025.             var bmg = 10;
  12026.             var sided = imagePosition.left + bmg + config.framewidth;
  12027.             var alwaysHide = (!config.showimagenav || config.showimageoverlay.toUpperCase() === "NEVER") ? true: false;
  12028.             _(".jb-classifier-detail-area .jbn-nav-left-touch-area .jbn-nav-button").css({
  12029.                 left: sided,
  12030.                 top: top
  12031.             });
  12032.             _(".jb-classifier-detail-area .jbn-nav-right-touch-area .jbn-nav-button").css({
  12033.                 right: sided + 10,
  12034.                 top: top
  12035.             });
  12036.             if (can_image_move() && !alwaysHide) {
  12037.                 _(".jb-classifier-detail-area .jbn-left-button").fadeIn(delay)
  12038.             }
  12039.             if (can_image_move(true) && !alwaysHide) {
  12040.                 _(".jb-classifier-detail-area .jbn-right-button").fadeIn(delay)
  12041.             }
  12042.         };
  12043.         detail_panel.initialize(params)
  12044.     };
  12045.     var windowResize = function () {
  12046.         repaint(false)
  12047.     };
  12048.     var after_loading_images = function (skipshowing) {
  12049.         if (config.randomizeimages) {
  12050.             gallery_manager.sort_images()
  12051.         }
  12052.         sizing.get_initial_size();
  12053.         initialize_panels();
  12054.         link_overlays();
  12055.         set_back_button();
  12056.         adjust_title_button_bar_position();
  12057.         if (config.useflickr) {
  12058.             _("").addClass("jb-flickr-glry")
  12059.         }
  12060.         if (fullScreenPersistor.is_full_screen) {
  12061.             if (utils.need_viewport_meta() && !utils.host_has_viewport_meta()) {
  12062.                 _("").addClass("jb-large-icon")
  12063.             }
  12064.         }
  12065.         var cntSize = sizing.get_containers_size_and_position(current_width, current_height, is_index_visible, is_detail_visible, config_manager.isp, need_top_panel(), index_panel.get_thumb_height(), config);
  12066.         _(".jbn-nav-left-touch-area .jbn-nav-button").css({
  12067.             left: (sizing.get_stage_padding(current_width, current_height, config) - 5)
  12068.         });
  12069.         _(".jbn-nav-right-touch-area .jbn-nav-button").css({
  12070.             right: (sizing.get_stage_padding(current_width, current_height, config) + 10)
  12071.         });
  12072.         if (false) {
  12073.             window.setTimeout(function () {
  12074.                 display_error_message(themeUrl)
  12075.             },
  12076.             image_change_speed)
  12077.         }
  12078.         if (!skipshowing) {
  12079.             setup_layout(current_width, current_height, is_detail_visible);
  12080.             set_nav_btn_position(cntSize);
  12081.             $(window).resize(windowResize);
  12082.             if (utils.is_iphone() || utils.is_ipad()) {
  12083.                 window.onorientationchange = function () {
  12084.                     repaint(true)
  12085.                 }
  12086.             }
  12087.             _(".jb-bb-btn-de-show-list").click(index_button_clicked);
  12088.             _(".jb-classifier-thumb-area .jbn-right-button").click(function () {
  12089.                 return next_page(0)
  12090.             });
  12091.             _(".jb-classifier-thumb-area .jbn-left-button").click(function () {
  12092.                 return previous_page(0)
  12093.             });
  12094.             _(".jb-bb-btn-open-url").click(open_url);
  12095.             _(".jb-bb-btn-full-screen").click(full_screen);
  12096.             _(".jb-bb-btn-auto-play").click(function () {
  12097.                 toggle_autoplay();
  12098.                 return false
  12099.             });
  12100.             _(".jb-bb-btn-audio").click(toggle_audio_play);
  12101.             _(".jb-bb-btn-show-info").click(function () {
  12102.                 toggle_info();
  12103.                 return false
  12104.             });
  12105.             _(".jb-bb-btn-top-nav.jb-bb-btn-top-nav-left").click(function () {
  12106.                 if (autoplay_timer) {
  12107.                     toggle_autoplay()
  12108.                 }
  12109.                 return previous_image(0)
  12110.             });
  12111.             _(".jb-bb-btn-top-nav.jb-bb-btn-top-nav-right").click(function () {
  12112.                 if (autoplay_timer) {
  12113.                     toggle_autoplay()
  12114.                 }
  12115.                 return next_image(0)
  12116.             });
  12117.             var audioUrl = "";
  12118.             if (utils.is_firefox() || utils.is_opera()) {
  12119.                 audioUrl = config.audiourlogg
  12120.             } else {
  12121.                 if (config.audiourlmp3) {
  12122.                     audioUrl = config.audiourlmp3
  12123.                 } else {
  12124.                     audioUrl = config.audiourlogg
  12125.                 }
  12126.             }
  12127.             if (fullScreenPersistor.is_full_screen && fullScreenPersistor.parent_gallery_param.parent_toggle_audio_play) {
  12128.                 audio_playing = fullScreenPersistor.parent_gallery_param.is_audio_playing;
  12129.                 if (fullScreenPersistor.parent_gallery_param.is_audio_playing) {
  12130.                     _(".jb-bb-btn-audio").addClass("jb-status-playing").attr("title", config.languagelist.psa)
  12131.                 } else {
  12132.                     _(".jb-bb-btn-audio").removeClass("jb-status-playing").attr("title", config.languagelist.plya)
  12133.                 }
  12134.             } else {
  12135.                 if (audioUrl && !utils.is_earlier_ie() && !utils.is_adobe_air()) {
  12136.                     audioPlayer = new Audio(audioUrl);
  12137.                     audioPlayer.addEventListener("ended", function () {
  12138.                         this.currentTime = 0;
  12139.                         if (config.loopaudio) {
  12140.                             this.play()
  12141.                         } else {
  12142.                             toggle_audio_play()
  12143.                         }
  12144.                     },
  12145.                     false);
  12146.                     audioPlayer.volume = config.audiovolume;
  12147.                     if (config.playaudioonload) {
  12148.                         toggle_audio_play()
  12149.                     }
  12150.                 }
  12151.             }
  12152.             if (!utils.is_swipable_device()) {
  12153.                 var clickMode = config.imageclickmode.toUpperCase();
  12154.                 _(".jb-classifier-detail-area .jbn-right-button").click(function () {
  12155.                     if (autoplay_timer) {
  12156.                         toggle_autoplay()
  12157.                     }
  12158.                     return next_image(0)
  12159.                 });
  12160.                 _(".jb-classifier-detail-area .jbn-left-button").click(function () {
  12161.                     if (autoplay_timer) {
  12162.                         toggle_autoplay()
  12163.                     }
  12164.                     return previous_image(0)
  12165.                 });
  12166.                 if (!config.forcetouchmode) {
  12167.                     if (clickMode === "NONE") {
  12168.                         _(".jb-classifier-detail-area .jbn-nav-right-touch-area").css("cursor", "default");
  12169.                         _(".jb-classifier-detail-area .jbn-nav-left-touch-area").css("cursor", "default")
  12170.                     } else {
  12171.                         if (clickMode === "OPEN_URL") {
  12172.                             _(".jb-classifier-detail-area .jbn-nav-right-touch-area").click(open_url);
  12173.                             _(".jb-classifier-detail-area .jbn-nav-left-touch-area").click(open_url)
  12174.                         } else {
  12175.                             _(".jb-classifier-detail-area .jbn-nav-right-touch-area").click(function () {
  12176.                                 if (autoplay_timer) {
  12177.                                     toggle_autoplay()
  12178.                                 }
  12179.                                 return next_image(0)
  12180.                             });
  12181.                             _(".jb-classifier-detail-area .jbn-nav-left-touch-area").click(function () {
  12182.                                 if (autoplay_timer) {
  12183.                                     toggle_autoplay()
  12184.                                 }
  12185.                                 return previous_image(0)
  12186.                             })
  12187.                         }
  12188.                     }
  12189.                 }
  12190.             } else {
  12191.                 var delay = 1050 * config.imagetransitiontime + 300;
  12192.                 var delay = parseInt(1005 * config.imagetransitiontime + 510 * config.imagetransitiontime);
  12193.                 _(".jb-classifier-detail-area .jbn-right-button").bind("touchend", function (e) {
  12194.                     index_panel.yield_4_transition(delay);
  12195.                     e.preventDefault();
  12196.                     if (in_the_transitioning) {
  12197.                         return
  12198.                     }
  12199.                     in_the_transitioning = true;
  12200.                     if (autoplay_timer) {
  12201.                         toggle_autoplay()
  12202.                     }
  12203.                     next_image(0);
  12204.                     window.setTimeout(function () {
  12205.                         in_the_transitioning = false
  12206.                     },
  12207.                     delay)
  12208.                 });
  12209.                 _(".jb-classifier-detail-area .jbn-left-button").bind("touchend", function (e) {
  12210.                     index_panel.yield_4_transition(delay);
  12211.                     e.preventDefault();
  12212.                     if (in_the_transitioning) {
  12213.                         return
  12214.                     }
  12215.                     in_the_transitioning = true;
  12216.                     if (autoplay_timer) {
  12217.                         toggle_autoplay()
  12218.                     }
  12219.                     previous_image(0);
  12220.                     window.setTimeout(function () {
  12221.                         in_the_transitioning = false
  12222.                     },
  12223.                     delay)
  12224.                 })
  12225.             }
  12226.             if (is_detail_visible) {
  12227.                 if (fullScreenPersistor.is_full_screen) {
  12228.                     overlay_visible = fullScreenPersistor.parent_gallery_param.overlay_visible
  12229.                 } else {
  12230.                     overlay_visible = true
  12231.                 }
  12232.                 show_hide_overlay(overlay_visible, 0);
  12233.                 show_hide_nav_controls(overlay_visible)
  12234.             }
  12235.             set_key_events();
  12236.             config.onload();
  12237.             if (!utils.is_iphone() && !utils.is_ipad() && !utils.is_android() && !config.showinfobutton && !config.forcetouchmode) {
  12238.                 var selstr = "";
  12239.                 _(selstr).hover(function () {
  12240.                     overlay_visible = true;
  12241.                     set_overlay(overlay_visible, 250)
  12242.                 },
  12243.                 function () {
  12244.                     overlay_visible = false;
  12245.                     set_overlay(overlay_visible, 250)
  12246.                 })
  12247.             }
  12248.             set_hash_changed_event();
  12249.             var forceInitialization = true;
  12250.             if (fullScreenPersistor.is_full_screen) {
  12251.                 forceInitialization = false;
  12252.                 if (utils.is_large_screen_mode(config)) {
  12253.                     show_main_image(fullScreenPersistor.parent_gallery_param.current_image_index, image_change_speed, true);
  12254.                     hide_thumbnails_in_lsm = fullScreenPersistor.parent_gallery_param.hide_thumbnails_in_lsm;
  12255.                     repaint(true);
  12256.                     if (fullScreenPersistor.parent_gallery_param.is_autoplaying) {
  12257.                         autoplay_timer = 0;
  12258.                         toggle_autoplay(false, true)
  12259.                     }
  12260.                 } else {
  12261.                     is_detail_visible = fullScreenPersistor.parent_gallery_param.is_detail_visible;
  12262.                     is_index_visible = fullScreenPersistor.parent_gallery_param.is_index_visible;
  12263.                     if (is_detail_visible) {
  12264.                         show_main_image(fullScreenPersistor.parent_gallery_param.current_image_index, image_change_speed, true)
  12265.                     } else {
  12266.                         show_thumbnails(fullScreenPersistor.parent_gallery_param.current_image_index)
  12267.                     }
  12268.                     repaint(true)
  12269.                 }
  12270.                 utils.add_fullscreen_listener(function (fullscreen) {
  12271.                     if (!fullscreen) {
  12272.                         full_screen()
  12273.                     }
  12274.                 })
  12275.             } else {
  12276.                 if (utils.is_new_expanded_window()) {
  12277.                     forceInitialization = false;
  12278.                     hide_thumbnails_in_lsm = config.hide_thumbnails_in_lsm === "true";
  12279.                     is_detail_visible = config.is_detail_visible === "true";
  12280.                     is_index_visible = config.is_index_visible === "true";
  12281.                     if (config.pageTitle) {
  12282.                         try {
  12283.                             $("head > title").html(config.pageTitle)
  12284.                         } catch(err) {}
  12285.                     }
  12286.                     if (is_detail_visible) {
  12287.                         show_main_image(config.firstimageindex ? config.firstimageindex - 1 : 0, image_change_speed, true)
  12288.                     }
  12289.                     repaint(true)
  12290.                 } else {
  12291.                     check_open_image_directly()
  12292.                 }
  12293.             }
  12294.             if (!utils.is_new_expanded_window()) {
  12295.                 window.setTimeout(function () {
  12296.                     if (config.usethumbdots && is_detail_visible && is_index_visible) {
  12297.                         var cntSize = sizing.get_containers_size_and_position(current_width, current_height, is_index_visible, is_detail_visible, config_manager.isp, need_top_panel(), index_panel.get_thumb_height(), config);
  12298.                         detail_panel.repaint(cntSize.detail_panel_width, cntSize.detail_panel_height)
  12299.                     }
  12300.                     repaint(true);
  12301.                     if (config_manager.isp && fullScreenPersistor.is_full_screen) {
  12302.                         lastImageEventIndex = fullScreenPersistor.parent_gallery_param.last_image_event_index;
  12303.                         for (var key in fullScreenPersistor.parent_gallery) {
  12304.                             if (typeof(fullScreenPersistor.parent_gallery[key]) != "function") {
  12305.                                 continue
  12306.                             }
  12307.                             if (key === "onExpand") {
  12308.                                 continue
  12309.                             }
  12310.                             juicebox_instances[instance_id][key] = fullScreenPersistor.parent_gallery[key]
  12311.                         }
  12312.                     }
  12313.                 },
  12314.                 100);
  12315.                 if (window.location.href.toLowerCase().indexOf("http") !== 0 && $.browser.mozilla) {
  12316.                     repaint(true)
  12317.                 }
  12318.                 if ($.browser.msie && !utils.is_large_screen_mode(config)) {
  12319.                     window.setTimeout(function () {
  12320.                         repaint(true)
  12321.                     },
  12322.                     100)
  12323.                 }
  12324.             }
  12325.             var panelVisibilityOverwritten = false;
  12326.             if (config.autoplayonload && !fullScreenPersistor.is_full_screen) {
  12327.                 if (!utils.is_large_screen_mode(config)) {
  12328.                     show_main_image(detail_panel.get_photo_position(), image_change_speed, true);
  12329.                     is_detail_visible = true;
  12330.                     is_index_visible = false;
  12331.                     panelVisibilityOverwritten = true
  12332.                 }
  12333.                 toggle_autoplay(true)
  12334.             }
  12335.             if (!config.showlargethumbs && utils.is_large_screen_mode(config)) {
  12336.                 hide_thumbnails_in_lsm = false;
  12337.                 toggle_index_panel_4_lsm(true)
  12338.             }
  12339.             if (config_manager.isp && juicebox_instances[instance_id] && typeof(juicebox_instances[instance_id].onInitComplete) === "function") {
  12340.                 juicebox_instances[instance_id].onInitComplete()
  12341.             }
  12342.             apply_show_options(forceInitialization, false, panelVisibilityOverwritten)
  12343.         }
  12344.         _(".jb-classifier-detail-area").disableSelection()
  12345.     };
  12346.     var autoplay_timer = 0;
  12347.     var set_autoplay_info = function (skipStatusInfo) {
  12348.         var message = config.languagelist.aon;
  12349.         if (autoplay_timer) {
  12350.             _(".jb-bb-btn-auto-play").toggleClass("jb-status-playing").attr("title", config.languagelist.stpa)
  12351.         } else {
  12352.             message = config.languagelist.aoff;
  12353.             _(".jb-bb-btn-auto-play").toggleClass("jb-status-playing").attr("title", config.languagelist.strta)
  12354.         }
  12355.         if (config.showautoplaystatus && !skipStatusInfo) {
  12356.             var msgdlg = _(".jb-status-message");
  12357.             var cntSize = sizing.get_containers_size_and_position(current_width, current_height, is_index_visible, is_detail_visible, config_manager.isp, need_top_panel(), index_panel.get_thumb_height(), config);
  12358.             var msgTp = cntSize.detail_panel_height / 2 - 18;
  12359.             var msgLf = cntSize.detail_panel_width / 2 - 60 + cntSize.detail_panel_left;
  12360.             msgdlg.css({
  12361.                 top: msgTp,
  12362.                 left: msgLf,
  12363.                 width: "115px"
  12364.             });
  12365.             msgdlg.html(message).fadeIn(300);
  12366.             window.setTimeout(function () {
  12367.                 msgdlg.fadeOut(300)
  12368.             },
  12369.             1000)
  12370.         }
  12371.     };
  12372.     var audio_playing = false;
  12373.     var toggle_audio_play = function () {
  12374.         if (fullScreenPersistor.is_full_screen && fullScreenPersistor.parent_gallery_param.parent_toggle_audio_play) {
  12375.             fullScreenPersistor.parent_gallery_param.parent_toggle_audio_play()
  12376.         } else {
  12377.             if (!audioPlayer) {
  12378.                 return false
  12379.             }
  12380.         }
  12381.         if (utils.is_earlier_ie()) {
  12382.             return false
  12383.         }
  12384.         if (audio_playing) {
  12385.             if (audioPlayer) {
  12386.                 audioPlayer.pause()
  12387.             }
  12388.             audio_playing = false;
  12389.             _(".jb-bb-btn-audio").removeClass("jb-status-playing").attr("title", config.languagelist.plya)
  12390.         } else {
  12391.             if (audioPlayer) {
  12392.                 audioPlayer.play()
  12393.             }
  12394.             audio_playing = true;
  12395.             _(".jb-bb-btn-audio").addClass("jb-status-playing").attr("title", config.languagelist.psa)
  12396.         }
  12397.         return false
  12398.     };
  12399.     var can_image_move = function (to_next) {
  12400.         var glrylen = gallery_manager.length();
  12401.         if (glrylen <= 1) {
  12402.             return false
  12403.         }
  12404.         if (config.enablelooping) {
  12405.             return true
  12406.         }
  12407.         var imgpos = detail_panel.get_photo_position();
  12408.         if (to_next) {
  12409.             if (imgpos >= glrylen - 1) {
  12410.                 return false
  12411.             }
  12412.             return true
  12413.         } else {
  12414.             if (imgpos <= 0) {
  12415.                 return false
  12416.             }
  12417.             return true
  12418.         }
  12419.     };
  12420.     var can_page_move = function (to_next) {
  12421.         if (index_panel.is_last_page() && index_panel.is_first_page()) {
  12422.             return false
  12423.         }
  12424.         if (config.enablelooping) {
  12425.             return true
  12426.         }
  12427.         if (to_next) {
  12428.             if (index_panel.is_last_page()) {
  12429.                 return false
  12430.             }
  12431.             return true
  12432.         } else {
  12433.             if (index_panel.is_first_page()) {
  12434.                 return false
  12435.             }
  12436.             return true
  12437.         }
  12438.     };
  12439.     var set_autoplay = function () {
  12440.         autoplay_timer = window.setInterval(function () {
  12441.             if (!can_image_move(true)) {
  12442.                 toggle_autoplay();
  12443.                 return false
  12444.             }
  12445.             var ptpos = gallery_manager.get_next_image(detail_panel.get_photo_position()).position;
  12446.             var mimg = _(".jb-dt-main-image-" + ptpos + " .jb-status-loading");
  12447.             if (mimg.length <= 0 && config.main_load_placeholder.indexOf("jb-status-") > 0) {
  12448.                 next_image(0)
  12449.             }
  12450.         },
  12451.         1000 * config.displaytime + image_change_speed)
  12452.     };
  12453.     var toggle_autoplay = function (callOnLoad, skipStatusInfo) {
  12454.         if (!config.showautoplaybutton && !config.enableautoplay) {
  12455.             return
  12456.         }
  12457.         if (autoplay_timer) {
  12458.             window.clearInterval(autoplay_timer);
  12459.             autoplay_timer = 0;
  12460.             set_autoplay_info(skipStatusInfo);
  12461.             return false
  12462.         }
  12463.         if (is_detail_visible) {
  12464.             if (config.gonextonautoplay && !callOnLoad) {
  12465.                 next_image(0)
  12466.             } else {
  12467.                 show_main_image(detail_panel.get_photo_position())
  12468.             }
  12469.         }
  12470.         set_autoplay();
  12471.         set_autoplay_info(skipStatusInfo);
  12472.         return false
  12473.     };
  12474.     var set_key_events = function () {
  12475.         if (!config.enablekeyboardcontrols) {
  12476.             return
  12477.         }
  12478.         if (utils.is_iphone() || utils.is_ipad() || utils.is_small_android()) {
  12479.             return
  12480.         }
  12481.         if (fullScreenPersistor.is_full_screen || is_full_screen_mode) {
  12482.             if (!utils.is_in_iframe()) {
  12483.                 _("").focus()
  12484.             }
  12485.         }
  12486.         _("").keydown(function (evt) {
  12487.             if (evt.ctrlKey || evt.altKey || evt.shiftKey || evt.metaKey) {
  12488.                 return
  12489.             }
  12490.             switch (evt.keyCode) {
  12491.             case 32:
  12492.                 evt.preventDefault();
  12493.                 toggle_autoplay();
  12494.                 break;
  12495.             case 37:
  12496.             case 75:
  12497.                 evt.preventDefault();
  12498.                 previous_image(0);
  12499.                 break;
  12500.             case 39:
  12501.             case 74:
  12502.                 evt.preventDefault();
  12503.                 next_image(0);
  12504.                 break;
  12505.             case 36:
  12506.                 evt.preventDefault();
  12507.                 show_thumbnails(0);
  12508.                 show_main_image(0);
  12509.                 break;
  12510.             case 35:
  12511.                 evt.preventDefault();
  12512.                 var imgpos = gallery_manager.length() - 1;
  12513.                 show_thumbnails(imgpos);
  12514.                 show_main_image(imgpos);
  12515.                 break;
  12516.             case 70:
  12517.                 if (is_full_screen_mode || fullScreenPersistor.is_full_screen) {
  12518.                     return
  12519.                 }
  12520.                 evt.preventDefault();
  12521.                 full_screen();
  12522.                 break;
  12523.             case 27:
  12524.                 if (fullScreenPersistor.is_full_screen) {
  12525.                     evt.preventDefault();
  12526.                     full_screen()
  12527.                 }
  12528.                 break
  12529.             }
  12530.         })
  12531.     };
  12532.     var update_flickr_image_details = function (imageIndex, details) {
  12533.         if (!details) {
  12534.             return
  12535.         }
  12536.         var image = gallery_manager.get_image(imageIndex);
  12537.         if (image.flickrPhotoId !== details.id) {
  12538.             return
  12539.         }
  12540.         image.description = details.description;
  12541.         image.detail_loaded = true;
  12542.         if (detail_panel.is_initialized()) {
  12543.             detail_panel.repopulate_caption_html(image)
  12544.         }
  12545.     };
  12546.     var load_images = function (xml) {
  12547.         if (config.useflickr) {
  12548.             flickr_loader = new juicebox_flickr_image_loader($, config_manager, display_error_message)
  12549.         }
  12550.         if (fullScreenPersistor.is_full_screen && fullScreenPersistor.parent_gallery_param && fullScreenPersistor.parent_gallery_param.gallery_manager) {
  12551.             gallery_manager = fullScreenPersistor.parent_gallery_param.gallery_manager;
  12552.             show_splash_page();
  12553.             return
  12554.         }
  12555.         var limit = config_manager.isp ? (100000) : 50;
  12556.         if (config.useflickr) {
  12557.             flickr_loader.get_images(function (photos) {
  12558.                 for (var i = 0; i < photos.length && i < limit; i++) {
  12559.                     gallery_manager.add_image({
  12560.                         imageURL: photos[i].imageURL,
  12561.                         thumbURL: photos[i].thumbURL,
  12562.                         caption: photos[i].caption,
  12563.                         imageFullURL: photos[i].imageFullURL,
  12564.                         flickrPhotoId: photos[i].flickrPhotoId
  12565.                     })
  12566.                 }
  12567.                 show_splash_page()
  12568.             },
  12569.             null)
  12570.         } else {
  12571.             var count = 0;
  12572.             $(xml).find("image").each(function () {
  12573.                 if (count >= limit) {
  12574.                     return
  12575.                 }
  12576.                 count++;
  12577.                 var node = $(this);
  12578.                 var imgurl = correct_path(node.attr("imageURL"));
  12579.                 var tu = node.attr("thumbURL");
  12580.                 var thmurl = (tu ? correct_path(tu) : imgurl);
  12581.                 gallery_manager.add_image({
  12582.                     imageURL: imgurl,
  12583.                     thumbURL: thmurl,
  12584.                     title: node.children("title").text(),
  12585.                     caption: node.children("caption").text(),
  12586.                     linkURL: correct_path(node.attr("linkURL")),
  12587.                     linkTarget: node.attr("linkTarget")
  12588.                 })
  12589.             });
  12590.             show_splash_page()
  12591.         }
  12592.     };
  12593.     var get_gallery_height = function (donotAdjustHeight) {
  12594.         return sizing.get_gallery_height(config, fullScreenPersistor.is_full_screen || is_full_screen_mode, fullScreenPersistor.is_full_screen, donotAdjustHeight)
  12595.     };
  12596.     var get_gallery_width = function () {
  12597.         return sizing.get_gallery_width(config, fullScreenPersistor.is_full_screen || is_full_screen_mode, fullScreenPersistor.is_full_screen)
  12598.     };
  12599.     var init_before_loading_gallery_html = function (container) {
  12600.         if (!utils.is_ie8()) {
  12601.             container.css({
  12602.                 height: config.galleryheight,
  12603.                 width: config.gallerywidth
  12604.             })
  12605.         }
  12606.         sizing = new juicebox_sizing_manager($, container, utils);
  12607.         if (!utils.is_ie8()) {
  12608.             is_full_screen_mode = sizing.is_fullscreen_mode(config)
  12609.         }
  12610.         sizing.try_set_body_size(config, fullScreenPersistor.is_full_screen || is_full_screen_mode);
  12611.         if (!sizing.force_height_calculation(config) && (config.galleryheight + "").indexOf("%") > 0) {
  12612.             $("#" + config.containerid).css({
  12613.                 height: get_gallery_height(),
  12614.                 width: config.gallerywidth
  12615.             })
  12616.         } else {
  12617.             container.css({
  12618.                 height: config.galleryheight,
  12619.                 width: config.gallerywidth
  12620.             })
  12621.         }
  12622.         if (utils.is_ie8()) {
  12623.             is_full_screen_mode = sizing.is_fullscreen_mode(config)
  12624.         }
  12625.         if (is_full_screen_mode) {
  12626.             $("body").css({
  12627.                 overflow: "hidden",
  12628.                 padding: "0",
  12629.                 margin: "0"
  12630.             })
  12631.         }
  12632.         current_width = get_gallery_width();
  12633.         current_height = get_gallery_height()
  12634.     };
  12635.     var set_touchevent = function () {
  12636.         var pushImageThrough = function (delta) {
  12637.             var crntIdx = detail_panel.get_current_photo().position;
  12638.             if (delta > 10) {
  12639.                 if (!can_image_move(false)) {
  12640.                     return false
  12641.                 } else {
  12642.                     crntIdx--;
  12643.                     detail_panel.change_2_photo(false, 0, is_caption_visible(), crntIdx, true)
  12644.                 }
  12645.             } else {
  12646.                 if (delta < -10) {
  12647.                     if (!can_image_move(true)) {
  12648.                         return false
  12649.                     } else {
  12650.                         crntIdx++;
  12651.                         detail_panel.change_2_photo(true, 0, is_caption_visible(), crntIdx, true)
  12652.                     }
  12653.                 }
  12654.             }
  12655.             return true
  12656.         };
  12657.         var moveImage = function (e, delta) {
  12658.             in_navigation = false;
  12659.             in_the_transitioning = true;
  12660.             var delaytime = parseInt(1000 * config.imagetransitiontime * (current_width - delta_x) / current_width);
  12661.             if (delta > 10) {
  12662.                 if (autoplay_timer) {
  12663.                     toggle_autoplay()
  12664.                 }
  12665.                 if (!can_image_move(false)) {
  12666.                     move_back_image_after_touch(delta)
  12667.                 } else {
  12668.                     previous_image(Math.abs(delta))
  12669.                 }
  12670.                 e.preventDefault()
  12671.             } else {
  12672.                 if (delta < -10) {
  12673.                     if (autoplay_timer) {
  12674.                         toggle_autoplay()
  12675.                     }
  12676.                     if (!can_image_move(true)) {
  12677.                         move_back_image_after_touch(delta)
  12678.                     } else {
  12679.                         next_image(Math.abs(delta))
  12680.                     }
  12681.                     e.preventDefault()
  12682.                 } else {
  12683.                     var clickMode = config.imageclickmode.toUpperCase();
  12684.                     if (clickMode === "OPEN_URL") {
  12685.                         open_url();
  12686.                         transTimer = 0;
  12687.                         in_the_transitioning = false;
  12688.                         unhide_image_nav_if_necessary();
  12689.                         return
  12690.                     }
  12691.                     move_back_image_after_touch(delta);
  12692.                     if (!config.showinfobutton) {
  12693.                         toggle_overlay();
  12694.                         delaytime = 310
  12695.                     } else {
  12696.                         transTimer = 0;
  12697.                         in_the_transitioning = false;
  12698.                         return
  12699.                     }
  12700.                 }
  12701.             }
  12702.             index_panel.yield_4_transition(delaytime);
  12703.             if (utils.is_large_screen_mode(config)) {
  12704.                 transTimer = window.setTimeout(function () {
  12705.                     transTimer = 0;
  12706.                     in_the_transitioning = false
  12707.                 },
  12708.                 delaytime)
  12709.             } else {
  12710.                 in_the_transitioning = false
  12711.             }
  12712.         };
  12713.         var touchStarted = function (e) {
  12714.             if (fullScreenPersistor.is_full_screen) {
  12715.                 e.preventDefault()
  12716.             }
  12717.             if (in_navigation) {
  12718.                 return
  12719.             }
  12720.             if (in_the_transitioning) {
  12721.                 in_the_transitioning = false;
  12722.                 if (!pushImageThrough(delta_x)) {
  12723.                     return
  12724.                 }
  12725.             }
  12726.             delta_x = 0;
  12727.             delta_y = 0;
  12728.             if (!in_navigation) {
  12729.                 in_navigation = true;
  12730.                 start_x = e.originalEvent.touches[0].pageX;
  12731.                 last_x = e.originalEvent.touches[0].pageX;
  12732.                 start_y = e.originalEvent.touches[0].pageY;
  12733.                 last_y = e.originalEvent.touches[0].pageY;
  12734.                 hide_image_nav_if_needed(0)
  12735.             }
  12736.         };
  12737.         var touchMoving = function (e) {
  12738.             if (fullScreenPersistor.is_full_screen || is_full_screen_mode || Math.abs(e.originalEvent.touches[0].pageX - start_x) > Math.abs(e.originalEvent.touches[0].pageY - start_y)) {
  12739.                 e.preventDefault()
  12740.             }
  12741.             if (in_the_transitioning) {
  12742.                 return
  12743.             }
  12744.             if (!in_navigation) {
  12745.                 return
  12746.             }
  12747.             delta_x = e.originalEvent.touches[0].pageX - start_x;
  12748.             delta_y = e.originalEvent.touches[0].pageY - start_y;
  12749.             if (Math.abs(delta_x) > 10) {
  12750.                 if (autoplay_timer) {
  12751.                     toggle_autoplay()
  12752.                 }
  12753.             }
  12754.             var imgs = _(" .jb-panel-detail .jb-dt-main-frame");
  12755.             imgs.animate({
  12756.                 left: "+=" + (e.originalEvent.touches[0].pageX - last_x),
  12757.                 avoidTransforms: !config.use_webkit_transform,
  12758.                 useTranslate3d: true
  12759.             },
  12760.             0);
  12761.             last_x = e.originalEvent.touches[0].pageX;
  12762.             last_y = e.originalEvent.touches[0].pageY
  12763.         };
  12764.         var touchEnded = function (e) {
  12765.             var is_h_swipe = Math.abs(delta_x) > Math.abs(delta_y);
  12766.             if (fullScreenPersistor.is_full_screen || is_full_screen_mode || is_h_swipe) {
  12767.                 e.preventDefault()
  12768.             }
  12769.             if (in_the_transitioning || !in_navigation) {
  12770.                 return
  12771.             }
  12772.             if (is_h_swipe) {
  12773.                 moveImage(e, delta_x)
  12774.             } else {
  12775.                 if (Math.abs(delta_y) > 10) {
  12776.                     var clickMode = config.imageclickmode.toUpperCase();
  12777.                     if (clickMode === "OPEN_URL") {
  12778.                         open_url();
  12779.                         in_navigation = false;
  12780.                         in_the_transitioning = false;
  12781.                         unhide_image_nav_if_necessary();
  12782.                         return
  12783.                     }
  12784.                     move_back_image_after_touch(delta_x);
  12785.                     in_navigation = false
  12786.                 } else {
  12787.                     moveImage(e, 0)
  12788.                 }
  12789.             }
  12790.         };
  12791.         _(".jb-navigation.jb-classifier-detail-area").bind("touchstart", touchStarted).bind("touchmove", touchMoving).bind("touchend", touchEnded);
  12792.         _(".jb-classifier-detail-area .jbn-right-button, jb-classifier-detail-area .jbn-left-button").bind("touchstart", function (e) {
  12793.             e.preventDefault()
  12794.         }).bind("touchmove", function (e) {
  12795.             e.preventDefault()
  12796.         }).bind("touchend", function (e) {
  12797.             e.preventDefault()
  12798.         });
  12799.         _(".jb-area-caption, .jb-classifier-link-wrapper, .jb-area-large-mode-title").bind("touchmove", function (e) {
  12800.             e.preventDefault()
  12801.         });
  12802.         _(".jb-panel-detail").nextAll('div[onclick*="window.open"]').bind("touchmove", function (e) {
  12803.             e.preventDefault()
  12804.         }).bind("touchend", function (e) {
  12805.             window.open("http://www." + ["ju", "ice", "b", "ox", ".n", "et"].join(""));
  12806.             e.preventDefault()
  12807.         });
  12808.         if (config.forcetouchmode) {
  12809.             _(".jb-classifier-detail-area .jbn-left-button, .jb-classifier-detail-area .jbn-right-button").mouseup(function (e) {
  12810.                 e.preventDefault();
  12811.                 in_navigation = false
  12812.             }).mousedown(function (e) {
  12813.                 e.preventDefault()
  12814.             }).mousemove(function (e) {
  12815.                 e.preventDefault()
  12816.             });
  12817.             _(".jb-navigation.jb-classifier-detail-area").mousedown(function (e) {
  12818.                 if (e.which !== 1) {
  12819.                     return
  12820.                 }
  12821.                 var thEvt = {
  12822.                     originalEvent: {
  12823.                         touches: [{}]
  12824.                     }
  12825.                 };
  12826.                 e.preventDefault();
  12827.                 thEvt.preventDefault = function () {};
  12828.                 thEvt.originalEvent.touches[0].pageX = e.screenX;
  12829.                 thEvt.originalEvent.touches[0].pageY = e.screenY;
  12830.                 touchStarted(thEvt)
  12831.             }).mousemove(function (e) {
  12832.                 if (e.which !== 1) {
  12833.                     in_navigation = false;
  12834.                     return
  12835.                 }
  12836.                 if (!in_navigation) {
  12837.                     return
  12838.                 }
  12839.                 var thEvt = {
  12840.                     originalEvent: {
  12841.                         touches: [{}]
  12842.                     }
  12843.                 };
  12844.                 thEvt.preventDefault = function () {};
  12845.                 thEvt.originalEvent.touches[0].pageX = e.screenX;
  12846.                 thEvt.originalEvent.touches[0].pageY = e.screenY;
  12847.                 touchMoving(thEvt)
  12848.             }).mouseup(function (e) {
  12849.                 if (!in_navigation) {
  12850.                     return
  12851.                 }
  12852.                 var thEvt = {};
  12853.                 thEvt.preventDefault = function () {};
  12854.                 touchEnded(thEvt)
  12855.             }).mouseout(function (e) {
  12856.                 if (!in_navigation) {
  12857.                     return
  12858.                 }
  12859.                 var thEvt = {};
  12860.                 thEvt.preventDefault = function () {};
  12861.                 touchEnded(thEvt)
  12862.             })
  12863.         }
  12864.     };
  12865.     var init_after_dom_loaded = function () {
  12866.         _(".jb-navigation.jb-classifier-detail-area").fadeOut(0);
  12867.         dialog = new juicebox_gallery_dialog({
  12868.             jquery: $
  12869.         });
  12870.         if (config.showpreloader) {
  12871.             var opct = $.browser.msie ? "filter: alpha(opacity = 0);": "opacity:0;";
  12872.             if (utils.is_firefox3()) {
  12873.                 opct = "display:none;"
  12874.             }
  12875.             if (sizing.force_height_calculation(config)) {
  12876.                 _("").css({
  12877.                     height: current_height
  12878.                 })
  12879.             }
  12880.             _(".jb-idx-thumbnail-container").html(config.main_load_placeholder);
  12881.             _("#jb-glry-preload .jb-status-loading").css({
  12882.                 height: current_height,
  12883.                 width: current_width
  12884.             });
  12885.             _("#jb-glry-preload").fadeIn(300)
  12886.         }
  12887.         if (window.location.href.toLowerCase().indexOf("http") !== 0) {
  12888.             if (utils.is_chrome()) {
  12889.                 display_error_message(config.languagelist.lcchm.replace("$BrowserName$", "Google Chrome").replace("$BrowserLink$", "chrome_local"));
  12890.                 return
  12891.             }
  12892.             if (utils.is_opera()) {
  12893.                 display_error_message(config.languagelist.lcchm.replace("$BrowserName$", "Opera").replace("$BrowserLink$", "opera_local"));
  12894.                 return
  12895.             }
  12896.         }
  12897.         var galleryFile = correct_path(config.configurl);
  12898.         $.ajax({
  12899.             url: galleryFile,
  12900.             type: "GET",
  12901.             error: function (xhr, data) {
  12902.                 $("#" + document_id).html(display_error_message(config.languagelist.ae))
  12903.             },
  12904.             success: function (data) {
  12905.                 var rsp;
  12906.                 if (typeof data === "string") {
  12907.                     if ($.browser.msie) {
  12908.                         rsp = new ActiveXObject("Microsoft.XMLDOM");
  12909.                         rsp.async = false;
  12910.                         rsp.loadXML(data);
  12911.                         data = rsp
  12912.                     } else {
  12913.                         rsp = new DOMParser();
  12914.                         data = rsp.parseFromString(data, "text/xml")
  12915.                     }
  12916.                 }
  12917.                 if (!utils.is_new_expanded_window()) {
  12918.                     config_manager.sync_options(_config, data);
  12919.                     config = config_manager.get_config()
  12920.                 }
  12921.                 image_change_speed = 1000 * config.imagetransitiontime;
  12922.                 index_panel.synchronize_config(config);
  12923.                 var bIsPercentage = (config.galleryheight + "").indexOf("%") > 0;
  12924.                 _("." + theme_cls).attr("style", get_background_style());
  12925.                 var bkhtml = get_background_html(correct_path(config.backgroundurl));
  12926.                 if (bkhtml) {
  12927.                     $(bkhtml).prependTo(_("." + theme_cls))
  12928.                 }
  12929.                 set_touchevent();
  12930.                 if (config.showpreloader) {
  12931.                     window.setTimeout(function () {
  12932.                         load_images(data)
  12933.                     },
  12934.                     300)
  12935.                 } else {
  12936.                     load_images(data)
  12937.                 }
  12938.             }
  12939.         })
  12940.     };
  12941.     var toggle_overlay = function () {
  12942.         overlay_visible = !overlay_visible;
  12943.         show_hide_overlay(overlay_visible, 250)
  12944.     };
  12945.     var toggle_info = function () {
  12946.         overlay_visible = !overlay_visible;
  12947.         show_hide_nav_controls(overlay_visible, 250, true)
  12948.     };
  12949.     var show_hide_nav_controls = function (show, delay, skipBtnBar) {
  12950.         if (!is_detail_visible) {
  12951.             return
  12952.         }
  12953.         var tags;
  12954.         show_hide_controls(_(".jb-classifier-show-on-over"), show, (($.browser.msie && $.browser.version >= 7 && $.browser.version < 8) ? 0 : delay));
  12955.         _(".jb-area-caption table").css({
  12956.             display: ""
  12957.         });
  12958.         var tt = show ? config.languagelist.hdinfo: config.languagelist.sinfo;
  12959.         _(".jb-bb-button.jb-bb-btn-show-info").attr("title", tt)
  12960.     };
  12961.     var display_error_message = function (msg) {
  12962.         var container;
  12963.         if (config.containerid) {
  12964.             container = $("#" + config.containerid)
  12965.         }
  12966.         var msgHtml;
  12967.         if (container.height() <= 0 && config.galleryheight.indexOf("%") > 0) {
  12968.             container.height($(window).height() * parseInt(config.galleryheight) / 100)
  12969.         }
  12970.         if (container && container.length > 0) {
  12971.             msgHtml = "<table style='width:100%;height:100%;text-align:center;background-color:#777;'><tr><td><div class='jb-error-message' style='color:white;font-family:sans-serif;font-size:18px;'>" + msg + "</div></td></tr></table>";
  12972.             container.html(msgHtml)
  12973.         } else {
  12974.             msgHtml = "<table style='width:100%;height:100%;text-align:center;font-family:sans-serif;font-size:18px;background-color:#777;color:#FFF;'><tr><td>" + msg + "</td></tr></table>";
  12975.             document.write(msgHtml)
  12976.         }
  12977.     };
  12978.     var add_css_link = function (linkUrl) {
  12979.         var csslnk = document.createElement("link");
  12980.         csslnk.type = "text/css";
  12981.         csslnk.rel = "stylesheet";
  12982.         var head = document.getElementsByTagName("head")[0] || document.documentElement;
  12983.         csslnk.href = linkUrl;
  12984.         head.appendChild(csslnk)
  12985.     };
  12986.     var init = function () {
  12987.         instance_id = juicebox_instance_count;
  12988.         juicebox_instance_count++;
  12989.         if (config.themeurl) {
  12990.             themeUrl = config.themeurl
  12991.         } else {
  12992.             if (config.theme) {
  12993.                 themeUrl = correct_path(config.jbcore) + "themes/" + config.theme + "/css/style.css"
  12994.             }
  12995.         }
  12996.         add_css_link(themeUrl);
  12997.         if ($.browser.msie && $.browser.version < 7) {
  12998.             add_css_link(themeUrl.toLowerCase().replace(".css", "-ie6.css"))
  12999.         }
  13000.         var container;
  13001.         if (config.containerid) {
  13002.             var dom_loading_tmr = 0;
  13003.             container = $("#" + config.containerid);
  13004.             if (container.length > 0) {
  13005.                 init_before_loading_gallery_html(container);
  13006.                 container.html(gallery_skeleton(document_id));
  13007.                 init_after_dom_loaded()
  13008.             } else {
  13009.                 dom_loading_tmr = window.setInterval(function () {
  13010.                     var cntnr = $("#" + config.containerid);
  13011.                     if (cntnr.length <= 0) {
  13012.                         if ($("body").length > 0) {
  13013.                             display_error_message(config.languagelist.noid01 + config.containerid + config.languagelist.noid02);
  13014.                             console.log(config.languagelist.noid01 + config.containerid + config.languagelist.noid02);
  13015.                             if (dom_loading_tmr) {
  13016.                                 window.clearInterval(dom_loading_tmr)
  13017.                             }
  13018.                             dom_loading_tmr = 0;
  13019.                             return
  13020.                         }
  13021.                         return
  13022.                     }
  13023.                     if (dom_loading_tmr) {
  13024.                         window.clearInterval(dom_loading_tmr)
  13025.                     }
  13026.                     dom_loading_tmr = 0;
  13027.                     init_before_loading_gallery_html(cntnr);
  13028.                     cntnr.html(gallery_skeleton(document_id));
  13029.                     init_after_dom_loaded()
  13030.                 },
  13031.                 200)
  13032.             }
  13033.         } else {
  13034.             document.write(get_container_html(document_id));
  13035.             container = _("");
  13036.             init_before_loading_gallery_html(container);
  13037.             container.html(get_gallery_frame_html());
  13038.             init_after_dom_loaded()
  13039.         }
  13040.     };
  13041.     var get_container_html = function (document_id, token) {
  13042.         var ver = "";
  13043.         if ($.browser.msie) {
  13044.             ver = "jb-flag-msie jb-flag-msiever" + parseInt($.browser.version) + (utils.is_earlier_ie() ? " jb-flag-msie-bf9": "")
  13045.         }
  13046.         return "<div id='" + document_id + "' tabindex='0' class='juicebox-gallery " + ver + "' style='width:100%;height:100%;'>" + (token ? token: "") + "</div>"
  13047.     };
  13048.     var show_back_button = function () {
  13049.         if (config.showsmallbackbutton) {
  13050.             return true
  13051.         }
  13052.         var bkbtnpos = config.backbuttonposition.toUpperCase();
  13053.         if (bkbtnpos === "TOP" || bkbtnpos === "OVERLAY") {
  13054.             return true
  13055.         }
  13056.         return false
  13057.     };
  13058.     var get_back_button_html_content = function () {
  13059.         if (!show_back_button()) {
  13060.             return ""
  13061.         }
  13062.         var lnk;
  13063.         var icncls = config.backbuttonuseicon ? "jb-go-back-icon": "";
  13064.         if (config.backbuttonurl) {
  13065.             lnk = "<a href='" + config.backbuttonurl + "'" + (config.showsmallbackbutton ? " class='jb-classifier-show-on-over " + icncls + "'": "class='" + icncls + "'") + ">" + config.backbuttontext + "</a>"
  13066.         } else {
  13067.             lnk = "<a href='#' onclick='history.back(); return false;'" + (config.showsmallbackbutton ? " class='jb-classifier-show-on-over " + icncls + "'": "class='" + icncls + "'") + ">" + config.backbuttontext + "</a>"
  13068.         }
  13069.         return lnk
  13070.     };
  13071.     var set_back_button = function () {
  13072.         if (!show_back_button()) {
  13073.             _(".jb-go-back").remove();
  13074.             return
  13075.         }
  13076.         var pd = 10 + sizing.get_stage_padding(current_width, current_height, config);
  13077.         var cntSize = sizing.get_containers_size_and_position(current_width, current_height, true, true, config_manager.isp, need_top_panel(), index_panel.get_thumb_height(), config);
  13078.         var btnrt = pd;
  13079.         var btntp = config.backbuttonposition.toUpperCase() != "OVERLAY" ? pd: (cntSize.detail_panel_top + 10);
  13080.         var bhalgn = config.backbuttonhalign.toUpperCase();
  13081.         var cssobj;
  13082.         if (bhalgn === "CENTER") {
  13083.             if ($.browser.msie && $.browser.version < 7) {
  13084.                 cssobj = {
  13085.                     top: btntp,
  13086.                     left: 0,
  13087.                     width: "100%",
  13088.                     "text-align": "center",
  13089.                     "z-index": 550
  13090.                 }
  13091.             } else {
  13092.                 cssobj = {
  13093.                     top: btntp,
  13094.                     left: btnrt,
  13095.                     right: btnrt,
  13096.                     "text-align": "center",
  13097.                     "z-index": 550
  13098.                 }
  13099.             }
  13100.             if (config.backbuttonuseicon) {
  13101.                 cssobj.left = parseInt((current_width - 38) / 2);
  13102.                 cssobj.right = "auto";
  13103.                 cssobj.padding = 0;
  13104.                 cssobj.width = "auto"
  13105.             }
  13106.         } else {
  13107.             if (bhalgn === "RIGHT") {
  13108.                 cssobj = {
  13109.                     top: btntp,
  13110.                     left: "auto",
  13111.                     right: btnrt,
  13112.                     "z-index": 650
  13113.                 }
  13114.             } else {
  13115.                 cssobj = {
  13116.                     top: btntp,
  13117.                     left: btnrt,
  13118.                     right: "auto",
  13119.                     "z-index": 650
  13120.                 }
  13121.             }
  13122.         }
  13123.         if (!config.showsmallbackbutton) {
  13124.             _(".jb-go-back").html(get_back_button_html_content()).css(cssobj).show()
  13125.         } else {
  13126.             _(".jb-go-back").html(get_back_button_html_content()).css(cssobj)
  13127.         }
  13128.         if (config.textcolor) {
  13129.             _(".jb-go-back a").css({
  13130.                 color: utils.format_color(config.textcolor)
  13131.             })
  13132.         }
  13133.     };
  13134.     var get_back_button_html = function () {
  13135.         return "<div class='jb-go-back jb-classifier-layer' layer='600' style='position:absolute !important;z-index:600; top: 10px; left: 10px; display:none;'>" + get_back_button_html_content() + "</div>"
  13136.     };
  13137.     var get_autoplay_status_html = function () {
  13138.         if (!config.showautoplaystatus) {
  13139.             return ""
  13140.         }
  13141.         return "<div class='jb-status-message' style='position:absolute;" + (config.autoplayonload ? "": "display:none;") + "'></div>"
  13142.     };
  13143.     var need_image_nav_button = function () {
  13144.         if (utils.is_large_screen_mode(config)) {
  13145.             return true
  13146.         }
  13147.         if (!config.showimagenav) {
  13148.             return false
  13149.         }
  13150.         return true
  13151.     };
  13152.     var need_button_bar = function () {
  13153.         if (config.buttonbarposition.toUpperCase() === "NONE") {
  13154.             return false
  13155.         }
  13156.         if (typeof(config.showimageoverlay) === "string" && config.showimageoverlay.toUpperCase() === "NEVER" && config.buttonbarposition.toUpperCase() === "OVERLAY") {
  13157.             return false
  13158.         }
  13159.         return true
  13160.     };
  13161.     var get_calculated_gallery_height = function (ht) {
  13162.         return parseInt(ht * parseInt(config.galleryheight) / 100)
  13163.     };
  13164.     var get_background_style = function () {
  13165.         var hstr = "height:100%";
  13166.         return "display:none;width:100%;" + hstr + ";" + (config.backgroundcolor ? "background-color:" + utils.format_color(config.backgroundcolor) + ";": "") + (utils.is_earlier_ie() ? config.backgroundopacity + ";": "")
  13167.     };
  13168.     var get_top_panel_html = function () {
  13169.         return "<div class='jb-panel-top' style='position:absolute;display:none;'> </div>"
  13170.     };
  13171.     var get_splitter_html = function (cls) {
  13172.         return "<div class='jb-bb-splitter " + cls + "' style=''></div>"
  13173.     };
  13174.     var get_badge_image_url = function () {
  13175.         if (utils.is_adobe_air()) {
  13176.             return ""
  13177.         }
  13178.         return ["u", "rl", "(", "ht", "tp", ":", "/", "/", "j", "ui", "ce", "b", "o", "x", ".", "n", "e", "t", "/", "i", "m", "g", "/", "jb", "0", "0", "1", ".", "p", "n", "g", ")"].join("")
  13179.     };
  13180.     var get_badge_link = function () {
  13181.         return ["on", "c", "l", "i", "c", "k", "=", '"', "w", "i", "n", "d", "o", "w", ".", "o", "p", "e", "n", "(", "'", "h", "t", "t", "p", ":", "/", "/", "w", "w", "w", ".", "j", "u", "i", "c", "eb", "ox", ".", "ne", "t'", ")", ";", "return ", "false", ';"'].join("")
  13182.     };
  13183.     var set_background_image_size = function (initfull) {
  13184.         if (!config.backgroundurl) {
  13185.             return
  13186.         }
  13187.         if (!backgroundImageWidth || !backgroundImageHeight) {
  13188.             return
  13189.         }
  13190.         var szinfo = {};
  13191.         var scaleMode = config.backgroundscale.toUpperCase();
  13192.         var bkimg = _(".jb-panel-background");
  13193.         var cheight = current_height;
  13194.         var cwidth = current_width;
  13195.         if (initfull) {
  13196.             if (config.usefullscreenexpand && utils.support_real_fullscreen && screen.height && screen.width) {
  13197.                 cheight = parseInt(screen.height);
  13198.                 cwidth = parseInt(screen.width)
  13199.             } else {
  13200.                 cheight = $(window).height();
  13201.                 cwidth = $(window).width()
  13202.             }
  13203.         }
  13204.         if (scaleMode === "FILL") {
  13205.             szinfo = sizing.get_image_display_size({
  13206.                 width: backgroundImageWidth,
  13207.                 height: backgroundImageHeight
  13208.             },
  13209.             cwidth, cheight, config, "FILL", true);
  13210.             bkimg.css({
  13211.                 top: szinfo.unadjtop,
  13212.                 left: szinfo.unadjleft,
  13213.                 width: szinfo.width,
  13214.                 height: szinfo.height
  13215.             })
  13216.         } else {
  13217.             if (scaleMode === "NONE") {} else {
  13218.                 bkimg.css({
  13219.                     width: cwidth,
  13220.                     height: cheight
  13221.                 });
  13222.                 szinfo = {
  13223.                     imageTop: 0,
  13224.                     imageLeft: 0,
  13225.                     imageWidth: cwidth,
  13226.                     imageHeight: cheight
  13227.                 }
  13228.             }
  13229.         }
  13230.         return szinfo
  13231.     };
  13232.     var get_background_html = function (backgroundurl) {
  13233.         if (backgroundUrl === backgroundurl) {
  13234.             return ""
  13235.         }
  13236.         _(".jb-panel-background").remove();
  13237.         if (!backgroundurl) {
  13238.             return ""
  13239.         }
  13240.         backgroundUrl = backgroundurl;
  13241.         if (fullScreenPersistor.is_full_screen) {
  13242.             backgroundImageWidth = fullScreenPersistor.parent_gallery_param.background_image_width;
  13243.             backgroundImageHeight = fullScreenPersistor.parent_gallery_param.background_image_height;
  13244.             var szinfo = set_background_image_size(true);
  13245.             var szstr = "";
  13246.             if (typeof(szinfo.imageTop) != "undefined") {
  13247.                 szstr += "top:" + szinfo.imageTop + "px;"
  13248.             }
  13249.             if (typeof(szinfo.imageLeft) != "undefined") {
  13250.                 szstr += "left:" + szinfo.imageLeft + "px;"
  13251.             }
  13252.             if (szinfo.imageWidth) {
  13253.                 szstr += "width:" + szinfo.imageWidth + "px;"
  13254.             }
  13255.             if (szinfo.imageHeight) {
  13256.                 szstr += "height:" + szinfo.imageHeight + "px;"
  13257.             }
  13258.             return "<img class='jb-panel-background' src='" + backgroundurl + "' style='position:absolute;" + szstr + "'/>"
  13259.         } else {
  13260.             var bkimage = new Image();
  13261.             bkimage.onload = function () {
  13262.                 backgroundImageWidth = bkimage.width;
  13263.                 backgroundImageHeight = bkimage.height;
  13264.                 set_background_image_size();
  13265.                 _(".jb-panel-background").attr("src", backgroundurl).show()
  13266.             };
  13267.             bkimage.src = backgroundurl;
  13268.             return "<img class='jb-panel-background' style='display:none;position:absolute;'/>"
  13269.         }
  13270.     };
  13271.     var get_gallery_frame_html = function () {
  13272.         var badge = "";
  13273.         if (!utils.ship) {
  13274.             badge = "<div style='display:block !important;width: 90px !important;height: 24px !important;overflow: hidden !important;position: absolute !important;z-index: 3000" + ($.browser.msie ? "": " !important") + ";background: " + get_badge_image_url() + " no-repeat 0 0 !important;cursor:pointer;margin:0 !important;padding:0 !important;bottom:0 !important;right:0 !important' " + get_badge_link() + "></div>"
  13275.         }
  13276.         if (utils.is_adobe_air()) {
  13277.             badge = badge.replace("<div style=", "<div class='" + ["j", "b", "-", "b", "a", "d", "g", "e"].join("") + "' style=").replace(";background: " + get_badge_image_url() + " no-repeat 0 0 !important;", ";")
  13278.         }
  13279.         return "<div class='" + theme_cls + "' style='" + get_background_style() + "'>" + get_background_html(correct_path(config.backgroundurl)) + get_top_panel_html() + "<div class='jb-panel-index jb-classifier-thumb-area' style='position:absolute !important;'><div class='jb-idx-thumbnail-container' style='height:100% !important;width:100% !important;margin:0;padding:0;position:relative;'></div><div class='jb-navigation index-navigation jb-classifier-thumb-area'><div class='jbn-nav-button jbn-left-button jb-classifier-layer' layer='1000' style='z-index:1000;display:none;'></div><div class='jbn-nav-button jbn-right-button jb-classifier-layer' layer='1000' style='z-index:1000;display:none;'></div></div></div>" + get_back_button_html() + "<div class='jb-classifier-link-wrapper jb-classifier-thumb-area jb-classifier-layer' layer='3000' style='z-index:3000;right:10px;top:10px;'><div class='jb-bb-bar' ><div class='jb-bb-button jb-bb-btn-full-screen" + ((fullScreenPersistor.is_full_screen || utils.is_new_expanded_window()) ? " jb-bb-btn-de-full-screen": "") + "' title='" + ((fullScreenPersistor.is_full_screen || utils.is_new_expanded_window()) ? config.languagelist.ef: config.languagelist.gf) + "'> </div></div></div><div class='jb-panel-detail jb-classifier-detail-area jb-classifier-layer' layer='50' style='position:absolute !important'></div>" + utils.get_gallery_title_html(config) + "<div class='jb-classifier-link-wrapper jb-classifier-detail-area jb-classifier-layer' layer='3000' style='z-index:3000;'>" + (need_button_bar() ? "<div class='jb-bb-bar' ><div class='jb-bb-button jb-bb-btn-de-show-list' title='" + config.languagelist.st + "'></div><div class='jb-bb-button jb-bb-btn-open-url' title='" + config.languagelist.oiinw + "'></div><div class='jb-bb-button jb-bb-btn-full-screen" + ((fullScreenPersistor.is_full_screen || utils.is_new_expanded_window()) ? " jb-bb-btn-de-full-screen": "") + "' title='" + ((fullScreenPersistor.is_full_screen || utils.is_new_expanded_window()) ? config.languagelist.ef: config.languagelist.gf) + "'></div>" + get_splitter_html("jb-bb-splitter-1") + "<div class='jb-bb-button jb-bb-btn-top-nav jb-bb-btn-top-nav-left' title='" + config.languagelist.goprv + "'></div><div class='jb-bb-button jb-bb-btn-auto-play' title='" + config.languagelist.strta + "'></div><div class='jb-bb-button jb-bb-btn-top-nav jb-bb-btn-top-nav-right' title='" + config.languagelist.gonxt + "'></div>" + get_splitter_html("jb-bb-splitter-2") + "<div class='jb-bb-button jb-bb-btn-show-info' title='" + config.languagelist.hdinfo + "'></div><div class='jb-bb-button jb-bb-btn-audio' title='" + config.languagelist.plya + "'></div></div>": "") + "</div>" + badge + ((config.captionposition.toUpperCase() != "NONE") ? utils.get_caption_html() : "") + "<div class='jb-navigation jb-classifier-detail-area jb-classifier-layer' layer='500' style='height:100%;z-index:500;'>" + get_autoplay_status_html() + "<div class='jbn-nav-touch-area jbn-nav-left-touch-area'><div class='jbn-nav-button jb-classifier-show-on-over jb-classifier-layer' layer='1000' style='z-index:1000;position:absolute;left:" + (sizing.get_stage_padding(current_width, current_height, config)) + "px;'><div class='jbn-left-button' style='display:none;'></div></div></div><div class='jbn-nav-touch-area jbn-nav-right-touch-area'>" + (need_image_nav_button() ? "<div class='jbn-nav-button jb-classifier-show-on-over jb-classifier-layer' layer='1000' style='z-index:1000;position:absolute;right:" + (sizing.get_stage_padding(current_width, current_height, config) + 10) + "px;'><div class='jbn-right-button' style='display:none;'></div></div>": "") + "</div></div></div>"
  13280.     };
  13281.     var gallery_skeleton = function (document_id) {
  13282.         return get_container_html(document_id, get_gallery_frame_html())
  13283.     };
  13284.     var lastPageEventIndex = -1;
  13285.     var after_page_changed = function (skipEvent) {
  13286.         set_index_nav_button();
  13287.         if (!skipEvent && config_manager.isp && juicebox_instances[instance_id] && typeof(juicebox_instances[instance_id].onThumbPageChange) === "function") {
  13288.             var curntPage = parseInt(index_panel.get_index()) + 1;
  13289.             if (curntPage != lastPageEventIndex) {
  13290.                 lastPageEventIndex = curntPage;
  13291.                 var curntImage = detail_panel.get_current_photo();
  13292.                 var evntObj = {
  13293.                     id: curntPage,
  13294.                     title: config.gallerytitle,
  13295.                     caption: curntImage.caption
  13296.                 };
  13297.                 juicebox_instances[instance_id].onThumbPageChange(evntObj)
  13298.             }
  13299.         }
  13300.     };
  13301.     var set_index_nav_button = function () {
  13302.         if (!can_page_move()) {
  13303.             _(".jb-classifier-thumb-area .jbn-left-button").hide()
  13304.         } else {
  13305.             _(".jb-classifier-thumb-area .jbn-left-button").show()
  13306.         }
  13307.         if (!can_page_move(true)) {
  13308.             _(".jb-classifier-thumb-area .jbn-right-button").hide()
  13309.         } else {
  13310.             _(".jb-classifier-thumb-area .jbn-right-button").show()
  13311.         }
  13312.     };
  13313.     var show_thumbnails = function (imgpos) {
  13314.         var cntSize = sizing.get_containers_size_and_position(current_width, current_height, is_index_visible, is_detail_visible, config_manager.isp, need_top_panel(), index_panel.get_thumb_height(), config);
  13315.         if (is_index_visible) {
  13316.             set_containers_size_and_position(cntSize);
  13317.             set_index_nav_button_position(cntSize)
  13318.         }
  13319.         index_panel.show_page_4_image_position(imgpos, cntSize.index_panel_width, cntSize.index_panel_height);
  13320.         set_index_nav_button();
  13321.         apply_show_options();
  13322.         set_gallery_title();
  13323.         set_show_list_button()
  13324.     };
  13325.     var index_button_clicked = function () {
  13326.         if (!utils.is_large_screen_mode(config)) {
  13327.             return switch_2_thumbnails()
  13328.         }
  13329.         return toggle_index_panel_4_lsm()
  13330.     };
  13331.     var toggle_index_panel_4_lsm = function (noAnim) {
  13332.         var cntSize;
  13333.         var avoidtf = !_config.use_webkit_transform;
  13334.         var idxPnl = _(".jb-panel-index");
  13335.         hide_thumbnails_in_lsm = !hide_thumbnails_in_lsm;
  13336.         if (hide_thumbnails_in_lsm) {
  13337.             var finishHiddingIndexPanel = function () {
  13338.                 is_index_visible = false;
  13339.                 idxPnl.hide();
  13340.                 adjust_title_button_bar_position();
  13341.                 repaint(true, false, true)
  13342.             };
  13343.             if (!noAnim) {
  13344.                 var idxht = parseInt(idxPnl.height());
  13345.                 var idxwd = parseInt(idxPnl.width());
  13346.                 var tmbpos = config.thumbsposition.toUpperCase();
  13347.                 _(".jb-panel-index .jb-area-large-mode-title").css({
  13348.                     overflow: "hidden",
  13349.                     "white-space": "nowrap"
  13350.                 });
  13351.                 if (tmbpos === "TOP") {
  13352.                     idxPnl.animate({
  13353.                         bottom: "+=" + (idxht),
  13354.                         height: "-=" + (idxht),
  13355.                         avoidTransforms: avoidtf
  13356.                     },
  13357.                     500, "easeOutQuart", finishHiddingIndexPanel)
  13358.                 } else {
  13359.                     if (tmbpos === "LEFT") {
  13360.                         _(".index-navigation .jbn-nav-button").hide();
  13361.                         idxPnl.animate({
  13362.                             right: "+=" + (idxwd),
  13363.                             width: "-=" + (idxwd),
  13364.                             avoidTransforms: avoidtf
  13365.                         },
  13366.                         500, "easeOutQuart", finishHiddingIndexPanel)
  13367.                     } else {
  13368.                         if (tmbpos === "RIGHT") {
  13369.                             idxPnl.animate({
  13370.                                 left: "+=" + (idxwd),
  13371.                                 width: "-=" + (idxwd),
  13372.                                 avoidTransforms: avoidtf
  13373.                             },
  13374.                             500, "easeOutQuart", finishHiddingIndexPanel)
  13375.                         } else {
  13376.                             idxPnl.animate({
  13377.                                 top: "+=" + (idxht),
  13378.                                 height: "-=" + (idxht),
  13379.                                 avoidTransforms: avoidtf
  13380.                             },
  13381.                             500, "easeOutQuart", finishHiddingIndexPanel)
  13382.                         }
  13383.                     }
  13384.                 }
  13385.             } else {
  13386.                 finishHiddingIndexPanel()
  13387.             }
  13388.         } else {
  13389.             cntSize = sizing.get_containers_size_and_position(current_width, current_height, true, is_detail_visible, config_manager.isp, need_top_panel(), index_panel.get_thumb_height(), config);
  13390.             repaint(true, true, true);
  13391.             var tmbpos = config.thumbsposition.toUpperCase();
  13392.             var initop = cntSize.index_panel_top;
  13393.             var inileft = cntSize.index_panel_left;
  13394.             var iniheight = cntSize.index_panel_height;
  13395.             var iniwidth = cntSize.index_panel_width;
  13396.             if (tmbpos === "TOP") {
  13397.                 iniheight = 0
  13398.             } else {
  13399.                 if (tmbpos === "LEFT") {
  13400.                     iniwidth = 0
  13401.                 } else {
  13402.                     if (tmbpos === "RIGHT") {
  13403.                         iniwidth = 0;
  13404.                         inileft = cntSize.index_panel_left + cntSize.index_panel_width
  13405.                     } else {
  13406.                         iniheight = 0;
  13407.                         initop = cntSize.index_panel_top + cntSize.index_panel_height
  13408.                     }
  13409.                 }
  13410.             }
  13411.             idxPnl.css({
  13412.                 top: initop,
  13413.                 height: iniheight,
  13414.                 left: inileft,
  13415.                 width: iniwidth
  13416.             });
  13417.             idxPnl.show();
  13418.             _(".jb-panel-index .jb-area-caption").show();
  13419.             if (config.gallerytitleposition.toUpperCase() === "ABOVE_THUMBS") {
  13420.                 _(".jb-panel-index .jb-area-large-mode-title").show()
  13421.             }
  13422.             var finishShowingIndexPanel = function () {
  13423.                 is_index_visible = true;
  13424.                 idxPnl.hide();
  13425.                 repaint(true, false, true)
  13426.             };
  13427.             if (!noAnim) {
  13428.                 _(".jb-panel-index .jb-area-large-mode-title").css({
  13429.                     overflow: "hidden",
  13430.                     "white-space": "nowrap"
  13431.                 });
  13432.                 if (tmbpos === "TOP") {
  13433.                     idxPnl.animate({
  13434.                         height: "+=" + (cntSize.index_panel_height),
  13435.                         avoidTransforms: avoidtf
  13436.                     },
  13437.                     500, "easeOutQuart", finishShowingIndexPanel)
  13438.                 } else {
  13439.                     if (tmbpos === "LEFT") {
  13440.                         idxPnl.animate({
  13441.                             right: "-=" + (cntSize.index_panel_width),
  13442.                             width: "+=" + (cntSize.index_panel_width),
  13443.                             avoidTransforms: avoidtf
  13444.                         },
  13445.                         500, "easeOutQuart", finishShowingIndexPanel)
  13446.                     } else {
  13447.                         if (tmbpos === "RIGHT") {
  13448.                             idxPnl.animate({
  13449.                                 left: "-=" + (cntSize.index_panel_width),
  13450.                                 width: "+=" + (cntSize.index_panel_width),
  13451.                                 avoidTransforms: avoidtf
  13452.                             },
  13453.                             500, "easeOutQuart", finishShowingIndexPanel)
  13454.                         } else {
  13455.                             idxPnl.animate({
  13456.                                 top: "+=" + ( - cntSize.index_panel_height),
  13457.                                 height: "+=" + (cntSize.index_panel_height),
  13458.                                 avoidTransforms: avoidtf
  13459.                             },
  13460.                             500, "easeOutQuart", finishShowingIndexPanel)
  13461.                         }
  13462.                     }
  13463.                 }
  13464.             } else {
  13465.                 finishShowingIndexPanel()
  13466.             }
  13467.         }
  13468.         if (config_manager.isp && juicebox_instances[instance_id] && typeof(juicebox_instances[instance_id].onShowThumbs) === "function") {
  13469.             juicebox_instances[instance_id].onShowThumbs(!hide_thumbnails_in_lsm)
  13470.         }
  13471.         return false
  13472.     };
  13473.     var switch_2_thumbnails = function (current_image_position) {
  13474.         if (autoplay_timer) {
  13475.             toggle_autoplay()
  13476.         }
  13477.         var imgpos = current_image_position ? current_image_position: 0;
  13478.         if (detail_panel.get_photo_position() > 0) {
  13479.             imgpos = detail_panel.get_photo_position()
  13480.         }
  13481.         if (is_index_visible && is_detail_visible) {
  13482.             show_thumbnails(imgpos);
  13483.             return false
  13484.         }
  13485.         is_detail_visible = false;
  13486.         is_index_visible = true;
  13487.         var target = _(" .jb-panel-index");
  13488.         var dtpnl = _(" .jb-panel-detail, .jb-area-caption");
  13489.         if (dtpnl.is(":visible")) {
  13490.             switching_2_thumbnail = true;
  13491.             var imgs = _(" .jb-panel-detail img");
  13492.             if (imgs.length > 0) {
  13493.                 imgs.fadeOut(250)
  13494.             }
  13495.             if (utils.is_android()) {
  13496.                 dtpnl.fadeOut(250);
  13497.                 window.setTimeout(function () {
  13498.                     _(" .jb-classifier-detail-area, .jb-area-caption").hide();
  13499.                     _(".jb-classifier-thumb-area").show().fadeIn(200);
  13500.                     show_thumbnails(imgpos)
  13501.                 },
  13502.                 250)
  13503.             } else {
  13504.                 dtpnl.fadeOut(250);
  13505.                 window.setTimeout(function () {
  13506.                     _(" .jb-classifier-detail-area, .jb-area-caption").hide();
  13507.                     _(".jb-classifier-thumb-area").show().fadeIn(200);
  13508.                     show_thumbnails(imgpos)
  13509.                 },
  13510.                 250)
  13511.             }
  13512.         } else {
  13513.             show_thumbnails()
  13514.         }
  13515.         if (config.enabledirectlinks) {
  13516.             window.location.href = window.location.href.split("#")[0] + "#"
  13517.         }
  13518.         return false
  13519.     };
  13520.     var set_image_hash_value = function (position) {
  13521.         if (!config.enabledirectlinks) {
  13522.             return
  13523.         }
  13524.         var urlele = window.location.href.split("#");
  13525.         if (urlele.length >= 2 && position === parseInt(urlele[1]) - 1) {
  13526.             return
  13527.         }
  13528.         window.location.href = urlele[0] + "#" + (parseInt(position) + 1)
  13529.     };
  13530.     var set_image_nav = function () {
  13531.         var alwaysHide = (!config.showimagenav || config.showimageoverlay.toUpperCase() === "NEVER") ? true: false;
  13532.         if (!can_image_move()) {
  13533.             _(".jb-classifier-detail-area .jbn-left-button").hide();
  13534.             _(".jb-classifier-detail-area .jbn-nav-left-touch-area").addClass("dt-nav-disabled");
  13535.             _(".jb-bb-button.jb-bb-btn-top-nav.jb-bb-btn-top-nav-left").css({
  13536.                 opacity: 0.5
  13537.             })
  13538.         } else {
  13539.             if (!alwaysHide) {
  13540.                 _(".jb-classifier-detail-area .jbn-left-button").show().css({
  13541.                     opacity: 1
  13542.                 })
  13543.             }
  13544.             _(".jb-classifier-detail-area .jbn-nav-left-touch-area").removeClass("dt-nav-disabled");
  13545.             _(".jb-bb-button.jb-bb-btn-top-nav.jb-bb-btn-top-nav-left").css({
  13546.                 opacity: 1
  13547.             })
  13548.         }
  13549.         if (!can_image_move(true)) {
  13550.             _(" .jb-classifier-detail-area .jbn-right-button").hide();
  13551.             _(".jb-classifier-detail-area .jbn-nav-right-touch-area").addClass("dt-nav-disabled");
  13552.             _(".jb-bb-button.jb-bb-btn-top-nav.jb-bb-btn-top-nav-right").css({
  13553.                 opacity: 0.5
  13554.             })
  13555.         } else {
  13556.             if (!alwaysHide) {
  13557.                 _(" .jb-classifier-detail-area .jbn-right-button").show().css({
  13558.                     opacity: 1
  13559.                 })
  13560.             }
  13561.             _(".jb-classifier-detail-area .jbn-nav-right-touch-area").removeClass("dt-nav-disabled");
  13562.             _(".jb-bb-button.jb-bb-btn-top-nav.jb-bb-btn-top-nav-right").css({
  13563.                 opacity: 1
  13564.             })
  13565.         }
  13566.     };
  13567.     var set_gallery_title = function () {
  13568.         if (utils.is_large_screen_mode(config)) {
  13569.             index_panel.display_gallery_top(false);
  13570.             if (config.gallerytitle) {
  13571.                 var showimageoverlay = config.showimageoverlay.toUpperCase();
  13572.                 var galleryTitlePosition = config.gallerytitleposition.toUpperCase();
  13573.                 if (config.textcolor) {
  13574.                     _(".jb-area-large-mode-title").css({
  13575.                         color: utils.format_color(config.textcolor)
  13576.                     })
  13577.                 }
  13578.                 if (galleryTitlePosition == "TOP") {
  13579.                     _(".jb-area-large-mode-title").html(config.gallerytitle).show()
  13580.                 } else {
  13581.                     if (galleryTitlePosition === "ABOVE_THUMBS") {
  13582.                         if (is_index_visible) {
  13583.                             _(".jb-area-large-mode-title").html(config.gallerytitle).css({
  13584.                                 height: "auto",
  13585.                                 overflow: "visible",
  13586.                                 "white-space": "normal"
  13587.                             }).removeClass("jb-classifier-show-on-over").show()
  13588.                         } else {
  13589.                             _(".jb-area-large-mode-title").hide()
  13590.                         }
  13591.                     } else {
  13592.                         if (showimageoverlay === "NEVER") {
  13593.                             _(".jb-area-large-mode-title.jb-classifier-show-on-over").html(config.gallerytitle).hide()
  13594.                         } else {
  13595.                             if (overlay_visible || showimageoverlay === "ALWAYS") {
  13596.                                 _(".jb-area-large-mode-title.jb-classifier-show-on-over").html(config.gallerytitle).show()
  13597.                             }
  13598.                         }
  13599.                     }
  13600.                 }
  13601.             }
  13602.         } else {
  13603.             _(".jb-area-large-mode-title").remove();
  13604.             if (is_index_visible) {
  13605.                 index_panel.display_gallery_top(is_index_visible)
  13606.             }
  13607.         }
  13608.     };
  13609.     var need_jump_2_page = function (position) {
  13610.         if (!utils.is_swipable_device() || !in_the_transitioning) {
  13611.             return false
  13612.         }
  13613.         var cntSize = sizing.get_containers_size_and_position(current_width, current_height, is_index_visible, is_detail_visible, config_manager.isp, need_top_panel(), index_panel.get_thumb_height(), config);
  13614.         index_panel.show_page_4_image_position(position, cntSize.index_panel_width, cntSize.index_panel_height);
  13615.         return true
  13616.     };
  13617.     var before_show_main_image = function (position) {
  13618.         index_panel.set_thumbnail_visited(position);
  13619.         if (is_index_visible && (!autoplay_timer || config.autoplaythumbs)) {
  13620.             var idxRange = index_panel.get_image_index_range();
  13621.             var rangeSize = idxRange.to - idxRange.from + 1;
  13622.             if (position < idxRange.from - rangeSize) {
  13623.                 return
  13624.             }
  13625.             if (position > idxRange.to + rangeSize) {
  13626.                 return
  13627.             }
  13628.             if (position < idxRange.from && position === 0) {
  13629.                 if (!need_jump_2_page(position)) {
  13630.                     index_panel.move_to_next_page()
  13631.                 }
  13632.             } else {
  13633.                 if (position > idxRange.to) {
  13634.                     if (!need_jump_2_page(position)) {
  13635.                         index_panel.move_to_next_page()
  13636.                     }
  13637.                 } else {
  13638.                     if (position < idxRange.from) {
  13639.                         if (!need_jump_2_page(position)) {
  13640.                             index_panel.move_to_prev_page()
  13641.                         }
  13642.                     }
  13643.                 }
  13644.             }
  13645.         }
  13646.     };
  13647.     var after_show_main_image = function (position, fromHashEvent) {
  13648.         is_switching_image = false;
  13649.         set_gallery_title();
  13650.         set_image_hash_value(position);
  13651.         var imgrange = index_panel.get_image_index_range();
  13652.         if (imgrange.from > position || imgrange.to < position) {
  13653.             show_thumbnails(position)
  13654.         }
  13655.         apply_show_options();
  13656.         set_caption_height_mode();
  13657.         set_image_nav();
  13658.         set_show_list_button();
  13659.         if (utils.is_swipable_device() && overlay_visible) {
  13660.             show_hide_nav_controls(overlay_visible)
  13661.         }
  13662.         if ((fromHashEvent || !config.enabledirectlinks) && config_manager.isp && juicebox_instances[instance_id] && typeof(juicebox_instances[instance_id].onImageChange) === "function") {
  13663.             needImageEventOnFirstLoad = false;
  13664.             var curntImage = detail_panel.get_current_photo();
  13665.             var curntImgIdxNo = parseInt(curntImage.position) + 1;
  13666.             var evntObj = {
  13667.                 id: curntImgIdxNo,
  13668.                 title: config.gallerytitle,
  13669.                 caption: curntImage.caption
  13670.             };
  13671.             if (curntImgIdxNo != lastImageEventIndex) {
  13672.                 lastImageEventIndex = curntImgIdxNo;
  13673.                 juicebox_instances[instance_id].onImageChange(evntObj)
  13674.             }
  13675.         }
  13676.         handle_image_preload();
  13677.         if (utils.is_chrome()) {
  13678.             _(" *").disableSelection()
  13679.         } else {
  13680.             _(".jb-dt-main-image-" + position + " img").disableSelection();
  13681.             _(".table_page_" + index_panel.get_index() + " img").disableSelection();
  13682.             if ($.browser.mozilla) {
  13683.                 _(".jb-navigation.jb-classifier-detail-area *").disableSelection()
  13684.             }
  13685.         }
  13686.         if (!utils.is_swipable_device()) {
  13687.             var cappos = config.captionposition.toUpperCase();
  13688.             if (cappos != "NONE" && cappos != "BELOW_IMAGE" && cappos != "BOTTOM" && cappos != "BELOW_THUMBS") {
  13689.                 set_overlay(overlay_visible, 0)
  13690.             }
  13691.         }
  13692.         if ($.browser.msie && $.browser.version >= 8 && config.firstimageindex > 0) {
  13693.             index_panel.set_thumbnail_visited(position);
  13694.             window.setTimeout(function () {
  13695.                 index_panel.set_thumbnail_visited(position)
  13696.             },
  13697.             200)
  13698.         }
  13699.     };
  13700.     var is_caption_visible = function () {
  13701.         var cappos = config.captionposition.toUpperCase();
  13702.         if (cappos === "NONE") {
  13703.             return false
  13704.         }
  13705.         if (cappos === "BELOW_IMAGE" || cappos === "BOTTOM" || cappos === "BELOW_THUMBS") {
  13706.             return true
  13707.         }
  13708.         set_overlay_visible(overlay_visible);
  13709.         return overlay_visible
  13710.     };
  13711.     var needImageEventOnFirstLoad = true;
  13712.     var lastImageEventIndex = -1;
  13713.     var show_main_image = function (position, delay, isfirstimage, fromHashEvent) {
  13714.         in_the_transitioning = false;
  13715.         in_navigation = false;
  13716.         if (transTimer) {
  13717.             window.clearTimeout(transTimer);
  13718.             transTimer = 0
  13719.         }
  13720.         if (!delay && $.browser.msie) {
  13721.             window.setTimeout(function () {
  13722.                 index_panel.set_thumbnail_visited(position)
  13723.             },
  13724.             100)
  13725.         } else {
  13726.             index_panel.set_thumbnail_visited(position)
  13727.         }
  13728.         if (isfirstimage) {
  13729.             detail_panel.populate_photo_html(position, delay, function () {
  13730.                 after_show_main_image(position, needImageEventOnFirstLoad);
  13731.                 needImageEventOnFirstLoad = false
  13732.             },
  13733.             is_caption_visible());
  13734.             return
  13735.         }
  13736.         if (delay) {
  13737.             is_switching_image = true;
  13738.             detail_panel.change_2_photo(false, 0, is_caption_visible(), position)
  13739.         } else {
  13740.             detail_panel.populate_photo_html(position, 0, null, is_caption_visible());
  13741.             after_show_main_image(position, fromHashEvent)
  13742.         }
  13743.         needImageEventOnFirstLoad = false
  13744.     };
  13745.     var handle_image_preload = function () {
  13746.         var range;
  13747.         var preldopt = config.imagepreloading.toUpperCase();
  13748.         if (preldopt === "NEXT" || preldopt === "NONE") {
  13749.             return
  13750.         }
  13751.         if (preldopt === "ALL") {
  13752.             range = {
  13753.                 from: 0,
  13754.                 to: gallery_manager.length() - 1
  13755.             }
  13756.         } else {
  13757.             range = index_panel.get_image_index_range()
  13758.         }
  13759.         if (flickr_loader) {
  13760.             flickr_loader.load_flickr_images_detail(gallery_manager.get_images(), range, update_flickr_image_details)
  13761.         }
  13762.         if (utils.is_large_screen_mode(config)) {
  13763.             detail_panel.preload_images(range.from, range.to + 1)
  13764.         }
  13765.     };
  13766.     var set_touch_component_height = function (height) {
  13767.         var size = sizing.get_containers_size_and_position(current_width, current_height, is_index_visible, is_detail_visible, config_manager.isp, need_top_panel(), index_panel.get_thumb_height(), config);
  13768.         set_touch_component_size(size.detail_panel_top, size.detail_panel_left, size.detail_panel_width, height)
  13769.     };
  13770.     var set_touch_component_size = function (top, left, width, height) {
  13771.         _(".jb-navigation.jb-classifier-detail-area").css({
  13772.             top: top,
  13773.             left: left,
  13774.             width: width,
  13775.             height: height
  13776.         })
  13777.     };
  13778.     var set_toucharea_height = function (position, size) {
  13779.         var halfht = size.detail_panel_height / 2 + parseInt(_(".jbn-right-button").height() / 2);
  13780.         var clnk = _(".jb-cap-frame.caption_" + position + " a");
  13781.         var cappos = config.captionposition.toUpperCase();
  13782.         var needReduce = cappos != "BOTTOM" && cappos != "NONE" && cappos != "BELOW_IMAGE" && cappos != "BELOW_THUMBS";
  13783.         set_touch_component_size(size.detail_panel_top, size.detail_panel_left, size.detail_panel_width, size.detail_panel_height - (!needReduce || clnk.length <= 0 ? 0 : (halfht > config.maxcaptionheight ? config.maxcaptionheight: halfht)))
  13784.     };
  13785.     var switch_2_main_image = function (position) {
  13786.         if (autoplay_timer) {
  13787.             toggle_autoplay()
  13788.         }
  13789.         if (is_index_visible && is_detail_visible) {
  13790.             show_main_image(position, image_change_speed);
  13791.             return
  13792.         }
  13793.         is_detail_visible = true;
  13794.         is_index_visible = false;
  13795.         if (_(".jb-panel-index").is(":visible")) {
  13796.             switching_2_thumbnail = false;
  13797.             var navpnl = _(".jb-panel-index img");
  13798.             if (!navpnl.length) {
  13799.                 _(".jb-classifier-thumb-area").hide();
  13800.                 _(".jb-classifier-detail-area, .jb-area-caption").show();
  13801.                 show_main_image(position)
  13802.             } else {
  13803.                 var transitionTime = 1000 * config.imagetransitiontime;
  13804.                 navpnl.stop();
  13805.                 navpnl.fadeOut(transitionTime, function () {});
  13806.                 window.setTimeout(function () {
  13807.                     _(".jb-classifier-thumb-area").hide();
  13808.                     var dtpnl = _(".jb-classifier-detail-area, .jb-area-caption");
  13809.                     dtpnl.stop();
  13810.                     _(".jb-area-caption").html("");
  13811.                     if (utils.is_firefox3()) {
  13812.                         dtpnl.css({
  13813.                             opacity: 1,
  13814.                             display: "none"
  13815.                         })
  13816.                     }
  13817.                     dtpnl.children(".jb-dt-main-frame").remove();
  13818.                     dtpnl.fadeIn(transitionTime, function () {});
  13819.                     window.setTimeout(function () {
  13820.                         show_main_image(position, transitionTime)
  13821.                     },
  13822.                     20)
  13823.                 },
  13824.                 transitionTime > 50 ? transitionTime - 50 : transitionTime)
  13825.             }
  13826.         } else {
  13827.             show_main_image(position)
  13828.         }
  13829.     };
  13830.     var set_show_list_button = function () {
  13831.         var slb = _(".jb-bb-btn-de-show-list");
  13832.         if (utils.is_large_screen_mode(config)) {
  13833.             if (is_index_visible) {
  13834.                 slb.attr("title", config.languagelist.htlsm)
  13835.             } else {
  13836.                 slb.attr("title", config.languagelist.stlsm)
  13837.             }
  13838.         } else {
  13839.             slb.attr("title", config.languagelist.st);
  13840.             if (!is_index_visible) {
  13841.                 slb.show()
  13842.             } else {
  13843.                 slb.hide();
  13844.                 if (_(".jb-bb-bar>div:visible").length <= 0) {
  13845.                     _(".jb-bb-bar").hide()
  13846.                 }
  13847.             }
  13848.             if (is_detail_visible) {
  13849.                 index_panel.display_gallery_top(false);
  13850.                 _(".jb-classifier-link-wrapper.jb-classifier-detail-area").show()
  13851.             } else {
  13852.                 _(".jb-classifier-link-wrapper.jb-classifier-detail-area").hide()
  13853.             }
  13854.         }
  13855.     };
  13856.     var set_caption_height_mode = function () {
  13857.         if (config_manager.isp || !is_detail_visible) {
  13858.             return
  13859.         }
  13860.         var isHigh = true;
  13861.         if (is_index_visible && config.captionposition.toUpperCase() !== "BOTTOM" && config.captionposition.toUpperCase() !== "BELOW_THUMBS") {
  13862.             isHigh = false
  13863.         }
  13864.         detail_panel.set_caption_height_mode(isHigh)
  13865.     };
  13866.     var set_index_nav_button_position = function (cntSize) {
  13867.         if (utils.is_large_screen_mode(config)) {
  13868.             var thumb_size = index_panel.get_thumblist_size();
  13869.             var pd = (cntSize.index_panel_width - thumb_size.width) / 2 - 60;
  13870.             if (config.thumbnavposition.toUpperCase() === "BOTTOM") {
  13871.                 pd = parseInt((cntSize.index_panel_width - thumb_size.width) / 2 + (config.thumbwidth / 2) - 31);
  13872.                 if (parseInt(config.maxthumbcolumns) <= 1) {
  13873.                     pd -= parseInt(config.thumbwidth / 2 - 12)
  13874.                 }
  13875.             }
  13876.             if (config.thumbnavposition.toUpperCase() === "BOTTOM" && config.usethumbdots) {
  13877.                 if (config.maxthumbcolumns <= 4) {
  13878.                     pd -= 31
  13879.                 } else {
  13880.                     pd -= 3
  13881.                 }
  13882.             }
  13883.             _(".index-navigation .jbn-left-button").css("left", (pd - 3) + "px");
  13884.             _(".index-navigation .jbn-right-button").css("right", (pd + 1) + "px")
  13885.         } else {
  13886.             if ((utils.is_swipable_device() || config.forcetouchmode)) {
  13887.                 if (current_height > current_width) {
  13888.                     _(".index-navigation .jbn-left-button").css("left", "1px");
  13889.                     _(".index-navigation .jbn-right-button").css("right", "1px")
  13890.                 } else {
  13891.                     _(".index-navigation .jbn-left-button").css("left", "-9px");
  13892.                     _(".index-navigation .jbn-right-button").css("right", "-9px")
  13893.                 }
  13894.             } else {
  13895.                 _(".index-navigation .jbn-left-button").css("left", "10px");
  13896.                 _(".index-navigation .jbn-right-button").css("right", "10px")
  13897.             }
  13898.         }
  13899.     };
  13900.     var repaint_timer = 0;
  13901.     var repaint = function (force, ignoreIndexPnl, noresize, donotAdjustHeight) {
  13902.         sizing.try_set_body_size(config, fullScreenPersistor.is_full_screen || is_full_screen_mode);
  13903.         var _current_height = noresize ? current_height: get_gallery_height(donotAdjustHeight);
  13904.         var _current_width = noresize ? current_width: get_gallery_width();
  13905.         var win = $(window);
  13906.         if (!sizing.force_height_calculation(config) && (config.galleryheight + "").indexOf("%") > 0) {
  13907.             $("#" + config.containerid).height(_current_height)
  13908.         }
  13909.         if ($("#jb-glry-dlg:visible").length > 0 && _("").parent().attr("id") != "jb-glry-dlg") {
  13910.             return
  13911.         }
  13912.         if (right_button_offset == null) {
  13913.             right_button_offset = _(".jbn-right-button").width() + parseInt(_(".jbn-right-button").css("margin-right"))
  13914.         }
  13915.         if (force || ((current_width != _current_width || current_height != _current_height))) {
  13916.             current_width = _current_width;
  13917.             current_height = _current_height;
  13918.             if (fullScreenPersistor.is_full_screen) {
  13919.                 _("").css({
  13920.                     width: _current_width,
  13921.                     height: _current_height
  13922.                 })
  13923.             } else {
  13924.                 if (sizing.force_height_calculation(config)) {
  13925.                     _("").css({
  13926.                         height: _current_height
  13927.                     })
  13928.                 }
  13929.                 if (sizing.force_width_calculation(config)) {
  13930.                     _("").css({
  13931.                         width: _current_width
  13932.                     })
  13933.                 }
  13934.             }
  13935.             setup_layout(_current_width, _current_height, is_detail_visible);
  13936.             var cntSize = sizing.get_containers_size_and_position(_current_width, _current_height, is_index_visible, is_detail_visible, config_manager.isp, need_top_panel(), index_panel.get_thumb_height(), config);
  13937.             set_containers_size_and_position(cntSize);
  13938.             if (is_detail_visible) {
  13939.                 var wrappersel = utils.is_swipable_device() ? ":not(.jb-classifier-link-wrapper)": "";
  13940.                 var mainselstr = (overlay_visible && utils.is_swipable_device()) ? ".jb-classifier-detail-area" + wrappersel + ", .jb-area-caption": ".jb-classifier-detail-area" + wrappersel;
  13941.                 if (utils.is_earlier_ie()) {
  13942.                     _(mainselstr).fadeIn(100);
  13943.                     var imgs = _(".jb-panel-detail img");
  13944.                     imgs.fadeIn(100);
  13945.                     _(".jb-panel-detail").fadeIn(100)
  13946.                 } else {
  13947.                     _(mainselstr).css("opacity", 1).show();
  13948.                     var imgs = _(".jb-panel-detail img");
  13949.                     imgs.css("opacity", 1).show();
  13950.                     _(".jb-panel-detail").css("opacity", 1)
  13951.                 }
  13952.                 if (_(".jb-panel-detail").html()) {
  13953.                     detail_panel.repaint(cntSize.detail_panel_width, cntSize.detail_panel_height)
  13954.                 } else {
  13955.                     show_main_image(detail_panel.get_photo_position())
  13956.                 }
  13957.                 _(".jb-area-caption").css("max-height", config.maxcaptionheight > cntSize.detail_panel_height ? cntSize.detail_panel_height: config.maxcaptionheight)
  13958.             } else {
  13959.                 detail_panel.repaint(cntSize.detail_panel_width, cntSize.detail_panel_height);
  13960.                 _(".jb-classifier-detail-area, .jb-area-caption, .jb-classifier-link-wrapper.jb-classifier-detail-area").hide()
  13961.             }
  13962.             if (is_index_visible && !ignoreIndexPnl) {
  13963.                 _(".jb-classifier-thumb-area").show();
  13964.                 _(".jb-panel-index").show();
  13965.                 var imgpos = detail_panel.get_photo_position();
  13966.                 index_panel.show_page_4_image_position(imgpos, cntSize.index_panel_width, cntSize.index_panel_height, true)
  13967.             } else {
  13968.                 _(".jb-panel-index").hide()
  13969.             }
  13970.             set_nav_btn_position(cntSize);
  13971.             set_index_nav_button_position(cntSize);
  13972.             set_show_list_button();
  13973.             index_panel.set_thumbnail_visited(detail_panel.get_photo_position());
  13974.             set_caption_height_mode();
  13975.             adjust_title_button_bar_position(cntSize)
  13976.         }
  13977.         if (!donotAdjustHeight) {
  13978.             if (fullScreenPersistor.is_full_screen) {
  13979.                 if (utils.is_android()) {
  13980.                     hide_android_url_bar()
  13981.                 } else {
  13982.                     if (utils.is_chrome() || utils.is_ipad()) {
  13983.                         if (repaint_timer) {
  13984.                             window.clearTimeout(repaint_timer);
  13985.                             repaint_timer = 0
  13986.                         }
  13987.                         repaint_timer = window.setTimeout(function () {
  13988.                             var ofst = _("").offset();
  13989.                             var bd = $("body");
  13990.                             bd.css("overflow", "scroll");
  13991.                             window.scrollTo(ofst.left, ofst.top);
  13992.                             bd.css("overflow", "hidden")
  13993.                         },
  13994.                         100)
  13995.                     } else {
  13996.                         if (!$.browser.msie) {
  13997.                             var offset = _("").offset();
  13998.                             if (offset) {
  13999.                                 window.scrollTo(offset.left, offset.top)
  14000.                             }
  14001.                         }
  14002.                     }
  14003.                 }
  14004.             } else {
  14005.                 if (is_full_screen_mode) {
  14006.                     if (utils.is_iphone()) {
  14007.                         window.scrollTo(0, 1);
  14008.                         if (repaint_timer) {
  14009.                             window.clearTimeout(repaint_timer);
  14010.                             repaint_timer = 0
  14011.                         }
  14012.                         repaint_timer = window.setTimeout(function () {
  14013.                             window.scrollTo(0, 1)
  14014.                         },
  14015.                         1000)
  14016.                     } else {
  14017.                         if (utils.is_android() && !noresize) {
  14018.                             hide_android_url_bar()
  14019.                         }
  14020.                     }
  14021.                 }
  14022.             }
  14023.         }
  14024.         set_background_image_size()
  14025.     };
  14026.     var hide_url_bar = function () {
  14027.         if (utils.is_iphone()) {
  14028.             window.scrollTo(0, 1)
  14029.         } else {
  14030.             if (utils.is_small_android()) {
  14031.                 hide_android_url_bar()
  14032.             }
  14033.         }
  14034.     };
  14035.     var urlHidingTimer = 0;
  14036.     var hide_android_url_bar = function () {
  14037.         var win = $(window);
  14038.         var aver = utils.get_android_ver();
  14039.         var addht = sizing.get_android_additional_height(aver, win.width(), win.height());
  14040.         if (addht === 0 && aver < 4) {
  14041.             return
  14042.         }
  14043.         if (aver < 3.1) {
  14044.             $("body").css("overflow", "auto").height(get_gallery_height() + 60)
  14045.         }
  14046.         if (addht) {
  14047.             window.scrollTo(0, 1)
  14048.         }
  14049.         window.setTimeout(function () {
  14050.             if (addht) {
  14051.                 window.scrollTo(0, 1)
  14052.             }
  14053.             if (aver >= 4 && (fullScreenPersistor.is_full_screen || is_full_screen_mode) && current_height > $(window).height() + 3) {
  14054.                 if (urlHidingTimer) {
  14055.                     window.clearTimeout(urlHidingTimer)
  14056.                 }
  14057.                 urlHidingTimer = window.setTimeout(function () {
  14058.                     repaint(true, false, false, true)
  14059.                 },
  14060.                 500)
  14061.             }
  14062.         },
  14063.         200)
  14064.     };
  14065.     if (config.css != null) {
  14066.         document.write("<style id='" + document_id + "_style'>" + config.css.trim().replace(/\}\s/g, "} #" + document_id + " ").replace(/^/, "#" + document_id + " ") + "</style>");
  14067.         init()
  14068.     } else {
  14069.         init()
  14070.     }
  14071.     var next_page = function (delta_x) {
  14072.         if (!can_page_move(true)) {
  14073.             return false
  14074.         }
  14075.         index_panel.move_to_next_page(0, set_index_nav_button);
  14076.         handle_image_preload();
  14077.         return false
  14078.     };
  14079.     var previous_page = function (delta_x) {
  14080.         if (!can_page_move(false)) {
  14081.             return false
  14082.         }
  14083.         index_panel.move_to_prev_page(0, set_index_nav_button);
  14084.         handle_image_preload();
  14085.         return false
  14086.     };
  14087.     var next_image = function (delta_x) {
  14088.         if (!can_image_move(true)) {
  14089.             return false
  14090.         }
  14091.         detail_panel.move_2_next_photo(delta_x, ((config.captionposition.toUpperCase() === "BELOW_THUMBS" && !is_index_visible) ? false: overlay_visible));
  14092.         return false
  14093.     };
  14094.     var previous_image = function (delta_x) {
  14095.         if (!can_image_move(false)) {
  14096.             return false
  14097.         }
  14098.         detail_panel.move_2_previous_photo(delta_x, ((config.captionposition.toUpperCase() === "BELOW_THUMBS" && !is_index_visible) ? false: overlay_visible));
  14099.         return false
  14100.     };
  14101.     var open_url = function () {
  14102.         var curntImage = detail_panel.get_current_photo();
  14103.         if (config.useflickr) {
  14104.             if (curntImage.imageFullURL) {
  14105.                 window.open(curntImage.imageFullURL);
  14106.                 return false
  14107.             }
  14108.         }
  14109.         var targetUrl = curntImage.linkURL ? curntImage.linkURL: curntImage.imageURL;
  14110.         var linkTarget = curntImage.linkTarget ? curntImage.linkTarget.toLowerCase() : "";
  14111.         if (linkTarget === "_self") {
  14112.             window.location.href = targetUrl
  14113.         } else {
  14114.             window.open(targetUrl, linkTarget)
  14115.         }
  14116.         return false
  14117.     };
  14118.     var get_current_gallery_html = function () {
  14119.         var glrhtml = _("").html();
  14120.         _("").html("").hide();
  14121.         return glrhtml
  14122.     };
  14123.     var scroll_bar_compensition = function () {
  14124.         var scroll = utils.is_page_scrolling();
  14125.         return {
  14126.             h: scroll.v_scrolling ? 21 : 0,
  14127.             v: scroll.h_scrolling ? 21 : 0
  14128.         }
  14129.     };
  14130.     var is_doing_event = false;
  14131.     var full_screen = function () {
  14132.         if (navigator.userAgent.match(/Safari/i)) {
  14133.             if (is_doing_event) {
  14134.                 return false
  14135.             }
  14136.             window.setTimeout(function () {
  14137.                 toggle_full_screen()
  14138.             },
  14139.             100);
  14140.             window.setTimeout(function () {
  14141.                 is_doing_event = false
  14142.             },
  14143.             200);
  14144.             is_doing_event = true
  14145.         } else {
  14146.             return toggle_full_screen()
  14147.         }
  14148.         return false
  14149.     };
  14150.     var toggle_full_screen = function () {
  14151.         if (!fullScreenPersistor.is_full_screen) {
  14152.             if (utils.is_new_expanded_window()) {
  14153.                 window.history.back();
  14154.                 return false
  14155.             }
  14156.             if (! (config.usefullscreenexpand && utils.exit_support_real_fullscreen() && !utils.is_in_iframe()) && utils.need_new_window(config)) {
  14157.                 var savedconfig;
  14158.                 if ($.browser.msie && $.browser.version < 8 && $.browser.version >= 7) {
  14159.                     savedconfig = {
  14160.                         configurl: utils.convert_to_absolute_path(correct_path(config.configurl)),
  14161.                         themeurl: utils.convert_to_absolute_path(correct_path(config.themeurl)),
  14162.                         backgroundurl: utils.convert_to_absolute_path(correct_path(config.backgroundurl)),
  14163.                         firstimageindex: detail_panel.get_current_photo() ? detail_panel.get_current_photo().position + 1 : 0,
  14164.                         hide_thumbnails_in_lsm: hide_thumbnails_in_lsm,
  14165.                         baseurl: utils.convert_to_absolute_path(config.baseurl)
  14166.                     }
  14167.                 } else {
  14168.                     savedconfig = {
  14169.                         showsplashpage: "NEVER",
  14170.                         configurl: utils.convert_to_absolute_path(correct_path(config.configurl)),
  14171.                         themeurl: utils.convert_to_absolute_path(correct_path(config.themeurl)),
  14172.                         baseurl: utils.convert_to_absolute_path(config.baseurl),
  14173.                         audiourlmp3: utils.convert_to_absolute_path(config.audiourlmp3),
  14174.                         audiourlogg: utils.convert_to_absolute_path(config.audiourlogg),
  14175.                         backgroundurl: utils.convert_to_absolute_path(correct_path(config.backgroundurl)),
  14176.                         firstimageindex: detail_panel.get_current_photo() ? detail_panel.get_current_photo().position + 1 : 0,
  14177.                         hide_thumbnails_in_lsm: hide_thumbnails_in_lsm,
  14178.                         is_detail_visible: need_show_splash_page() ? true: is_detail_visible,
  14179.                         is_index_visible: need_show_splash_page() ? false: is_index_visible,
  14180.                         pageTitle: $("head > title").text()
  14181.                     }
  14182.                 }
  14183.                 config_manager.get_cookie_manager().saveConfig({
  14184.                     skip: "gallerywidth,galleryheight,containerid,enabledirectlinks,usefullscreenexpand,expandinnewpage,languagelist,splashbuttontext,splashtitle,splashimageurl,splashshowimagecount,splashdescription,thumb_load_placeholder,main_load_placeholder",
  14185.                     config: savedconfig
  14186.                 });
  14187.                 if (audio_playing) {
  14188.                     toggle_audio_play()
  14189.                 }
  14190.                 document.location.href = utils.get_js_folder_url() + "full.html";
  14191.                 return false
  14192.             }
  14193.             var vpc = utils.get_viewport_meta_content();
  14194.             utils.set_viewport_meta(true);
  14195.             var param = $.extend({},
  14196.             config);
  14197.             param.containerid = dialog.get_id();
  14198.             param.gallerywidth = "100%";
  14199.             param.galleryheight = "100%";
  14200.             param.fullscreen_displaying_mode = true;
  14201.             param.parent_gallery = juicebox_instances[instance_id];
  14202.             param.initial_body_css_inline_style = $("body").attr("style");
  14203.             param.scroll_position = {};
  14204.             param.scroll_position.scrollTop = $(window).scrollTop();
  14205.             param.scroll_position.scrollLeft = $(window).scrollLeft();
  14206.             if ($.browser.msie) {
  14207.                 window.scroll(0, 0)
  14208.             }
  14209.             param.persistor_param = {};
  14210.             param.persistor_param.viewportContent = vpc;
  14211.             var win = $(window);
  14212.             var isLSM = utils.is_large_screen_mode(config);
  14213.             param.persistor_param.max_side_length = Math.max(win.width(), win.height());
  14214.             param.persistor_param.restore_viewport = function (vpv, scalable) {
  14215.                 utils.set_viewport_value(vpv, scalable)
  14216.             };
  14217.             param.persistor_param.is_index_visible = splash_is_set() ? false: is_index_visible;
  14218.             param.persistor_param.is_detail_visible = splash_is_set() ? true: is_detail_visible;
  14219.             param.persistor_param.current_image_index = detail_panel.get_photo_position();
  14220.             param.persistor_param.restore_image = function (imgIdx) {
  14221.                 lastImageEventIndex = imgIdx + 1;
  14222.                 if (isLSM) {
  14223.                     show_main_image(imgIdx)
  14224.                 } else {
  14225.                     switch_2_main_image(imgIdx)
  14226.                 }
  14227.             };
  14228.             param.persistor_param.restore_index = (isLSM ? show_thumbnails: switch_2_thumbnails);
  14229.             param.persistor_param.splash_is_set = splash_is_set;
  14230.             param.persistor_param.background_image_width = backgroundImageWidth;
  14231.             param.persistor_param.background_image_height = backgroundImageHeight;
  14232.             param.persistor_param.gallery_manager = gallery_manager;
  14233.             param.persistor_param.hide_thumbnails_in_lsm = hide_thumbnails_in_lsm;
  14234.             param.persistor_param.last_image_event_index = lastImageEventIndex;
  14235.             param.persistor_param.overlay_visible = overlay_visible;
  14236.             if (audioPlayer) {
  14237.                 param.persistor_param.is_audio_playing = audio_playing;
  14238.                 param.persistor_param.parent_toggle_audio_play = toggle_audio_play
  14239.             }
  14240.             if (autoplay_timer) {
  14241.                 toggle_autoplay(false, true);
  14242.                 param.persistor_param.is_autoplaying = true
  14243.             }
  14244.             param.persistor_param.restore_autoplay = function () {
  14245.                 toggle_autoplay(false, true)
  14246.             };
  14247.             if (! (utils.is_swipable_device() || config.forcetouchmode || config.showinfobutton)) {
  14248.                 overlay_visible = false;
  14249.                 set_overlay(overlay_visible, 0)
  14250.             }
  14251.             $("body").css({
  14252.                 overflow: "hidden"
  14253.             });
  14254.             if (config.backgroundopacity === 1 || config.backgroundopacity === "1" || (typeof(config.backgroundopacity) === "string" && config.backgroundopacity.indexOf("filter") === 0 && config.backgroundopacity.indexOf("100") > 0)) {
  14255.                 dialog.show_dialog(true)
  14256.             } else {
  14257.                 param.persistor_param.restore_zindex = function () {
  14258.                     _("").show();
  14259.                     _("").focus()
  14260.                 };
  14261.                 _("").hide();
  14262.                 dialog.show_dialog(false)
  14263.             }
  14264.             new juicebox(param);
  14265.             var eledlg = document.getElementById("jb-glry-dlg");
  14266.             if (config.usefullscreenexpand) {
  14267.                 utils.show_real_fullscreen("jb-glry-dlg")
  14268.             }
  14269.             if (config_manager.isp && juicebox_instances[instance_id] && typeof(juicebox_instances[instance_id].onExpand) === "function") {
  14270.                 juicebox_instances[instance_id].onExpand(true)
  14271.             }
  14272.         } else {
  14273.             var win = $(window);
  14274.             if (utils.need_viewport_meta()) {
  14275.                 if (fullScreenPersistor.parent_gallery_param.viewportContent) {
  14276.                     utils.set_viewport_meta_content(fullScreenPersistor.parent_gallery_param.viewportContent)
  14277.                 } else {
  14278.                     if (utils.is_android() && utils.get_android_ver() >= 4) {
  14279.                         fullScreenPersistor.parent_gallery_param.restore_viewport(320, true)
  14280.                     } else {
  14281.                         if (utils.is_iphone()) {
  14282.                             fullScreenPersistor.parent_gallery_param.restore_viewport(0.4, true)
  14283.                         } else {
  14284.                             if (utils.is_ipad()) {} else {
  14285.                                 fullScreenPersistor.parent_gallery_param.restore_viewport(160 * fullScreenPersistor.parent_gallery_param.max_side_length / Math.max(win.width(), win.height()), true)
  14286.                             }
  14287.                         }
  14288.                     }
  14289.                 }
  14290.             }
  14291.             if (!fullScreenPersistor.parent_gallery_param.splash_is_set()) {
  14292.                 var curntImgIdx = detail_panel.get_photo_position();
  14293.                 if (is_detail_visible) {
  14294.                     fullScreenPersistor.parent_gallery_param.restore_image(curntImgIdx)
  14295.                 }
  14296.                 if (is_index_visible) {
  14297.                     fullScreenPersistor.parent_gallery_param.restore_index(curntImgIdx)
  14298.                 }
  14299.             }
  14300.             $("body").attr("style", fullScreenPersistor.initial_body_css_inline_style);
  14301.             window.setTimeout(function () {
  14302.                 window.scroll(fullScreenPersistor.scroll_position.scrollLeft, fullScreenPersistor.scroll_position.scrollTop)
  14303.             },
  14304.             100);
  14305.             if (fullScreenPersistor.parent_gallery_param.restore_zindex) {
  14306.                 fullScreenPersistor.parent_gallery_param.restore_zindex()
  14307.             }
  14308.             var cleanupDialog = function () {
  14309.                 dialog.cleanup_dialog();
  14310.                 $(window).unbind("resize", windowResize);
  14311.                 if (!splash_is_set()) {
  14312.                     fullScreenPersistor.parent_gallery.restore(hide_thumbnails_in_lsm, overlay_visible)
  14313.                 }
  14314.                 if (!splash_is_set()) {
  14315.                     fullScreenPersistor.parent_gallery.sendMessage()
  14316.                 }
  14317.             };
  14318.             if (config.usefullscreenexpand) {
  14319.                 utils.exit_fullscreen();
  14320.                 if (navigator.userAgent.match(/Safari/i) && navigator.userAgent.match(/Mac OS/i)) {
  14321.                     window.setTimeout(function () {
  14322.                         if (autoplay_timer) {
  14323.                             toggle_autoplay(false, true);
  14324.                             fullScreenPersistor.parent_gallery_param.restore_autoplay()
  14325.                         }
  14326.                         cleanupDialog()
  14327.                     },
  14328.                     50);
  14329.                     return false
  14330.                 }
  14331.             }
  14332.             if (autoplay_timer) {
  14333.                 toggle_autoplay(false, true);
  14334.                 fullScreenPersistor.parent_gallery_param.restore_autoplay()
  14335.             }
  14336.             cleanupDialog()
  14337.         }
  14338.         return false
  14339.     };
  14340.     var debug_info = function (selMsgTag) {
  14341.         var win = $(window);
  14342.         var msg = "timestamp = " + ((new Date()).valueOf() + "").substring(9) + "<br/>isfullscreen = " + is_full_screen_mode + "<br/>r_h = " + sizing.get_initial_win_size(win.height(), win.width()) + "<br/>current_height = " + current_height + "<br/>current_width = " + current_width + "<br/>scrn.h = " + screen.height + "<br/>win.h = " + $(window).height() + "<br/>doc.h = " + $(document).height() + "<br/>bd.h = " + $("body").height() + "<br/>bd.w = " + $("body").width() + "<br/>scrn.w = " + screen.width + "<br/>win.w = " + $(window).width() + "<br/>doc.w = " + $(document).width() + "<br/>bd.w = " + $("body").width() + "<br/>glry.h = " + _("").height();
  14343.         _(".jb-navigation").html(msg).css({
  14344.             color: "white",
  14345.             "font-size": "20px"
  14346.         }).click(function () {
  14347.             window.location.href = window.location.href.replace(/#/g, "") + "?cw=" + current_width + "&ch=" + current_height;
  14348.             return false
  14349.         });
  14350.         if (!selMsgTag) {
  14351.             selMsgTag = "jb-debug-message"
  14352.         }
  14353.         $("#jb-debug-message").html(msg).show()
  14354.     };
  14355.     var debug_viewport_info = function (selMsgTag) {
  14356.         var win = $(window);
  14357.         var msg = "timestamp = " + ((new Date()).valueOf() + "").substring(9) + "<br/>viewport=" + $("#sv-meta").attr("content");
  14358.         _(".jb-navigation").html(msg).css({
  14359.             color: "white",
  14360.             "font-size": "20px"
  14361.         }).click(function () {
  14362.             window.location.href = window.location.href.replace(/#/g, "") + "?cw=" + current_width + "&ch=" + current_height;
  14363.             return false
  14364.         });
  14365.         if (!selMsgTag) {
  14366.             selMsgTag = "jb-debug-message"
  14367.         }
  14368.         $("#jb-debug-message").html(msg).show()
  14369.     };
  14370.     var debug_info2 = function (v1, v2, v3) {
  14371.         var win = $(window);
  14372.         _(".jb-navigation").html("timestamp = " + ((new Date()).valueOf() + "").substring(9) + "<br/>v1 = " + v1 + "<br/>v2 = " + v2 + "<br/>v3 = " + v3).css({
  14373.             color: "white",
  14374.             "font-size": "20px"
  14375.         })
  14376.     };
  14377.     var debug_message = function (msg) {
  14378.         _(".jb-navigation").html(msg).css({
  14379.             color: "white",
  14380.             "font-size": "20px"
  14381.         })
  14382.     };
  14383.     var basicMethods = {
  14384.         debug: function (script) {
  14385.             config.debugmode = true;
  14386.             eval(script)
  14387.         },
  14388.         sendMessage: function () {
  14389.             if (config_manager.isp && juicebox_instances[instance_id] && typeof(juicebox_instances[instance_id].onExpand) === "function") {
  14390.                 juicebox_instances[instance_id].onExpand(false)
  14391.             }
  14392.         },
  14393.         restore: function (hideThumbs, isOverlayVisible) {
  14394.             if (splash_is_set()) {
  14395.                 return
  14396.             }
  14397.             if (typeof(isOverlayVisible) != "undefined") {
  14398.                 overlay_visible = isOverlayVisible;
  14399.                 window.setTimeout(function () {
  14400.                     overlay_visible = isOverlayVisible;
  14401.                     show_hide_overlay(overlay_visible, 0);
  14402.                     show_hide_nav_controls(overlay_visible);
  14403.                     if (!is_detail_visible) {
  14404.                         _(".jb-area-caption").hide()
  14405.                     }
  14406.                 },
  14407.                 100)
  14408.             }
  14409.             hide_thumbnails_in_lsm = !hideThumbs;
  14410.             toggle_index_panel_4_lsm(true)
  14411.         }
  14412.     };
  14413.     var proMethods = config_manager.isp ? {
  14414.         showGallery: function (show) {
  14415.             show ? _("").show() : _("").hide()
  14416.         },
  14417.         setGallerySize: function (width, height) {
  14418.             if (fullScreenPersistor.is_full_screen) {
  14419.                 return
  14420.             }
  14421.             var container = $("#" + config.containerid);
  14422.             if (container.length <= 0) {
  14423.                 return
  14424.             }
  14425.             var w = parseInt(width) + "px";
  14426.             var h = parseInt(height) + "px";
  14427.             is_full_screen_mode = false;
  14428.             config.gallerywidth = w;
  14429.             config.galleryheight = h;
  14430.             container.css({
  14431.                 height: h,
  14432.                 width: w
  14433.             });
  14434.             _("").height(h);
  14435.             repaint(true)
  14436.         },
  14437.         showImage: function (index) {
  14438.             var glrylen = gallery_manager.length();
  14439.             index--;
  14440.             if (index < 0 || index >= glrylen) {
  14441.                 return
  14442.             }
  14443.             show_main_image(index)
  14444.         },
  14445.         showNextImage: next_image,
  14446.         showPreviousImage: previous_image,
  14447.         showIndexByImage: show_thumbnails,
  14448.         toggleAutoPlay: toggle_autoplay,
  14449.         toggleThumbs: index_button_clicked,
  14450.         toggleAudio: toggle_audio_play,
  14451.         toggleExpand: full_screen,
  14452.         openImageLink: open_url,
  14453.         showThumbPage: function (index) {
  14454.             index--;
  14455.             index_panel.show_page_by_page_index(index)
  14456.         },
  14457.         getImageInfo: function (index) {
  14458.             index--;
  14459.             var glrylen = gallery_manager.length();
  14460.             if (index < 0 || index >= glrylen) {
  14461.                 return null
  14462.             }
  14463.             var img = gallery_manager.get_image(index);
  14464.             return {
  14465.                 id: parseInt(img.position) + 1,
  14466.                 imageURL: img.imageURL,
  14467.                 thumbURL: img.thumbURL,
  14468.                 caption: img.caption,
  14469.                 title: img.title,
  14470.                 linkURL: img.linkURL,
  14471.                 linkTarget: img.linkTarget
  14472.             }
  14473.         },
  14474.         getImageCount: function () {
  14475.             return gallery_manager.length()
  14476.         },
  14477.         getThumbPageIndex: function () {
  14478.             return parseInt(index_panel.get_index()) + 1
  14479.         },
  14480.         getImageIndex: function () {
  14481.             return parseInt(detail_panel.get_current_photo().position) + 1
  14482.         }
  14483.     }: {};
  14484.     juicebox_instances[instance_id] = $.extend(basicMethods, proMethods);
  14485.     return juicebox_instances[instance_id]
  14486. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement