1/* 2 3 4 Magic Zoom v5.2.9 5 Copyright 2019 Magic Toolbox 6 Buy a license: https://www.magictoolbox.com/magiczoom/ 7 License agreement: https://www.magictoolbox.com/license/ 8 9 10*/ 11window.MagicZoom = (function() { 12 var v, x; 13 v = x = (function() { 14 var S = { 15 version: "v3.3-b5-7-g46fd501", 16 UUID: 0, 17 storage: {}, 18 $uuid: function(W) { 19 return (W.$J_UUID || (W.$J_UUID = ++M.UUID)) 20 }, 21 getStorage: function(W) { 22 return (M.storage[W] || (M.storage[W] = {})) 23 }, 24 $F: function() {}, 25 $false: function() { 26 return false 27 }, 28 $true: function() { 29 return true 30 }, 31 stylesId: "mjs-" + Math.floor(Math.random() * new Date().getTime()), 32 defined: function(W) { 33 return (undefined != W) 34 }, 35 ifndef: function(X, W) { 36 return (undefined != X) ? X : W 37 }, 38 exists: function(W) { 39 return !!(W) 40 }, 41 jTypeOf: function(W) { 42 if (!M.defined(W)) { 43 return false 44 } 45 if (W.$J_TYPE) { 46 return W.$J_TYPE 47 } 48 if (!!W.nodeType) { 49 if (1 == W.nodeType) { 50 return "element" 51 } 52 if (3 == W.nodeType) { 53 return "textnode" 54 } 55 } 56 if (W.length && W.item) { 57 return "collection" 58 } 59 if (W.length && W.callee) { 60 return "arguments" 61 } 62 if ((W instanceof window.Object || W instanceof window.Function) && W.constructor === M.Class) { 63 return "class" 64 } 65 if (W instanceof window.Array) { 66 return "array" 67 } 68 if (W instanceof window.Function) { 69 return "function" 70 } 71 if (W instanceof window.String) { 72 return "string" 73 } 74 if (M.browser.trident) { 75 if (M.defined(W.cancelBubble)) { 76 return "event" 77 } 78 } else { 79 if (W === window.event || W.constructor == window.Event || W.constructor == window.MouseEvent || W.constructor == window.UIEvent || W.constructor == window.KeyboardEvent || W.constructor == window.KeyEvent) { 80 return "event" 81 } 82 } if (W instanceof window.Date) { 83 return "date" 84 } 85 if (W instanceof window.RegExp) { 86 return "regexp" 87 } 88 if (W === window) { 89 return "window" 90 } 91 if (W === document) { 92 return "document" 93 } 94 return typeof(W) 95 }, 96 extend: function(ab, aa) { 97 if (!(ab instanceof window.Array)) { 98 ab = [ab] 99 } 100 if (!aa) { 101 return ab[0] 102 } 103 for (var Z = 0, X = ab.length; Z < X; Z++) { 104 if (!M.defined(ab)) { 105 continue 106 } 107 for (var Y in aa) { 108 if (!Object.prototype.hasOwnProperty.call(aa, Y)) { 109 continue 110 } 111 try { 112 ab[Z][Y] = aa[Y] 113 } catch (W) {} 114 } 115 } 116 return ab[0] 117 }, 118 implement: function(aa, Z) { 119 if (!(aa instanceof window.Array)) { 120 aa = [aa] 121 } 122 for (var Y = 0, W = aa.length; Y < W; Y++) { 123 if (!M.defined(aa[Y])) { 124 continue 125 } 126 if (!aa[Y].prototype) { 127 continue 128 } 129 for (var X in (Z || {})) { 130 if (!aa[Y].prototype[X]) { 131 aa[Y].prototype[X] = Z[X] 132 } 133 } 134 } 135 return aa[0] 136 }, 137 nativize: function(Y, X) { 138 if (!M.defined(Y)) { 139 return Y 140 } 141 for (var W in (X || {})) { 142 if (!Y[W]) { 143 Y[W] = X[W] 144 } 145 } 146 return Y 147 }, 148 $try: function() { 149 for (var X = 0, W = arguments.length; X < W; X++) { 150 try { 151 return arguments[X]() 152 } catch (Y) {} 153 } 154 return null 155 }, 156 $A: function(Y) { 157 if (!M.defined(Y)) { 158 return M.$([]) 159 } 160 if (Y.toArray) { 161 return M.$(Y.toArray()) 162 } 163 if (Y.item) { 164 var X = Y.length || 0, 165 W = new Array(X); 166 while (X--) { 167 W[X] = Y[X] 168 } 169 return M.$(W) 170 } 171 return M.$(Array.prototype.slice.call(Y)) 172 }, 173 now: function() { 174 return new Date().getTime() 175 }, 176 detach: function(aa) { 177 var Y; 178 switch (M.jTypeOf(aa)) { 179 case "object": 180 Y = {}; 181 for (var Z in aa) { 182 Y[Z] = M.detach(aa[Z]) 183 } 184 break; 185 case "array": 186 Y = []; 187 for (var X = 0, W = aa.length; X < W; X++) { 188 Y[X] = M.detach(aa[X]) 189 } 190 break; 191 default: 192 return aa 193 } 194 return M.$(Y) 195 }, 196 $: function(Y) { 197 var W = true; 198 if (!M.defined(Y)) { 199 return null 200 } 201 if (Y.$J_EXT) { 202 return Y 203 } 204 switch (M.jTypeOf(Y)) { 205 case "array": 206 Y = M.nativize(Y, M.extend(M.Array, { 207 $J_EXT: M.$F 208 })); 209 Y.jEach = Y.forEach; 210 return Y; 211 break; 212 case "string": 213 var X = document.getElementById(Y); 214 if (M.defined(X)) { 215 return M.$(X) 216 } 217 return null; 218 break; 219 case "window": 220 case "document": 221 M.$uuid(Y); 222 Y = M.extend(Y, M.Doc); 223 break; 224 case "element": 225 M.$uuid(Y); 226 Y = M.extend(Y, M.Element); 227 break; 228 case "event": 229 Y = M.extend(Y, M.Event); 230 break; 231 case "textnode": 232 case "function": 233 case "array": 234 case "date": 235 default: 236 W = false; 237 break 238 } 239 if (W) { 240 return M.extend(Y, { 241 $J_EXT: M.$F 242 }) 243 } else { 244 return Y 245 } 246 }, 247 $new: function(W, Y, X) { 248 return M.$(M.doc.createElement(W)).setProps(Y || {}).jSetCss(X || {}) 249 }, 250 addCSS: function(Z, aa, X) { 251 var W, ac, Y, ae = [], 252 ad = -1; 253 X || (X = M.stylesId); 254 W = M.$(X) || M.$new("style", { 255 id: X, 256 type: "text/css" 257 }).jAppendTo((document.head || document.body), "top"); 258 ac = W.sheet || W.styleSheet; 259 if ("string" != M.jTypeOf(aa)) { 260 for (var Y in aa) { 261 ae.push(Y + ":" + aa[Y]) 262 } 263 aa = ae.join(";") 264 } 265 if (ac.insertRule) { 266 ad = ac.insertRule(Z + " {" + aa + "}", ac.cssRules.length) 267 } else { 268 try { 269 ad = ac.addRule(Z, aa, ac.rules.length) 270 } catch (ab) {} 271 } 272 return ad 273 }, 274 removeCSS: function(Z, W) { 275 var Y, X; 276 Y = M.$(Z); 277 if ("element" !== M.jTypeOf(Y)) { 278 return 279 } 280 X = Y.sheet || Y.styleSheet; 281 if (X.deleteRule) { 282 X.deleteRule(W) 283 } else { 284 if (X.removeRule) { 285 X.removeRule(W) 286 } 287 } 288 }, 289 generateUUID: function() { 290 return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(Y) { 291 var X = Math.random() * 16 | 0, 292 W = Y == "x" ? X : (X & 3 | 8); 293 return W.toString(16) 294 }).toUpperCase() 295 }, 296 getAbsoluteURL: (function() { 297 var W; 298 return function(X) { 299 if (!W) { 300 W = document.createElement("a") 301 } 302 W.setAttribute("href", X); 303 return ("!!" + W.href).replace("!!", "") 304 } 305 })(), 306 getHashCode: function(Y) { 307 var Z = 0, 308 W = Y.length; 309 for (var X = 0; X < W; ++X) { 310 Z = 31 * Z + Y.charCodeAt(X); 311 Z %= 4294967296 312 } 313 return Z 314 } 315 }; 316 var M = S; 317 var N = S.$; 318 if (!window.magicJS) { 319 window.magicJS = S; 320 window.$mjs = S.$ 321 } 322 M.Array = { 323 $J_TYPE: "array", 324 indexOf: function(Z, aa) { 325 var W = this.length; 326 for (var X = this.length, Y = (aa < 0) ? Math.max(0, X + aa) : aa || 0; Y < X; Y++) { 327 if (this[Y] === Z) { 328 return Y 329 } 330 } 331 return -1 332 }, 333 contains: function(W, X) { 334 return this.indexOf(W, X) != -1 335 },
336 forEach: function(W, Z) { 337 for (var Y = 0, X = this.length; Y < X; Y++) { 338 if (Y in this) { 339 W.call(Z, this[Y], Y, this) 340 } 341 } 342 }, 343 filter: function(W, ab) { 344 var aa = []; 345 for (var Z = 0, X = this.length; Z < X; Z++) { 346 if (Z in this) { 347 var Y = this[Z]; 348 if (W.call(ab, this[Z], Z, this)) { 349 aa.push(Y) 350 } 351 } 352 } 353 return aa 354 }, 355 map: function(W, aa) { 356 var Z = []; 357 for (var Y = 0, X = this.length; Y < X; Y++) { 358 if (Y in this) { 359 Z[Y] = W.call(aa, this[Y], Y, this) 360 } 361 } 362 return Z 363 } 364 }; 365 M.implement(String, { 366 $J_TYPE: "string", 367 jTrim: function() { 368 return this.replace(/^\s+|\s+$/g, "") 369 }, 370 eq: function(W, X) { 371 return (X || false) ? (this.toString() === W.toString()) : (this.toLowerCase().toString() === W.toLowerCase().toString()) 372 }, 373 jCamelize: function() { 374 return this.replace(/-\D/g, function(W) { 375 return W.charAt(1).toUpperCase() 376 }) 377 }, 378 dashize: function() { 379 return this.replace(/[A-Z]/g, function(W) { 380 return ("-" + W.charAt(0).toLowerCase()) 381 }) 382 }, 383 jToInt: function(W) { 384 return parseInt(this, W || 10) 385 }, 386 toFloat: function() { 387 return parseFloat(this) 388 }, 389 jToBool: function() { 390 return !this.replace(/true/i, "").jTrim() 391 }, 392 has: function(X, W) { 393 W = W || ""; 394 return (W + this + W).indexOf(W + X + W) > -1 395 } 396 }); 397 S.implement(Function, { 398 $J_TYPE: "function", 399 jBind: function() { 400 var X = M.$A(arguments), 401 W = this, 402 Y = X.shift(); 403 return function() { 404 return W.apply(Y || null, X.concat(M.$A(arguments))) 405 } 406 }, 407 jBindAsEvent: function() { 408 var X = M.$A(arguments), 409 W = this, 410 Y = X.shift(); 411 return function(Z) { 412 return W.apply(Y || null, M.$([Z || (M.browser.ieMode ? window.event : null)]).concat(X)) 413 } 414 }, 415 jDelay: function() { 416 var X = M.$A(arguments), 417 W = this, 418 Y = X.shift(); 419 return window.setTimeout(function() { 420 return W.apply(W, X) 421 }, Y || 0) 422 }, 423 jDefer: function() { 424 var X = M.$A(arguments), 425 W = this; 426 return function() { 427 return W.jDelay.apply(W, X) 428 } 429 }, 430 interval: function() { 431 var X = M.$A(arguments), 432 W = this, 433 Y = X.shift(); 434 return window.setInterval(function() { 435 return W.apply(W, X) 436 }, Y || 0) 437 } 438 }); 439 var T = {}; 440 var L = navigator.userAgent.toLowerCase(); 441 var K = L.match(/(webkit|gecko|trident|presto)\/(\d+\.?\d*)/i); 442 var P = L.match(/(edge|opr)\/(\d+\.?\d*)/i) || L.match(/(crios|chrome|safari|firefox|opera|opr)\/(\d+\.?\d*)/i); 443 var R = L.match(/version\/(\d+\.?\d*)/i); 444 var G = document.documentElement.style; 445 446 function H(X) { 447 var W = X.charAt(0).toUpperCase() + X.slice(1); 448 return X in G || ("Webkit" + W) in G || ("Moz" + W) in G || ("ms" + W) in G || ("O" + W) in G 449 } 450 M.browser = { 451 features: { 452 xpath: !!(document.evaluate), 453 air: !!(window.runtime), 454 query: !!(document.querySelector), 455 fullScreen: !!(document.fullscreenEnabled || document.msFullscreenEnabled || document.exitFullscreen || document.cancelFullScreen || document.webkitexitFullscreen || document.webkitCancelFullScreen || document.mozCancelFullScreen || document.oCancelFullScreen || document.msCancelFullScreen), 456 xhr2: !!(window.ProgressEvent) && !!(window.FormData) && (window.XMLHttpRequest && "withCredentials" in new XMLHttpRequest), 457 transition: H("transition"), 458 transform: H("transform"), 459 perspective: H("perspective"), 460 animation: H("animation"), 461 requestAnimationFrame: false, 462 multibackground: false, 463 cssFilters: false,
464 canvas: false, 465 svg: (function() { 466 return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1") 467 }()) 468 }, 469 touchScreen: (function() { 470 return "ontouchstart" in window || (window.DocumentTouch && document instanceof DocumentTouch) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0) 471 }()), 472 mobile: !!L.match(/(android|bb\d+|meego).+|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/), 473 engine: (K && K[1]) ? K[1].toLowerCase() : (window.opera) ? "presto" : !!(window.ActiveXObject) ? "trident" : (document.getBoxObjectFor !== undefined || window.mozInnerScreenY !== null) ? "gecko" : (window.WebKitPoint !== null || !navigator.taintEnabled) ? "webkit" : "unknown", 474 version: (K && K[2]) ? parseFloat(K[2]) : 0, 475 uaName: (P && P[1]) ? P[1].toLowerCase() : "", 476 uaVersion: (P && P[2]) ? parseFloat(P[2]) : 0, 477 cssPrefix: "", 478 cssDomPrefix: "", 479 domPrefix: "", 480 ieMode: 0, 481 platform: L.match(/ip(?:ad|od|hone)/) ? "ios" : (L.match(/(?:webos|android)/) || navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(), 482 backCompat: document.compatMode && document.compatMode.toLowerCase() === "backcompat", 483 scrollbarsWidth: 0, 484 getDoc: function() { 485 return (document.compatMode && document.compatMode.toLowerCase() === "backcompat") ? document.body : document.documentElement 486 }, 487 requestAnimationFrame: window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || undefined, 488 cancelAnimationFrame: window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame || window.webkitCancelRequestAnimationFrame || undefined, 489 ready: false, 490 onready: function() { 491 if (M.browser.ready) { 492 return 493 } 494 var Z; 495 var Y; 496 M.browser.ready = true; 497 M.body = M.$(document.body); 498 M.win = M.$(window); 499 try { 500 var X = M.$new("div").jSetCss({ 501 width: 100, 502 height: 100, 503 overflow: "scroll", 504 position: "absolute", 505 top: -9999 506 }).jAppendTo(document.body); 507 M.browser.scrollbarsWidth = X.offsetWidth - X.clientWidth; 508 X.jRemove() 509 } catch (W) {} 510 try { 511 Z = M.$new("div"); 512 Y = Z.style; 513 Y.cssText = "background:url(https://),url(https://),red url(https://)"; 514 M.browser.features.multibackground = (/(url\s*\(.*?){3}/).test(Y.background); 515 Y = null; 516 Z = null 517 } catch (W) {} 518 if (!M.browser.cssTransformProp) { 519 M.browser.cssTransformProp = M.normalizeCSS("transform").dashize() 520 } 521 try { 522 Z = M.$new("div"); 523 Z.style.cssText = M.normalizeCSS("filter").dashize() + ":blur(2px);"; 524 M.browser.features.cssFilters = !!Z.style.length && (!M.browser.ieMode || M.browser.ieMode > 9); 525 Z = null 526 } catch (W) {} 527 if (!M.browser.features.cssFilters) { 528 M.$(document.documentElement).jAddClass("no-cssfilters-magic") 529 } 530 try { 531 M.browser.features.canvas = (function() { 532 var aa = M.$new("canvas"); 533 return !!(aa.getContext && aa.getContext("2d")) 534 }()) 535 } catch (W) {} 536 if (window.TransitionEvent === undefined && window.WebKitTransitionEvent !== undefined) { 537 T.transitionend = "webkitTransitionEnd" 538 } 539 M.Doc.jCallEvent.call(M.$(document), "domready") 540 } 541 }; 542 (function() { 543 var X = [], 544 aa, Z, ab; 545 546 function W() { 547 return !!(arguments.callee.caller) 548 } 549 switch (M.browser.engine) { 550 case "trident": 551 if (!M.browser.version) { 552 M.browser.version = !!(window.XMLHttpRequest) ? 3 : 2 553 } 554 break; 555 case "gecko": 556 M.browser.version = (P && P[2]) ? parseFloat(P[2]) : 0; 557 break 558 } 559 M.browser[M.browser.engine] = true; 560 if (P && P[1] === "crios") { 561 M.browser.uaName = "chrome" 562 } 563 if (!!window.chrome) { 564 M.browser.chrome = true 565 } 566 if (P && P[1] === "opr") { 567 M.browser.uaName = "opera"; 568 M.browser.opera = true 569 } 570 if (M.browser.uaName === "safari" && (R && R[1])) { 571 M.browser.uaVersion = parseFloat(R[1]) 572 } 573 if (M.browser.platform === "android" && M.browser.webkit && (R && R[1])) { 574 M.browser.androidBrowser = true 575 } 576 aa = ({ 577 gecko: ["-moz-", "Moz", "moz"], 578 webkit: ["-webkit-", "Webkit", "webkit"], 579 trident: ["-ms-", "ms", "ms"], 580 presto: ["-o-", "O", "o"] 581 })[M.browser.engine] || ["", "", ""]; 582 M.browser.cssPrefix = aa[0]; 583 M.browser.cssDomPrefix = aa[1]; 584 M.browser.domPrefix = aa[2]; 585 M.browser.ieMode = !M.browser.trident ? undefined : (document.documentMode) ? document.documentMode : (function() { 586 var ac = 0; 587 if (M.browser.backCompat) { 588 return 5 589 } 590 switch (M.browser.version) { 591 case 2: 592 ac = 6; 593 break; 594 case 3: 595 ac = 7; 596 break 597 } 598 return ac 599 }());
600 X.push(M.browser.platform + "-magic"); 601 if (M.browser.mobile) { 602 X.push("mobile-magic") 603 } 604 if (M.browser.androidBrowser) { 605 X.push("android-browser-magic") 606 } 607 if (M.browser.ieMode) { 608 M.browser.uaName = "ie"; 609 M.browser.uaVersion = M.browser.ieMode; 610 X.push("ie" + M.browser.ieMode + "-magic"); 611 for (Z = 11; Z > M.browser.ieMode; Z--) { 612 X.push("lt-ie" + Z + "-magic") 613 } 614 } 615 if (M.browser.webkit && M.browser.version < 536) { 616 M.browser.features.fullScreen = false 617 } 618 if (M.browser.requestAnimationFrame) { 619 M.browser.requestAnimationFrame.call(window, function() { 620 M.browser.features.requestAnimationFrame = true 621 }) 622 } 623 if (M.browser.features.svg) { 624 X.push("svg-magic") 625 } else { 626 X.push("no-svg-magic") 627 } 628 ab = (document.documentElement.className || "").match(/\S+/g) || []; 629 document.documentElement.className = M.$(ab).concat(X).join(" "); 630 try { 631 document.documentElement.setAttribute("data-magic-ua", M.browser.uaName); 632 document.documentElement.setAttribute("data-magic-ua-ver", M.browser.uaVersion) 633 } catch (Y) {} 634 if (M.browser.ieMode && M.browser.ieMode < 9) { 635 document.createElement("figure"); 636 document.createElement("figcaption") 637 } 638 if (!window.navigator.pointerEnabled) { 639 M.$(["Down", "Up", "Move", "Over", "Out"]).jEach(function(ac) { 640 T["pointer" + ac.toLowerCase()] = window.navigator.msPointerEnabled ? "MSPointer" + ac : -1 641 }) 642 } 643 }()); 644 (function() { 645 M.browser.fullScreen = { 646 capable: M.browser.features.fullScreen, 647 enabled: function() { 648 return !!(document.fullscreenElement || document[M.browser.domPrefix + "FullscreenElement"] || document.fullScreen || document.webkitIsFullScreen || document[M.browser.domPrefix + "FullScreen"]) 649 }, 650 request: function(W, X) { 651 if (!X) { 652 X = {} 653 } 654 if (this.capable) { 655 M.$(document).jAddEvent(this.changeEventName, this.onchange = function(Y) { 656 if (this.enabled()) { 657 if (X.onEnter) { 658 X.onEnter() 659 } 660 } else { 661 M.$(document).jRemoveEvent(this.changeEventName, this.onchange); 662 if (X.onExit) { 663 X.onExit() 664 } 665 } 666 }.jBindAsEvent(this)); 667 M.$(document).jAddEvent(this.errorEventName, this.onerror = function(Y) { 668 if (X.fallback) { 669 X.fallback() 670 } 671 M.$(document).jRemoveEvent(this.errorEventName, this.onerror) 672 }.jBindAsEvent(this)); 673 (W.requestFullscreen || W[M.browser.domPrefix + "RequestFullscreen"] || W[M.browser.domPrefix + "RequestFullScreen"] || function() {}).call(W) 674 } else { 675 if (X.fallback) { 676 X.fallback() 677 } 678 } 679 }, 680 cancel: (document.exitFullscreen || document.cancelFullScreen || document[M.browser.domPrefix + "ExitFullscreen"] || document[M.browser.domPrefix + "CancelFullScreen"] || function() {}).jBind(document), 681 changeEventName: document.msExitFullscreen ? "MSFullscreenChange" : (document.exitFullscreen ? "" : M.browser.domPrefix) + "fullscreenchange", 682 errorEventName: document.msExitFullscreen ? "MSFullscreenError" : (document.exitFullscreen ? "" : M.browser.domPrefix) + "fullscreenerror", 683 prefix: M.browser.domPrefix, 684 activeElement: null 685 } 686 }()); 687 var V = /\S+/g,
688 J = /^(border(Top|Bottom|Left|Right)Width)|((padding|margin)(Top|Bottom|Left|Right))$/, 689 O = { 690 "float": ("undefined" === typeof(G.styleFloat)) ? "cssFloat" : "styleFloat" 691 }, 692 Q = { 693 fontWeight: true, 694 lineHeight: true, 695 opacity: true, 696 zIndex: true, 697 zoom: true 698 }, 699 I = (window.getComputedStyle) ? function(Y, W) { 700 var X = window.getComputedStyle(Y, null); 701 return X ? X.getPropertyValue(W) || X[W] : null 702 } : function(Z, X) { 703 var Y = Z.currentStyle, 704 W = null; 705 W = Y ? Y[X] : null; 706 if (null == W && Z.style && Z.style[X]) { 707 W = Z.style[X] 708 } 709 return W 710 }; 711 712 function U(Y) { 713 var W, X; 714 X = (M.browser.webkit && "filter" == Y) ? false : (Y in G); 715 if (!X) { 716 W = M.browser.cssDomPrefix + Y.charAt(0).toUpperCase() + Y.slice(1); 717 if (W in G) { 718 return W 719 } 720 } 721 return Y 722 } 723 M.normalizeCSS = U; 724 M.Element = { 725 jHasClass: function(W) { 726 return !(W || "").has(" ") && (this.className || "").has(W, " ") 727 }, 728 jAddClass: function(aa) { 729 var X = (this.className || "").match(V) || [], 730 Z = (aa || "").match(V) || [], 731 W = Z.length, 732 Y = 0; 733 for (; Y < W; Y++) { 734 if (!M.$(X).contains(Z[Y])) { 735 X.push(Z[Y]) 736 } 737 } 738 this.className = X.join(" "); 739 return this 740 }, 741 jRemoveClass: function(ab) { 742 var X = (this.className || "").match(V) || [], 743 aa = (ab || "").match(V) || [], 744 W = aa.length, 745 Z = 0, 746 Y; 747 for (; Z < W; Z++) { 748 if ((Y = M.$(X).indexOf(aa[Z])) > -1) { 749 X.splice(Y, 1) 750 } 751 } 752 this.className = ab ? X.join(" ") : ""; 753 return this 754 }, 755 jToggleClass: function(W) { 756 return this.jHasClass(W) ? this.jRemoveClass(W) : this.jAddClass(W) 757 }, 758 jGetCss: function(X) { 759 var Y = X.jCamelize(), 760 W = null; 761 X = O[Y] || (O[Y] = U(Y)); 762 W = I(this, X); 763 if ("auto" === W) { 764 W = null 765 } 766 if (null !== W) { 767 if ("opacity" == X) { 768 return M.defined(W) ? parseFloat(W) : 1 769 } 770 if (J.test(X)) { 771 W = parseInt(W, 10) ? W : "0px" 772 } 773 } 774 return W 775 }, 776 jSetCssProp: function(X, W) { 777 var Z = X.jCamelize(); 778 try { 779 if ("opacity" == X) { 780 this.jSetOpacity(W); 781 return this 782 } 783 X = O[Z] || (O[Z] = U(Z)); 784 this.style[X] = W + (("number" == M.jTypeOf(W) && !Q[Z]) ? "px" : "") 785 } catch (Y) {} 786 return this 787 }, 788 jSetCss: function(X) { 789 for (var W in X) { 790 this.jSetCssProp(W, X[W]) 791 } 792 return this 793 }, 794 jGetStyles: function() { 795 var W = {}; 796 M.$A(arguments).jEach(function(X) { 797 W[X] = this.jGetCss(X) 798 }, this); 799 return W 800 }, 801 jSetOpacity: function(Y, W) { 802 var X; 803 W = W || false; 804 this.style.opacity = Y; 805 Y = parseInt(parseFloat(Y) * 100); 806 if (W) { 807 if (0 === Y) { 808 if ("hidden" != this.style.visibility) { 809 this.style.visibility = "hidden" 810 } 811 } else { 812 if ("visible" != this.style.visibility) { 813 this.style.visibility = "visible" 814 } 815 } 816 } 817 if (M.browser.ieMode && M.browser.ieMode < 9) { 818 if (!isNaN(Y)) { 819 if (!~this.style.filter.indexOf("Alpha")) { 820 this.style.filter += " progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Y + ")" 821 } else { 822 this.style.filter = this.style.filter.replace(/Opacity=\d*/i, "Opacity=" + Y) 823 } 824 } else { 825 this.style.filter = this.style.filter.replace(/progid:DXImageTransform.Microsoft.Alpha\(Opacity=\d*\)/i, "").jTrim(); 826 if ("" === this.style.filter) { 827 this.style.removeAttribute("filter") 828 } 829 } 830 } 831 return this 832 }, 833 setProps: function(W) { 834 for (var X in W) { 835 if ("class" === X) { 836 this.jAddClass("" + W[X]) 837 } else { 838 this.setAttribute(X, "" + W[X]) 839 } 840 } 841 return this 842 }, 843 jGetTransitionDuration: function() { 844 var X = 0, 845 W = 0; 846 X = this.jGetCss("transition-duration"); 847 W = this.jGetCss("transition-delay"); 848 X = X.indexOf("ms") > -1 ? parseFloat(X) : X.indexOf("s") > -1 ? parseFloat(X) * 1000 : 0; 849 W = W.indexOf("ms") > -1 ? parseFloat(W) : W.indexOf("s") > -1 ? parseFloat(W) * 1000 : 0; 850 return X + W 851 }, 852 hide: function() { 853 return this.jSetCss({ 854 display: "none", 855 visibility: "hidden" 856 }) 857 }, 858 show: function() { 859 return this.jSetCss({ 860 display: "", 861 visibility: "visible" 862 }) 863 }, 864 jGetSize: function() { 865 return { 866 width: this.offsetWidth, 867 height: this.offsetHeight 868 } 869 }, 870 getInnerSize: function(X) { 871 var W = this.jGetSize(); 872 W.width -= (parseFloat(this.jGetCss("border-left-width") || 0) + parseFloat(this.jGetCss("border-right-width") || 0)); 873 W.height -= (parseFloat(this.jGetCss("border-top-width") || 0) + parseFloat(this.jGetCss("border-bottom-width") || 0)); 874 if (!X) { 875 W.width -= (parseFloat(this.jGetCss("padding-left") || 0) + parseFloat(this.jGetCss("padding-right") || 0)); 876 W.height -= (parseFloat(this.jGetCss("padding-top") || 0) + parseFloat(this.jGetCss("padding-bottom") || 0)) 877 } 878 return W 879 }, 880 jGetScroll: function() { 881 return { 882 top: this.scrollTop, 883 left: this.scrollLeft 884 } 885 }, 886 jGetFullScroll: function() { 887 var W = this, 888 X = { 889 top: 0, 890 left: 0 891 }; 892 do { 893 X.left += W.scrollLeft || 0; 894 X.top += W.scrollTop || 0; 895 W = W.parentNode 896 } while (W); 897 return X 898 }, 899 jGetPosition: function() { 900 var aa = this, 901 X = 0, 902 Z = 0; 903 if (M.defined(document.documentElement.getBoundingClientRect)) { 904 var W = this.getBoundingClientRect(), 905 Y = M.$(document).jGetScroll(), 906 ab = M.browser.getDoc(); 907 return { 908 top: W.top + Y.y - ab.clientTop, 909 left: W.left + Y.x - ab.clientLeft 910 } 911 } 912 do { 913 X += aa.offsetLeft || 0; 914 Z += aa.offsetTop || 0; 915 aa = aa.offsetParent 916 } while (aa && !(/^(?:body|html)$/i).test(aa.tagName)); 917 return { 918 top: Z, 919 left: X 920 } 921 }, 922 jGetRect: function() { 923 var X = this.jGetPosition(); 924 var W = this.jGetSize(); 925 return { 926 top: X.top,
927 bottom: X.top + W.height, 928 left: X.left, 929 right: X.left + W.width 930 } 931 }, 932 changeContent: function(X) { 933 try { 934 this.innerHTML = X 935 } catch (W) { 936 this.innerText = X 937 } 938 return this 939 }, 940 jRemove: function() { 941 return (this.parentNode) ? this.parentNode.removeChild(this) : this 942 }, 943 kill: function() { 944 M.$A(this.childNodes).jEach(function(W) { 945 if (3 == W.nodeType || 8 == W.nodeType) { 946 return 947 } 948 M.$(W).kill() 949 }); 950 this.jRemove(); 951 this.jClearEvents(); 952 if (this.$J_UUID) { 953 M.storage[this.$J_UUID] = null; 954 delete M.storage[this.$J_UUID] 955 } 956 return null 957 }, 958 append: function(Y, X) { 959 X = X || "bottom"; 960 var W = this.firstChild; 961 ("top" == X && W) ? this.insertBefore(Y, W): this.appendChild(Y); 962 return this 963 }, 964 jAppendTo: function(Y, X) { 965 var W = M.$(Y).append(this, X); 966 return this 967 }, 968 enclose: function(W) { 969 this.append(W.parentNode.replaceChild(this, W)); 970 return this 971 }, 972 hasChild: function(W) { 973 if ("element" !== M.jTypeOf("string" == M.jTypeOf(W) ? W = document.getElementById(W) : W)) { 974 return false 975 } 976 return (this == W) ? false : (this.contains && !(M.browser.webkit419)) ? (this.contains(W)) : (this.compareDocumentPosition) ? !!(this.compareDocumentPosition(W) & 16) : M.$A(this.byTag(W.tagName)).contains(W) 977 } 978 }; 979 M.Element.jGetStyle = M.Element.jGetCss; 980 M.Element.jSetStyle = M.Element.jSetCss; 981 if (!window.Element) { 982 window.Element = M.$F; 983 if (M.browser.engine.webkit) { 984 window.document.createElement("iframe") 985 } 986 window.Element.prototype = (M.browser.engine.webkit) ? window["[[DOMElement.prototype]]"] : {} 987 } 988 M.implement(window.Element, { 989 $J_TYPE: "element" 990 }); 991 M.Doc = { 992 jGetSize: function() { 993 if (M.browser.touchScreen || M.browser.presto925 || M.browser.webkit419) { 994 return { 995 width: window.innerWidth, 996 height: window.innerHeight 997 } 998 } 999 return { 1000 width: M.browser.getDoc().clientWidth, 1001 height: M.browser.getDoc().clientHeight 1002 } 1003 }, 1004 jGetScroll: function() { 1005 return { 1006 x: window.pageXOffset || M.browser.getDoc().scrollLeft, 1007 y: window.pageYOffset || M.browser.getDoc().scrollTop 1008 } 1009 }, 1010 jGetFullSize: function() { 1011 var W = this.jGetSize(); 1012 return { 1013 width: Math.max(M.browser.getDoc().scrollWidth, W.width), 1014 height: Math.max(M.browser.getDoc().scrollHeight, W.height) 1015 } 1016 } 1017 }; 1018 M.extend(document, { 1019 $J_TYPE: "document" 1020 }); 1021 M.extend(window, { 1022 $J_TYPE: "window" 1023 }); 1024 M.extend([M.Element, M.Doc], { 1025 jFetch: function(Z, X) { 1026 var W = M.getStorage(this.$J_UUID), 1027 Y = W[Z]; 1028 if (undefined !== X && undefined === Y) { 1029 Y = W[Z] = X 1030 } 1031 return (M.defined(Y) ? Y : null) 1032 }, 1033 jStore: function(Y, X) { 1034 var W = M.getStorage(this.$J_UUID); 1035 W[Y] = X; 1036 return this 1037 }, 1038 jDel: function(X) { 1039 var W = M.getStorage(this.$J_UUID); 1040 delete W[X]; 1041 return this 1042 } 1043 }); 1044 if (!(window.HTMLElement && window.HTMLElement.prototype && window.HTMLElement.prototype.getElementsByClassName)) { 1045 M.extend([M.Element, M.Doc], { 1046 getElementsByClassName: function(W) { 1047 return M.$A(this.getElementsByTagName("*")).filter(function(Y) { 1048 try { 1049 return (1 == Y.nodeType && Y.className.has(W, " ")) 1050 } catch (X) {} 1051 }) 1052 } 1053 }) 1054 } 1055 M.extend([M.Element, M.Doc], { 1056 byClass: function() { 1057 return this.getElementsByClassName(arguments[0]) 1058 }, 1059 byTag: function() { 1060 return this.getElementsByTagName(arguments[0]) 1061 } 1062 }); 1063 if (M.browser.fullScreen.capable && !document.requestFullScreen) { 1064 M.Element.requestFullScreen = function() { 1065 M.browser.fullScreen.request(this) 1066 } 1067 } 1068 M.Event = { 1069 $J_TYPE: "event", 1070 isQueueStopped: M.$false, 1071 stop: function() { 1072 return this.stopDistribution().stopDefaults() 1073 }, 1074 stopDistribution: function() { 1075 if (this.stopPropagation) { 1076 this.stopPropagation() 1077 } else { 1078 this.cancelBubble = true 1079 } 1080 return this 1081 }, 1082 stopDefaults: function() { 1083 if (this.preventDefault) { 1084 this.preventDefault() 1085 } else { 1086 this.returnValue = false 1087 } 1088 return this 1089 }, 1090 stopQueue: function() { 1091 this.isQueueStopped = M.$true; 1092 return this 1093 }, 1094 getClientXY: function() {
1095 var W = (/touch/i).test(this.type) ? this.changedTouches[0] : this; 1096 return !M.defined(W) ? { 1097 x: 0, 1098 y: 0 1099 } : { 1100 x: W.clientX, 1101 y: W.clientY 1102 } 1103 }, 1104 jGetPageXY: function() { 1105 var W = (/touch/i).test(this.type) ? this.changedTouches[0] : this; 1106 return !M.defined(W) ? { 1107 x: 0, 1108 y: 0 1109 } : { 1110 x: W.pageX || W.clientX + M.browser.getDoc().scrollLeft, 1111 y: W.pageY || W.clientY + M.browser.getDoc().scrollTop 1112 } 1113 }, 1114 getTarget: function() { 1115 var W = this.target || this.srcElement; 1116 while (W && W.nodeType === 3) { 1117 W = W.parentNode 1118 } 1119 return W 1120 }, 1121 getRelated: function() { 1122 var X = null; 1123 switch (this.type) { 1124 case "mouseover": 1125 case "pointerover": 1126 case "MSPointerOver": 1127 X = this.relatedTarget || this.fromElement; 1128 break; 1129 case "mouseout": 1130 case "pointerout": 1131 case "MSPointerOut": 1132 X = this.relatedTarget || this.toElement; 1133 break; 1134 default: 1135 return X 1136 } 1137 try { 1138 while (X && X.nodeType === 3) { 1139 X = X.parentNode 1140 } 1141 } catch (W) { 1142 X = null 1143 } 1144 return X 1145 }, 1146 getButton: function() { 1147 if (!this.which && this.button !== undefined) { 1148 return (this.button & 1 ? 1 : (this.button & 2 ? 3 : (this.button & 4 ? 2 : 0))) 1149 } 1150 return this.which 1151 }, 1152 isTouchEvent: function() { 1153 return (this.pointerType && (this.pointerType === "touch" || this.pointerType === this.MSPOINTER_TYPE_TOUCH)) || (/touch/i).test(this.type) 1154 }, 1155 isPrimaryTouch: function() { 1156 if (this.pointerType) { 1157 return (this.pointerType === "touch" || this.MSPOINTER_TYPE_TOUCH === this.pointerType) && this.isPrimary 1158 } else { 1159 if (this instanceof window.TouchEvent) { 1160 return this.changedTouches.length === 1 && (this.targetTouches.length ? this.targetTouches[0].identifier === this.changedTouches[0].identifier : true) 1161 } 1162 } 1163 return false 1164 }, 1165 getPrimaryTouch: function() { 1166 if (this.pointerType) { 1167 return this.isPrimary && (this.pointerType === "touch" || this.MSPOINTER_TYPE_TOUCH === this.pointerType) ? this : null 1168 } else { 1169 if (this instanceof window.TouchEvent) { 1170 return this.changedTouches[0] 1171 } 1172 } 1173 return null 1174 }, 1175 getPrimaryTouchId: function() { 1176 if (this.pointerType) { 1177 return this.isPrimary && (this.pointerType === "touch" || this.MSPOINTER_TYPE_TOUCH === this.pointerType) ? this.pointerId : null 1178 } else { 1179 if (this instanceof window.TouchEvent) { 1180 return this.changedTouches[0].identifier 1181 } 1182 } 1183 return null 1184 } 1185 }; 1186 M._event_add_ = "addEventListener"; 1187 M._event_del_ = "removeEventListener"; 1188 M._event_prefix_ = ""; 1189 if (!document.addEventListener) { 1190 M._event_add_ = "attachEvent"; 1191 M._event_del_ = "detachEvent"; 1192 M._event_prefix_ = "on" 1193 } 1194 M.Event.Custom = { 1195 type: "", 1196 x: null, 1197 y: null, 1198 timeStamp: null, 1199 button: null, 1200 target: null, 1201 relatedTarget: null, 1202 $J_TYPE: "event.custom", 1203 isQueueStopped: M.$false, 1204 events: M.$([]), 1205 pushToEvents: function(W) { 1206 var X = W; 1207 this.events.push(X) 1208 }, 1209 stop: function() { 1210 return this.stopDistribution().stopDefaults() 1211 }, 1212 stopDistribution: function() { 1213 this.events.jEach(function(X) { 1214 try { 1215 X.stopDistribution() 1216 } catch (W) {} 1217 }); 1218 return this 1219 }, 1220 stopDefaults: function() { 1221 this.events.jEach(function(X) { 1222 try { 1223 X.stopDefaults() 1224 } catch (W) {} 1225 }); 1226 return this 1227 }, 1228 stopQueue: function() { 1229 this.isQueueStopped = M.$true; 1230 return this 1231 }, 1232 getClientXY: function() { 1233 return { 1234 x: this.clientX, 1235 y: this.clientY 1236 } 1237 }, 1238 jGetPageXY: function() { 1239 return { 1240 x: this.x, 1241 y: this.y 1242 } 1243 }, 1244 getTarget: function() { 1245 return this.target 1246 }, 1247 getRelated: function() { 1248 return this.relatedTarget 1249 }, 1250 getButton: function() { 1251 return this.button 1252 }, 1253 getOriginalTarget: function() { 1254 return this.events.length > 0 ? this.events[0].getTarget() : undefined 1255 }, 1256 isTouchEvent: function() { 1257 return (this.pointerType && (this.pointerType === "touch" || this.pointerType === this.MSPOINTER_TYPE_TOUCH)) || (/touch/i).test(this.t
1257ype) 1258 }, 1259 isPrimaryTouch: function() { 1260 if (this.pointerType) { 1261 return (this.pointerType === "touch" || this.MSPOINTER_TYPE_TOUCH === this.pointerType) && this.isPrimary 1262 } else { 1263 if (this instanceof window.TouchEvent) { 1264 return this.changedTouches.length === 1 && (this.targetTouches.length ? this.targetTouches[0].identifier === this.changedTouches[0].identifier : true) 1265 } 1266 } 1267 return false 1268 }, 1269 getPrimaryTouch: function() { 1270 if (this.pointerType) { 1271 return this.isPrimary && (this.pointerType === "touch" || this.MSPOINTER_TYPE_TOUCH === this.pointerType) ? this : null 1272 } else { 1273 if (this instanceof window.TouchEvent) { 1274 return this.changedTouches[0] 1275 } 1276 } 1277 return null 1278 }, 1279 getPrimaryTouchId: function() { 1280 if (this.pointerType) { 1281 return this.isPrimary && (this.pointerType === "touch" || this.MSPOINTER_TYPE_TOUCH === this.pointerType) ? this.pointerId : null 1282 } else { 1283 if (this instanceof window.TouchEvent) { 1284 return this.changedTouches[0].identifier 1285 } 1286 } 1287 return null 1288 } 1289 }; 1290 M.extend([M.Element, M.Doc], { 1291 jAddEvent: function(Y, aa, ab, ae) { 1292 var ad, W, Z, ac, X; 1293 if (M.jTypeOf(Y) === "string") { 1294 X = Y.split(" "); 1295 if (X.length > 1) { 1296 Y = X 1297 } 1298 } 1299 if (M.jTypeOf(Y) === "array") { 1300 M.$(Y).jEach(this.jAddEvent.jBindAsEvent(this, aa, ab, ae)); 1301 return this 1302 } 1303 Y = T[Y] || Y; 1304 if (!Y || !aa || M.jTypeOf(Y) !== "string" || M.jTypeOf(aa) !== "function") { 1305 return this 1306 } 1307 if (Y === "domready" && M.browser.ready) { 1308 aa.call(this); 1309 return this 1310 } 1311 ab = parseInt(ab || 50, 10); 1312 if (!aa.$J_EUID) { 1313 aa.$J_EUID = Math.floor(Math.random() * M.now()) 1314 } 1315 ad = M.Doc.jFetch.call(this, "_EVENTS_", {}); 1316 W = ad[Y]; 1317 if (!W) { 1318 ad[Y] = W = M.$([]); 1319 Z = this; 1320 if (M.Event.Custom[Y]) { 1321 M.Event.Custom[Y].handler.add.call(this, ae) 1322 } else { 1323 W.handle = function(af) { 1324 af = M.extend(af || window.e, { 1325 $J_TYPE: "event" 1326 }); 1327 M.Doc.jCallEvent.call(Z, Y, M.$(af)) 1328 }; 1329 this[M._event_add_](M._event_prefix_ + Y, W.handle, false) 1330 } 1331 } 1332 ac = { 1333 type: Y, 1334 fn: aa, 1335 priority: ab, 1336 euid: aa.$J_EUID 1337 }; 1338 W.push(ac); 1339 W.sort(function(ag, af) { 1340 return ag.priority - af.priority 1341 }); 1342 return this 1343 }, 1344 jRemoveEvent: function(ac) { 1345 var aa = M.Doc.jFetch.call(this, "_EVENTS_", {}); 1346 var Y; 1347 var W; 1348 var X; 1349 var ad; 1350 var ab; 1351 var Z; 1352 ab = arguments.length > 1 ? arguments[1] : -100; 1353 if (M.jTypeOf(ac) === "string") { 1354 Z = ac.split(" "); 1355 if (Z.length > 1) { 1356 ac = Z 1357 } 1358 } 1359 if (M.jTypeOf(ac) === "array") { 1360 M.$(ac).jEach(this.jRemoveEvent.jBindAsEvent(this, ab)); 1361 return this 1362 } 1363 ac = T[ac] || ac; 1364 if (!ac || M.jTypeOf(ac) !== "string" || !aa || !aa[ac]) { 1365 return this 1366 } 1367 Y = aa[ac] || []; 1368 for (X = 0; X < Y.length; X++) { 1369 W = Y[X]; 1370 if (ab === -100 || !!ab && ab.$J_EUID === W.euid) { 1371 ad = Y.splice(X--, 1) 1372 } 1373 } 1374 if (Y.length === 0) { 1375 if (M.Event.Custom[ac]) { 1376 M.Event.Custom[ac].handler.jRemove.call(this) 1377 } else { 1378 this[M._event_del_](M._event_prefix_ + ac, Y.handle, false) 1379 } 1380 delete aa[ac] 1381 } 1382 return this 1383 }, 1384 jCallEvent: function(Z, ab) { 1385 var Y = M.Doc.jFetch.call(this, "_EVENTS_", {}); 1386 var X; 1387 var W; 1388 Z = T[Z] || Z; 1389 if (!Z || M.jTypeOf(Z) !== "string" || !Y || !Y[Z]) { 1390 return this 1391 } 1392 try { 1393 ab = M.extend(ab || {}, { 1394 type: Z 1395 }) 1396 } catch (aa) {} 1397 if (ab.timeStamp === undefined) { 1398 ab.timeStamp = M.now() 1399 } 1400 X = Y[Z] || []; 1401 for (W = 0; W < X.length && !(ab.isQueueStopped && ab.isQueueStopped()); W++) { 1402 X[W].fn.call(this, ab) 1403 } 1404 }, 1405 jRaiseEvent: function(X, W) { 1406 var aa = (X !== "domready"); 1407 var Z = this; 1408 var Y; 1409 X = T[X] || X; 1410 if (!aa) { 1411 M.Doc.jCallEvent.call(this, X); 1412 return this 1413 } 1414 if (Z === document && document.createEvent && !Z.dispatchEvent) { 1415 Z = document.documentElement 1416 } 1417 if (document.createEvent) { 1418 Y = document.createEvent(X); 1419 Y.initEvent(W, true, true) 1420 } else { 1421 Y = document.createEventObject(); 1422 Y.eventType = X 1423 } if (document.createEvent) { 1424 Z.dispatchEvent(Y) 1425 } else { 1426 Z.fireEvent("on" + W, Y) 1427 } 1428 return Y 1429 }, 1430 jClearEvents: function() { 1431 var X = M.Doc.jFetch.call(this, "_EVENTS_"); 1432 if (!X) { 1433 return this 1434 } 1435 for (var W in X) { 1436 M.Doc.jRemoveEvent.call(this, W) 1437 } 1438 M.Doc.jDel.call(this, "_EVENTS_"); 1439 return this 1440 } 1441 }); 1442 (function(W) { 1443 if (document.readyState === "complete") { 1444 return W.browser.onready.jDelay(1) 1445 } 1446 if (W.browser.webkit && W.browser.version < 420) { 1447 (function() { 1448 if (W.$(["loaded", "complete"]).contains(document.readyState)) { 1449 W.browser.onready() 1450 } else { 1451 arguments.callee.jDelay(50) 1452 } 1453 }()) 1454 } else { 1455 if (W.browser.trident && W.browser.ieMode < 9 && window === top) { 1456 (function() { 1457 if (W.$try(function() { 1458 W.browser.getDoc().doScroll("left"); 1459 return true 1460 })) { 1461 W.browser.onready() 1462 } else { 1463 arguments.callee.jDelay(50) 1464 } 1465 }()) 1466 } else { 1467 W.Doc.jAddEvent.call(W.$(document), "DOMContentLoaded", W.browser.onready); 1468 W.Doc.jAddEvent.call(W.$(window), "load", W.browser.onready) 1469 } 1470 } 1471 }(S)); 1472 M.Class = function() { 1473 var aa = null, 1474 X = M.$A(arguments); 1475 if ("class" == M.jTypeOf(X[0])) { 1476 aa = X.shift() 1477 } 1478 var W = function() { 1479 for (var ad in this) { 1480 this[ad] = M.detach(this[ad]) 1481 } 1482 if (this.constructor.$parent) { 1483 this.$parent = {}; 1484 var af = this.constructor.$parent; 1485 for (var ae in af) { 1486 var ac = af[ae]; 1487 switch (M.jTypeOf(ac)) { 1488 case "function": 1489 this.$parent[ae] = M.Class.wrap(this, ac); 1490 break; 1491 case "object": 1492 this.$parent[ae] = M.detach(ac); 1493 break; 1494 case "array": 1495 this.$parent[ae] = M.detach(ac); 1496 break 1497 } 1498 } 1499 } 1500 var ab = (this.init) ? this.init.apply(this, arguments) : this; 1501 delete this.caller; 1502 return ab 1503 }; 1504 if (!W.prototype.init) { 1505 W.prototype.init = M.$F 1506 } 1507 if (aa) { 1508 var Z = function() {}; 1509 Z.prototype = aa.prototype; 1510 W.prototype = new Z; 1511 W.$parent = {}; 1512 for (var Y in aa.prototype) { 1513 W.$parent[Y] = aa.prototype[Y] 1514 } 1515 } else { 1516 W.$parent = null 1517 } 1518 W.constructor = M.Class; 1519 W.prototype.constructor = W; 1520 M.extend(W.prototype, X[0]); 1521 M.extend(W, { 1522 $J_TYPE: "class" 1523 }); 1524 return W 1525 }; 1526 S.Class.wrap = function(W, X) { 1527 return function() { 1528 var Z = this.caller; 1529 var Y = X.apply(W, arguments); 1530 return Y 1531 } 1532 }; 1533 (function(Z) { 1534 var Y = Z.$; 1535 var W = 5, 1536 X = 300; 1537 Z.Event.Custom.btnclick = new Z.Class(Z.extend(Z.Event.Custom, { 1538 type: "btnclick", 1539 init: function(ac, ab) { 1540 var aa = ab.jGetPageXY(); 1541 this.x = aa.x; 1542 this.y = aa.y; 1543 this.clientX = ab.clientX; 1544 this.clientY = ab.clientY; 1545 this.timeStamp = ab.timeStamp; 1546 this.button = ab.getButton(); 1547 this.target = ac; 1548 this.pushToEvents(ab) 1549 } 1550 })); 1551 Z.Event.Custom.btnclick.handler = { 1552 options: { 1553 threshold: X, 1554 button: 1 1555 }, 1556 add: function(aa) { 1557 this.jStore("event:btnclick:options", Z.extend(Z.detach(Z.Event.Custom.btnclick.handler.options), aa || {})); 1558 this.jAddEvent("mousedown", Z.Event.Custom.btnclick.handler.handle, 1); 1559 this.jAddEvent("mouseup", Z.Event.Custom.btnclick.handler.handle, 1); 1560 this.jAddEvent("click", Z.Event.Custom.btnclick.handler.oncl
1560ick, 1); 1561 if (Z.browser.trident && Z.browser.ieMode < 9) { 1562 this.jAddEvent("dblclick", Z.Event.Custom.btnclick.handler.handle, 1) 1563 } 1564 }, 1565 jRemove: function() { 1566 this.jRemoveEvent("mousedown", Z.Event.Custom.btnclick.handler.handle); 1567 this.jRemoveEvent("mouseup", Z.Event.Custom.btnclick.handler.handle); 1568 this.jRemoveEvent("click", Z.Event.Custom.btnclick.handler.onclick); 1569 if (Z.browser.trident && Z.browser.ieMode < 9) { 1570 this.jRemoveEvent("dblclick", Z.Event.Custom.btnclick.handler.handle) 1571 } 1572 }, 1573 onclick: function(aa) { 1574 aa.stopDefaults() 1575 }, 1576 handle: function(ad) { 1577 var ac, aa, ab; 1578 aa = this.jFetch("event:btnclick:options"); 1579 if (ad.type != "dblclick" && ad.getButton() != aa.button) { 1580 return 1581 } 1582 if (this.jFetch("event:btnclick:ignore")) { 1583 this.jDel("event:btnclick:ignore"); 1584 return 1585 } 1586 if ("mousedown" == ad.type) { 1587 ac = new Z.Event.Custom.btnclick(this, ad); 1588 this.jStore("event:btnclick:btnclickEvent", ac) 1589 } else { 1590 if ("mouseup" == ad.type) { 1591 ac = this.jFetch("event:btnclick:btnclickEvent"); 1592 if (!ac) { 1593 return 1594 } 1595 ab = ad.jGetPageXY(); 1596 this.jDel("event:btnclick:btnclickEvent"); 1597 ac.pushToEvents(ad); 1598 if (ad.timeStamp - ac.timeStamp <= aa.threshold && Math.sqrt(Math.pow(ab.x - ac.x, 2) + Math.pow(ab.y - ac.y, 2)) <= W) { 1599 this.jCallEvent("btnclick", ac) 1600 } 1601 document.jCallEvent("mouseup", ad) 1602 } else { 1603 if (ad.type == "dblclick") { 1604 ac = new Z.Event.Custom.btnclick(this, ad); 1605 this.jCallEvent("btnclick", ac) 1606 } 1607 } 1608 } 1609 } 1610 } 1611 })(S); 1612 (function(X) { 1613 var W = X.$; 1614 X.Event.Custom.mousedrag = new X.Class(X.extend(X.Event.Custom, { 1615 type: "mousedrag", 1616 state: "dragstart", 1617 dragged: false, 1618 init: function(ab, aa, Z) { 1619 var Y = aa.jGetPageXY(); 1620 this.x = Y.x; 1621 this.y = Y.y; 1622 this.clientX = aa.clientX; 1623 this.clientY = aa.clientY; 1624 this.timeStamp = aa.timeStamp; 1625 this.button = aa.getButton(); 1626 this.target = ab; 1627 this.pushToEvents(aa); 1628 this.state = Z 1629 } 1630 })); 1631 X.Event.Custom.mousedrag.handler = { 1632 add: function() { 1633 var Z = X.Event.Custom.mousedrag.handler.handleMouseMove.jBindAsEvent(this), 1634 Y = X.Event.Custom.mousedrag.handler.handleMouseUp.jBindAsEvent(this); 1635 this.jAddEvent("mousedown", X.Event.Custom.mousedrag.handler.handleMouseDown, 1); 1636 this.jAddEvent("mouseup", X.Event.Custom.mousedrag.handler.handleMouseUp, 1); 1637 document.jAddEvent("mousemove", Z, 1); 1638 document.jAddEvent("mouseup", Y, 1); 1639 this.jStore("event:mousedrag:listeners:document:move", Z); 1640 this.jStore("event:mousedrag:listeners:document:end", Y) 1641 }, 1642 jRemove: function() { 1643 this.jRemoveEvent("mousedown", X.Event.Custom.mousedrag.handler.handleMouseDown);
1644 this.jRemoveEvent("mouseup", X.Event.Custom.mousedrag.handler.handleMouseUp); 1645 W(document).jRemoveEvent("mousemove", this.jFetch("event:mousedrag:listeners:document:move") || X.$F); 1646 W(document).jRemoveEvent("mouseup", this.jFetch("event:mousedrag:listeners:document:end") || X.$F); 1647 this.jDel("event:mousedrag:listeners:document:move"); 1648 this.jDel("event:mousedrag:listeners:document:end") 1649 }, 1650 handleMouseDown: function(Z) { 1651 var Y; 1652 if (1 != Z.getButton()) { 1653 return 1654 } 1655 Y = new X.Event.Custom.mousedrag(this, Z, "dragstart"); 1656 this.jStore("event:mousedrag:dragstart", Y) 1657 }, 1658 handleMouseUp: function(Z) { 1659 var Y; 1660 Y = this.jFetch("event:mousedrag:dragstart"); 1661 if (!Y) { 1662 return 1663 } 1664 Z.stopDefaults(); 1665 Y = new X.Event.Custom.mousedrag(this, Z, "dragend"); 1666 this.jDel("event:mousedrag:dragstart"); 1667 this.jCallEvent("mousedrag", Y) 1668 }, 1669 handleMouseMove: function(Z) { 1670 var Y; 1671 Y = this.jFetch("event:mousedrag:dragstart"); 1672 if (!Y) { 1673 return 1674 } 1675 Z.stopDefaults(); 1676 if (!Y.dragged) { 1677 Y.dragged = true; 1678 this.jCallEvent("mousedrag", Y) 1679 } 1680 Y = new X.Event.Custom.mousedrag(this, Z, "dragmove"); 1681 this.jCallEvent("mousedrag", Y) 1682 } 1683 } 1684 })(S); 1685 (function(X) { 1686 var W = X.$; 1687 X.Event.Custom.dblbtnclick = new X.Class(X.extend(X.Event.Custom, { 1688 type: "dblbtnclick", 1689 timedout: false, 1690 tm: null, 1691 init: function(aa, Z) { 1692 var Y = Z.jGetPageXY(); 1693 this.x = Y.x; 1694 this.y = Y.y; 1695 this.clientX = Z.clientX; 1696 this.clientY = Z.clientY; 1697 this.timeStamp = Z.timeStamp; 1698 this.button = Z.getButton(); 1699 this.target = aa; 1700 this.pushToEvents(Z) 1701 } 1702 })); 1703 X.Event.Custom.dblbtnclick.handler = { 1704 options: { 1705 threshold: 200 1706 }, 1707 add: function(Y) { 1708 this.jStore("event:dblbtnclick:options", X.extend(X.detach(X.Event.Custom.dblbtnclick.handler.options), Y || {})); 1709 this.jAddEvent("btnclick", X.Event.Custom.dblbtnclick.handler.handle, 1) 1710 }, 1711 jRemove: function() { 1712 this.jRemoveEvent("btnclick", X.Event.Custom.dblbtnclick.handler.handle) 1713 }, 1714 handle: function(aa) { 1715 var Z, Y; 1716 Z = this.jFetch("event:dblbtnclick:event"); 1717 Y = this.jFetch("event:dblbtnclick:options"); 1718 if (!Z) { 1719 Z = new X.Event.Custom.dblbtnclick(this, aa); 1720 Z.tm = setTimeout(function() { 1721 Z.timedout = true; 1722 aa.isQueueStopped = X.$false; 1723 this.jCallEvent("btnclick", aa); 1724 this.jDel("event:dblbtnclick:event") 1725 }.jBind(this), Y.threshold + 10); 1726 this.jStore("event:dblbtnclick:event", Z); 1727 aa.stopQueue() 1728 } else { 1729 clearTimeout(Z.tm); 1730 this.jDel("event:dblbtnclick:event"); 1731 if (!Z.timedout) { 1732 Z.pushToEvents(aa); 1733 aa.stopQueue().stop(); 1734 this.jCallEvent("dblbtnclick", Z) 1735 } else {} 1736 } 1737 } 1738 } 1739 })(S); 1740 (function(Z) { 1741 var Y = Z.$; 1742 var W = 10; 1743 var X = 200; 1744 Z.Event.Custom.tap = new Z.Class(Z.extend(Z.Event.Custom, { 1745 type: "tap", 1746 id: null, 1747 init: function(ab, aa) { 1748 var ac = aa.getPrimaryTouch(); 1749 this.id = ac.pointerId || ac.identifier; 1750 this.x = ac.pageX; 1751 this.y = ac.pageY; 1752 this.pageX = ac.pageX; 1753 this.pageY = ac.pageY; 1754 this.clientX = ac.clientX; 1755 this.clientY = ac.clientY; 1756 this.timeStamp = aa.timeStamp; 1757 this.button = 0; 1758 this.target = ab; 1759 this.pushToEvents(aa) 1760 } 1761 })); 1762 Z.Event.Custom.tap.handler = { 1763 add: function(aa) { 1764 this.jAddEvent(["touchstart", "pointerdown"], Z.Event.Custom.tap.handler.onTouchStart, 1); 1765 this.jAddEvent(["touchend", "pointerup"], Z.Event.Custom.tap.handler.onTouchEnd, 1); 1766 this.jAddEvent("click", Z.Event.Custom.tap.handler.onClick, 1) 1767 }, 1768 jRemove: function() { 1769 this.jRemoveEvent(["touchstart", "pointerdown"], Z.Event.Custom.tap.handler.onTouchStart); 1770 this.jRemoveEvent(["touchend", "pointerup"], Z.Event.Custom.tap.handler.onTouchEnd); 1771 this.jRemoveEvent("click", Z.Event.Custom.tap.handler.onClick) 1772 }, 1773 onClick: function(aa) { 1774 aa.stopDefaults() 1775 }, 1776 onTouchStart: function(aa) { 1777 if (!aa.isPrimaryTouch()) { 1778 this.jDel("event:tap:event"); 1779 return 1780 } 1781 this.jStore("event:tap:event", new Z.Event.Custom.tap(this, aa)); 1782 this.jStore("event:btnclick:ignore", true) 1783 }, 1784 onTouchEnd: function(ad) { 1785 var ab = Z.now(); 1786 var ac = this.jFetch("event:tap:event"); 1787 var aa = this.jFetch("event:tap:options"); 1788 if (!ac || !ad.isPrimaryTouch()) { 1789 return 1790 } 1791 this.jDel("event:tap:event"); 1792 if (ac.id === ad.getPrimaryTouchId() && ad.timeStamp - ac.timeStamp <= X && Math.sqrt(Math.pow(ad.getPrimaryTouch().pageX - ac.x, 2) + Math.pow(ad.getPrimaryTouch().pageY - ac.y, 2)) <= W) { 1793 this.jDel("event:btnclick:btnclickEvent"); 1794 ad.stop(); 1795 ac.pushToEvents(ad); 1796 this.jCallEvent("tap", ac) 1797 } 1798 } 1799 } 1800 }(S)); 1801 M.Event.Custom.dbltap = new M.Class(M.extend(M.Event.Custom, { 1802 type: "dbltap", 1803 timedout: false, 1804 tm: null, 1805 init: function(X, W) { 1806 this.x = W.x; 1807 this.y = W.y; 1808 this.clientX = W.clientX; 1809 this.clientY = W.clientY; 1810 this.timeStamp = W.timeStamp; 1811 this.button = 0; 1812 this.target = X; 1813 this.pushToEvents(W) 1814 } 1815 })); 1816 M.Event.Custom.dbltap.handler = { 1817 options: { 1818 threshold: 300 1819 }, 1820 add: function(W) { 1821 this.jStore("event:dbltap:options", M.extend(M.detach(M.Event.Custom.dbltap.handler.options), W || {})); 1822 this.jAddEvent("tap", M.Event.Custom.dbltap.handler.handle, 1) 1823 }, 1824 jRemove: function() { 1825 this.jRemoveEvent("tap", M.Event.Custom.dbltap.handler.handle) 1826 }, 1827 handle: function(Y) { 1828 var X, W; 1829 X = this.jFetch("event:dbltap:event"); 1830 W = this.jFetch("event:dbltap:options"); 1831 if (!X) { 1832 X = new M.Event.Custom.dbltap(this, Y); 1833 X.tm = setTimeout(function() { 1834 X.timedout = true; 1835 Y.isQueueStopped = M.$false; 1836 this.jCallEvent("tap", Y) 1837 }.jBind(this), W.threshold + 10);
1838 this.jStore("event:dbltap:event", X); 1839 Y.stopQueue() 1840 } else { 1841 clearTimeout(X.tm); 1842 this.jDel("event:dbltap:event"); 1843 if (!X.timedout) { 1844 X.pushToEvents(Y); 1845 Y.stopQueue().stop(); 1846 this.jCallEvent("dbltap", X) 1847 } else {} 1848 } 1849 } 1850 }; 1851 (function(Y) { 1852 var X = Y.$; 1853 var W = 10; 1854 Y.Event.Custom.touchdrag = new Y.Class(Y.extend(Y.Event.Custom, { 1855 type: "touchdrag", 1856 state: "dragstart", 1857 id: null, 1858 dragged: false, 1859 init: function(ab, aa, Z) { 1860 var ac = aa.getPrimaryTouch(); 1861 this.id = ac.pointerId || ac.identifier; 1862 this.clientX = ac.clientX; 1863 this.clientY = ac.clientY; 1864 this.pageX = ac.pageX; 1865 this.pageY = ac.pageY; 1866 this.x = ac.pageX; 1867 this.y = ac.pageY; 1868 this.timeStamp = aa.timeStamp; 1869 this.button = 0; 1870 this.target = ab; 1871 this.pushToEvents(aa); 1872 this.state = Z 1873 } 1874 })); 1875 Y.Event.Custom.touchdrag.handler = { 1876 add: function() { 1877 var aa = Y.Event.Custom.touchdrag.handler.onTouchMove.jBind(this); 1878 var Z = Y.Event.Custom.touchdrag.handler.onTouchEnd.jBind(this); 1879 this.jAddEvent(["touchstart", "pointerdown"], Y.Event.Custom.touchdrag.handler.onTouchStart, 1); 1880 this.jAddEvent(["touchend", "pointerup"], Y.Event.Custom.touchdrag.handler.onTouchEnd, 1); 1881 this.jAddEvent(["touchmove", "pointermove"], Y.Event.Custom.touchdrag.handler.onTouchMove, 1); 1882 this.jStore("event:touchdrag:listeners:document:move", aa); 1883 this.jStore("event:touchdrag:listeners:document:end", Z); 1884 X(document).jAddEvent("pointermove", aa, 1); 1885 X(document).jAddEvent("pointerup", Z, 1) 1886 }, 1887 jRemove: function() { 1888 this.jRemoveEvent(["touchstart", "pointerdown"], Y.Event.Custom.touchdrag.handler.onTouchStart); 1889 this.jRemoveEvent(["touchend", "pointerup"], Y.Event.Custom.touchdrag.handler.onTouchEnd); 1890 this.jRemoveEvent(["touchmove", "pointermove"], Y.Event.Custom.touchdrag.handler.onTouchMove); 1891 X(document).jRemoveEvent("pointermove", this.jFetch("event:touchdrag:listeners:document:move") || Y.$F, 1); 1892 X(document).jRemoveEvent("pointerup", this.jFetch("event:touchdrag:listeners:document:end") || Y.$F, 1); 1893 this.jDel("event:touchdrag:listeners:document:move"); 1894 this.jDel("event:touchdrag:listeners:document:end") 1895 }, 1896 onTouchStart: function(aa) { 1897 var Z; 1898 if (!aa.isPrimaryTouch()) { 1899 return 1900 } 1901 Z = new Y.Event.Custom.touchdrag(this, aa, "dragstart"); 1902 this.jStore("event:touchdrag:dragstart", Z) 1903 }, 1904 onTouchEnd: function(aa) { 1905 var Z; 1906 Z = this.jFetch("event:touchdrag:dragstart"); 1907 if (!Z || !Z.dragged || Z.id !== aa.getPrimaryTouchId()) { 1908 return 1909 } 1910 Z = new Y.Event.Custom.touchdrag(this, aa, "dragend"); 1911 this.jDel("event:touchdrag:dragstart"); 1912 this.jCallEvent("touchdrag", Z) 1913 }, 1914 onTouchMove: function(aa) { 1915 var Z; 1916 Z = this.jFetch("event:touchdrag:dragstart"); 1917 if (!Z || !aa.isPrimaryTouch()) { 1918 return 1919 } 1920 if (Z.id !== aa.getPrimaryTouchId()) { 1921 this.jDel("event:touchdrag:dragstart"); 1922 return 1923 } 1924 if (!Z.dragged && Math.sqrt(Math.pow(aa.getPrimaryTouch().pageX - Z.x, 2) + Math.pow(aa.getPrimaryTouch().pageY - Z.y, 2)) > W) { 1925 Z.dragged = true; 1926 this.jCallEvent("touchdrag", Z) 1927 } 1928 if (!Z.dragged) { 1929 return 1930 } 1931 Z = new Y.Event.Custom.touchdrag(this, aa, "dragmove"); 1932 this.jCallEvent("touchdrag", Z) 1933 } 1934 } 1935 }(S)); 1936 M.Event.Custom.touchpinch = new M.Class(M.extend(M.Event.Custom, { 1937 type: "touchpinch", 1938 scale: 1, 1939 previousScale: 1, 1940 curScale: 1, 1941 state: "pinchstart", 1942 init: function(X, W) { 1943 this.timeStamp = W.timeStamp; 1944 this.button = 0; 1945 this.target = X; 1946 this.x = W.touches[0].clientX + (W.touches[1].clientX - W.touches[0].clientX) / 2; 1947 this.y = W.touches[0].clientY + (W.touches[1].clientY - W.touches[0].clientY) / 2; 1948 this._initialDistance = Math.sqrt(Math.pow(W.touches[0].clientX - W.touches[1].clientX, 2) + Math.pow(W.touches[0].clientY - W.touches[1].clientY, 2)); 1949 this.pushToEvents(W) 1950 }, 1951 update: function(W) { 1952 var X; 1953 this.state = "pinchupdate"; 1954 if (W.changedTouches[0].identifier != this.events[0].touches[0].identifier || W.changedTouches[1].identifier != this.events[0].touches[1].identifier) { 1955 return 1956 } 1957 X = Math.sqrt(Math.pow(W.changedTouches[0].clientX - W.changedTouches[1].clientX, 2) + Math.pow(W.changedTouches[0].clientY - W.changedTouches[1].clientY, 2)); 1958 this.previousScale = this.scale; 1959 this.scale = X / this._initialDistance; 1960 this.curScale = this.scale / this.previousScale; 1961 this.x = W.changedTouches[0].clientX + (W.changedTouches[1].clientX - W.changedTouches[0].clientX) / 2; 1962 this.y = W.changedTouches[0].clientY + (W.changedTouches[1].clientY - W.changedTouches[0].clientY) / 2; 1963 this.pushToEvents(W) 1964 } 1965 })); 1966 M.Event.Custom.touchpinch.handler = { 1967 add: function() { 1968 this.jAddEvent("touchstart", M.Event.Custom.touchpinch.handler.handleTouchStart, 1); 1969 this.jAddEvent("touchend", M.Event.Custom.touchpinch.handler.handleTouchEnd, 1); 1970 this.jAddEvent("touchmove", M.Event.Custom.touchpinch.handler.handleTouchMove, 1) 1971 }, 1972 jRemove: function() { 1973 this.jRemoveEvent("touchstart", M.Event.Custom.touchpinch.handler.handleTouchStart); 1974 this.jRemoveEvent("touchend", M.Event.Custom.touchpinch.handler.handleTouchEnd); 1975 this.jRemoveEvent("touchmove", M.Event.Custom.touchpinch.handler.handleTouchMove) 1976 }, 1977 handleTouchStart: function(X) { 1978 var W; 1979 if (X.touches.length != 2) { 1980 return 1981 } 1982 X.stopDefaults(); 1983 W = new M.Event.Custom.touchpinch(this, X); 1984 this.jStore("event:touchpinch:event", W) 1985 }, 1986 handleTouchEnd: function(X) { 1987 var W; 1988 W = this.jFetch("event:touchpinch:event"); 1989 if (!W) { 1990 return 1991 } 1992 X.stopDefaults(); 1993 this.jDel("event:touchpinch:event") 1994 }, 1995 handleTouchMove: function(X) { 1996 var W; 1997 W = this.jFetch("event:touchpinch:event"); 1998 if (!W) { 1999 return 2000 } 2001 X.stopDefaults(); 2002 W.update(X); 2003 this.jCallEvent("touchpinch", W) 2004 } 2005 }; 2006 (function(ab) { 2007 var Z = ab.$; 2008 ab.Event.Custom.mousescroll = new ab.Class(ab.extend(ab.Event.Custom, { 2009 type: "mousescroll", 2010 init: function(ah, ag, aj, ad, ac, ai, ae) { 2011 var af = ag.jGetPageXY(); 2012 this.x = af.x; 2013 this.y = af.y; 2014 this.timeStamp = ag.timeStamp; 2015 this.target = ah; 2016 this.delta = aj || 0; 2017 this.deltaX = ad || 0; 2018 this.deltaY = ac || 0; 2019 this.deltaZ = ai || 0; 2020 this.deltaFactor = ae || 0; 2021 this.deltaMode = ag.deltaMode || 0; 2022 this.isMouse = false; 2023 this.pushToEvents(ag) 2024 } 2025 })); 2026 var aa, X; 2027 2028 function W() { 2029 aa = null 2030 } 2031 2032 function Y(ac, ad) { 2033 return (ac > 50) || (1 === ad && !("win" == ab.browser.platform && ac < 1)) || (0 === ac % 12) || (0 == ac % 4.000244140625) 2034 } 2035 ab.Event.Custom.mousescroll.handler = { 2036 eventType: "onwheel" in document || ab.browser.ieMode > 8 ? "wheel" : "mousewheel", 2037 add: function() { 2038 this.jAddEvent(ab.Event.Custom.mousescroll.handler.eventType, ab.Event.Custom.mousescroll.handler.handle, 1) 2039 }, 2040 jRemove: function() { 2041 this.jRemoveEvent(ab.Event.Custom.mousescroll.handler.eventType, ab.Event.Custom.mousescroll.handler.handle, 1) 2042 }, 2043 handle: function(ah) { 2044 var ai = 0, 2045 af = 0, 2046 ad = 0, 2047 ac = 0, 2048 ag, ae; 2049 if (ah.detail) { 2050 ad = ah.detail * -1 2051 } 2052 if (ah.wheelDelta !== undefined) { 2053 ad = ah.wheelDelta 2054 } 2055 if (ah.wheelDeltaY !== undefined) { 2056 ad = ah.wheelDeltaY 2057 } 2058 if (ah.wheelDeltaX !== undefined) { 2059 af = ah.wheelDeltaX * -1 2060 } 2061 if (ah.deltaY) { 2062 ad = -1 * ah.deltaY 2063 } 2064 if (ah.deltaX) { 2065 af = ah.deltaX 2066 } 2067 if (0 === ad && 0 === af) { 2068 return 2069 } 2070 ai = 0 === ad ? af : ad; 2071 ac = Math.max(Math.abs(ad), Math.abs(af)); 2072 if (!aa || ac < aa) { 2073 aa = ac 2074 } 2075 ag = ai > 0 ? "floor" : "ceil"; 2076 ai = Math[ag](ai / aa); 2077 af = Math[ag](af / aa); 2078 ad = Math[ag](ad / aa); 2079 if (X) { 2080 clearTimeout(X) 2081 } 2082 X = setTimeout(W, 200);
2083 ae = new ab.Event.Custom.mousescroll(this, ah, ai, af, ad, 0, aa); 2084 ae.isMouse = Y(aa, ah.deltaMode || 0); 2085 this.jCallEvent("mousescroll", ae) 2086 } 2087 } 2088 })(S); 2089 M.win = M.$(window); 2090 M.doc = M.$(document); 2091 return S 2092 })(); 2093 (function(I) { 2094 if (!I) { 2095 throw "MagicJS not found" 2096 } 2097 var H = I.$; 2098 var G = window.URL || window.webkitURL || null; 2099 v.ImageLoader = new I.Class({ 2100 img: null, 2101 ready: false, 2102 options: { 2103 onprogress: I.$F, 2104 onload: I.$F, 2105 onabort: I.$F, 2106 onerror: I.$F, 2107 oncomplete: I.$F, 2108 onxhrerror: I.$F, 2109 xhr: false, 2110 progressiveLoad: true 2111 }, 2112 size: null, 2113 _timer: null, 2114 loadedBytes: 0, 2115 _handlers: { 2116 onprogress: function(J) { 2117 if (J.target && (200 === J.target.status || 304 === J.target.status) && J.lengthComputable) { 2118 this.options.onprogress.jBind(null, (J.loaded - (this.options.progressiveLoad ? this.loadedBytes : 0)) / J.total).jDelay(1); 2119 this.loadedBytes = J.loaded 2120 } 2121 }, 2122 onload: function(J) { 2123 if (J) { 2124 H(J).stop() 2125 } 2126 this._unbind(); 2127 if (this.ready) { 2128 return 2129 } 2130 this.ready = true; 2131 this._cleanup(); 2132 !this.options.xhr && this.options.onprogress.jBind(null, 1).jDelay(1); 2133 this.options.onload.jBind(null, this).jDelay(1); 2134 this.options.oncomplete.jBind(null, this).jDelay(1) 2135 }, 2136 onabort: function(J) { 2137 if (J) { 2138 H(J).stop() 2139 } 2140 this._unbind(); 2141 this.ready = false; 2142 this._cleanup(); 2143 this.options.onabort.jBind(null, this).jDelay(1); 2144 this.options.oncomplete.jBind(null, this).jDelay(1) 2145 }, 2146 onerror: function(J) { 2147 if (J) { 2148 H(J).stop() 2149 } 2150 this._unbind(); 2151 this.ready = false; 2152 this._cleanup(); 2153 this.options.onerror.jBind(null, this).jDelay(1); 2154 this.options.oncomplete.jBind(null, this).jDelay(1) 2155 } 2156 }, 2157 _bind: function() { 2158 H(["load", "abort", "error"]).jEach(function(J) { 2159 this.img.jAddEvent(J, this._handlers["on" + J].jBindAsEvent(this).jDefer(1)) 2160 }, this) 2161 }, 2162 _unbind: function() { 2163 if (this._timer) { 2164 try { 2165 clearTimeout(this._timer) 2166 } catch (J) {} 2167 this._timer = null 2168 } 2169 H(["load", "abort", "error"]).jEach(function(K) { 2170 this.img.jRemoveEvent(K) 2171 }, this) 2172 }, 2173 _cleanup: function() { 2174 this.jGetSize(); 2175 if (this.img.jFetch("new")) { 2176 var J = this.img.parentNode; 2177 this.img.jRemove().jDel("new").jSetCss({ 2178 position: "static", 2179 top: "auto" 2180 }); 2181 J.kill() 2182 } 2183 }, 2184 loadBlob: function(K) { 2185 var L = new XMLHttpRequest(), 2186 J; 2187 H(["abort", "progress"]).jEach(function(M) { 2188 L["on" + M] = H(function(N) { 2189 this._handlers["on" + M].call(this, N) 2190 }).jBind(this) 2191 }, this); 2192 L.onerror = H(function() {
2193 this.options.onxhrerror.jBind(null, this).jDelay(1); 2194 this.options.xhr = false; 2195 this._bind(); 2196 this.img.src = K 2197 }).jBind(this); 2198 L.onload = H(function() { 2199 if (200 !== L.status && 304 !== L.status) { 2200 this._handlers.onerror.call(this); 2201 return 2202 } 2203 J = L.response; 2204 this._bind(); 2205 if (G && !I.browser.trident && !("ios" === I.browser.platform && I.browser.version < 537)) { 2206 this.img.setAttribute("src", G.createObjectURL(J)) 2207 } else { 2208 this.img.src = K 2209 } 2210 }).jBind(this); 2211 L.open("GET", K); 2212 L.responseType = "blob"; 2213 L.send() 2214 }, 2215 init: function(K, J) { 2216 this.options = I.extend(this.options, J); 2217 this.img = H(K) || I.$new("img", {}, { 2218 "max-width": "none", 2219 "max-height": "none" 2220 }).jAppendTo(I.$new("div").jAddClass("magic-temporary-img").jSetCss({ 2221 position: "absolute", 2222 top: -10000, 2223 width: 10, 2224 height: 10, 2225 overflow: "hidden" 2226 }).jAppendTo(document.body)).jStore("new", true); 2227 if (I.browser.features.xhr2 && this.options.xhr && "string" == I.jTypeOf(K)) { 2228 this.loadBlob(K); 2229 return 2230 } 2231 var L = function() { 2232 if (this.isReady()) { 2233 this._handlers.onload.call(this) 2234 } else { 2235 this._handlers.onerror.call(this) 2236 } 2237 L = null 2238 }.jBind(this); 2239 this._bind(); 2240 if ("string" == I.jTypeOf(K)) { 2241 this.img.src = K 2242 } else { 2243 if (I.browser.trident && 5 == I.browser.version && I.browser.ieMode < 9) { 2244 this.img.onreadystatechange = function() { 2245 if (/loaded|complete/.test(this.img.readyState)) { 2246 this.img.onreadystatechange = null; 2247 L && L() 2248 } 2249 }.jBind(this) 2250 } 2251 this.img.src = K.getAttribute("src") 2252 } 2253 this.img && this.img.complete && L && (this._timer = L.jDelay(100)) 2254 }, 2255 destroy: function() { 2256 this._unbind(); 2257 this._cleanup(); 2258 this.ready = false; 2259 return this 2260 }, 2261 isReady: function() { 2262 var J = this.img; 2263 return (J.naturalWidth) ? (J.naturalWidth > 0) : (J.readyState) ? ("complete" == J.readyState) : J.width > 0 2264 }, 2265 jGetSize: function() { 2266 return this.size || (this.size = { 2267 width: this.img.naturalWidth || this.img.width, 2268 height: this.img.naturalHeight || this.img.height 2269 }) 2270 } 2271 }) 2272 })(v); 2273 (function(H) { 2274 if (!H) { 2275 throw "MagicJS not found" 2276 } 2277 if (H.FX) { 2278 return 2279 } 2280 var G = H.$; 2281 H.FX = new H.Class({ 2282 init: function(J, I) { 2283 var K; 2284 this.el = H.$(J); 2285 this.options = H.extend(this.options, I); 2286 this.timer = false; 2287 this.easeFn = this.cubicBezierAtTime; 2288 K = H.FX.Transition[this.options.transition] || this.options.transition; 2289 if ("function" === H.jTypeOf(K)) { 2290 this.easeFn = K 2291 } else { 2292 this.cubicBezier = this.parseCubicBezier(K) || this.parseCubicBezier("ease") 2293 } if ("string" == H.jTypeOf(this.options.cycles)) { 2294 this.options.cycles = "infinite" === this.options.cycles ? Infinity : parseInt(this.options.cycles) || 1 2295 } 2296 }, 2297 options: { 2298 fps: 60, 2299 duration: 600, 2300 transition: "ease", 2301 cycles: 1,
2302 direction: "normal", 2303 onStart: H.$F, 2304 onComplete: H.$F, 2305 onBeforeRender: H.$F, 2306 onAfterRender: H.$F, 2307 forceAnimation: false, 2308 roundCss: false 2309 }, 2310 styles: null, 2311 cubicBezier: null, 2312 easeFn: null, 2313 setTransition: function(I) { 2314 this.options.transition = I; 2315 I = H.FX.Transition[this.options.transition] || this.options.transition; 2316 if ("function" === H.jTypeOf(I)) { 2317 this.easeFn = I 2318 } else { 2319 this.easeFn = this.cubicBezierAtTime; 2320 this.cubicBezier = this.parseCubicBezier(I) || this.parseCubicBezier("ease") 2321 } 2322 }, 2323 start: function(K) { 2324 var I = /\%$/, 2325 J; 2326 this.styles = K || {}; 2327 this.cycle = 0; 2328 this.state = 0; 2329 this.curFrame = 0; 2330 this.pStyles = {}; 2331 this.alternate = "alternate" === this.options.direction || "alternate-reverse" === this.options.direction; 2332 this.continuous = "continuous" === this.options.direction || "continuous-reverse" === this.options.direction; 2333 for (J in this.styles) { 2334 I.test(this.styles[J][0]) && (this.pStyles[J] = true); 2335 if ("reverse" === this.options.direction || "alternate-reverse" === this.options.direction || "continuous-reverse" === this.options.direction) { 2336 this.styles[J].reverse() 2337 } 2338 } 2339 this.startTime = H.now(); 2340 this.finishTime = this.startTime + this.options.duration; 2341 this.options.onStart.call(); 2342 if (0 === this.options.duration) { 2343 this.render(1); 2344 this.options.onComplete.call() 2345 } else { 2346 this.loopBind = this.loop.jBind(this); 2347 if (!this.options.forceAnimation && H.browser.features.requestAnimationFrame) { 2348 this.timer = H.browser.requestAnimationFrame.call(window, this.loopBind) 2349 } else { 2350 this.timer = this.loopBind.interval(Math.round(1000 / this.options.fps)) 2351 } 2352 } 2353 return this 2354 }, 2355 stopAnimation: function() { 2356 if (this.timer) { 2357 if (!this.options.forceAnimation && H.browser.features.requestAnimationFrame && H.browser.cancelAnimationFrame) { 2358 H.browser.cancelAnimationFrame.call(window, this.timer) 2359 } else { 2360 clearInterval(this.timer) 2361 } 2362 this.timer = false 2363 } 2364 }, 2365 stop: function(I) { 2366 I = H.defined(I) ? I : false; 2367 this.stopAnimation(); 2368 if (I) { 2369 this.render(1); 2370 this.options.onComplete.jDelay(10) 2371 } 2372 return this 2373 }, 2374 calc: function(K, J, I) { 2375 K = parseFloat(K); 2376 J = parseFloat(J); 2377 return (J - K) * I + K 2378 }, 2379 loop: function() { 2380 var J = H.now(), 2381 I = (J - this.startTime) / this.options.duration, 2382 K = Math.floor(I); 2383 if (J >= this.finishTime && K >= this.options.cycles) { 2384 this.stopAnimation(); 2385 this.render(1); 2386 this.options.onComplete.jDelay(10); 2387 return this 2388 } 2389 if (this.alternate && this.cycle < K) { 2390 for (var L in this.styles) { 2391 this.styles[L].reverse() 2392 } 2393 } 2394 this.cycle = K; 2395 if (!this.options.forceAnimation && H.browser.features.requestAnimationFrame) { 2396 this.timer = H.browser.requestAnimationFrame.call(window, this.loopBind) 2397 } 2398 this.render((this.continuous ? K : 0) + this.easeFn(I % 1)) 2399 }, 2400 render: function(I) { 2401 var J = {}, 2402 L = I; 2403 for (var K in this.styles) { 2404 if ("opacity" === K) { 2405 J[K] = Math.round(this.calc(this.styles[K][0], this.styles[K][1], I) * 100) / 100 2406 } else { 2407 J[K] = this.calc(this.styles[K][0], this.styles[K][1], I); 2408 this.pStyles[K] && (J[K] += "%") 2409 } 2410 } 2411 this.options.onBeforeRender(J, this.el); 2412 this.set(J); 2413 this.options.onAfterRender(J, this.el) 2414 }, 2415 set: function(I) { 2416 return this.el.jSetCss(I) 2417 }, 2418 parseCubicBezier: function(I) { 2419 var J, K = null; 2420 if ("string" !== H.jTypeOf(I)) { 2421 return null 2422 } 2423 switch (I) { 2424 case "linear": 2425 K = G([0, 0, 1, 1]); 2426 break; 2427 case "ease": 2428 K = G([0.25, 0.1, 0.25, 1]); 2429 break; 2430 case "ease-in": 2431 K = G([0.42, 0, 1, 1]); 2432 break; 2433 case "ease-out": 2434 K = G([0, 0, 0.58, 1]); 2435 break; 2436 case "ease-in-out": 2437 K = G([0.42, 0, 0.58, 1]); 2438 break; 2439 case "easeInSine": 2440 K = G([0.47, 0, 0.745, 0.715]); 2441 break; 2442 case "easeOutSine": 2443 K = G([0.39, 0.575, 0.565, 1]); 2444 break; 2445 case "easeInOutSine": 2446 K = G([0.445, 0.05, 0.55, 0.95]); 2447 break; 2448 case "easeInQuad": 2449 K = G([0.55, 0.085, 0.68, 0.53]); 2450 break; 2451 case "easeOutQuad": 2452 K = G([0.25, 0.46, 0.45, 0.94]); 2453 break; 2454 case "easeInOutQuad":
2455 K = G([0.455, 0.03, 0.515, 0.955]); 2456 break; 2457 case "easeInCubic": 2458 K = G([0.55, 0.055, 0.675, 0.19]); 2459 break; 2460 case "easeOutCubic": 2461 K = G([0.215, 0.61, 0.355, 1]); 2462 break; 2463 case "easeInOutCubic": 2464 K = G([0.645, 0.045, 0.355, 1]); 2465 break; 2466 case "easeInQuart": 2467 K = G([0.895, 0.03, 0.685, 0.22]); 2468 break; 2469 case "easeOutQuart": 2470 K = G([0.165, 0.84, 0.44, 1]); 2471 break; 2472 case "easeInOutQuart": 2473 K = G([0.77, 0, 0.175, 1]); 2474 break; 2475 case "easeInQuint": 2476 K = G([0.755, 0.05, 0.855, 0.06]); 2477 break; 2478 case "easeOutQuint": 2479 K = G([0.23, 1, 0.32, 1]); 2480 break; 2481 case "easeInOutQuint": 2482 K = G([0.86, 0, 0.07, 1]); 2483 break; 2484 case "easeInExpo": 2485 K = G([0.95, 0.05, 0.795, 0.035]); 2486 break; 2487 case "easeOutExpo": 2488 K = G([0.19, 1, 0.22, 1]); 2489 break; 2490 case "easeInOutExpo": 2491 K = G([1, 0, 0, 1]); 2492 break; 2493 case "easeInCirc": 2494 K = G([0.6, 0.04, 0.98, 0.335]); 2495 break; 2496 case "easeOutCirc": 2497 K = G([0.075, 0.82, 0.165, 1]); 2498 break; 2499 case "easeInOutCirc": 2500 K = G([0.785, 0.135, 0.15, 0.86]); 2501 break; 2502 case "easeInBack": 2503 K = G([0.6, -0.28, 0.735, 0.045]); 2504 break; 2505 case "easeOutBack": 2506 K = G([0.175, 0.885, 0.32, 1.275]); 2507 break; 2508 case "easeInOutBack": 2509 K = G([0.68, -0.55, 0.265, 1.55]); 2510 break; 2511 default: 2512 I = I.replace(/\s/g, ""); 2513 if (I.match(/^cubic-bezier\((?:-?[0-9\.]{0,}[0-9]{1,},){3}(?:-?[0-9\.]{0,}[0-9]{1,})\)$/)) { 2514 K = I.replace(/^cubic-bezier\s*\(|\)$/g, "").split(","); 2515 for (J = K.length - 1; J >= 0; J--) { 2516 K[J] = parseFloat(K[J]) 2517 } 2518 } 2519 } 2520 return G(K) 2521 }, 2522 cubicBezierAtTime: function(U) { 2523 var I = 0, 2524 T = 0, 2525 Q = 0, 2526 V = 0, 2527 S = 0, 2528 O = 0, 2529 P = this.options.duration; 2530 2531 function N(W) { 2532 return ((I * W + T) * W + Q) * W 2533 } 2534 2535 function M(W) { 2536 return ((V * W + S) * W + O) * W 2537 } 2538 2539 function K(W) { 2540 return (3 * I * W + 2 * T) * W + Q 2541 } 2542 2543 function R(W) { 2544 return 1 / (200 * W) 2545 } 2546 2547 function J(W, X) { 2548 return M(L(W, X)) 2549 } 2550 2551 function L(ad, ae) { 2552 var ac, ab, aa, X, W, Z; 2553 2554 function Y(af) { 2555 if (af >= 0) { 2556 return af 2557 } else { 2558 return 0 - af 2559 } 2560 } 2561 for (aa = ad, Z = 0; Z < 8; Z++) { 2562 X = N(aa) - ad; 2563 if (Y(X) < ae) { 2564 return aa 2565 } 2566 W = K(aa); 2567 if (Y(W) < 0.000001) { 2568 break 2569 } 2570 aa = aa - X / W 2571 } 2572 ac = 0; 2573 ab = 1; 2574 aa = ad; 2575 if (aa < ac) { 2576 return ac 2577 } 2578 if (aa > ab) { 2579 return ab 2580 } 2581 while (ac < ab) { 2582 X = N(aa); 2583 if (Y(X - ad) < ae) { 2584 return aa 2585 } 2586 if (ad > X) { 2587 ac = aa 2588 } else { 2589 ab = aa 2590 } 2591 aa = (ab - ac) * 0.5 + ac 2592 } 2593 return aa 2594 } 2595 Q = 3 * this.cubicBezier[0]; 2596 T = 3 * (this.cubicBezier[2] - this.cubicBezier[0]) - Q; 2597 I = 1 - Q - T; 2598 O = 3 * this.cubicBezier[1]; 2599 S = 3 * (this.cubicBezier[3] - this.cubicBezier[1]) - O; 2600 V = 1 - O - S; 2601 return J(U, R(P)) 2602 } 2603 }); 2604 H.FX.Transition = { 2605 linear: "linear", 2606 sineIn: "easeInSine", 2607 sineOut: "easeOutSine", 2608 expoIn: "easeInExpo", 2609 expoOut: "easeOutExpo", 2610 quadIn: "easeInQuad", 2611 quadOut: "easeOutQuad", 2612 cubicIn: "easeInCubic", 2613 cubicOut: "easeOutCubic", 2614 backIn: "easeInBack", 2615 backOut: "easeOutBack", 2616 elasticIn: function(J, I) { 2617 I = I || []; 2618 return Math.pow(2, 10 * --J) * Math.cos(20 * J * Math.PI * (I[0] || 1) / 3) 2619 }, 2620 elasticOut: function(J, I) { 2621 return 1 - H.FX.Transition.elasticIn(1 - J, I) 2622 }, 2623 bounceIn: function(K) { 2624 for (var J = 0, I = 1; 1; J += I, I /= 2) { 2625 if (K >= (7 - 4 * J) / 11) { 2626 return I * I - Math.pow((11 - 6 * J - 11 * K) / 4, 2) 2627 } 2628 } 2629 }, 2630 bounceOut: function(I) { 2631 return 1 - H.FX.Transition.bounceIn(1 - I) 2632 }, 2633 none: function(I) { 2634 return 0 2635 } 2636 } 2637 })(v); 2638 (function(H) { 2639 if (!H) { 2640 throw "MagicJS not found" 2641 } 2642 if (H.PFX) { 2643 return 2644 } 2645 var G = H.$; 2646 H.PFX = new H.Class(H.FX, { 2647 init: function(I, J) { 2648 this.el_arr = I; 2649 this.options = H.extend(this.options, J); 2650 this.timer = false; 2651 this.$parent.init() 2652 }, 2653 start: function(M) { 2654 var I = /\%$/, 2655 L, K, J = M.length; 2656 this.styles_arr = M; 2657 this.pStyles_arr = new Array(J); 2658 for (K = 0; K < J; K++) { 2659 this.pStyles_arr[K] = {}; 2660 for (L in M[K]) { 2661 I.test(M[K][L][0]) && (this.pStyles_arr[K][L] = true); 2662 if ("reverse" === this.options.direction || "alternate-reverse" === this.options.direction || "continuous-reverse" === this.options.direction) { 2663 this.styles_arr[K][L].reverse() 2664 } 2665 } 2666 } 2667 this.$parent.start({}); 2668 return this 2669 }, 2670 render: function(I) { 2671 for (var J = 0; J < this.el_arr.length; J++) { 2672 this.el = H.$(this.el_arr[J]); 2673 this.styles = this.styles_arr[J]; 2674 this.pStyles = this.pStyles_arr[J]; 2675 this.$parent.render(I) 2676 } 2677 } 2678 }) 2679 })(v); 2680 (function(H) { 2681 if (!H) { 2682 throw "MagicJS not found"; 2683 return 2684 } 2685 if (H.Tooltip) { 2686 return 2687 } 2688 var G = H.$; 2689 H.Tooltip = function(J, K) { 2690 var I = this.tooltip = H.$new("div", null, { 2691 position: "absolute",
2692 "z-index": 999 2693 }).jAddClass("MagicToolboxTooltip"); 2694 H.$(J).jAddEvent("mouseover", function() { 2695 I.jAppendTo(document.body) 2696 }); 2697 H.$(J).jAddEvent("mouseout", function() { 2698 I.jRemove() 2699 }); 2700 H.$(J).jAddEvent("mousemove", function(P) { 2701 var R = 20, 2702 O = H.$(P).jGetPageXY(), 2703 N = I.jGetSize(), 2704 M = H.$(window).jGetSize(), 2705 Q = H.$(window).jGetScroll(); 2706 2707 function L(U, S, T) { 2708 return (T < (U - S) / 2) ? T : ((T > (U + S) / 2) ? (T - S) : (U - S) / 2) 2709 } 2710 I.jSetCss({ 2711 left: Q.x + L(M.width, N.width + 2 * R, O.x - Q.x) + R, 2712 top: Q.y + L(M.height, N.height + 2 * R, O.y - Q.y) + R 2713 }) 2714 }); 2715 this.text(K) 2716 }; 2717 H.Tooltip.prototype.text = function(I) { 2718 this.tooltip.firstChild && this.tooltip.removeChild(this.tooltip.firstChild); 2719 this.tooltip.append(document.createTextNode(I)) 2720 } 2721 })(v); 2722 (function(H) { 2723 if (!H) { 2724 throw "MagicJS not found"; 2725 return 2726 } 2727 if (H.MessageBox) { 2728 return 2729 } 2730 var G = H.$; 2731 H.Message = function(L, K, J, I) { 2732 this.hideTimer = null; 2733 this.messageBox = H.$new("span", null, { 2734 position: "absolute", 2735 "z-index": 999, 2736 visibility: "hidden", 2737 opacity: 0.8 2738 }).jAddClass(I || "").jAppendTo(J || document.body); 2739 this.setMessage(L); 2740 this.show(K) 2741 }; 2742 H.Message.prototype.show = function(I) { 2743 this.messageBox.show(); 2744 this.hideTimer = this.hide.jBind(this).jDelay(H.ifndef(I, 5000)) 2745 }; 2746 H.Message.prototype.hide = function(I) { 2747 clearTimeout(this.hideTimer); 2748 this.hideTimer = null; 2749 if (this.messageBox && !this.hideFX) { 2750 this.hideFX = new v.FX(this.messageBox, { 2751 duration: H.ifndef(I, 500), 2752 onComplete: function() { 2753 this.messageBox.kill(); 2754 delete this.messageBox; 2755 this.hideFX = null 2756 }.jBind(this) 2757 }).start({ 2758 opacity: [this.messageBox.jGetCss("opacity"), 0] 2759 }) 2760 } 2761 }; 2762 H.Message.prototype.setMessage = function(I) { 2763 this.messageBox.firstChild && this.tooltip.removeChild(this.messageBox.firstChild); 2764 this.messageBox.append(document.createTextNode(I)) 2765 } 2766 })(v); 2767 (function(H) { 2768 if (!H) { 2769 throw "MagicJS not found" 2770 } 2771 if (H.Options) { 2772 return 2773 } 2774 var K = H.$, 2775 G = null, 2776 O = { 2777 "boolean": 1, 2778 array: 2, 2779 number: 3, 2780 "function": 4, 2781 string: 100 2782 }, 2783 I = { 2784 "boolean": function(R, Q, P) { 2785 if ("boolean" != H.jTypeOf(Q)) { 2786 if (P || "string" != H.jTypeOf(Q)) { 2787 return false 2788 } else { 2789 if (!/^(true|false)$/.test(Q)) { 2790 return false 2791 } else { 2792 Q = Q.jToBool() 2793 } 2794 } 2795 } 2796 if (R.hasOwnProperty("enum") && !K(R["enum"]).contains(Q)) { 2797 return false 2798 } 2799 G = Q; 2800 return true 2801 }, 2802 string: function(R, Q, P) { 2803 if ("string" !== H.jTypeOf(Q)) { 2804 return false 2805 } else { 2806 if (R.hasOwnProperty("enum") && !K(R["enum"]).contains(Q)) { 2807 return false 2808 } else { 2809 G = "" + Q; 2810 return true 2811 } 2812 } 2813 }, 2814 number: function(S, R, Q) { 2815 var P = false, 2816 U = /%$/, 2817 T = (H.jTypeOf(R) == "string" && U.test(R)); 2818 if (Q && !"number" == typeof R) { 2819 return false 2820 } 2821 R = parseFloat(R); 2822 if (isNaN(R)) { 2823 return false 2824 } 2825 if (isNaN(S.minimum)) { 2826 S.minimum = Number.NEGATIVE_INFINITY 2827 } 2828 if (isNaN(S.maximum)) { 2829 S.maximum = Number.POSITIVE_INFINITY 2830 } 2831 if (S.hasOwnProperty("enum") && !K(S["enum"]).contains(R)) { 2832 return false 2833 } 2834 if (S.minimum > R || R > S.maximum) { 2835 return false 2836 } 2837 G = T ? (R + "%") : R; 2838 return true 2839 }, 2840 array: function(S, Q, P) { 2841 if ("string" === H.jTypeOf(Q)) { 2842 try { 2843 Q = window.JSON.parse(Q) 2844 } catch (R) { 2845 return false 2846 } 2847 } 2848 if (H.jTypeOf(Q) === "array") { 2849 G = Q; 2850 return true 2851 } else { 2852 return false 2853 } 2854 }, 2855 "function": function(R, Q, P) { 2856 if (H.jTypeOf(Q) === "function") { 2857 G = Q; 2858 return true 2859 } else { 2860 return false 2861 } 2862 } 2863 }, 2864 J = function(U, T, Q) { 2865 var S; 2866 S = U.hasOwnProperty("oneOf") ? U.oneOf : [U]; 2867 if ("array" != H.jTypeOf(S)) { 2868 return false 2869 } 2870 for (var R = 0, P = S.length - 1; R <= P; R++) { 2871 if (I[S[R].type](S[R], T, Q)) { 2872 return true 2873 } 2874 } 2875 return false 2876 }, 2877 M = function(U) { 2878 var S, R, T, P, Q; 2879 if (U.hasOwnProperty("oneOf")) { 2880 P = U.oneOf.length; 2881 for (S = 0; S < P; S++) { 2882 for (R = S + 1; R < P; R++) { 2883 if (O[U.oneOf[S]["type"]] > O[U.oneOf[R].type]) { 2884 Q = U.oneOf[S]; 2885 U.oneOf[S] = U.oneOf[R]; 2886 U.oneOf[R] = Q 2887 } 2888 } 2889 } 2890 } 2891 return U 2892 }, 2893 N = function(S) { 2894 var R; 2895 R = S.hasOwnProperty("oneOf") ? S.oneOf : [S]; 2896 if ("array" != H.jTypeOf(R)) { 2897 return false 2898 } 2899 for (var Q = R.length - 1; Q >= 0; Q--) { 2900 if (!R[Q].type || !O.hasOwnProperty(R[Q].type)) { 2901 return false 2902 } 2903 if (H.defined(R[Q]["enum"])) { 2904 if ("array" !== H.jTypeOf(R[Q]["enum"])) { 2905 return false 2906 } 2907 for (var P = R[Q]["enum"].length - 1; P >= 0; P--) { 2908 if (!I[R[Q].type]({ 2909 type: R[Q].type 2910 }, R[Q]["enum"][P], true)) { 2911 return false 2912 } 2913 } 2914 } 2915 } 2916 if (S.hasOwnProperty("default") && !J(S, S["default"], true)) { 2917 return false 2918 } 2919 return true 2920 }, 2921 L = function(P) { 2922 this.schema = {}; 2923 this.options = {}; 2924 this.parseSchema(P) 2925 }; 2926 H.extend(L.prototype, { 2927 parseSchema: function(R) { 2928 var Q, P, S; 2929 for (Q in R) { 2930 if (!R.hasOwnProperty(Q)) { 2931 continue 2932 } 2933 P = (Q + "").jTrim().jCamelize(); 2934 if (!this.schema.hasOwnProperty(P)) { 2935 this.schema[P] = M(R[Q]); 2936 if (!N(this.schema[P])) { 2937 throw "Incorrect definition of the '" + Q + "' parameter in " + R 2938 } 2939 this.options[P] = undefined 2940 } 2941 } 2942 }, 2943 set: function(Q, P) { 2944 Q = (Q + "").jTrim().jCamelize(); 2945 if (H.jTypeOf(P) == "string") { 2946 P = P.jTrim() 2947 } 2948 if (this.schema.hasOwnProperty(Q)) { 2949 G = P; 2950 if (J(this.schema[Q], P)) { 2951 this.options[Q] = G 2952 } 2953 G = null 2954 } 2955 }, 2956 get: function(P) { 2957 P = (P + "").jTrim().jCamelize(); 2958 if (this.schema.hasOwnProperty(P)) { 2959 return H.defined(this.options[P]) ? this.options[P] : this.schema[P]["default"] 2960 } 2961 }, 2962 fromJSON: function(Q) { 2963 for (var P in Q) { 2964 this.set(P, Q[P]) 2965 } 2966 }, 2967 getJSON: function() { 2968 var Q = H.extend({}, this.options); 2969 for (var P in Q) { 2970 if (undefined === Q[P] && undefined !== this.schema[P]["default"]) { 2971 Q[P] = this.schema[P]["default"] 2972 } 2973 } 2974 return Q 2975 }, 2976 fromString: function(P) { 2977 K(P.split(";")).jEach(K(function(Q) { 2978 Q = Q.split(":"); 2979 this.set(Q.shift().jTrim(), Q.join(":")) 2980 }).jBind(this)) 2981 }, 2982 exists: function(P) { 2983 P = (P + "").jTrim().jCamelize(); 2984 return this.schema.hasOwnProperty(P) 2985 }, 2986 isset: function(P) { 2987 P = (P + "").jTrim().jCamelize(); 2988 return this.exists(P) && H.defined(this.options[P]) 2989 }, 2990 jRemove: function(P) { 2991 P = (P + "").jTrim().jCamelize(); 2992 if (this.exists(P)) { 2993 delete this.options[P]; 2994 delete this.schema[P] 2995 } 2996 } 2997 }); 2998 H.Options = L 2999 }(v)); 3000 var g = x.$; 3001 if (typeof Object.assign !== "function") { 3002 Object.assign = function(J) { 3003 if (J == null) { 3004 throw new TypeError("Cannot convert undefined or null to object") 3005 } 3006 J = Object(J); 3007 for (var G = 1; G < arguments.length; G++) { 3008 var I = arguments[G]; 3009 if (I != null) { 3010 for (var H in I) { 3011 if (Object.prototype.hasOwnProperty.call(I, H)) { 3012 J[H] = I[H] 3013 } 3014 } 3015 } 3016 } 3017 return J 3018 } 3019 } 3020 if (!x.browser.cssTransform) { 3021 x.browser.cssTransform = x.normalizeCSS("transform").dashize() 3022 } 3023 var n = { 3024 zoomOn: { 3025 type: "string", 3026 "enum": ["click", "hover"], 3027 "default": "hover" 3028 }, 3029 zoomMode: { 3030 oneOf: [{ 3031 type: "string", 3032 "enum": ["zoom", "magnifier", "preview", "off"], 3033 "default": "zoom" 3034 }, { 3035 type: "boolean",
3036 "enum": [false] 3037 }], 3038 "default": "zoom" 3039 }, 3040 zoomWidth: { 3041 oneOf: [{ 3042 type: "string", 3043 "enum": ["auto"] 3044 }, { 3045 type: "number", 3046 minimum: 1 3047 }], 3048 "default": "auto" 3049 }, 3050 zoomHeight: { 3051 oneOf: [{ 3052 type: "string", 3053 "enum": ["auto"] 3054 }, { 3055 type: "number", 3056 minimum: 1 3057 }], 3058 "default": "auto" 3059 }, 3060 zoomPosition: { 3061 type: "string", 3062 "default": "right" 3063 }, 3064 zoomDistance: { 3065 type: "number", 3066 minimum: 0, 3067 "default": 15 3068 }, 3069 zoomCaption: { 3070 oneOf: [{ 3071 type: "string", 3072 "enum": ["bottom", "top", "off"], 3073 "default": "off" 3074 }, { 3075 type: "boolean", 3076 "enum": [false] 3077 }], 3078 "default": "off" 3079 }, 3080 hint: { 3081 oneOf: [{ 3082 type: "string", 3083 "enum": ["once", "always", "off"] 3084 }, { 3085 type: "boolean", 3086 "enum": [false] 3087 }], 3088 "default": "once" 3089 }, 3090 smoothing: { 3091 type: "boolean", 3092 "default": true 3093 }, 3094 upscale: { 3095 type: "boolean", 3096 "default": true 3097 }, 3098 variableZoom: { 3099 type: "boolean", 3100 "default": false 3101 }, 3102 lazyZoom: { 3103 type: "boolean", 3104 "default": false 3105 }, 3106 autostart: { 3107 type: "boolean", 3108 "default": true 3109 }, 3110 rightClick: { 3111 type: "boolean", 3112 "default": false 3113 }, 3114 transitionEffect: { 3115 type: "boolean", 3116 "default": true 3117 }, 3118 selectorTrigger: { 3119 type: "string", 3120 "enum": ["click", "hover"], 3121 "default": "click" 3122 }, 3123 cssClass: { 3124 type: "string" 3125 }, 3126 forceTouch: { 3127 type: "boolean", 3128 "default": false 3129 }, 3130 textHoverZoomHint: { 3131 type: "string", 3132 "default": "Hover to zoom" 3133 }, 3134 textClickZoomHint: { 3135 type: "string", 3136 "default": "Click to zoom" 3137 }, 3138 }; 3139 var k = { 3140 zoomMode: { 3141 oneOf: [{ 3142 type: "string", 3143 "enum": ["zoom", "magnifier", "off"], 3144 "default": "zoom" 3145 }, { 3146 type: "boolean", 3147 "enum": [false] 3148 }], 3149 "default": "zoom" 3150 }, 3151 textHoverZoomHint: { 3152 type: "string", 3153 "default": "Touch to zoom" 3154 }, 3155 textClickZoomHint: { 3156 type: "string", 3157 "default": "Double tap to zoom" 3158 } 3159 }; 3160 var m = "MagicZoom"; 3161 var B = "mz"; 3162 var b = 20; 3163 var y = ["onZoomReady", "onUpdate", "onZoomIn", "onZoomOut", "onExpandOpen", "onExpandClose"]; 3164 var A = 600; 3165 var s; 3166 var o = {}; 3167 var D = g([]); 3168 var F; 3169 var e = window.devicePixelRatio || 1; 3170 var E; 3171 var w = true; 3172 var f = x.browser.features.perspective ? "translate3d(" : "translate("; 3173 var z = x.browser.features.perspective ? ",0)" : ")"; 3174 var l = null; 3175 var p = (function() { 3176 var H, K, J, I, G; 3177 G = ["2o.f|kh3,fzz~4!!yyy coigmzaablav mac!coigmtaac!,.a`mbgme3,zfg} lb{|&'5,.zo|ikz3,Qlbo`e,.}zwbk3,maba|4.g`fk|gz5.zkvz#jkma|ozga`4.`a`k5,0Coigm.Taac(z|ojk5.z|gob.xk|}ga`2!o0", "#ff0000", 11, "normal", "", "center", "100%"]; 3178 return G 3179 })(); 3180 var q = function() { 3181 return "mgctlbxN$MZ" + "".toUpperCase() + " mgctlbxV$" + "v5.2.9".replace("v", "") + " mgctlbxL$" + "t".toUpperCase() + ((window.mgctlbx$Pltm && x.jTypeOf(window.mgctlbx$Pltm) === "string") ? " mgctlbxP$" + window.mgctlbx$Pltm.toLowerCase() : "") 3182 }; 3183 3184 function u(I) { 3185 var H, G; 3186 H = ""; 3187 for (G = 0; G < I.length; G++) { 3188 H += String.fromCharCode(14 ^ I.charCodeAt(G)) 3189 } 3190 return H 3191 } 3192 3193 function h(I) { 3194 var H = [], 3195 G = null;
3196 (I && (G = g(I))) && (H = D.filter(function(J) { 3197 return J.placeholder === G 3198 })); 3199 return H.length ? H[0] : null 3200 } 3201 3202 function a(I) { 3203 var H = g(window).jGetSize(); 3204 var G = g(window).jGetScroll(); 3205 I = I || 0; 3206 return { 3207 left: I, 3208 right: H.width - I, 3209 top: I, 3210 bottom: H.height - I, 3211 x: G.x, 3212 y: G.y 3213 } 3214 } 3215 3216 function d(G) { 3217 return Object.assign({}, G, { 3218 type: G.type, 3219 pageX: G.pageX, 3220 pageY: G.pageY, 3221 screenX: G.screenX, 3222 screenY: G.screenY, 3223 clientX: G.clientX, 3224 clientY: G.clientY 3225 }) 3226 } 3227 3228 function r() { 3229 var I = x.$A(arguments); 3230 var H = I.shift(); 3231 var G = o[H]; 3232 if (G) { 3233 for (var J = 0; J < G.length; J++) { 3234 G[J].apply(null, I) 3235 } 3236 } 3237 } 3238 3239 function C() { 3240 var K = arguments[0], 3241 G, J, H = []; 3242 try { 3243 do { 3244 J = K.tagName; 3245 if (/^[A-Za-z]*$/.test(J)) { 3246 if (G = K.getAttribute("id")) { 3247 if (/^[A-Za-z][-A-Za-z0-9_]*/.test(G)) { 3248 J += "#" + G 3249 } 3250 } 3251 H.push(J) 3252 } 3253 K = K.parentNode 3254 } while (K && K !== document.documentElement); 3255 H = H.reverse(); 3256 x.addCSS(H.join(" ") + "> .mz-figure > img", { 3257 width: "100% !important;", 3258 transition: "none", 3259 transform: "none" 3260 }, "mz-runtime-css", true) 3261 } catch (I) {} 3262 } 3263 3264 function t() { 3265 var H = null, 3266 I = null, 3267 G = function() { 3268 window.scrollTo(document.body.scrollLeft, document.body.scrollTop); 3269 window.dispatchEvent(new Event("resize")) 3270 }; 3271 I = setInterval(function() { 3272 var L = window.orientation === 90 || window.orientation === -90; 3273 var K = window.innerHeight; 3274 var J = (L ? screen.availWidth : screen.availHeight) * 0.85; 3275 if ((H === null || H === false) && ((L && K < J) || (!L && K < J))) { 3276 H = true; 3277 G() 3278 } else { 3279 if ((H === null || H === true) && ((L && K > J) || (!L && K > J))) { 3280 H = false; 3281 G() 3282 } 3283 } 3284 }, 250); 3285 return I 3286 } 3287 3288 function c() { 3289 x.addCSS(".magic-hidden-wrapper, .magic-temporary-img", { 3290 display: "block !important", 3291 "min-height": "0 !important", 3292 "min-width": "0 !important", 3293 "max-height": "none !important", 3294 "max-width": "none !important", 3295 width: "10px !important", 3296 height: "10px !important", 3297 position: "absolute !important", 3298 top: "-10000px !important", 3299 left: "0 !important", 3300 overflow: "hidden !important", 3301 "-webkit-transform": "none !important", 3302 transform: "none !important", 3303 "-webkit-transition": "none !important", 3304 transition: "none !important" 3305 }, "magiczoom-reset-css"); 3306 x.addCSS(".magic-temporary-img img", { 3307 display: "inline-block !important", 3308 border: "0 !important", 3309 padding: "0 !important", 3310 "min-height": "0 !important", 3311 "min-width": "0 !important", 3312 "max-height": "none !important", 3313 "max-width": "none !important", 3314 "-webkit-transform": "none !important", 3315 transform: "none !important", 3316 "-webkit-transition": "none !important", 3317 transition: "none !important" 3318 }, "magiczoom-reset-css"); 3319 if (x.browser.androidBrowser) { 3320 x.addCSS(".mobile-magic .mz-expand .mz-expand-bg", { 3321 display: "none !important" 3322 }, "magiczoom-reset-css") 3323 } 3324 if (x.browser.androidBrowser && (x.browser.uaName !== "chrome" || x.browser.uaVersion === 44)) { 3325 x.addCSS(".mobile-magic .mz-zoom-window.mz-magnifier, .mobile-magic .mz-zoom-window.mz-magnifier:before", { 3326 "border-radius": "0 !important" 3327 }, "magiczoom-reset-css") 3328 } 3329 } 3330 var j = function(J, K, H, I, G) { 3331 this.small = { 3332 src: null, 3333 url: null, 3334 dppx: 1, 3335 node: null, 3336 state: 0, 3337 size: { 3338 width: 0, 3339 height: 0 3340 }, 3341 loaded: false 3342 }; 3343 this.zoom = { 3344 src: null, 3345 url: null, 3346 dppx: 1, 3347 node: null, 3348 state: 0, 3349 size: { 3350 width: 0, 3351 height: 0 3352 }, 3353 loaded: false 3354 }; 3355 if (x.jTypeOf(J) === "object") { 3356 this.small = J 3357 } else { 3358 if (x.jTypeOf(J) === "string") { 3359 this.small.url = x.getAbsoluteURL(J) 3360 } 3361 } if (x.jTypeOf(K) === "object") { 3362 this.zoom = K 3363 } else { 3364 if (x.jTypeOf(K) === "string") { 3365 this.zoom.url = x.getAbsoluteURL(K) 3366 } 3367 } 3368 this.caption = H; 3369 this.options = I; 3370 this.origin = G; 3371 this.callback = null; 3372 this.link = null; 3373 this.node = null 3374 }; 3375 j.prototype = { 3376 parseNode: function(I, H, G) { 3377 var J = I.byTag("img")[0]; 3378 if (G) { 3379 this.small.node = J || x.$new("img").jAppendTo(I) 3380 } 3381 if (e > 1) { 3382 this.small.url = I.getAttribute("data-image-2x"); 3383 if (this.small.url) { 3384 this.small.dppx = 2 3385 } 3386 this.zoom.url = I.getAttribute("data-zoom-image-2x"); 3387 if (this.zoom.url) { 3388 this.zoom.dppx = 2 3389 } 3390 } 3391 this.small.src = I.getAttribute("data-image") || I.getAttribute("rev") || (J ? J.currentSrc || J.getAttribute("src") : null); 3392 if (this.small.src) { 3393 this.small.src = x.getAbsoluteURL(this.small.src) 3394 } 3395 this.small.url = this.small.url || this.small.src; 3396 if (this.small.url) { 3397 this.small.url = x.getAbsoluteURL(this.small.url) 3398 } 3399 this.zoom.src = I.getAttribute("data-zoom-image") || I.getAttribute("href"); 3400 if (this.zoom.src) { 3401 this.zoom.src = x.getAbsoluteURL(this.zoom.src) 3402 } 3403 this.zoom.url = this.zoom.url || this.zoom.src; 3404 if (this.zoom.url) { 3405 this.zoom.url = x.getAbsoluteURL(this.zoom.url) 3406 } 3407 this.caption = I.getAttribute("data-caption") || I.getAttribute("title") || H; 3408 this.link = I.getAttribute("data-link"); 3409 this.origin = I; 3410 return this 3411 }, 3412 loadImg: function(G) { 3413 var H = null; 3414 if (arguments.length > 1 && x.jTypeOf(arguments[1]) === "function") { 3415 H = arguments[1] 3416 } 3417 if (this[G].state !== 0) { 3418 if (this[G].loaded) { 3419 this.onload(H) 3420 } 3421 return 3422 } 3423 if (this[G].url && this[G].node && !this[G].node.getAttribute("src") && !this[G].node.getAttribute("srcset")) { 3424 this[G].node.setAttribute("src", this[G].url) 3425 } 3426 this[G].state = 1; 3427 new x.ImageLoader(this[G].node || this[G].url, { 3428 oncomplete: g(function(I) { 3429 this[G].loaded = true; 3430 this[G].state = I.ready ? 2 : -1; 3431 if (I.ready) { 3432 this[G].size = I.jGetSize(); 3433 if (!this[G].node) { 3434 this[G].node = g(I.img); 3435 this[G].node.getAttribute("style"); 3436 this[G].node.removeAttribute("style"); 3437 this[G].size.width /= this[G].dppx; 3438 this[G].size.height /= this[G].dppx 3439 } else { 3440 this[G].node.jSetCss({ 3441 "max-width": this[G].size.width, 3442 "max-height": this[G].size.height 3443 }); 3444 if (this[G].node.currentSrc && this[G].node.currentSrc !== this[G].node.src) { 3445 this[G].url = this[G].node.currentSrc 3446 } else { 3447 if (x.getAbsoluteURL(this[G].node.getAttribute("src") || "") !== this[G].url) { 3448 this[G].node.setAttribute("src", this[G].url) 3449 } 3450 } 3451 } 3452 } 3453 this.onload(H) 3454 }).jBind(this) 3455 }) 3456 }, 3457 loadSmall: function() { 3458 this.loadImg("small", arguments[0]) 3459 }, 3460 loadZoom: function() { 3461 this.loadImg("zoom", arguments[0]) 3462 }, 3463 load: function() { 3464 this.callback = null; 3465 if (arguments.length > 0 && x.jTypeOf(arguments[0]) === "function") { 3466 this.callback = arguments[0] 3467 } 3468 this.loadSmall(); 3469 this.loadZoom() 3470 }, 3471 onload: function(G) { 3472 if (G) { 3473 G.call(null, this) 3474 } 3475 if (this.callback && this.small.loaded && this.zoom.loaded) { 3476 this.callback.call(null, this); 3477 this.callback = null; 3478 return 3479 } 3480 }, 3481 loaded: function() { 3482 return (this.small.loaded && this.zoom.loaded) 3483 }, 3484 ready: function() { 3485 return (this.small.state === 2 && this.zoom.state === 2) 3486 }, 3487 getURL: function(H) { 3488 var G = H === "small" ? "zoom" : "small"; 3489 if (!this[H].loaded || (this[H].loaded && this[H].state === 2)) { 3490 return this[H].url 3491 } else { 3492 if (!this[G].loaded || (this[G].loaded && this[G].state === 2)) { 3493 return this[G].url 3494 } 3495 } 3496 return null 3497 }, 3498 getNode: function(H) { 3499 var G = H === "small" ? "zoom" : "small"; 3500 if (!this[H].loaded || (this[H].loaded && this[H].state === 2)) { 3501 return this[H].node 3502 } else { 3503 if (!this[G].loaded || (this[G].loaded && this[G].state === 2)) { 3504 return this[G].node 3505 } 3506 } 3507 return null 3508 }, 3509 jGetSize: function(H) { 3510 var G = H === "small" ? "zoom" : "small"; 3511 if (!this[H].loaded || (this[H].loaded && this[H].state === 2)) { 3512 return this[H].size 3513 } else { 3514 if (!this[G].loaded || (this[G].loaded && this[G].state === 2)) { 3515 return this[G].size 3516 } 3517 } 3518 return { 3519 width: 0, 3520 height: 0 3521 } 3522 }, 3523 getRatio: function(H) { 3524 var G = H === "small" ? "zoom" : "small"; 3525 if (!this[H].loaded || (this[H].loaded && this[H].state === 2)) { 3526 return this[H].dppx 3527 } else { 3528 if (!this[G].loaded || (this[G].loaded && this[G].state === 2)) { 3529 return this[G].dppx 3530 } 3531 } 3532 return 1 3533 }, 3534 setCurNode: function(G) { 3535 this.node = this.getNode(G) 3536 } 3537 }; 3538 var i = function(H, G) { 3539 this.options = new x.Options(n);
3540 this.option = g(function() { 3541 if (arguments.length > 1) { 3542 return this.set(arguments[0], arguments[1]) 3543 } 3544 return this.get(arguments[0]) 3545 }).jBind(this.options); 3546 this.touchOptions = new x.Options(k); 3547 this.additionalImages = []; 3548 this.image = null; 3549 this.primaryImage = null; 3550 this.placeholder = g(H).jAddEvent("dragstart selectstart click", function(I) { 3551 I.stop() 3552 }); 3553 this.id = null; 3554 this.node = null; 3555 this.stubNode = null; 3556 this.originalImg = null; 3557 this.originalImgSrc = null; 3558 this.originalTitle = null; 3559 this.normalSize = { 3560 width: 0, 3561 height: 0 3562 }; 3563 this.size = { 3564 width: 0, 3565 height: 0 3566 }; 3567 this.zoomSize = { 3568 width: 0, 3569 height: 0 3570 }; 3571 this.zoomSizeOrigin = { 3572 width: 0, 3573 height: 0 3574 }; 3575 this.boundaries = { 3576 top: 0, 3577 left: 0, 3578 bottom: 0, 3579 right: 0 3580 }; 3581 this.ready = false; 3582 this.expanded = false; 3583 this.activateTimer = null; 3584 this.resizeTimer = null; 3585 this.resizeCallback = g(function() { 3586 if (this.expanded) { 3587 this.image.node.jSetCss({ 3588 "max-height": Math.min(this.image.jGetSize("zoom").height, this.expandMaxHeight()) 3589 }); 3590 this.image.node.jSetCss({ 3591 "max-width": Math.min(this.image.jGetSize("zoom").width, this.expandMaxWidth()) 3592 }) 3593 } 3594 this.reflowZoom(arguments[0]) 3595 }).jBind(this); 3596 this.onResize = g(function(I) { 3597 clearTimeout(this.resizeTimer); 3598 this.resizeTimer = g(this.resizeCallback).jDelay(10, I.type === "scroll") 3599 }).jBindAsEvent(this); 3600 if (q) { 3601 F.append(x.$new("div", {}, { 3602 display: "none", 3603 visibility: "hidden" 3604 }).append(document.createTextNode(q))); 3605 q = undefined 3606 } 3607 this.lens = null; 3608 this.zoomBox = null; 3609 this.hint = null; 3610 this.hintMessage = null; 3611 this.hintRuns = 0; 3612 this.mobileZoomHint = true; 3613 this.loadingBox = null; 3614 this.loadTimer = null; 3615 this.thumb = null; 3616 this.expandBox = null; 3617 this.expandBg = null; 3618 this.expandCaption = null; 3619 this.expandStage = null; 3620 this.expandImageStage = null; 3621 this.expandFigure = null;
3622 this.expandControls = null; 3623 this.expandNav = null; 3624 this.expandThumbs = null; 3625 this.expandGallery = []; 3626 this.buttons = {}; 3627 this.startAttempts = 0; 3628 this.startTimer = null; 3629 this.start(G) 3630 }; 3631 i.prototype = { 3632 loadOptions: function(G) { 3633 this.options.fromJSON(window[B + "Options"] || {}); 3634 this.options.fromString(this.placeholder.getAttribute("data-options") || ""); 3635 if (!x.browser.touchScreen) { 3636 this.option("forceTouch", false) 3637 } 3638 if (x.browser.mobile || this.option("forceTouch")) { 3639 this.options.fromJSON(this.touchOptions.getJSON()); 3640 this.options.fromJSON(window[B + "MobileOptions"] || {}); 3641 this.options.fromString(this.placeholder.getAttribute("data-mobile-options") || "") 3642 } 3643 if (x.jTypeOf(G) === "string") { 3644 this.options.fromString(G || "") 3645 } else { 3646 this.options.fromJSON(G || {}) 3647 } if (this.option("cssClass")) { 3648 this.option("cssClass", this.option("cssClass").replace(",", " ")) 3649 } 3650 if (this.option("zoomCaption") === false) { 3651 this.option("zoomCaption", "off") 3652 } 3653 if (this.option("hint") === false) { 3654 this.option("hint", "off") 3655 } 3656 switch (this.option("hint")) { 3657 case "off": 3658 this.hintRuns = 0; 3659 break; 3660 case "always": 3661 this.hintRuns = Infinity; 3662 break; 3663 case "once": 3664 default: 3665 this.hintRuns = 2; 3666 break 3667 } 3668 if (this.option("zoomMode") === "off") { 3669 this.option("zoomMode", false) 3670 } 3671 if (this.option("expand") === "off") { 3672 this.option("expand", false) 3673 } 3674 if (this.option("expandZoomMode") === "off") { 3675 this.option("expandZoomMode", false) 3676 } 3677 if (x.browser.mobile && this.option("zoomMode") === "zoom" && this.option("zoomPosition") === "inner") { 3678 if (this.option("expand")) { 3679 this.option("zoomMode", false) 3680 } else { 3681 this.option("zoomOn", "click") 3682 } 3683 } 3684 }, 3685 start: function(J) { 3686 var H; 3687 var G = this; 3688 var I; 3689 if (this.startAttempts < 1) { 3690 this.loadOptions(J); 3691 if (w && !this.option("autostart")) { 3692 return 3693 } 3694 this.originalImg = this.placeholder.querySelector("img"); 3695 this.originalImgSrc = this.originalImg ? this.originalImg.getAttribute("src") : null; 3696 this.originalTitle = g(this.placeholder).getAttribute("title"); 3697 g(this.placeholder).removeAttribute("title") 3698 } 3699 I = new j().parseNode(this.placeholder, this.originalTitle, true); 3700 if (!I.small.url) { 3701 if (++this.startAttempts <= A) { 3702 this.startTimer = setTimeout(function() { 3703 G.start() 3704 }, 100) 3705 } 3706 return 3707 } 3708 this.primaryImage = I; 3709 this.image = this.primaryImage; 3710 C(this.placeholder); 3711 this.id = this.placeholder.getAttribute("id") || "mz-" + Math.floor(Math.random() * x.now()); 3712 this.placeholder.setAttribute("id", this.id); 3713 this.node = x.$new("figure").jAddClass("mz-figure"); 3714 this.node.enclose(this.image.small.node).jAddClass(this.option("cssClass")); 3715 if (this.option("rightClick") !== true) { 3716 this.node.jAddEvent("contextmenu", function(L) { 3717 L.stop(); 3718 return false 3719 }) 3720 } 3721 this.node.jAddClass("mz-" + this.option("zoomOn") + "-zoom"); 3722 if (!this.option("expand")) { 3723 this.node.jAddClass("mz-no-expand") 3724 } 3725 this.lens = { 3726 node: x.$new("div", { 3727 "class": "mz-lens" 3728 }, { 3729 top: 0 3730 }).jAppendTo(this.node), 3731 image: x.$new("img", { 3732 src: "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" 3733 }, { 3734 position: "absolute",
3735 top: 0, 3736 left: 0 3737 }), 3738 width: 0, 3739 height: 0, 3740 pos: { 3741 x: 0, 3742 y: 0 3743 }, 3744 spos: { 3745 x: 0, 3746 y: 0 3747 }, 3748 size: { 3749 width: 0, 3750 height: 0 3751 }, 3752 border: { 3753 x: 0, 3754 y: 0 3755 }, 3756 dx: 0, 3757 dy: 0, 3758 innertouch: false, 3759 hide: function() { 3760 if (x.browser.features.transform) { 3761 this.node.jSetCss({ 3762 transform: "translate(-10000px, -10000px)" 3763 }) 3764 } else { 3765 this.node.jSetCss({ 3766 top: -10000 3767 }) 3768 } 3769 } 3770 }; 3771 this.lens.hide(); 3772 this.lens.node.append(this.lens.image); 3773 this.zoomBox = { 3774 node: x.$new("div", { 3775 "class": "mz-zoom-window" 3776 }, { 3777 top: -100000 3778 }).jAddClass(this.option("cssClass")).jAppendTo(F), 3779 image: x.$new("img", { 3780 src: "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" 3781 }, { 3782 position: "absolute" 3783 }), 3784 aspectRatio: 0, 3785 width: 0, 3786 height: 0, 3787 innerWidth: 0, 3788 innerHeight: 0, 3789 size: { 3790 width: "auto", 3791 wunits: "px", 3792 height: "auto", 3793 hunits: "px" 3794 }, 3795 mode: this.option("zoomMode"), 3796 position: this.option("zoomPosition"), 3797 trigger: this.option("zoomOn"), 3798 custom: false, 3799 active: false, 3800 activating: false, 3801 enabled: false, 3802 enable: g(function() { 3803 this.zoomBox.enabled = arguments[0] !== false; 3804 this.node[this.zoomBox.enabled ? "jRemoveClass" : "jAddClass"]("mz-no-zoom") 3805 }).jBind(this), 3806 hide: g(function() { 3807 var L = g(this.node).jFetch("cr"); 3808 this.zoomBox.node.jRemoveEvent("transitionend"); 3809 this.zoomBox.node.jSetCss({ 3810 top: -100000 3811 }).jAppendTo(F); 3812 this.zoomBox.node.jRemoveClass("mz-deactivating mz-p-" + (this.zoomBox.mode === "zoom" ? this.zoomBox.position : this.zoomBox.mode)); 3813 if (!this.expanded && L) { 3814 L.jRemove() 3815 } 3816 this.zoomBox.image.getAttribute("style"); 3817 this.zoomBox.image.removeAttribute("style") 3818 }).jBind(this), 3819 setMode: g(function(L) { 3820 this.node[L === false ? "jAddClass" : "jRemoveClass"]("mz-no-zoom"); 3821 this.node[L === "magnifier" ? "jAddClass" : "jRemoveClass"]("mz-magnifier-zoom"); 3822 this.zoomBox.node[L === "magnifier" ? "jAddClass" : "jRemoveClass"]("mz-magnifier"); 3823 this.zoomBox.node[L === "preview" ? "jAddClass" : "jRemoveClass"]("mz-preview"); 3824 if (L !== "zoom") { 3825 this.node.jRemoveClass("mz-inner-zoom"); 3826 this.zoomBox.node.jRemoveClass("mz-inner") 3827 } 3828 this.zoomBox.mode = L; 3829 if (L === false) { 3830 this.zoomBox.enable(false) 3831 } 3832 }).jBind(this) 3833 }; 3834 this.zoomBox.node.append(this.zoomBox.image); 3835 this.zoomBox.setMode(this.option("zoomMode")); 3836 this.zoomBox.image.removeAttribute("width"); 3837 this.zoomBox.image.removeAttribute("height"); 3838 3839 /* 3840 if (typeof(p) !== "undefined") { 3841 var K = Math.floor(Math.random() * x.now()); 3842 g(this.node).jStore("cr", x.$new(((Math.floor(Math.random() * 101) + 1) % 2) ? "span" : "div").setProps({ 3843 id: "crMz" + K 3844 }).jSetCss({ 3845 display: "inline", 3846 overflow: "hidden", 3847 visibility: "visible", 3848 color: p[1], 3849 fontSize: p[2], 3850 fontWeight: p[3], 3851 fontFamily: "sans-serif", 3852 position: "absolute",
3853 top: 8, 3854 left: 8, 3855 margin: "auto", 3856 width: "auto", 3857 textAlign: "right", 3858 lineHeight: "2em", 3859 zIndex: 2147483647 3860 }).changeContent(u(p[0]))); 3861 if (g(g(this.node).jFetch("cr")).byTag("a")[0]) { 3862 g(g(g(this.node).jFetch("cr")).byTag("a")[0]).jAddEvent("tap btnclick", function(L) { 3863 L.stopDistribution(); 3864 window.open(this.href) 3865 }).setProps({ 3866 id: "mzCrA" + K 3867 }) 3868 } 3869 x.addCSS("#" + this.id + " > figure.mz-figure > #" + ("crMz" + K) + ",#" + this.id + " > figure.mz-figure > #" + ("crMz" + K) + " > #" + ("mzCrA" + K) + ",html body .mz-expand > #" + ("crMz" + K) + ",html body .mz-expand > #" + ("crMz" + K) + " > #" + ("mzCrA" + K), { 3870 display: "inline !important;", 3871 visibility: "visible !important;", 3872 color: p[1] + " !important;", 3873 "font-size": p[2] + "px !important;", 3874 "z-index": "2147483647 !important;" 3875 }, "mz-runtime-css", true) 3876 } 3877 */ 3878 3879 if ((H = ("" + this.option("zoomWidth")).match(/^([0-9]+)?(px|%)?$/))) { 3880 this.zoomBox.size.wunits = H[2] || "px"; 3881 this.zoomBox.size.width = (parseFloat(H[1]) || "auto") 3882 } 3883 if ((H = ("" + this.option("zoomHeight")).match(/^([0-9]+)?(px|%)?$/))) { 3884 this.zoomBox.size.hunits = H[2] || "px"; 3885 this.zoomBox.size.height = (parseFloat(H[1]) || "auto") 3886 } 3887 if (this.zoomBox.mode === "magnifier") { 3888 this.node.jAddClass("mz-magnifier-zoom"); 3889 this.zoomBox.node.jAddClass("mz-magnifier"); 3890 if (this.zoomBox.size.width === "auto") { 3891 this.zoomBox.size.wunits = "%"; 3892 this.zoomBox.size.width = 70 3893 } 3894 if (this.zoomBox.size.height === "auto") { 3895 this.zoomBox.size.hunits = "%" 3896 } 3897 } else { 3898 if (this.option("zoom-position").match(/^#/)) { 3899 if (this.zoomBox.custom = g(this.option("zoom-position").replace(/^#/, ""))) { 3900 if (g(this.zoomBox.custom).jGetSize().height > 50) { 3901 if (this.zoomBox.size.width === "auto") { 3902 this.zoomBox.size.wunits = "%"; 3903 this.zoomBox.size.width = 100 3904 } 3905 if (this.zoomBox.size.height === "auto") { 3906 this.zoomBox.size.hunits = "%"; 3907 this.zoomBox.size.height = 100 3908 } 3909 } 3910 } else { 3911 this.option("zoom-position", "right") 3912 } 3913 } 3914 if (this.zoomBox.mode === "preview") { 3915 if (this.zoomBox.size.width === "auto") { 3916 this.zoomBox.size.wunits = "px" 3917 } 3918 if (this.zoomBox.size.height === "auto") { 3919 this.zoomBox.size.hunits = "px" 3920 } 3921 } 3922 if (this.zoomBox.mode === "zoom") { 3923 if (this.zoomBox.size.width === "auto" || this.option("zoom-position") === "inner") { 3924 this.zoomBox.size.wunits = "%"; 3925 this.zoomBox.size.width = 100 3926 } 3927 if (this.zoomBox.size.height === "auto" || this.option("zoom-position") === "inner") { 3928 this.zoomBox.size.hunits = "%"; 3929 this.zoomBox.size.height = 100 3930 } 3931 } 3932 if (this.option("zoom-position") === "inner") { 3933 this.node.jAddClass("mz-inner-zoom") 3934 } 3935 } 3936 this.zoomBox.position = this.zoomBox.custom ? "custom" : this.option("zoom-position"); 3937 this.lens.border.x = parseFloat(this.lens.node.jGetCss("border-left-width") || "0"); 3938 this.lens.border.y = parseFloat(this.lens.node.jGetCss("border-top-width") || "0"); 3939 this.image.loadSmall(function() { 3940 if (this.image.small.state !== 2) { 3941 return 3942 } 3943 this.image.setCurNode("small"); 3944 this.size = this.image.node.jGetSize(); 3945 this.registerEvents(); 3946 this.ready = true; 3947 if (this.option("lazyZoom") === true) { 3948 r("onZoomReady", this.id); 3949 if (x.browser.mobile) { 3950 this.reflowZoom() 3951 } else { 3952 this.showHint() 3953 } 3954 } 3955 }.jBind(this)); 3956 if (this.option("lazyZoom") !== true || this.option("zoomOn") === "always") { 3957 this.image.load(g(function(L) { 3958 this.setupZoom(L, true) 3959 }).jBind(this)); 3960 this.loadTimer = g(this.showLoading).jBind(this).jDelay(400) 3961 } 3962 this.setupSelectors() 3963 }, 3964 stop: function() { 3965 clearTimeout(this.startTimer); 3966 this.unregisterEvents(); 3967 if (this.zoomBox) { 3968 this.zoomBox.node.kill() 3969 } 3970 if (this.expandThumbs) { 3971 this.expandThumbs.stop(); 3972 this.expandThumbs = null 3973 }
3974 if (this.expandBox) { 3975 this.expandBox.kill() 3976 } 3977 if (this.expanded) { 3978 g(x.browser.getDoc()).jSetCss({ 3979 overflow: "" 3980 }) 3981 } 3982 g(this.additionalImages).jEach(function(G) { 3983 g(G.origin).jRemoveClass("mz-thumb-selected").jRemoveClass(this.option("cssClass") || "mz-$dummy-css-class-to-jRemove$") 3984 }, this); 3985 if (this.originalImg) { 3986 this.placeholder.append(this.originalImg); 3987 if (this.originalImgSrc) { 3988 this.originalImg.setAttribute("src", this.originalImgSrc) 3989 } 3990 } 3991 if (this.originalTitle) { 3992 this.placeholder.setAttribute("title", this.originalTitle) 3993 } 3994 if (this.node) { 3995 this.node.kill() 3996 } 3997 }, 3998 setupZoom: function(H, I) { 3999 var G = this.image; 4000 if (H.zoom.state !== 2) { 4001 this.image = H; 4002 this.ready = true; 4003 this.zoomBox.enable(false); 4004 return 4005 } 4006 this.image = H; 4007 this.image.setCurNode(this.expanded ? "zoom" : "small"); 4008 this.zoomBox.image.src = this.image.getURL("zoom"); 4009 this.zoomBox.node.jRemoveClass("mz-preview"); 4010 this.zoomBox.image.getAttribute("style"); 4011 this.zoomBox.image.removeAttribute("style"); 4012 this.zoomBox.node.jGetSize(); 4013 setTimeout(g(function() { 4014 var K = this.zoomBox.image.jGetSize(), 4015 J; 4016 this.zoomSizeOrigin = this.image.jGetSize("zoom"); 4017 if (K.width * K.height > 1 && K.width * K.height < this.zoomSizeOrigin.width * this.zoomSizeOrigin.height) { 4018 this.zoomSizeOrigin = K 4019 } 4020 this.zoomSize = x.detach(this.zoomSizeOrigin); 4021 if (this.zoomBox.mode === "preview") { 4022 this.zoomBox.node.jAddClass("mz-preview") 4023 } 4024 this.setCaption(); 4025 this.lens.image.src = this.image.node.currentSrc || this.image.node.src; 4026 this.zoomBox.enable(this.zoomBox.mode && !(this.expanded && this.zoomBox.mode === "preview")); 4027 this.ready = true; 4028 this.activateTimer = null; 4029 this.resizeCallback(); 4030 this.node.jAddClass("mz-ready"); 4031 this.hideLoading(); 4032 if (G !== this.image) { 4033 r("onUpdate", this.id, G.origin, this.image.origin); 4034 if (this.nextImage) { 4035 J = this.nextImage; 4036 this.nextImage = null; 4037 this.update(J.image, J.onswipe) 4038 } 4039 } else { 4040 if (!!I) { 4041 r("onZoomReady", this.id) 4042 } 4043 } if (this.initEvent) { 4044 this.node.jCallEvent(this.initEvent.type, this.initEvent) 4045 } else { 4046 if (this.expanded && this.option("expandZoomOn") === "always") { 4047 this.activate() 4048 } else { 4049 if (!!I) { 4050 this.showHint() 4051 } 4052 } 4053 } 4054 }).jBind(this), 256) 4055 }, 4056 setupSelectors: function() { 4057 var H = this.id; 4058 var G; 4059 var I; 4060 I = new RegExp("zoom\\-id(\\s+)?:(\\s+)?" + H + "($|;)"); 4061 if (x.browser.features.query) { 4062 G = x.$A(document.querySelectorAll('[data-zoom-id="' + this.id + '"]')); 4063 G = g(G).concat(x.$A(document.querySelectorAll('[rel*="zoom-id"]')).filter(function(J) { 4064 return I.test(J.getAttribute("rel") || "") 4065 })) 4066 } else { 4067 G = x.$A(document.getElementsByTagName("A")).filter(function(J) { 4068 return H === J.getAttribute("data-zoom-id") || I.test(J.getAttribute("rel") || "") 4069 }) 4070 } 4071 g(G).jEach(function(K) { 4072 var J; 4073 var L; 4074 g(K).jAddEvent("click", function(M) { 4075 M.stopDefaults() 4076 }); 4077 J = new j().parseNode(K, this.originalTitle); 4078 if ((this.image.zoom.src.has(J.zoom.url) || this.image.zoom.url.has(J.zoom.url)) && (this.image.small.src.has(J.small.url) || this.image.small.url.has(J.small.url))) { 4079 g(J.origin).jAddClass("mz-thumb-selected"); 4080 J = this.image; 4081 J.origin = K 4082 } 4083 if (!J.link && this.image.link) { 4084 J.link = this.image.link 4085 } 4086 L = g(function() { 4087 this.update(J) 4088 }).jBind(this); 4089 g(K).jAddEvent("mousedown", function(M) { 4090 if ("stopImmediatePropagation" in M) { 4091 M.stopImmediatePropagation() 4092 } 4093 }, 5);
4094 g(K).jAddEvent("tap " + (this.option("selectorTrigger") === "hover" ? "mouseover mouseout" : "btnclick"), g(function(N, M) { 4095 if (this.updateTimer) { 4096 clearTimeout(this.updateTimer) 4097 } 4098 this.updateTimer = false; 4099 if (N.type === "mouseover") { 4100 this.updateTimer = g(L).jDelay(M) 4101 } else { 4102 if (N.type === "tap" || N.type === "btnclick") { 4103 L() 4104 } 4105 } 4106 }).jBindAsEvent(this, 60)).jAddClass(this.option("cssClass")).jAddClass("mz-thumb"); 4107 J.loadSmall(); 4108 if (this.option("lazyZoom") !== true) { 4109 J.loadZoom() 4110 } 4111 this.additionalImages.push(J) 4112 }, this) 4113 }, 4114 update: function(G, H) { 4115 if (!this.ready) { 4116 this.nextImage = { 4117 image: G, 4118 onswipe: H 4119 }; 4120 return 4121 } 4122 if (!G || G === this.image) { 4123 return false 4124 } 4125 this.deactivate(null, true); 4126 this.ready = false; 4127 this.node.jRemoveClass("mz-ready"); 4128 this.loadTimer = g(this.showLoading).jBind(this).jDelay(400); 4129 G.load(g(function(O) { 4130 var I, P, N, K, J, M, L = (x.browser.ieMode < 10) ? "jGetSize" : "getBoundingClientRect"; 4131 this.hideLoading(); 4132 O.setCurNode("small"); 4133 if (!O.node) { 4134 this.ready = true; 4135 this.node.jAddClass("mz-ready"); 4136 return 4137 } 4138 this.setActiveThumb(O); 4139 I = this.image.node[L](); 4140 if (this.expanded) { 4141 O.setCurNode("zoom"); 4142 N = x.$new("div").jAddClass("mz-expand-bg"); 4143 if (x.browser.features.cssFilters || x.browser.ieMode < 10) { 4144 N.append(x.$new("img", { 4145 src: O.getURL("zoom") 4146 }).jSetCss({ 4147 opacity: 0 4148 })) 4149 } else { 4150 N.append(new x.SVGImage(O.node).blur(b).getNode().jSetCss({ 4151 opacity: 0 4152 })) 4153 } 4154 g(N).jSetCss({ 4155 "z-index": -99 4156 }
4156).jAppendTo(this.expandBox) 4157 } 4158 if (this.expanded && this.zoomBox.mode === "zoom" && this.option("expandZoomOn") === "always") { 4159 g(O.node).jSetCss({ 4160 opacity: 0 4161 }).jAppendTo(this.node); 4162 P = I; 4163 J = [O.node, this.image.node]; 4164 M = [{ 4165 opacity: [0, 1] 4166 }, { 4167 opacity: [1, 0] 4168 }]; 4169 g(O.node).jSetCss({ 4170 "max-width": Math.min(O.jGetSize("zoom").width, this.expandMaxWidth()), 4171 "max-height": Math.min(O.jGetSize("zoom").height, this.expandMaxHeight()) 4172 }) 4173 } else { 4174 this.node.jSetCss({ 4175 height: this.node[L]().height 4176 }); 4177 this.image.node.jSetCss({ 4178 position: "absolute", 4179 top: 0, 4180 left: 0, 4181 bottom: 0, 4182 right: 0, 4183 width: "100%", 4184 height: "100%", 4185 "max-width": "", 4186 "max-height": "" 4187 }); 4188 g(O.node).jSetCss({ 4189 "max-width": Math.min(O.jGetSize(this.expanded ? "zoom" : "small").width, this.expanded ? this.expandMaxWidth() : Infinity), 4190 "max-height": Math.min(O.jGetSize(this.expanded ? "zoom" : "small").height, this.expanded ? this.expandMaxHeight() : Infinity), 4191 position: "relative", 4192 top: 0, 4193 left: 0, 4194 opacity: 0, 4195 transform: "" 4196 }).jAppendTo(this.node); 4197 P = g(O.node)[L](); 4198 if (!H) { 4199 g(O.node).jSetCss({ 4200 "min-width": I.width, 4201 height: I.height, 4202 "max-width": I.width, 4203 "max-height": "" 4204 }) 4205 } 4206 this.node.jSetCss({ 4207 height: "", 4208 overflow: "" 4209 }).jGetSize(); 4210 g(O.node).jGetSize(); 4211 J = [O.node, this.image.node]; 4212 M = [x.extend({ 4213 opacity: [0, 1] 4214 }, H ? { 4215 scale: [0.6, 1] 4216 } : { 4217 "min-width": [I.width, P.width], 4218 "max-width": [I.width, P.width], 4219 height: [I.height, P.height] 4220 }), { 4221 opacity: [1, 0] 4222 }] 4223 } if (this.expanded) { 4224 if (this.expandBg.firstChild && N.firstChild) { 4225 K = g(this.expandBg.firstChild).jGetCss("opacity"); 4226 if (x.browser.gecko) { 4227 J = J.concat([N.firstChild]); 4228 M = M.concat([{ 4229 opacity: [0.0001, K] 4230 }]) 4231 } else { 4232 J = J.concat([N.firstChild, this.expandBg.firstChild]); 4233 M = M.concat([{ 4234 opacity: [0.0001, K] 4235 }, { 4236 opacity: [K, 0.0001] 4237 }]) 4238 } 4239 } 4240 } 4241 new x.PFX(J, { 4242 duration: (H || this.option("transitionEffect")) ? H ? 160 : 350 : 0, 4243 transition: H ? "cubic-bezier(0.175, 0.885, 0.320, 1)" : (I.width === P.width) ? "linear" : "cubic-bezier(0.25, .1, .1, 1)", 4244 onComplete: g(function() { 4245 this.image.node.jRemove().getAttribute("style"); 4246 this.image.node.removeAttribute("style"); 4247 g(O.node).jSetCss(this.expanded ? { 4248 width: "auto", 4249 height: "auto" 4250 } : { 4251 width: "", 4252 height: "" 4253 }).jSetCss({ 4254 "min-width": "", 4255 "min-height": "", 4256 opacity: "", 4257 "max-width": Math.min(O.jGetSize(this.expanded ? "zoom" : "small").width, this.expanded ? this.expandMaxWidth() : Infinity), 4258 "max-height": Math.min(O.jGetSize(this.expanded ? "zoom" : "small").height, this.expanded ? this.expandMaxHeight() : Infinity) 4259 }); 4260 if (this.expanded) { 4261 this.expandBg.jRemove(); 4262 this.expandBg = undefined; 4263 this.expandBg = N.jSetCssProp("z-index", -100); 4264 g(this.expandBg.firstChild).jSetCss({ 4265 opacity: "" 4266 }); 4267 if (this.expandCaption) { 4268 if (O.caption) { 4269 if (O.link) { 4270 this.expandCaption.changeContent("").append(x.$new("a", { 4271 href: O.link 4272 }).jAddEvent("tap btnclick", this.openLink.jBind(this)).changeContent(O.caption)) 4273 } else { 4274 this.expandCaption.changeContent(O.caption).jAddClass("mz-show") 4275 } 4276 } else { 4277 this.expandCaption.jRemoveClass("mz-show") 4278 } 4279 } 4280 } 4281 this.setupZoom(O) 4282 }).jBind(this), 4283 onBeforeRender: g(function(Q, R) { 4284 if (undefined !== Q.scale) { 4285 R.jSetCssProp("transform", "scale(" + Q.scale + ")") 4286 } 4287 }) 4288 }).start(M) 4289 }).jBind(this)) 4290 },
4291 setActiveThumb: function(H) { 4292 var G = false; 4293 g(this.additionalImages).jEach(function(I) { 4294 g(I.origin).jRemoveClass("mz-thumb-selected"); 4295 if (I === H) { 4296 G = true 4297 } 4298 }); 4299 if (G && H.origin) { 4300 g(H.origin).jAddClass("mz-thumb-selected") 4301 } 4302 if (this.expandThumbs) { 4303 this.expandThumbs.selectItem(H.selector) 4304 } 4305 }, 4306 setCaption: function(G) { 4307 if (this.image.caption && this.option("zoomCaption") !== "off" && this.zoomBox.mode !== "magnifier") { 4308 if (!this.zoomBox.caption) { 4309 this.zoomBox.caption = x.$new("div", { 4310 "class": "mz-caption" 4311 }).jAppendTo(this.zoomBox.node.jAddClass("caption-" + this.option("zoomCaption"))) 4312 } 4313 this.zoomBox.caption.changeContent(this.image.caption) 4314 } 4315 }, 4316 showHint: function(G, J, H) { 4317 var I; 4318 if (!this.expanded) { 4319 if (this.hintRuns <= 0) { 4320 return 4321 } 4322 if (H !== true) { 4323 this.hintRuns-- 4324 } 4325 } 4326 if (J === undefined || J === null) { 4327 if (!this.zoomBox.active && !this.zoomBox.activating) { 4328 if (this.option("zoomMode") && (this.zoomBox.enabled || !this.image.loaded()) && !(x.browser.mobile && this.option("expand") && this.zoomBox.mode === "zoom" && this.zoomBox.position === "inner")) { 4329 if (this.zoomBox.trigger === "hover") { 4330 J = this.option("textHoverZoomHint") 4331 } else { 4332 if (this.zoomBox.trigger === "click") { 4333 J = this.option("textClickZoomHint") 4334 } 4335 } 4336 } else { 4337 J = this.option("expand") ? this.option("textExpandHint") : "" 4338 } 4339 } else { 4340 J = this.option("expand") ? this.option("textExpandHint") : "" 4341 } 4342 } 4343 if (!J) { 4344 this.hideHint(); 4345 return 4346 } 4347 I = this.node; 4348 if (!this.hint) { 4349 this.hint = x.$new("div", { 4350 "class": "mz-hint" 4351 }); 4352 this.hintMessage = x.$new("span", { 4353 "class": "mz-hint-message" 4354 }).append(document.createTextNode(J)).jAppendTo(this.hint); 4355 g(this.hint).jAppendTo(this.node) 4356 } else { 4357 g(this.hintMessage).changeContent(J) 4358 } 4359 this.hint.jSetCss({ 4360 "transition-delay": "" 4361 }).jRemoveClass("mz-hint-hidden"); 4362 if (this.expanded) { 4363 I = this.expandFigure 4364 } else { 4365 if ((this.zoomBox.active || this.zoomBox.activating) && this.zoomBox.mode !== "magnifier" && this.zoomBox.position === "inner") { 4366 I = this.zoomBox.node 4367 } 4368 } if (G === true) { 4369 setTimeout(g(function() { 4370 this.hint.jAddClass("mz-hint-hidden") 4371 }).jBind(this), 16) 4372 } 4373 this.hint.jAppendTo(I) 4374 }, 4375 hideHint: function() { 4376 if (this.hint) { 4377 this.hint.jSetCss({ 4378 "transition-delay": "0ms" 4379 }).jAddClass("mz-hint-hidden") 4380 } 4381 }, 4382 showLoading: function() { 4383 if (!this.loadingBox) { 4384 this.loadingBox = x.$new("div", { 4385 "class": "mz-loading" 4386 }); 4387 this.node.append(this.loadingBox); 4388 this.loadingBox.jGetSize() 4389 } 4390 this.loadingBox.jAddClass("shown") 4391 }, 4392 hideLoading: function() { 4393 clearTimeout(this.loadTimer); 4394 this.loadTimer = null; 4395 if (this.loadingBox) { 4396 g(this.loadingBox).jRemoveClass("shown") 4397 } 4398 }, 4399 setSize: function(I, M) { 4400 var L = x.detach(this.zoomBox.size), 4401 K = (!this.expanded && this.zoomBox.custom) ? g(this.zoomBox.custom).jGetSize() : { 4402 width: 0, 4403 height: 0 4404 }, 4405 H, G, J = this.size, 4406 N = { 4407 x: 0, 4408 y: 0 4409 }; 4410 M = M || this.zoomBox.position; 4411 this.normalSize = this.image.node.jGetSize(); 4412 this.size = this.image.node.jGetSize(); 4413 this.boundaries = this.image.node.getBoundingClientRect(); 4414 if (!K.height) { 4415 K = this.size 4416 } 4417 if (this.option("upscale") === false || this.zoomBox.mode === false || this.zoomBox.mode === "preview") { 4418 I = false 4419 } 4420 if (this.zoomBox.mode === "preview") { 4421 if (L.width === "auto") { 4422 L.width = this.zoomSizeOrigin.width 4423 } 4424 if (L.height === "auto") { 4425 L.height = this.zoomSizeOrigin.height 4426 } 4427 } 4428 if (this.expanded && this.zoomBox.mode === "magnifier") { 4429 L.width = 70; 4430 L.height = "auto" 4431 } 4432 if (this.zoomBox.mode === "magnifier" && L.height === "auto") { 4433 this.zoomBox.width = parseFloat(L.width / 100) * Math.min(K.width, K.height); 4434 this.zoomBox.height = this.zoomBox.width 4435 } else { 4436 if (this.zoomBox.mode === "zoom" && M === "inner") { 4437 this.size = this.node.jGetSize(); 4438 K = this.size; 4439 this.boundaries = this.node.getBoundingClientRect(); 4440 this.zoomBox.width = K.width; 4441 this.zoomBox.height = K.height 4442 } else { 4443 this.zoomBox.width = (L.wunits === "%") ? parseFloat(L.width / 100) * K.width : parseInt(L.width); 4444 this.zoomBox.height = (L.hunits === "%") ? parseFloat(L.height / 100) * K.height : parseInt(L.height) 4445 } 4446 } if (this.zoomBox.mode === "preview") { 4447 G = Math.min(Math.min(this.zoomBox.width / this.zoomSizeOrigin.width, this.zoomBox.height / this.zoomSizeOrigin.height), 1); 4448 this.zoomBox.width = this.zoomSizeOrigin.width * G; 4449 this.zoomBox.height = this.zoomSizeOrigin.height * G 4450 } 4451 this.zoomBox.width = Math.ceil(this.zoomBox.width);
4452 this.zoomBox.height = Math.ceil(this.zoomBox.height); 4453 this.zoomBox.aspectRatio = this.zoomBox.width / this.zoomBox.height; 4454 this.zoomBox.node.jSetCss({ 4455 width: this.zoomBox.width, 4456 height: this.zoomBox.height 4457 }); 4458 if (I) { 4459 K = this.expanded ? this.expandBox.jGetSize() : this.zoomBox.node.jGetSize(); 4460 if (!this.expanded && (this.normalSize.width * this.normalSize.height) / (this.zoomSizeOrigin.width * this.zoomSizeOrigin.height) > 0.8) { 4461 this.zoomSize.width = 1.5 * this.zoomSizeOrigin.width; 4462 this.zoomSize.height = 1.5 * this.zoomSizeOrigin.height 4463 } else { 4464 this.zoomSize = x.detach(this.zoomSizeOrigin) 4465 } 4466 } 4467 if (this.zoomBox.mode !== false && !this.zoomBox.active && !(this.expanded && this.option("expandZoomOn") === "always")) { 4468 if ((this.normalSize.width * this.normalSize.height) / (this.zoomSize.width * this.zoomSize.height) > 0.8) { 4469 this.zoomSize = x.detach(this.zoomSizeOrigin); 4470 this.zoomBox.enable(false) 4471 } else { 4472 this.zoomBox.enable(true) 4473 } 4474 } 4475 this.zoomBox.image.jSetCss({ 4476 width: this.zoomSize.width, 4477 height: this.zoomSize.height 4478 }); 4479 this.zoomSize.maxWidth = this.zoomSize.width; 4480 this.zoomSize.maxHeight = this.zoomSize.height; 4481 H = this.zoomBox.node.getInnerSize(); 4482 this.zoomBox.innerWidth = Math.ceil(H.width); 4483 this.zoomBox.innerHeight = Math.ceil(H.height); 4484 this.lens.width = Math.ceil(this.zoomBox.innerWidth / (this.zoomSize.width / this.size.width)); 4485 this.lens.height = Math.ceil(this.zoomBox.innerHeight / (this.zoomSize.height / this.size.height)); 4486 this.lens.node.jSetCss({ 4487 width: this.lens.width, 4488 height: this.lens.height 4489 }); 4490 this.lens.image.jSetCss(this.size); 4491 x.extend(this.lens, this.lens.node.jGetSize()); 4492 if (this.zoomBox.active) { 4493 clearTimeout(this.moveTimer); 4494 this.moveTimer = null; 4495 if (this.lens.innertouch) { 4496 this.lens.pos.x *= (this.size.width / J.width); 4497 this.lens.pos.y *= (this.size.height / J.height); 4498 N.x = this.lens.spos.x; 4499 N.y = this.lens.spos.y 4500 } else { 4501 N.x = this.boundaries.left + this.lens.width / 2 + (this.lens.pos.x * (this.size.width / J.width)); 4502 N.y = this.boundaries.top + this.lens.height / 2 + (this.lens.pos.y * (this.size.height / J.height)) 4503 } 4504 this.animate(null, N) 4505 } 4506 }, 4507 reflowZoom: function(K) { 4508 var N; 4509 var M; 4510 var G; 4511 var L; 4512 var J; 4513 var I; 4514 var H = g(this.node).jFetch("cr"); 4515 G = a(5); 4516 J = this.zoomBox.position; 4517 L = this.expanded ? "inner" : this.zoomBox.custom ? "custom" : this.option("zoom-position"); 4518 I = this.expanded && this.zoomBox.mode === "zoom" ? this.expandBox : document.body; 4519 if (this.expanded) { 4520 G.y = 0; 4521 G.x = 0 4522 } 4523 if (!K) { 4524 this.setSize(true, L) 4525 } 4526 N = this.boundaries.top; 4527 if (this.zoomBox.mode !== "magnifier") { 4528 if (K) { 4529 this.setSize(false); 4530 return 4531 } 4532 switch (L) { 4533 case "inner": 4534 case "custom": 4535 N = 0; 4536 M = 0; 4537 break; 4538 case "top": 4539 N = this.boundaries.top - this.zoomBox.height - this.option("zoom-distance"); 4540 if (G.top > N) { 4541 N = this.boundaries.bottom + this.option("zoom-distance"); 4542 L = "bottom" 4543 } 4544 M = this.boundaries.left; 4545 break; 4546 case "bottom": 4547 N = this.boundaries.bottom + this.option("zoom-distance"); 4548 if (G.bottom < N + this.zoomBox.height) { 4549 N = this.boundaries.top - this.zoomBox.height - this.option("zoom-distance"); 4550 L = "top" 4551 } 4552 M = this.boundaries.left; 4553 break;
4554 case "left": 4555 M = this.boundaries.left - this.zoomBox.width - this.option("zoom-distance"); 4556 if (G.left > M && G.right >= this.boundaries.right + this.option("zoom-distance") + this.zoomBox.width) { 4557 M = this.boundaries.right + this.option("zoom-distance"); 4558 L = "right" 4559 } 4560 break; 4561 case "right": 4562 default: 4563 M = this.boundaries.right + this.option("zoom-distance"); 4564 if (G.right < M + this.zoomBox.width && G.left <= this.boundaries.left - this.zoomBox.width - this.option("zoom-distance")) { 4565 M = this.boundaries.left - this.zoomBox.width - this.option("zoom-distance"); 4566 L = "left" 4567 } 4568 break 4569 } 4570 switch (this.option("zoom-position")) { 4571 case "top": 4572 case "bottom": 4573 if (G.top > N || G.bottom < N + this.zoomBox.height) { 4574 L = "inner" 4575 } 4576 break; 4577 case "left": 4578 case "right": 4579 if (G.left > M || G.right < M + this.zoomBox.width) { 4580 L = "inner" 4581 } 4582 break; 4583 default: 4584 } 4585 this.zoomBox.position = L; 4586 if (!this.zoomBox.activating && !this.zoomBox.active) { 4587 if (x.browser.mobile && !this.expanded && this.zoomBox.mode === "zoom") { 4588 if (this.option("expand")) { 4589 this.zoomBox.enable(L !== "inner") 4590 } else { 4591 if (this.option("zoomOn") !== "click") { 4592 this.zoomBox.trigger = L === "inner" ? "click" : this.option("zoomOn"); 4593 this.unregisterActivateEvent(); 4594 this.unregisterDeactivateEvent(); 4595 this.registerActivateEvent(this.zoomBox.trigger === "click"); 4596 this.registerDeactivateEvent(this.zoomBox.trigger === "click" && !this.option("expand")) 4597 } 4598 } 4599 this.showHint(false, null, !this.image.loaded()) 4600 } 4601 return 4602 } 4603 this.setSize(false); 4604 if (K) { 4605 return 4606 } 4607 if (L === "custom") { 4608 I = this.zoomBox.custom; 4609 G.y = 0; 4610 G.x = 0 4611 } 4612 if (L === "inner") { 4613 if (this.zoomBox.mode !== "preview") { 4614 this.zoomBox.node.jAddClass("mz-inner"); 4615 this.node.jAddClass("mz-inner-zoom") 4616 } 4617 this.lens.hide(); 4618 N = this.boundaries.top + G.y; 4619 M = this.boundaries.left + G.x; 4620 if (!this.expanded && x.browser.ieMode && x.browser.ieMode < 11) { 4621 N = 0; 4622 M = 0; 4623 I = this.node 4624 } 4625 } else { 4626 N += G.y; 4627 M += G.x; 4628 this.node.jRemoveClass("mz-inner-zoom"); 4629 this.zoomBox.node.jRemoveClass("mz-inner") 4630 } 4631 this.zoomBox.node.jSetCss({ 4632 top: N, 4633 left: M 4634 }) 4635 } else { 4636 this.setSize(false); 4637 I = this.node; 4638 if (x.browser.mobile && !this.expanded && !this.zoomBox.activating && !this.zoomBox.active) { 4639 this.showHint(false, null, !(this.option("lazyZoom") && this.image.loaded())) 4640 } 4641 } 4642 this.zoomBox.node[this.expanded ? "jAddClass" : "jRemoveClass"]("mz-expanded"); 4643 if (!this.expanded && H) { 4644 H.jAppendTo(this.zoomBox.mode === "zoom" && L === "inner" ? this.zoomBox.node : this.node, ((Math.floor(Math.random() * 101) + 1) % 2) ? "top" : "bottom") 4645 } 4646 this.zoomBox.node.jAppendTo(I) 4647 }, 4648 changeZoomLevel: function(M) { 4649 var I; 4650 var G; 4651 var K; 4652 var J; 4653 var L = false; 4654 var H = M.isMouse ? 5 : 3 / 54; 4655 if (!this.zoomBox.active) { 4656 return 4657 } 4658 g(M).stop(); 4659 H = (100 + H * Math.abs(M.deltaY)) / 100; 4660 if (M.deltaY < 0) { 4661 H = 1 / H 4662 } 4663 if (this.zoomBox.mode === "magnifier") { 4664 G = Math.max(100, Math.round(this.zoomBox.width * H)); 4665 G = Math.min(G, this.size.width * 0.9); 4666 K = G / this.zoomBox.aspectRatio; 4667 this.zoomBox.width = Math.ceil(G);
4668 this.zoomBox.height = Math.ceil(K); 4669 this.zoomBox.node.jSetCss({ 4670 width: this.zoomBox.width, 4671 height: this.zoomBox.height 4672 }); 4673 I = this.zoomBox.node.getInnerSize(); 4674 this.zoomBox.innerWidth = Math.ceil(I.width); 4675 this.zoomBox.innerHeight = Math.ceil(I.height); 4676 L = true 4677 } else { 4678 if (!this.expanded && this.zoomBox.mode === "zoom") { 4679 G = Math.max(this.size.width, Math.round(this.zoomSize.width * H)); 4680 G = Math.min(G, this.zoomSize.maxWidth); 4681 K = G / (this.zoomSize.maxWidth / this.zoomSize.maxHeight); 4682 this.zoomSize.width = Math.ceil(G); 4683 this.zoomSize.height = Math.ceil(K) 4684 } else { 4685 return 4686 } 4687 } 4688 J = g(window).jGetScroll(); 4689 this.lens.width = (this.zoomBox.innerWidth / (this.zoomSize.width / this.size.width)); 4690 this.lens.height = (this.zoomBox.innerHeight / (this.zoomSize.height / this.size.height)); 4691 this.lens.node.jSetCss({ 4692 width: this.lens.width, 4693 height: this.lens.height 4694 }); 4695 x.extend(this.lens, this.lens.node.jGetSize()); 4696 if (this.zoomBox.active) { 4697 clearTimeout(this.moveTimer); 4698 this.moveTimer = null; 4699 if (L) { 4700 this.moveTimer = true 4701 } 4702 this.animate(null, { 4703 x: M.x - J.x, 4704 y: M.y - J.y 4705 }); 4706 if (L) { 4707 this.moveTimer = null 4708 } 4709 } 4710 }, 4711 registerActivateEvent: function(I) { 4712 var H; 4713 var G = I ? "dbltap btnclick" : "touchstart" + (window.navigator.pointerEnabled ? " pointerdown" : window.navigator.msPointerEnabled ? " MSPointerDown" : "") + (window.navigator.pointerEnabled ? " pointermove" : window.navigator.msPointerEnabled ? " MSPointerMove" : " mousemove"); 4714 var J = this.node.jFetch("mz:handlers:activate:fn", (!I) ? g(function(K) { 4715 if (K.isTouchEvent() && !K.isPrimaryTouch()) { 4716 return 4717 } 4718 if (K && K.pointerType === "touch" && K.type !== "pointerdown") { 4719 return 4720 } 4721 H = (x.browser.ieMode < 9) ? x.extend({}, K) : K; 4722 if (!this.activateTimer) { 4723 clearTimeout(this.activateTimer); 4724 this.activateTimer = setTimeout(g(function() { 4725 this.activate(H) 4726 }).jBind(this), 120) 4727 } 4728 }).jBindAsEvent(this) : g(this.activate).jBindAsEvent(this)); 4729 this.node.jStore("mz:handlers:activate:event", G).jAddEvent(G, J, 10) 4730 }, 4731 unregisterActivateEvent: function() { 4732 var G = this.node.jFetch("mz:handlers:activate:event"); 4733 var H = this.node.jFetch("mz:handlers:activate:fn"); 4734 this.node.jRemoveEvent(G, H); 4735 this.node.jDel("mz:handlers:activate:fn") 4736 }, 4737 registerDeactivateEvent: function(H) { 4738 var G = "touchend"; 4739 if (window.navigator.pointerEnabled) { 4740 G += " pointerup pointerout pointermove" 4741 } else { 4742 if (window.navigator.msPointerEnabled) { 4743 G += " MSPointerUp MSPointerOut MSPointerMove" 4744 } else { 4745 G += " mouseout mousemove" 4746 } 4747 } if (H) { 4748 if (this.expanded || x.browser.mobile) { 4749 G = "dbltap btnclick" 4750 } else { 4751 G += " dbltap btnclick" 4752 } 4753 } 4754 var I = this.node.jFetch("mz:handlers:deactivate:fn", g(function(K) { 4755 if (K.isTouchEvent() && !K.isPrimaryTouch()) { 4756 return 4757 } 4758 if (K && K.type === "pointerup" && K.pointerType !== "touch") { 4759 return 4760 } 4761 if (K && (K.type === "pointermove" || K.type === "MSPointerMove" || K.type === "mousemove")) { 4762 if (!this.ready || !this.zoomBox.enabled || !this.zoomBox.active) { 4763 return 4764 } 4765 var J = K.getClientXY(); 4766 if (J.x < this.boundaries.left || J.x > this.boundaries.right || J.y < this.boundaries.top || J.y > this.boundaries.bottom) { 4767 this.deactivate(K); 4768 return 4769 } 4770 } else { 4771 if (this.zoomBox.node !== K.getRelated() && !((this.zoomBox.position === "inner" || this.zoomBox.mode === "magnifier") && this.zoomBox.node.hasChild(K.getRelated())) && !this.node.hasChild(K.getRelated())) { 4772 this.deactivate(K); 4773 return 4774 } 4775 } 4776 }).jBindAsEvent(this)); 4777 this.node.jStore("mz:handlers:deactivate:event", G).jAddEvent(G, I, 20) 4778 }, 4779 unregisterDeactivateEvent: function() { 4780 var G = this.node.jFetch("mz:handlers:deactivate:event"); 4781 var H = this.node.jFetch("mz:handlers:deactivate:fn"); 4782 this.node.jRemoveEvent(G, H);
4783 this.node.jDel("mz:handlers:deactivate:fn") 4784 }, 4785 registerEvents: function() { 4786 this.moveBind = this.move.jBind(this); 4787 this.node.jAddEvent(["touchstart", window.navigator.pointerEnabled ? "pointerdown" : "MSPointerDown"], g(function(G) { 4788 if ((x.browser.androidBrowser || x.browser.platform === "android" && x.browser.gecko) && this.option("zoomMode") && this.option("zoomOn") !== "click" && G.type === "touchstart") { 4789 G.stopDefaults(); 4790 if (x.browser.gecko) { 4791 G.stopDistribution() 4792 } 4793 } 4794 if (!this.zoomBox.active) { 4795 return 4796 } 4797 if (this.zoomBox.position === "inner") { 4798 this.lens.spos = G.getClientXY() 4799 } 4800 }).jBindAsEvent(this), 10); 4801 this.node.jAddEvent(["touchend", window.navigator.pointerEnabled ? "pointerup" : "MSPointerUp"], g(function(G) { 4802 if (G.isTouchEvent() && G.isPrimaryTouch()) { 4803 this.lens.touchmovement = false 4804 } 4805 }).jBindAsEvent(this), 10); 4806 this.node.jAddEvent("touchmove " + (x.browser.platform === "android" ? "" : window.navigator.pointerEnabled ? "pointermove" : window.navigator.msPointerEnabled ? "MSPointerMove" : "mousemove"), g(this.animate).jBindAsEvent(this)); 4807 if (this.option("zoomMode")) { 4808 this.registerActivateEvent(this.option("zoomOn") === "click"); 4809 this.registerDeactivateEvent(this.option("zoomOn") === "click") 4810 } 4811 this.node.jAddEvent("mousedown", function(G) { 4812 G.stopDistribution() 4813 }, 10).jAddEvent("btnclick", g(function(G) { 4814 this.node.jRaiseEvent("MouseEvent", "click"); 4815 if (this.expanded) { 4816 this.expandBox.jCallEvent("btnclick", G) 4817 } 4818 }).jBind(this), 15); 4819 if (this.option("expand")) { 4820 this.node.jAddEvent("tap btnclick", g(this.expand).jBindAsEvent(this), 15) 4821 } else { 4822 this.node.jAddEvent("tap btnclick", g(this.openLink).jBindAsEvent(this), 15) 4823 } if (this.additionalImages.length > 1) { 4824 this.swipe() 4825 } 4826 if (!x.browser.mobile && this.option("variableZoom")) { 4827 this.node.jAddEvent("mousescroll", this.changeZoomLevel.jBindAsEvent(this)) 4828 } 4829 g(window).jAddEvent(x.browser.mobile ? "resize" : "resize scroll", this.onResize) 4830 }, 4831 unregisterEvents: function() { 4832 if (this.node) { 4833 this.node.jRemoveEvent("mousescroll") 4834 } 4835 g(window).jRemoveEvent("resize scroll", this.onResize); 4836 g(this.additionalImages).jEach(function(G) { 4837 g(G.origin).jClearEvents() 4838 }) 4839 }, 4840 activate: function(M) { 4841 var N; 4842 var L; 4843 var J; 4844 var K; 4845 var G; 4846 var H = 0; 4847 var I = 0; 4848 if (!this.image.loaded() || !this.ready || !this.zoomBox.enabled || this.zoomBox.active || this.zoomBox.activating) { 4849 if (!this.image.loaded() && !this.initEvent) { 4850 if (M) { 4851 this.initEvent = d(M); 4852 M.stopQueue() 4853 } 4854 this.image.load(this.setupZoom.jBind(this)); 4855 if (!this.loadTimer) { 4856 this.loadTimer = g(this.showLoading).jBind(this).jDelay(400) 4857 } 4858 } 4859 return 4860 } 4861 if (M && M.type === "pointermove" && M.pointerType === "touch") { 4862 return 4863 } 4864 if (!this.option("zoomMode") && this.option("expand") && !this.expanded) { 4865 this.zoomBox.active = true; 4866 return 4867 } 4868 this.zoomBox.activating = true; 4869 if (this.expanded && this.zoomBox.mode === "zoom") { 4870 K = this.image.node.jGetRect(); 4871 this.expandStage.jAddClass("mz-zoom-in"); 4872 G = this.expandFigure.jGetRect(); 4873 I = ((K.left + K.right) / 2 - (G.left + G.right) / 2); 4874 H = ((K.top + K.bottom) / 2 - (G.top + G.bottom) / 2) 4875 } 4876 this.zoomBox.image.jRemoveEvent("transitionend"); 4877 this.zoomBox.node.jRemoveClass("mz-deactivating").jRemoveEvent("transitionend"); 4878 this.zoomBox.node.jAddClass("mz-activating"); 4879 this.node.jAddClass("mz-activating"); 4880 this.reflowZoom(); 4881 L = (this.zoomBox.mode === "zoom") ? this.zoomBox.position : this.zoomBox.mode; 4882 if (x.browser.features.transition && !(this.expanded && this.option("expandZoomOn") === "always")) { 4883 if (L === "inner") { 4884 J = this.image.node.jGetSize(); 4885 this.zoomBox.image.jSetCss({ 4886 transform: "translate3d(0," + H + "px, 0) scale(" + J.width / this.zoomSize.width + ", " + J.height / this.zoomSize.height + ")" 4887 }).jGetSize(); 4888 this.zoomBox.image.jAddEvent("transitionend", g(function() { 4889 this.zoomBox.image.jRemoveEvent("transitionend"); 4890 this.zoomBox.node.jRemoveClass("mz-activating mz-p-" + L); 4891 this.zoomBox.activating = false; 4892 this.zoomBox.active = true 4893 }).jBind(this)); 4894 this.zoomBox.node.jAddClass("mz-p-" + L).jGetSize(); 4895 if (!x.browser.mobile && x.browser.chrome && (x.browser.uaName === "chrome" || x.browser.uaName === "opera")) { 4896 this.zoomBox.activating = false; 4897 this.zoomBox.active = true 4898 } 4899 } else { 4900 this.zoomBox.node.jAddEvent("transitionend", g(function() { 4901 this.zoomBox.node.jRemoveEvent("transitionend"); 4902 this.zoomBox.node.jRemoveClass("mz-activating mz-p-" + L) 4903 }).jBind(this)); 4904 this.zoomBox.node.jSetCss({ 4905 transition: "none" 4906 }); 4907 this.zoomBox.node.jAddClass("mz-p-" + L).jGetSize(); 4908 this.zoomBox.node.jSetCss({ 4909 transition: "" 4910 }).jGetSize(); 4911 this.zoomBox.node.jRemoveClass("mz-p-" + L); 4912 this.zoomBox.activating = false; 4913 this.zoomBox.active = true 4914 } 4915 } else { 4916 this.zoomBox.node.jRemoveClass("mz-activating"); 4917 this.zoomBox.activating = false; 4918 this.zoomBox.active = true 4919 } if (!this.expanded) { 4920 this.showHint(true) 4921 } 4922 if (M) { 4923 M.stop().stopQueue(); 4924 N = M.getClientXY(); 4925 if (this.zoomBox.mode === "magnifier" && (/tap/i).test(M.type)) { 4926 N.y -= this.zoomBox.height / 2 + 10 4927 } 4928 if (L === "inner" && ((/tap/i).test(M.type) || M.isTouchEvent())) { 4929 this.lens.pos = { 4930 x: 0, 4931 y: 0 4932 }; 4933 N.x = -(N.x - this.boundaries.left - this.size.width / 2) * (this.zoomSize.width / this.size.width); 4934 N.y = -(N.y - this.boundaries.top - this.size.height / 2) * (this.zoomSize.height / this.size.height) 4935 } 4936 } else { 4937 N = { 4938 x: this.boundaries.left + (this.boundaries.right - this.boundaries.left) / 2, 4939 y: this.boundaries.top + (this.boundaries.bottom - this.boundaries.top) / 2 4940 }; 4941 if (x.browser.mobile && this.expanded && this.option("expandZoomOn") === "always") { 4942 this.lens.innertouch = true; 4943 this.lens.pos = { 4944 x: 0, 4945 y: 0 4946 }; 4947 N.x = -(N.x - this.boundaries.left - this.size.width / 2) * (this.zoomSize.width / this.size.width); 4948 N.y = -(N.y - this.boundaries.top - this.size.height / 2) * (this.zoomSize.height / this.size.height) 4949 } 4950 } 4951 this.node.jRemoveClass("mz-activating").jAddClass("mz-active"); 4952 N.x += -I; 4953 N.y += -H; 4954 this.lens.spos = { 4955 x: 0, 4956 y: 0 4957 }; 4958 this.lens.dx = 0; 4959 this.lens.dy = 0; 4960 this.animate(M, N, true); 4961 r("onZoomIn", this.id) 4962 }, 4963 deactivate: function(I, N) { 4964 var L; 4965 var J; 4966 var G; 4967 var H; 4968 var K = 0; 4969 var M = 0; 4970 var O = this.zoomBox.active; 4971 this.initEvent = null; 4972 if (!this.ready) { 4973 return 4974 } 4975 if (I && I.type === "pointerout" && I.pointerType === "touch") { 4976 return 4977 } 4978 clearTimeout(this.moveTimer); 4979 this.moveTimer = null; 4980 clearTimeout(this.activateTimer); 4981 this.activateTimer = null; 4982 this.zoomBox.activating = false; 4983 this.zoomBox.active = false; 4984 if (N !== true && !this.expanded) { 4985 if (O) { 4986 if (x.browser.mobile && !this.expanded && this.zoomBox.mode === "zoom") { 4987 this.reflowZoom() 4988 } else { 4989 this.showHint() 4990 } 4991 } 4992 } 4993 if (!this.zoomBox.enabled) { 4994 return 4995 } 4996 if (I) { 4997 I.stop() 4998 } 4999 this.zoomBox.image.jRemoveEvent("transitionend"); 5000 this.zoomBox.node.jRemoveClass("mz-activating").jRemoveEvent("transitionend"); 5001 if (this.expanded) { 5002 H = this.expandFigure.jGetRect(); 5003 if (this.option("expandZoomOn") !== "always") { 5004 this.expandStage.jRemoveClass("mz-zoom-in") 5005 } 5006 this.image.node.jSetCss({ 5007 "max-height": this.expandMaxHeight() 5008 }); 5009 G = this.image.node.jGetRect(); 5010 M = ((G.left + G.right) / 2 - (H.left + H.right) / 2);
5011 K = ((G.top + G.bottom) / 2 - (H.top + H.bottom) / 2) 5012 } 5013 L = (this.zoomBox.mode === "zoom") ? this.zoomBox.position : this.zoomBox.mode; 5014 if (x.browser.features.transition && I && !(this.expanded && this.option("expandZoomOn") === "always")) { 5015 if (L === "inner") { 5016 this.zoomBox.image.jAddEvent("transitionend", g(function() { 5017 this.zoomBox.image.jRemoveEvent("transitionend"); 5018 this.node.jRemoveClass("mz-active"); 5019 setTimeout(g(function() { 5020 this.zoomBox.hide() 5021 }).jBind(this), 32) 5022 }).jBind(this)); 5023 J = this.image.node.jGetSize(); 5024 this.zoomBox.node.jAddClass("mz-deactivating mz-p-" + L).jGetSize(); 5025 this.zoomBox.image.jSetCss({ 5026 transform: "translate3d(0," + K + "px,0) scale(" + J.width / this.zoomSize.maxWidth + ", " + J.height / this.zoomSize.maxHeight + ")" 5027 }) 5028 } else { 5029 this.zoomBox.node.jAddEvent("transitionend", g(function() { 5030 this.zoomBox.hide(); 5031 this.node.jRemoveClass("mz-active") 5032 }).jBind(this)); 5033 this.zoomBox.node.jGetCss("opacity"); 5034 this.zoomBox.node.jAddClass("mz-deactivating mz-p-" + L); 5035 this.node.jRemoveClass("mz-active") 5036 } 5037 } else { 5038 this.zoomBox.hide(); 5039 this.node.jRemoveClass("mz-active") 5040 } 5041 this.lens.dx = 0; 5042 this.lens.dy = 0; 5043 this.lens.spos = { 5044 x: 0, 5045 y: 0 5046 }; 5047 this.lens.hide(); 5048 if (O) { 5049 r("onZoomOut", this.id) 5050 } 5051 }, 5052 animate: function(Q, P, O) { 5053 var I = P; 5054 var K; 5055 var J; 5056 var M = 0; 5057 var H; 5058 var L = 0; 5059 var G; 5060 var R; 5061 var N = false; 5062 if (!this.zoomBox.active && !O) { 5063 return 5064 } 5065 if (Q) { 5066 g(Q).stopDefaults().stopDistribution(); 5067 if (Q.isTouchEvent() && !Q.isPrimaryTouch()) { 5068 return 5069 } 5070 N = (/tap/i).test(Q.type) || Q.isTouchEvent(); 5071 if (N && !this.lens.touchmovement) { 5072 this.lens.touchmovement = N 5073 } 5074 if (!I) { 5075 I = Q.getClientXY() 5076 } 5077 } 5078 if (this.zoomBox.mode === "preview") { 5079 return 5080 } 5081 if (this.zoomBox.mode === "zoom" && this.zoomBox.position === "inner" && (Q && N || !Q && this.lens.innertouch)) { 5082 this.lens.innertouch = true; 5083 K = this.lens.pos.x + (I.x - this.lens.spos.x); 5084 J = this.lens.pos.y + (I.y - this.lens.spos.y); 5085 this.lens.spos = I; 5086 M = Math.min(0, this.zoomBox.innerWidth - this.zoomSize.width) / 2; 5087 H = -M; 5088 L = Math.min(0, this.zoomBox.innerHeight - this.zoomSize.height) / 2; 5089 G = -L 5090 } else { 5091 this.lens.innertouch = false; 5092 if (this.zoomBox.mode === "magnifier") { 5093 I.y = Math.max(this.boundaries.top, Math.min(I.y, this.boundaries.bottom)); 5094 I.x = Math.max(this.boundaries.left, Math.min(I.x, this.boundaries.right)) 5095 } 5096 K = I.x - this.boundaries.left; 5097 J = I.y - this.boundaries.top; 5098 H = this.size.width - this.lens.width; 5099 G = this.size.height - this.lens.height; 5100 K -= this.lens.width / 2; 5101 J -= this.lens.height / 2 5102 } if (this.zoomBox.mode !== "magnifier") { 5103 K = Math.max(M, Math.min(K, H)); 5104 J = Math.max(L, Math.min(J, G)) 5105 } 5106 this.lens.pos.x = K; 5107 this.lens.pos.y = J; 5108 if (this.zoomBox.mode === "zoom" && this.zoomBox.position !== "inner") { 5109 if (x.browser.features.transform) { 5110 this.lens.node.jSetCss({ 5111 transform: "translate(" + this.lens.pos.x + "px," + this.lens.pos.y + "px)" 5112 }); 5113 this.lens.image.jSetCss({ 5114 transform: "translate(" + -(this.lens.pos.x + this.lens.border.x) + "px, " + -(this.lens.pos.y + this.lens.border.y) + "px)" 5115 }) 5116 } else { 5117 this.lens.node.jSetCss({ 5118 top: this.lens.pos.y, 5119 left: this.lens.pos.x 5120 }); 5121 this.lens.image.jSetCss({ 5122 top: -(this.lens.pos.y + this.lens.border.y), 5123 left: -(this.lens.pos.x + this.lens.border.x) 5124 }) 5125 } 5126 } 5127 if (this.zoomBox.mode === "magnifier") { 5128 if (this.lens.touchmovement && !(Q && Q.type === "dbltap")) { 5129 I.y -= this.zoomBox.height / 2 + 10 5130 } 5131 this.zoomBox.node.jSetCss({ 5132 top: I.y - this.boundaries.top - this.zoomBox.height / 2, 5133 left: I.x - this.boundaries.left - this.zoomBox.width / 2 5134 }) 5135 } 5136 if (!this.moveTimer) { 5137 this.lens.dx = 0; 5138 this.lens.dy = 0; 5139 this.move(1) 5140 } 5141 }, 5142 move: function(L) { 5143 var J; 5144 var H; 5145 var G; 5146 var M; 5147 var K; 5148 var I; 5149 if (!isFinite(L)) { 5150 if (this.lens.innertouch) { 5151 L = this.lens.touchmovement ? 0.4 : 0.16 5152 } else { 5153 L = this.option("smoothing") ? 0.2 : this.lens.touchmovement ? 0.4 : 0.8 5154 } 5155 } 5156 J = ((this.lens.pos.x - this.lens.dx) * L); 5157 H = ((this.lens.pos.y - this.lens.dy) * L); 5158 this.lens.dx += J; 5159 this.lens.dy += H; 5160 if (!this.moveTimer || Math.abs(J) > 0.000001 || Math.abs(H) > 0.000001) { 5161 if (this.lens.innertouch) { 5162 G = this.lens.dx; 5163 M = this.lens.dy 5164 } else { 5165 G = (this.lens.dx * (this.zoomSize.width / this.size.width) - Math.max(0, this.zoomSize.width - this.zoomBox.innerWidth) / 2); 5166 M = (this.lens.dy * (this.zoomSize.height / this.size.height) - Math.max(0, this.zoomSize.height - this.zoomBox.innerHeight) / 2); 5167 if (this.zoomBox.mode === "magnifier") { 5168 G = Math.round(G); 5169 M = Math.round(M) 5170 } 5171 G = -G; 5172 M = -M 5173 } 5174 K = this.zoomSize.width / this.zoomSize.maxWidth; 5175 I = this.zoomSize.height / this.zoomSize.maxHeight; 5176 this.zoomBox.image.jSetCss(x.browser.features.transform ? { 5177 transform: f + G + "px," + M + "px" + z + " scale(" + K + "," + I + ")" 5178 } : { 5179 width: this.zoomSize.width, 5180 height: this.zoomSize.height, 5181 left: -(this.lens.dx * (this.zoomSize.width / this.size.width) + Math.min(0, this.zoomSize.width - this.zoomBox.innerWidth) / 2), 5182 top: -(this.lens.dy * (this.zoomSize.height / this.size.height) + Math.min(0, this.zoomSize.height - this.zoomBox.innerHeight) / 2) 5183 }) 5184 } 5185 if (this.zoomBox.mode === "magnifier") { 5186 return 5187 } 5188 this.moveTimer = setTimeout(this.moveBind, 16) 5189 }, 5190 swipe: function() { 5191 var S; 5192 var I; 5193 var N = 30; 5194 var K = 201; 5195 var P; 5196 var Q = ""; 5197 var H = {}; 5198 var G; 5199 var M; 5200 var R = 0; 5201 var T = { 5202 transition: x.browser.cssTransform + String.fromCharCode(32) + "300ms cubic-bezier(.18,.35,.58,1)" 5203 }; 5204 var J; 5205 var O; 5206 var L = g(function(U) { 5207 if (!this.ready || this.zoomBox.active) { 5208 return 5209 } 5210 if (U.state === "dragstart") { 5211 clearTimeout(this.activateTimer); 5212 this.activateTimer = null; 5213 R = 0; 5214 H = { 5215 x: U.x, 5216 y: U.y, 5217 ts: U.timeStamp 5218 }; 5219 S = this.size.width; 5220 I = S / 2; 5221 this.image.node.jRemoveEvent("transitionend"); 5222 this.image.node.jSetCssProp("transition", ""); 5223 this.image.node.jSetCssProp("transform", "translate3d(0, 0, 0)"); 5224 O = null 5225 } else { 5226 G = (U.x - H.x); 5227 M = { 5228 x: 0, 5229 y: 0, 5230 z: 0 5231 }; 5232 if (O === null) { 5233 O = (Math.abs(U.x - H.x) < Math.abs(U.y - H.y)) 5234 } 5235 if (O) { 5236 return 5237 } 5238 U.stop(); 5239 if (U.state === "dragend") { 5240 R = 0; 5241 J = null; 5242 P = U.timeStamp - H.ts; 5243 if (Math.abs(G) > I || (P < K && Math.abs(G) > N)) { 5244 if ((Q = (G > 0) ? "backward" : (G <= 0) ? "forward" : "")) { 5245 if (Q === "backward") { 5246 J = this.getPrev(); 5247 R += S * 10 5248 } else { 5249 J = this.getNext(); 5250 R -= S * 10 5251 } 5252 } 5253 } 5254 M.x = R; 5255 M.deg = -90 * (M.x / S); 5256 this.image.node.jAddEvent("transitionend", g(function(V) { 5257 this.image.node.jRemoveEvent("transitionend"); 5258 this.image.node.jSetCssProp("transition", ""); 5259 if (J) { 5260 this.image.node.jSetCss({ 5261 transform: "translate3d(" + M.x + "px, 0px, 0px)" 5262 }); 5263 this.update(J, true) 5264 } 5265 }).jBind(this)); 5266 this.image.node.jSetCss(T); 5267 this.image.node.jSetCss({ 5268 "transition-duration": M.x ? "100ms" : "300ms", 5269 opacity: 1 - 0.2 * Math.abs(M.x / S), 5270 transform: "translate3d(" + M.x + "px, 0px, 0px)" 5271 }); 5272 G = 0; 5273 return 5274 } 5275 M.x = G; 5276 M.z = -50 * Math.abs(M.x / I); 5277 M.deg = -60 * (M.x / I); 5278 this.image.node.jSetCss({ 5279 opacity: 1 - 0.2 * Math.abs(M.x / I), 5280 transform: "translate3d(" + M.x + "px, 0px, " + M.z + "px)" 5281 }) 5282 } 5283 }).jBind(this); 5284 this.node.jAddEvent("touchdrag", L) 5285 }, 5286 openLink: function() { 5287 if (this.image.link) { 5288 window.open(this.image.link, "_self") 5289 } 5290 }, 5291 getNext: function() { 5292 var G = (this.expanded ? this.expandGallery : this.additionalImages).filter(function(J) { 5293 return (J.small.state !== -1 || J.zoom.state !== -1) 5294 }); 5295 var H = G.length; 5296 var I = g(G).indexOf(this.image) + 1; 5297 return (H <= 1) ? null : G[(I >= H) ? 0 : I] 5298 }, 5299 getPrev: function() { 5300 var G = (this.expanded ? this.expandGallery : this.additionalImages).filter(function(J) { 5301 return (J.small.state !== -1 || J.zoom.state !== -1) 5302 }); 5303 var H = G.length; 5304 var I = g(G).indexOf(this.image) - 1; 5305 return (H <= 1) ? null : G[(I < 0) ? H - 1 : I] 5306 }, 5307 imageByURL: function(H, I) { 5308 var G = this.additionalImages.filter(function(J) { 5309 return ((J.zoom.src.has(H) || J.zoom.url.has(H)) && (J.small.src.has(I) || J.small.url.has(I))) 5310 }) || []; 5311 return G[0] || ((I && H && x.jTypeOf(I) === "string" && x.jTypeOf(H) === "string") ? new j(I, H) : null) 5312 }, 5313 imageByOrigin: function(H) { 5314 var G = this.additionalImages.filter(function(I) { 5315 return (I.origin === H) 5316 }) || []; 5317 return G[0] 5318 }, 5319 imageByIndex: function(G) { 5320 return this.additionalImages[G] 5321 } 5322 }; 5323 s = { 5324 version: "v5.2.9 DEMO", 5325 start: function(J, H) { 5326 var I = null; 5327 var G = []; 5328 x.$A((J ? [g(J)] : x.$A(document.byClass("MagicZoom")).concat(x.$A(document.byClass("MagicZoomPlus"))))).jEach(g(function(K) { 5329 if (g(K)) { 5330 if (!h(K)) { 5331 I = new i(K, H); 5332 if (w && !I.option("autostart")) { 5333 I.stop(); 5334 I = null 5335 } else { 5336 D.push(I); 5337 G.push(I) 5338 } 5339 } 5340 } 5341 }).jBind(this)); 5342 return J ? G[0] : G 5343 }, 5344 stop: function(J) { 5345 var H, I, G; 5346 if (J) { 5347 (I = h(J)) && (I = D.splice(D.indexOf(I), 1)) && I[0].stop() && (delete I[0]); 5348 return 5349 } 5350 while (H = D.length) { 5351 I = D.splice(H - 1, 1); 5352 I[0].stop(); 5353 delete I[0] 5354 } 5355 }, 5356 refresh: function(G) { 5357 this.stop(G); 5358 return this.start(G) 5359 }, 5360 update: function(L, K, J, H) { 5361 var I = h(L); 5362 var G; 5363 if (I) { 5364 G = x.jTypeOf(K) === "element" ? I.imageByOrigin(K) : I.imageByURL(K, J); 5365 if (G) { 5366 I.update(G) 5367 } 5368 } 5369 }, 5370 switchTo: function(J, I) { 5371 var H = h(J); 5372 var G; 5373 if (H) { 5374 switch (x.jTypeOf(I)) { 5375 case "element": 5376 G = H.imageByOrigin(I); 5377 break; 5378 case "number": 5379 G = H.imageByIndex(I); 5380 break; 5381 default: 5382 } 5383 if (G) { 5384 H.update(G) 5385 } 5386 } 5387 }, 5388 prev: function(H) { 5389 var G; 5390 (G = h(H)) && G.update(G.getPrev()) 5391 }, 5392 next: function(H) { 5393 var G; 5394 (G = h(H)) && G.update(G.getNext()) 5395 }, 5396 zoomIn: function(H) { 5397 var G; 5398 (G = h(H)) && G.activate() 5399 }, 5400 zoomOut: function(H) { 5401 var G; 5402 (G = h(H)) && G.deactivate() 5403 }, 5404 registerCallback: function(G, H) { 5405
5405 if (!o[G]) { 5406 o[G] = [] 5407 } 5408 if (x.jTypeOf(H) === "function") { 5409 o[G].push(H) 5410 } 5411 }, 5412 running: function(G) { 5413 return !!h(G) 5414 } 5415 }; 5416 g(document).jAddEvent("domready", function() { 5417 var H = window[B + "Options"] || {}; 5418 q = q(); 5419 c(); 5420 F = x.$new("div", { 5421 "class": "magic-hidden-wrapper" 5422 }).jAppendTo(document.body); 5423 E = (x.browser.mobile && window.matchMedia && window.matchMedia("(max-device-width: 767px), (max-device-height: 767px)").matches); 5424 if (x.browser.mobile) { 5425 x.extend(n, k) 5426 } 5427 for (var G = 0; G < y.length; G++) { 5428 if (H[y[G]] && x.$F !== H[y[G]]) { 5429 s.registerCallback(y[G], H[y[G]]) 5430 } 5431 } 5432 s.start(); 5433 w = false 5434 }); 5435 window.MagicZoomPlus = window.MagicZoomPlus || {}; 5436 return s 5437})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.