Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 20th, 2012  |  syntax: JavaScript  |  size: 91.88 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /*!
  2.  * tn3 v1.2.0.45
  3.  * http://tn3gallery.com/
  4.  *
  5.  * License
  6.  * http://tn3gallery.com/license
  7.  *
  8.  * Date: 12 Apr, 2012 18:43:50 +0200
  9.  */ (function (f) {
  10.     function c(h) {
  11.         var i = h.skinDir + "/" + h.skin,
  12.             l = j[i];
  13.         if (l) l.loaded ? a.call(this, h, l.html) : l.queue.push({
  14.             c: this,
  15.             s: h
  16.         });
  17.         else {
  18.             j[i] = {
  19.                 loaded: false,
  20.                 queue: [{
  21.                     c: this,
  22.                     s: h
  23.                 }]
  24.             };
  25.             f.ajax({
  26.                 url: i + ".html",
  27.                 dataType: "text",
  28.                 success: function (m) {
  29.                     var p = j[i];
  30.                     p.loaded = true;
  31.                     p.html = m;
  32.                     for (m = 0; m < p.queue.length; m++) a.call(p.queue[m].c, p.queue[m].s, p.html)
  33.                 },
  34.                 dataFilter: function (m) {
  35.                     return m = m.substring(m.indexOf("<body>") + 6, m.lastIndexOf("</body>"))
  36.                 },
  37.                 error: function () {
  38.                     if (h.error) {
  39.                         var m = f.Event("tn3_error");
  40.                         m.description = "tn3 skin load error";
  41.                         h.error(m)
  42.                     }
  43.                 }
  44.             })
  45.         }
  46.         return this
  47.     }
  48.     function a(h, i) {
  49.         this.each(function () {
  50.             for (var l = f(this), m, p, q = i.indexOf("<img src="); q != -1;) {
  51.                 q += 10;
  52.                 p = i.indexOf('"', q);
  53.                 m = h.skinDir + "/" + i.substring(q, p);
  54.                 i = i.substr(0, q) + m + i.substr(p);
  55.                 q = i.indexOf("<img src=", q)
  56.             }
  57.             l.append(i);
  58.             l.data("tn3").init(l, h.fullOnly)
  59.         })
  60.     }
  61.     function d(h) {
  62.         var i = [],
  63.             l = h.children(".tn3.album"),
  64.             m, p;
  65.         if (l.length > 0) l.each(function (q) {
  66.             m = f(this);
  67.             i[q] = {
  68.                 title: m.find(":header").html()
  69.             };
  70.             f.extend(i[q], e(m));
  71.             if (p = b(m)) {
  72.                 i[q].imgs = p;
  73.                 if (!i[q].thumb) i[q].thumb = i[q].imgs[0].thumb
  74.             }
  75.         });
  76.         else if (p = b(h)) i[0] = {
  77.             imgs: p
  78.         };
  79.         return i
  80.     }
  81.     function b(h) {
  82.         var i = [],
  83.             l, m;
  84.         l = h.find("li");
  85.         if (l.length > 0) l.each(function (p) {
  86.             m = f(this);
  87.             $firsta = m.find("a:not(.tn3 > a)").filter(":first");
  88.             i[p] = {
  89.                 title: m.find(":header").filter(":first").html()
  90.             };
  91.             if ($firsta.length > 0) {
  92.                 i[p].img = $firsta.attr("href");
  93.                 i[p].thumb = $firsta.find("img").attr("src")
  94.             } else i[p].img = m.find("img").filter(":first").attr("src");
  95.             f.extend(i[p], e(m))
  96.         });
  97.         else {
  98.             l = h.find("img");
  99.             l.each(function (p) {
  100.                 m = f(this);
  101.                 $at = m.parent("a");
  102.                 i[p] = $at.length == 0 ? {
  103.                     title: m.attr("title"),
  104.                     img: m.attr("src")
  105.                 } : {
  106.                     title: m.attr("title"),
  107.                     img: $at.attr("href"),
  108.                     thumb: m.attr("src")
  109.                 }
  110.             })
  111.         }
  112.         if (i.length == 0) return null;
  113.         return i
  114.     }
  115.     function e(h) {
  116.         var i = {};
  117.         h = h.children(".tn3");
  118.         var l;
  119.         f.each(h, function () {
  120.             l = f(this);
  121.             i[l.attr("class").substr(4)] = l.html()
  122.         });
  123.         return i
  124.     }
  125.     function g(h) {
  126.         f('a[href^="#tn3-' + h + '"]').click(function (i) {
  127.             var l = n[h];
  128.             i = f(i.currentTarget).attr("href");
  129.             i = i.substr(i.indexOf("-", 5) + 1);
  130.             i = i.split("-");
  131.             switch (i[0]) {
  132.             case "next":
  133.                 l.cAlbum != null && l.show("next", i[1] == "fs");
  134.                 break;
  135.             case "prev":
  136.                 l.cAlbum != null && l.show("prev", i[1] == "fs");
  137.                 break;
  138.             default:
  139.                 l.cAlbum != parseInt(i[0]) ? l.showAlbum(parseInt(i[0]), parseInt(i[1]), i[2] == "fs") : l.show(parseInt(i[1]), i[2] == "fs")
  140.             }
  141.         })
  142.     }
  143.     function k() {
  144.         if (n.length == 0) {
  145.             var h = f(".tn3gallery");
  146.             h.length > 0 && h.tn3({})
  147.         }
  148.     }
  149.     if (/1\.(0|1|2|3|4)\.(0|1)/.test(f.fn.jquery) || /^1.1/.test(f.fn.jquery) || /^1.2/.test(f.fn.jquery) || /^1.3/.test(f.fn.jquery)) alert("tn3gallery requires jQuery v1.4.2 or later!  You are using v" + f.fn.jquery);
  150.     else {
  151.         var j = {},
  152.             n = [];
  153.         f.fn.tn3 = function (h) {
  154.             f.each(["skin", "startWithAlbums", "external"], function (l, m) {
  155.                 var p = m.split(".");
  156.                 if (p.length > 1 && h[p[0]]) delete h[p[0]][p[1]];
  157.                 else delete h[m]
  158.             });
  159.             h = f.extend(true, {}, f.fn.tn3.config, h);
  160.             if (h.skin != null) if (typeof h.skin == "object") {
  161.                 h.skinDir += "/" + h.skin[0];
  162.                 if (h.cssID == null) h.cssID = h.skin[0];
  163.                 h.skin = h.skin[1]
  164.             } else h.skinDir += "/" + h.skin;
  165.             else {
  166.                 h.skin = "tn3";
  167.                 h.skinDir += "/tn3";
  168.                 var i = true
  169.             }
  170.             if (h.cssID == null) h.cssID = h.skin == null ? "tn3" : h.skin;
  171.             this.each(function () {
  172.                 var l = f(this);
  173.                 h.fullOnly ? l.hide() : l.css("visibility", "hidden");
  174.                 var m = h.data ? h.data : d(l);
  175.                 m = n.push(new f.fn.tn3.Gallery(m, h)) - 1;
  176.                 l.data("tn3", n[m]);
  177.                 for (var p = 0; p < f.fn.tn3.plugins.length; p++) f.fn.tn3.plugins[p].init(l, h);
  178.                 l.empty();
  179.                 g(m)
  180.             });
  181.             i ? a.call(this, h, h.skinDefault) : c.call(this, h);
  182.             return this
  183.         };
  184.         f.fn.tn3.plugins = [];
  185.         f.fn.tn3.plugIn = function (h, i) {
  186.             f.fn.tn3.plugins.push({
  187.                 id: h,
  188.                 init: i
  189.             })
  190.         };
  191.         f.fn.tn3.version = "1.2.0.45";
  192.         f.fn.tn3.config = {
  193.             data: null,
  194.             skin: null,
  195.             skinDir: "skins",
  196.             skinDefault: '<div class="tn3-gallery"><div class="tn3-image"><div class="tn3-text-bg"><div class="tn3-image-title"></div><div class="tn3-image-description"></div></div><div class="tn3-next tn3_v tn3_o"></div><div class="tn3-prev tn3_v tn3_o"></div><div class="tn3-preloader tn3_h tn3_v"><img src="preload.gif"/></div><div class="tn3-timer"></div></div><div class="tn3-controls-bg tn3_rh"><div class="tn3-sep1"></div><div class="tn3-sep2"></div><div class="tn3-sep3"></div></div><div class="tn3-thumbs"></div><div class="tn3-fullscreen"></div><div class="tn3-show-albums"></div><div class="tn3-next-page"></div><div class="tn3-prev-page"></div><div class="tn3-play"></div><div class="tn3-count"></div><div class="tn3-albums"><div class="tn3-inalbums"><div class="tn3-album"></div></div><div class="tn3-albums-next"></div><div class="tn3-albums-prev"></div><div class="tn3-albums-close"></div></div></div>',
  197.             cssID: null
  198.         };
  199.         f.fn.tn3.translations = {};
  200.         f.fn.tn3.translate = function (h, i) {
  201.             if (i) f.fn.tn3.translations[h] = i;
  202.             else {
  203.                 var l = f.fn.tn3.translations[h];
  204.                 return l ? l : h
  205.             }
  206.         };
  207.         f(function () {
  208.             setTimeout(k, 1)
  209.         })
  210.     }
  211. })(jQuery);
  212. (function (f) {
  213.     f.fn.tn3utils = U = {};
  214.     U.shuffle = function (c) {
  215.         var a, d, b = c.length;
  216.         if (b) for (; --b;) {
  217.             d = Math.floor(Math.random() * (b + 1));
  218.             a = c[d];
  219.             c[d] = c[b];
  220.             c[b] = a
  221.         }
  222.     };
  223.     f.extend(f.easing, {
  224.         def: "easeOutQuad",
  225.         swing: function (c, a, d, b, e) {
  226.             return f.easing[f.easing.def](c, a, d, b, e)
  227.         },
  228.         linear: function (c, a, d, b, e) {
  229.             return b * a / e + d
  230.         },
  231.         easeInQuad: function (c, a, d, b, e) {
  232.             return b * (a /= e) * a + d
  233.         },
  234.         easeOutQuad: function (c, a, d, b, e) {
  235.             return -b * (a /= e) * (a - 2) + d
  236.         },
  237.         easeInOutQuad: function (c, a, d, b, e) {
  238.             if ((a /= e / 2) < 1) return b / 2 * a * a + d;
  239.             return -b / 2 * (--a * (a - 2) - 1) + d
  240.         },
  241.         easeInCubic: function (c, a, d, b, e) {
  242.             return b * (a /= e) * a * a + d
  243.         },
  244.         easeOutCubic: function (c, a, d, b, e) {
  245.             return b * ((a = a / e - 1) * a * a + 1) + d
  246.         },
  247.         easeInOutCubic: function (c, a, d, b, e) {
  248.             if ((a /= e / 2) < 1) return b / 2 * a * a * a + d;
  249.             return b / 2 * ((a -= 2) * a * a + 2) + d
  250.         },
  251.         easeInQuart: function (c, a, d, b, e) {
  252.             return b * (a /= e) * a * a * a + d
  253.         },
  254.         easeOutQuart: function (c, a, d, b, e) {
  255.             return -b * ((a = a / e - 1) * a * a * a - 1) + d
  256.         },
  257.         easeInOutQuart: function (c, a, d, b, e) {
  258.             if ((a /= e / 2) < 1) return b / 2 * a * a * a * a + d;
  259.             return -b / 2 * ((a -= 2) * a * a * a - 2) + d
  260.         },
  261.         easeInQuint: function (c, a, d, b, e) {
  262.             return b * (a /= e) * a * a * a * a + d
  263.         },
  264.         easeOutQuint: function (c, a, d, b, e) {
  265.             return b * ((a = a / e - 1) * a * a * a * a + 1) + d
  266.         },
  267.         easeInOutQuint: function (c, a, d, b, e) {
  268.             if ((a /= e / 2) < 1) return b / 2 * a * a * a * a * a + d;
  269.             return b / 2 * ((a -= 2) * a * a * a * a + 2) + d
  270.         },
  271.         easeInSine: function (c, a, d, b, e) {
  272.             return -b * Math.cos(a / e * (Math.PI / 2)) + b + d
  273.         },
  274.         easeOutSine: function (c, a, d, b, e) {
  275.             return b * Math.sin(a / e * (Math.PI / 2)) + d
  276.         },
  277.         easeInOutSine: function (c, a, d, b, e) {
  278.             return -b / 2 * (Math.cos(Math.PI * a / e) - 1) + d
  279.         },
  280.         easeInExpo: function (c, a, d, b, e) {
  281.             return a == 0 ? d : b * Math.pow(2, 10 * (a / e - 1)) + d
  282.         },
  283.         easeOutExpo: function (c, a, d, b, e) {
  284.             return a == e ? d + b : b * (-Math.pow(2, -10 * a / e) + 1) + d
  285.         },
  286.         easeInOutExpo: function (c, a, d, b, e) {
  287.             if (a == 0) return d;
  288.             if (a == e) return d + b;
  289.             if ((a /= e / 2) < 1) return b / 2 * Math.pow(2, 10 * (a - 1)) + d;
  290.             return b / 2 * (-Math.pow(2, -10 * --a) + 2) + d
  291.         },
  292.         easeInCirc: function (c, a, d, b, e) {
  293.             return -b * (Math.sqrt(1 - (a /= e) * a) - 1) + d
  294.         },
  295.         easeOutCirc: function (c, a, d, b, e) {
  296.             return b * Math.sqrt(1 - (a = a / e - 1) * a) + d
  297.         },
  298.         easeInOutCirc: function (c, a, d, b, e) {
  299.             if ((a /= e / 2) < 1) return -b / 2 * (Math.sqrt(1 - a * a) - 1) + d;
  300.             return b / 2 * (Math.sqrt(1 - (a -= 2) * a) + 1) + d
  301.         },
  302.         easeInElastic: function (c, a, d, b, e) {
  303.             c = 1.70158;
  304.             var g = 0,
  305.                 k = b;
  306.             if (a == 0) return d;
  307.             if ((a /= e) == 1) return d + b;
  308.             g || (g = e * 0.3);
  309.             if (k < Math.abs(b)) {
  310.                 k = b;
  311.                 c = g / 4
  312.             } else c = g / (2 * Math.PI) * Math.asin(b / k);
  313.             return -(k * Math.pow(2, 10 * (a -= 1)) * Math.sin((a * e - c) * 2 * Math.PI / g)) + d
  314.         },
  315.         easeOutElastic: function (c, a, d, b, e) {
  316.             c = 1.70158;
  317.             var g = 0,
  318.                 k = b;
  319.             if (a == 0) return d;
  320.             if ((a /= e) == 1) return d + b;
  321.             g || (g = e * 0.3);
  322.             if (k < Math.abs(b)) {
  323.                 k = b;
  324.                 c = g / 4
  325.             } else c = g / (2 * Math.PI) * Math.asin(b / k);
  326.             return k * Math.pow(2, -10 * a) * Math.sin((a * e - c) * 2 * Math.PI / g) + b + d
  327.         },
  328.         easeInOutElastic: function (c, a, d, b, e) {
  329.             c = 1.70158;
  330.             var g = 0,
  331.                 k = b;
  332.             if (a == 0) return d;
  333.             if ((a /= e / 2) == 2) return d + b;
  334.             g || (g = e * 0.3 * 1.5);
  335.             if (k < Math.abs(b)) {
  336.                 k = b;
  337.                 c = g / 4
  338.             } else c = g / (2 * Math.PI) * Math.asin(b / k);
  339.             if (a < 1) return -0.5 * k * Math.pow(2, 10 * (a -= 1)) * Math.sin((a * e - c) * 2 * Math.PI / g) + d;
  340.             return k * Math.pow(2, -10 * (a -= 1)) * Math.sin((a * e - c) * 2 * Math.PI / g) * 0.5 + b + d
  341.         },
  342.         easeInBack: function (c, a, d, b, e, g) {
  343.             if (g == undefined) g = 1.70158;
  344.             return b * (a /= e) * a * ((g + 1) * a - g) + d
  345.         },
  346.         easeOutBack: function (c, a, d, b, e, g) {
  347.             if (g == undefined) g = 1.70158;
  348.             return b * ((a = a / e - 1) * a * ((g + 1) * a + g) + 1) + d
  349.         },
  350.         easeInOutBack: function (c, a, d, b, e, g) {
  351.             if (g == undefined) g = 1.70158;
  352.             if ((a /= e / 2) < 1) return b / 2 * a * a * (((g *= 1.525) + 1) * a - g) + d;
  353.             return b / 2 * ((a -= 2) * a * (((g *= 1.525) + 1) * a + g) + 2) + d
  354.         },
  355.         easeInBounce: function (c, a, d, b, e) {
  356.             return b - f.easing.easeOutBounce(c, e - a, 0, b, e) + d
  357.         },
  358.         easeOutBounce: function (c, a, d, b, e) {
  359.             return (a /= e) < 1 / 2.75 ? b * 7.5625 * a * a + d : a < 2 / 2.75 ? b * (7.5625 * (a -= 1.5 / 2.75) * a + 0.75) + d : a < 2.5 / 2.75 ? b * (7.5625 * (a -= 2.25 / 2.75) * a + 0.9375) + d : b * (7.5625 * (a -= 2.625 / 2.75) * a + 0.984375) + d
  360.         },
  361.         easeInOutBounce: function (c, a, d, b, e) {
  362.             if (a < e / 2) return f.easing.easeInBounce(c, a * 2, 0, b, e) * 0.5 + d;
  363.             return f.easing.easeOutBounce(c, a * 2 - e, 0, b, e) * 0.5 + b * 0.5 + d
  364.         }
  365.     })
  366. })(jQuery);
  367. (function (f) {
  368.     f.fn.tn3.Gallery = function (c, a) {
  369.         this.data = c;
  370.         this.config = f.extend(true, {}, f.fn.tn3.Gallery.config, a);
  371.         this.initialized = false;
  372.         this.t = f.fn.tn3.translate;
  373.         this.loader = new f.fn.tn3.External(a.external, this)
  374.     };
  375.     f.fn.tn3.Gallery.config = {
  376.         cssID: "tn3",
  377.         active: [],
  378.         inactive: [],
  379.         iniAlbum: 0,
  380.         iniImage: 0,
  381.         imageClick: "next",
  382.         startWithAlbums: false,
  383.         autoplay: false,
  384.         delay: 7E3,
  385.         timerMode: "bar",
  386.         timerSteps: 300,
  387.         timerStepChar: "&#8226;",
  388.         isFullScreen: false,
  389.         fullOnly: false,
  390.         width: null,
  391.         height: null,
  392.         mouseWheel: true,
  393.         keyNavigation: "fullscreen",
  394.         timerOverStop: true,
  395.         responsive: false,
  396.         image: {},
  397.         thumbnailer: {}
  398.     };
  399.     f.fn.tn3.Gallery.prototype = {
  400.         config: null,
  401.         $c: null,
  402.         $tn3: null,
  403.         data: null,
  404.         thumbnailer: null,
  405.         imager: null,
  406.         cAlbum: null,
  407.         timer: null,
  408.         items: null,
  409.         initialized: null,
  410.         n: null,
  411.         albums: null,
  412.         loader: null,
  413.         fso: null,
  414.         timerSize: null,
  415.         special: null,
  416.         areHidden: false,
  417.         $inImage: null,
  418.         isPlaying: false,
  419.         cparent: null,
  420.         init: function (c, a) {
  421.             this.$c = c;
  422.             if (!(this.loader.reqs > 0 || this.data.length == 0 || a)) {
  423.                 this.trigger("init_start");
  424.                 this.config.fullOnly && this.$c.show();
  425.                 this.$c.css("visibility", "visible");
  426.                 this.$tn3 = this.$c.find("." + this.config.cssID + "-gallery");
  427.                 var d = this.config.initValues = {
  428.                     width: this.$tn3.width(),
  429.                     height: this.$tn3.height()
  430.                 };
  431.                 this.$tn3.css("float", "left");
  432.                 d.wDif = this.$tn3.outerWidth(true) - d.width;
  433.                 d.hDif = this.$tn3.outerHeight(true) - d.height;
  434.                 //this.replaceMenu("tn3gallddery.com", "http://tn3gallery.com");
  435.                 var b = this;
  436.                 this.timer = new f.fn.tn3.Timer(this.$c, this.config.delay, this.config.timerSteps);
  437.                 this.$c.bind("timer_end", function () {
  438.                     b.show("next")
  439.                 });
  440.                 this.special = {
  441.                     rv: [],
  442.                     rh: [],
  443.                     v: [],
  444.                     h: [],
  445.                     vi: [],
  446.                     hi: [],
  447.                     o: []
  448.                 };
  449.                 this.parseLayout();
  450.                 this.center();
  451.                 f.each(this.items, function (e, g) {
  452.                     switch (e) {
  453.                     case "next":
  454.                         g.click(function (j) {
  455.                             b.show("next");
  456.                             j.stopPropagation()
  457.                         });
  458.                         g.attr("title", b.t("Next Image"));
  459.                         break;
  460.                     case "prev":
  461.                         g.click(function (j) {
  462.                             b.show("prev");
  463.                             j.stopPropagation()
  464.                         });
  465.                         g.attr("title", b.t("Previous Image"));
  466.                         break;
  467.                     case "next-page":
  468.                         g.click(function () {
  469.                             b.items.thumbs && b.thumbnailer.next(true)
  470.                         });
  471.                         g.attr("title", b.t("Next Page"));
  472.                         break;
  473.                     case "prev-page":
  474.                         g.click(function () {
  475.                             b.items.thumbs && b.thumbnailer.prev(true)
  476.                         });
  477.                         g.attr("title", b.t("Previous Page"));
  478.                         break;
  479.                     case "thumbs":
  480.                         b.config.thumbnailer.cssID = b.config.cssID;
  481.                         b.config.thumbnailer.initValues = {
  482.                             width: g.width(),
  483.                             height: g.height()
  484.                         };
  485.                         b.config.thumbnailer.initValues.vertical = g.width() <= g.height();
  486.                         g.bind("tn_click", function (j) {
  487.                             b.show(j.n)
  488.                         }).bind("tn_over", function () {
  489.                             b.timer.pause(true)
  490.                         }).bind("tn_out", function () {
  491.                             b.timer.pause(false)
  492.                         }).bind("tn_error", function (j) {
  493.                             b.trigger("error", j)
  494.                         });
  495.                         break;
  496.                     case "image":
  497.                         b.config.image.cssID = b.config.cssID;
  498.                         b.config.image.initValues = {
  499.                             width: g.width(),
  500.                             height: g.height()
  501.                         };
  502.                         g.bind("img_click", function (j) {
  503.                             switch (b.config.imageClick) {
  504.                             case "next":
  505.                                 b.show("next");
  506.                                 break;
  507.                             case "fullscreen":
  508.                                 b.fullscreen();
  509.                                 break;
  510.                             case "url":
  511.                                 if (j = b.data[b.cAlbum].imgs[j.n].url) window.location = j
  512.                             }
  513.                         }).bind("img_load_start", function () {
  514.                             b.items.preloader && b.items.preloader.show()
  515.                         }).bind("img_load_end", function (j) {
  516.                             b.n = j.n;
  517.                             b.items.thumbs && b.thumbnailer.thumbClick(j.n);
  518.                             b.items.preloader && b.items.preloader.hide();
  519.                             b.items.timer && b.items.timer.hide();
  520.                             b.$inImage && b.$inImage.hide()
  521.                         }).bind("img_transition", function (j) {
  522.                             b.setTextValues(false, "image");
  523.                             b.$inImage && b.imager.cached[j.n].isImage && b.$inImage.fadeIn(300);
  524.                             b.items.count && b.items.count.text(b.n + 1 + "/" + b.data[b.cAlbum].imgs.length);
  525.                             b.isPlaying && b.timer.start();
  526.                             b.special.o.length > 0 && b.hideElements()
  527.                         }).bind("img_enter", function () {
  528.                             b.items.timer && b.config.timerOverStop && b.timer.pause(true);
  529.                             b.special.o.length > 0 && b.showElements(300)
  530.                         }).bind("img_leave", function () {
  531.                             b.items.timer && b.config.timerOverStop && b.timer.pause(false);
  532.                             b.special.o.length > 0 && b.hideElements(300)
  533.                         }).bind("img_resize", function (j) {
  534.                             if (b.$inImage) {
  535.                                 b.$inImage.width(j.w).height(j.h).css("left", j.left).css("top", j.top);
  536.                                 b.center();
  537.                                 b.imager.bindMouseEvents(b.$inImage)
  538.                             }
  539.                         }).bind("img_error", function (j) {
  540.                             b.trigger("error", j)
  541.                         });
  542.                         break;
  543.                     case "preloader":
  544.                         g.hide();
  545.                         break;
  546.                     case "timer":
  547.                         var k = g.width() > g.height() ? "width" : "height";
  548.                         b.$c.bind("timer_tick", function (j) {
  549.                             if (b.config.timerMode == "char") {
  550.                                 for (var n = b.config.timerStepChar; --j.tick;) n += b.config.timerStepChar;
  551.                                 b.items.timer.html(n)
  552.                             } else b.items.timer[k](b.timerSize / j.totalTicks * j.tick);
  553.                             b.trigger(j.type, j)
  554.                         }).bind("timer_start", function (j) {
  555.                             b.timerSize = b.$inImage[k]();
  556.                             b.items.timer.fadeIn(300);
  557.                             b.trigger(j.type, j)
  558.                         }).bind("timer_end timer_stop", function (j) {
  559.                             b.items.timer.hide();
  560.                             b.trigger(j.type, j)
  561.                         });
  562.                         g.hide();
  563.                         break;
  564.                     case "play":
  565.                         g.click(function (j) {
  566.                             var n = {
  567.                                 id: "play",
  568.                                 execute: true
  569.                             };
  570.                             b.trigger("control", n);
  571.                             if (b.isPlaying) {
  572.                                 if (n.execute) {
  573.                                     b.timer.stop();
  574.                                     g.removeClass(b.config.cssID + "-play-active");
  575.                                     g.attr("title", b.t("Start Slideshow"))
  576.                                 }
  577.                                 b.isPlaying = false
  578.                             } else {
  579.                                 if (n.execute) {
  580.                                     b.timer.start();
  581.                                     g.addClass(b.config.cssID + "-play-active");
  582.                                     g.attr("title", b.t("Stop Slideshow"))
  583.                                 }
  584.                                 b.isPlaying = true
  585.                             }
  586.                             j.stopPropagation()
  587.                         });
  588.                         g.attr("title", b.t("Start Slideshow"));
  589.                         b.config.autoplay && g.click();
  590.                         break;
  591.                     case "albums":
  592.                         b.albums = new f.fn.tn3.Albums(b.data, g, b.config.cssID);
  593.                         g.hide();
  594.                         g.bind("albums_binit", function (j) {
  595.                             b.trigger(j.type, j)
  596.                         }).bind("albums_click", function (j) {
  597.                             b.showAlbum(j.n);
  598.                             b.trigger(j.type, j)
  599.                         }).bind("albums_init", function (j) {
  600.                             b.timer.pause(true);
  601.                             b.trigger(j.type, j)
  602.                         }).bind("albums_error", function (j) {
  603.                             b.trigger("error", j)
  604.                         }).bind("albums_close", function () {
  605.                             b.timer.pause(false)
  606.                         });
  607.                         break;
  608.                     case "albums-next":
  609.                         b.albums && b.albums.setControl("next", g);
  610.                         g.attr("title", b.t("Next Album Page"));
  611.                         break;
  612.                     case "albums-prev":
  613.                         b.albums && b.albums.setControl("prev", g);
  614.                         g.attr("title", b.t("Previous Album Page"));
  615.                         break;
  616.                     case "albums-close":
  617.                         b.albums && b.albums.setControl("close", g);
  618.                         g.attr("title", b.t("Close"));
  619.                         break;
  620.                     case "show-albums":
  621.                         g.click(function (j) {
  622.                             b.items.albums && b.albums.show(0, b.cAlbum, false, true);
  623.                             j.stopPropagation()
  624.                         });
  625.                         g.attr("title", b.t("Album List"));
  626.                         break;
  627.                     case "fullscreen":
  628.                         g.click(function (j) {
  629.                             var n = {
  630.                                 id: "fullscreen",
  631.                                 execute: true
  632.                             };
  633.                             b.trigger("control", n);
  634.                             n.execute && b.fullscreen();
  635.                             j.stopPropagation()
  636.                         });
  637.                         g.attr("title", b.t("Maximize"))
  638.                     }
  639.                 });
  640.                 if (this.config.width !== null || this.config.height !== null) {
  641.                     if (this.config.width == null) this.config.width = this.config.initValues.width;
  642.                     if (this.config.height == null) this.config.height = this.config.initValues.height;
  643.                     this.resize(this.config.width, this.config.height)
  644.                 }
  645.                 d = Math.min(this.config.iniAlbum, this.data.length - 1);
  646.                 this.initialized = true;
  647.                 this.config.startWithAlbums && this.data.length > 1 && this.items.albums ? this.albums.show() : this.showAlbum(d, this.config.iniImage);
  648.                 this.config.isFullScreen && this.onFullResize(f(window).width(), f(window).height());
  649.                 this.trigger("init")
  650.             }
  651.         },
  652.         parseLayout: function () {
  653.             var c = this.items = {},
  654.                 a = this.config,
  655.                 d = a.active,
  656.                 b = a.inactive,
  657.                 e = a.cssID.length + 1,
  658.                 g = this,
  659.                 k, j;
  660.             this.$c.find("div[class^='" + a.cssID + "-']").each(function () {
  661.                 k = f(this);
  662.                 j = k.attr("class").split(" ")[0].substr(e);
  663.                 if (f.inArray(j, b) != -1) k.remove();
  664.                 else if (d.length == 0 || f.inArray(j, d) != -1) c[j] = k;
  665.                 else j != "gallery" && k.remove();
  666.                 if (k.parent().hasClass(a.cssID + "-image")) {
  667.                     if (!g.$inImage) {
  668.                         g.$inImage = k.parent().append('<div class="tn3-in-image"></div>').find(":last");
  669.                         if (f.browser.msie) {
  670.                             var h = f("<div />");
  671.                             h.css("background-color", "#fff").css("opacity", 0).css("width", "100%").css("height", "100%");
  672.                             h.appendTo(g.$inImage)
  673.                         }
  674.                         g.$inImage.css("position", "absolute").width(c.image.width()).height(c.image.height())
  675.                     }
  676.                     k.appendTo(g.$inImage)
  677.                 }
  678.                 this.className.indexOf("tn3_") != -1 && g.addSpecial(j, this.className)
  679.             });
  680.             $cm = this.$c;
  681.             f.each(["albums", "album", "album-next", "album-prev", "show-albums", "timer"], function (h, i) {
  682.                 delete c[i];
  683.                 $cm.find("." + a.cssID + "-" + i).remove()
  684.             });
  685.             var n = f('<div title="Powered by TN3 Gallery"></div>');
  686.           /*  n.css("position", "absolute").css("background-image", "url('" + this.config.skinDir + "/tn3.png')").css("background-position", "-258px -7px").css("bottom", "14px").css("right", "53px").css("cursor", "pointer").width(40).height(18);
  687.             n.appendTo(this.$c.find("." + a.cssID + "-gallery"));
  688.             n.click(function () {
  689.                 window.location = "http://tn3gallery.com"
  690.             }).hover(function () {
  691.                 f(this).css("background-position", "-258px -45px")
  692.             }, function () {
  693.                 f(this).css("background-position", "-258px -7px")
  694.             })*/
  695.         },
  696.         addSpecial: function (c, a) {
  697.             for (var d = a.split(" "), b, e = 0; e < d.length; e++) {
  698.                 b = d[e].split("_");
  699.                 if (b[0] == "tn3") {
  700.                     this.special[b[1]].push(c);
  701.                     if (b[1] == "rh" || b[1] == "rv") this.config.initValues[c] = {
  702.                         w: this.items[c].width(),
  703.                         h: this.items[c].height()
  704.                     }
  705.                 }
  706.             }
  707.         },
  708.         initHover: function (c, a) {
  709.             var d = this;
  710.             c.hover(function () {
  711.                 c.addClass(d.config.cssID + "-" + a + "-over")
  712.             }, function () {
  713.                 c.removeClass(d.config.cssID + "-" + a + "-over")
  714.             })
  715.         },
  716.         setTextValues: function (c, a) {
  717.             var d, b, e, g = a + "-";
  718.             for (e in this.items) if (e.indexOf(g) == 0) {
  719.                 d = e.substr(g.length);
  720.                 if (d != "info" && d != "prev" && d != "next") {
  721.                     b = a == "image" ? this.data[this.cAlbum].imgs[this.n] : this.data[this.cAlbum];
  722.                     if (!b || b[d] == undefined) {
  723.                         b = {};
  724.                         b[d] = ""
  725.                     } else b[d] = f.trim(b[d]);
  726.                     d = {
  727.                         field: d,
  728.                         text: b[d],
  729.                         data: b
  730.                     };
  731.                     this.trigger("set_text", d);
  732.                     if (c || d.text == undefined || d.text.length == 0) {
  733.                         this.items[e].html("");
  734.                         this.items[e].hide()
  735.                     } else {
  736.                         this.items[e].html(d.text);
  737.                         this.items[e].show()
  738.                     }
  739.                 }
  740.             }
  741.         },
  742.         show: function (c, a) {
  743.             this.timer.stop();
  744.             this.imager && this.imager.show(c);
  745.             a && this.fullscreen()
  746.         },
  747.         setAlbumData: function (c, a) {
  748.             if (a) this.trigger("error", {
  749.                 description: a
  750.             });
  751.             else {
  752.                 for (var d = 0, b = c.length; d < b; d++) this.data.push(c[d]);
  753.                 this.$c && this.init(this.$c, this.config.fullOnly)
  754.             }
  755.         },
  756.         setImageData: function (c, a, d) {
  757.             if (d) this.trigger("error", {
  758.                 description: d
  759.             });
  760.             else {
  761.                 this.items.preloader && this.items.preloader.hide();
  762.                 c = {
  763.                     data: c
  764.                 };
  765.                 this.trigger("image_data", c);
  766.                 this.data[a].imgs = c.data;
  767.                 if (this.cAlbum == a) this.rebuild(c.data, a == 0 ? this.config.iniImage : 0)
  768.             }
  769.         },
  770.         showAlbum: function (c, a, d) {
  771.             if (this.initialized) {
  772.                 if (c > this.data.length) return;
  773.                 this.timer.stop();
  774.                 this.cAlbum = c;
  775.                 this.albums && this.albums.hide();
  776.                 if (this.data[this.cAlbum].imgs === undefined) if (this.loader) {
  777.                     this.loader.getImages(this.data[this.cAlbum].adata, this.cAlbum);
  778.                     this.items.preloader && this.items.preloader.show()
  779.                 } else this.trigger("error", {
  780.                     description: "Wrong album id"
  781.                 });
  782.                 else this.rebuild(this.data[this.cAlbum].imgs, a)
  783.             } else {
  784.                 this.config.iniAlbum = c;
  785.                 this.config.iniImage = a;
  786.                 this.init(this.$c, false)
  787.             }
  788.             d && this.fullscreen()
  789.         },
  790.         rebuild: function (c, a) {
  791.             if (this.items.thumbs) if (this.thumbnailer) this.thumbnailer.rebuild(c);
  792.             else this.thumbnailer = new f.fn.tn3.Thumbnailer(this.items.thumbs, c, this.config.thumbnailer);
  793.             if (this.items.image) if (this.imager) this.imager.rebuild(c);
  794.             else this.imager = new f.fn.tn3.Imager(this.items.image, c, this.config.image);
  795.             this.setTextValues(true, "image");
  796.             this.setTextValues(false, "album");
  797.             this.show(a == null ? 0 : a);
  798.             this.trigger("rebuild", {
  799.                 album: this.cAlbum
  800.             })
  801.         },
  802.         showElements: function (c) {
  803.             if (this.areHidden) {
  804.                 var a = this,
  805.                     d;
  806.                 f.each(this.special.o, function (b, e) {
  807.                     d = a.items[e];
  808.                     d.show();
  809.                     if (c && f.support.opacity) {
  810.                         d.stop(true);
  811.                         d.css("opacity", 0);
  812.                         d.animate({
  813.                             opacity: 1
  814.                         }, {
  815.                             duration: c,
  816.                             queue: false
  817.                         })
  818.                     }
  819.                 });
  820.                 this.areHidden = false
  821.             }
  822.         },
  823.         hideElements: function (c) {
  824.             if (!this.areHidden) {
  825.                 var a = this,
  826.                     d;
  827.                 f.each(this.special.o, function (b, e) {
  828.                     d = a.items[e];
  829.                     if (c && f.support.opacity) {
  830.                         d.stop(true);
  831.                         d.animate({
  832.                             opacity: 0
  833.                         }, {
  834.                             duration: c,
  835.                             complete: function () {
  836.                                 d.hide()
  837.                             },
  838.                             queue: false
  839.                         })
  840.                     } else d.hide()
  841.                 });
  842.                 this.areHidden = true
  843.             }
  844.         },
  845.         setData: function (c) {
  846.             if (this.items.thumbs) this.thumbnailer.data = c;
  847.             if (this.items.imager) this.imager.data = c
  848.         },
  849.         fullscreen: function () {
  850.             if (this.config.isFullScreen) {
  851.                 f(window).unbind("resize", this.onFullResize);
  852.                 f.tn3unblock();
  853.                 this.config.width !== null || this.config.height !== null ? this.resize(this.config.width, this.config.height) : this.resize(this.config.initValues.width, this.config.initValues.height);
  854.                 if (this.items.fullscreen) {
  855.                     this.items.fullscreen.removeClass(this.config.cssID + "-fullscreen-active");
  856.                     this.items.fullscreen.attr("title", this.t("Maximize"))
  857.                 }
  858.                 this.config.fullOnly && this.$c.hide();
  859.                 this.config.isFullScreen = false;
  860.                 this.trigger("fullscreen", {
  861.                     fullscreen: false
  862.                 });
  863.                 this.config.keyNavigation == "fullscreen" && f(document).unbind("keyup", this.listenKeys)
  864.             } else {
  865.                 f.tn3block({
  866.                     message: this.$tn3,
  867.                     cssID: this.config.cssID
  868.                 });
  869.                 f(window).bind("resize", f.proxy(this.onFullResize, this));
  870.                 this.config.fullOnly && this.$c.show();
  871.                 this.config.isFullScreen = true;
  872.                 if (this.items.fullscreen) {
  873.                     this.items.fullscreen.addClass(this.config.cssID + "-fullscreen-active");
  874.                     this.items.fullscreen.attr("title", this.t("Minimize"))
  875.                 }
  876.                 this.onFullResize();
  877.                 this.trigger("fullscreen", {
  878.                     fullscreen: true
  879.                 })
  880.             }
  881.         },
  882.         listenKeys: function (c) {
  883.             if (c.keyCode == 70) this.items.fullscreen.click();
  884.             else if (this.items.albums && this.albums.enabled) {
  885.                 var a = 0;
  886.                 switch (c.keyCode) {
  887.                 case 27:
  888.                     this.albums.hide();
  889.                     break;
  890.                 case 39:
  891.                     a = "r";
  892.                     break;
  893.                 case 37:
  894.                     a = "l";
  895.                     break;
  896.                 case 38:
  897.                     a = "u";
  898.                     break;
  899.                 case 40:
  900.                     a = "d";
  901.                     break;
  902.                 case 32:
  903.                     a = "p"
  904.                 }
  905.                 a && this.albums.select(a)
  906.             } else switch (c.keyCode) {
  907.             case 27:
  908.                 this.config.isFullScreen && this.fullscreen();
  909.                 break;
  910.             case 39:
  911.                 this.show("next");
  912.                 break;
  913.             case 37:
  914.                 this.show("prev");
  915.                 break;
  916.             case 38:
  917.                 this.items.albums && this.albums.show(0, this.cAlbum, false, true);
  918.                 break;
  919.             case 32:
  920.                 this.items.play.click()
  921.             }
  922.         },
  923.         onFullResize: function () {
  924.             var c = f(window),
  925.                 a = c.width();
  926.             c = c.height();
  927.             a -= this.config.initValues.wDif;
  928.             c -= this.config.initValues.hDif;
  929.             this.resize(a, c)
  930.         },
  931.         resize: function (c, a) {
  932.             this.$tn3.width(c).height(a);
  933.             var d = c - this.config.initValues.width,
  934.                 b = a - this.config.initValues.height,
  935.                 e, g, k = this;
  936.             if (this.items.image) {
  937.                 e = this.config.image.initValues.width + d;
  938.                 g = this.config.image.initValues.height + b;
  939.                 if (this.imager) this.imager.setSize(e, g);
  940.                 else {
  941.                     this.items.image.width(e).height(g);
  942.                     this.$inImage.width(e).height(g)
  943.                 }
  944.             }
  945.             if (this.items.thumbs) {
  946.                 e = this.config.thumbnailer.initValues.width + d;
  947.                 g = this.config.thumbnailer.initValues.height + b;
  948.                 if (this.thumbnailer) this.thumbnailer.setSize(e, g);
  949.                 else this.config.thumbnailer.initValues.vertical ? this.items.thumbs.height(g) : this.items.thumbs.width(e)
  950.             }
  951.             if (this.items.albums) {
  952.                 e = this.albums.initValues.width + d;
  953.                 g = this.albums.initValues.height + b;
  954.                 this.albums.changeSize(d, b)
  955.             }
  956.             f.each(this.special.rh, function (j, n) {
  957.                 k.items[n].width(k.config.initValues[n].w + d)
  958.             });
  959.             f.each(this.special.rv, function (j, n) {
  960.                 k.items[n].height(k.config.initValues[n].h + b)
  961.             });
  962.             this.center()
  963.         },
  964.         center: function () {
  965.             var c, a = this,
  966.                 d = a.items.image.position();
  967.             f.each(this.special.v, function (b, e) {
  968.                 c = a.items[e];
  969.                 c.css("top", (c.parent().height() - c.height()) / 2)
  970.             });
  971.             f.each(this.special.h, function (b, e) {
  972.                 c = a.items[e];
  973.                 c.css("left", (c.parent().width() - c.width()) / 2)
  974.             });
  975.             f.each(this.special.vi, function (b, e) {
  976.                 c = a.items[e];
  977.                 c.css("top", d.top + (a.items.image.height() - c.height()) / 2)
  978.             });
  979.             f.each(this.special.hi, function (b, e) {
  980.                 c = a.items[e];
  981.                 c.css("left", d.left + (a.items.image.width() - c.width()) / 2)
  982.             })
  983.         },
  984.         trigger: function (c, a) {
  985.             var d = f.Event("tn3_" + c),
  986.                 b;
  987.             for (b in a) d[b] = a[b];
  988.             if (a && a.type != undefined) d.type = "tn3_" + c;
  989.             d.source = this;
  990.             this.$c.trigger(d);
  991.             this.config[c] && this.config[c].call(this, d);
  992.             for (b in a) a[b] = d[b]
  993.         },
  994.         initMouseWheel: function () {
  995.             var c = this,
  996.                 a = function (d) {
  997.                     c.show((d.originalEvent.detail ? -d.originalEvent.detail : d.originalEvent.wheelDelta) > 0 ? "prev" : "next");
  998.                     d.preventDefault()
  999.                 };
  1000.             this.$tn3.bind("mousewheel", a);
  1001.             this.$tn3.bind("DOMMouseScroll", a)
  1002.         },
  1003.       /*  replaceMenu: function (c, a) {
  1004.          var d = '<div style="position:absolute;background-color:#fff;color: #000;padding:0px 4px 0px 4px;z-index:1010;font-family:sans-serif;font-size:12px;">&copy; <a href="' + a + '">' + c + "</a></div>";
  1005.             this.$tn3.bind("contextmenu", function (b) {
  1006.                 b.preventDefault()
  1007.             }).bind("mousedown", function (b) {
  1008.                 if (b.which == 3) {
  1009.                     var e = f("body").append(d).find("div:last");
  1010.                     e.css("left", b.pageX).css("top", b.pageY);
  1011.                     e.find("a").mouseup(function (g) {
  1012.                         window.location = a;
  1013.                         e.unbind(g)
  1014.                     });
  1015.                     f("body").mouseup(function (g) {
  1016.                         e.remove();
  1017.                         f("body").unbind(g)
  1018.                     })
  1019.                 }
  1020.             })
  1021.         }*/
  1022.     }
  1023. })(jQuery);
  1024. (function (f) {
  1025.     f.fn.tn3.Imager = function (c, a, d) {
  1026.         this.$c = c;
  1027.         this.data = a;
  1028.         d.crop = false;
  1029.         this.config = f.extend(true, {}, f.fn.tn3.Imager.config, d);
  1030.         this.init()
  1031.     };
  1032.     f.fn.tn3.Imager.config = {
  1033.         transitions: null,
  1034.         defaultTransition: {
  1035.             type: "slide"
  1036.         },
  1037.         random: false,
  1038.         cssID: "tn3",
  1039.         maxZoom: 1.4,
  1040.         crop: false,
  1041.         clickEvent: "click",
  1042.         idleDelay: 3E3,
  1043.         stretch: true,
  1044.         dif: 0
  1045.     };
  1046.     f.fn.tn3.Imager.prototype = {
  1047.         config: null,
  1048.         $c: false,
  1049.         data: false,
  1050.         cached: null,
  1051.         active: -1,
  1052.         $active: false,
  1053.         $buffer: false,
  1054.         isInTransition: false,
  1055.         ts: null,
  1056.         cDim: null,
  1057.         qid: null,
  1058.         currentlyLoading: null,
  1059.         side: null,
  1060.         $ic: null,
  1061.         $binder: null,
  1062.         infoID: null,
  1063.         lastEnter: false,
  1064.         mouseCoor: {
  1065.             x: 0,
  1066.             y: 0
  1067.         },
  1068.         mouseIsOver: false,
  1069.         init: function () {
  1070.             this.$c.css("overflow", "hidden");
  1071.             this.$c.css("position", "relative");
  1072.             this.bindMouseEvents(this.$c);
  1073.             this.cached = [];
  1074.             this.ts = new f.fn.tn3.Transitions(this.config.transitions, this.config.defaultTransition, this.config.random, this, "onTransitionEnd")
  1075.         },
  1076.         bindMouseEvents: function (c) {
  1077.             this.unbindMouseEvents();
  1078.             var a = this;
  1079.             c.hover(function () {
  1080.                 a.mouseIsOver = true;
  1081.                 a.enterLeave("enter");
  1082.                 a.startIdle();
  1083.                 f(document).mousemove(f.proxy(a.onMouseMove, a))
  1084.             }, function () {
  1085.                 a.mouseIsOver = false;
  1086.                 a.enterLeave("leave");
  1087.                 a.stopIdle();
  1088.                 f(document).unbind("mousemove", a.onMouseMove)
  1089.             });
  1090.             c[this.config.clickEvent](function (d) {
  1091.                 a.active == -1 || a.isInTransition || d.target.tagName.toUpperCase() != "A" && a.trigger("click", {
  1092.                     n: a.active
  1093.                 })
  1094.             });
  1095.             this.$binder = c
  1096.         },
  1097.         unbindMouseEvents: function () {
  1098.             this.$binder && this.$binder.unbind("mouseenter mouseleave " + this.config.clickEvent);
  1099.             f(document).unbind("mousemove", this.onMouseMove);
  1100.             this.stopIdle()
  1101.         },
  1102.         startIdle: function () {
  1103.             this.stopIdle();
  1104.             var c = this;
  1105.             if (this.config.idleDelay > 0) this.infoID = setTimeout(function () {
  1106.                 c.enterLeave("leave");
  1107.                 c.stopIdle()
  1108.             }, this.config.idleDelay)
  1109.         },
  1110.         onMouseMove: function (c) {
  1111.             this.mouseCoor = {
  1112.                 x: c.pageX,
  1113.                 y: c.pageY
  1114.             };
  1115.             if (!this.isInTransition) {
  1116.                 this.infoID || this.enterLeave("enter");
  1117.                 this.startIdle()
  1118.             }
  1119.         },
  1120.         stopIdle: function () {
  1121.             clearTimeout(this.infoID);
  1122.             this.infoID = null
  1123.         },
  1124.         enterLeave: function (c) {
  1125.             this.lastEnter != c && this.trigger(c);
  1126.             this.lastEnter = c
  1127.         },
  1128.         show: function (c) {
  1129.             if (this.isInTransition) this.qid = c;
  1130.             else {
  1131.                 this.qid = null;
  1132.                 if (c == "next") {
  1133.                     c = this.active + 1 < this.data.length ? this.active + 1 : 0;
  1134.                     this.side = "left"
  1135.                 } else if (c == "prev") {
  1136.                     c = this.active > 0 ? this.active - 1 : this.data.length - 1;
  1137.                     this.side = "right"
  1138.                 } else this.side = this.active > c ? "right" : "left";
  1139.                 if (this.data[c]) {
  1140.                     this.trigger("load_start", {
  1141.                         n: c
  1142.                     });
  1143.                     this.$buffer = this.$c.prepend('<div class="' + this.config.cssID + '-image-in" style="position:absolute;overflow:hidden;"></div>').find(":first");
  1144.                     if (this.cached[this.currentlyLoading] != undefined) this.cached[this.currentlyLoading].init = false;
  1145.                     if (this.cached[c] != undefined) if (this.cached[c].status == "loaded") this.initImage(c);
  1146.                     else {
  1147.                         this.cached[c].init = true;
  1148.                         this.currentlyLoading = c
  1149.                     } else this.startLoading(c, true)
  1150.                 }
  1151.             }
  1152.         },
  1153.         startLoading: function (c, a) {
  1154.             this.cached[c] = {
  1155.                 isImage: true,
  1156.                 status: "loading",
  1157.                 init: a
  1158.             };
  1159.             this.currentlyLoading = c;
  1160.             if (this.data[c].content != undefined) {
  1161.                 this.cached[c].isImage = false;
  1162.                 this.onCacheLoad(f(this.data[c].content), c)
  1163.             } else this.cached[c].loader = new f.fn.tn3.ImageLoader(this.data[c].img, this, this.onCacheLoad, [c])
  1164.         },
  1165.         onCacheLoad: function (c, a, d) {
  1166.             this.cached[a].status = "loaded";
  1167.             this.cached[a].$content = c;
  1168.             d && this.trigger("error", {
  1169.                 description: d,
  1170.                 n: a
  1171.             });
  1172.             this.cached[a].init && this.initImage(a)
  1173.         },
  1174.         initImage: function (c) {
  1175.             var a = this.cached[c].$content;
  1176.             this.currentlyLoading = null;
  1177.             this.active = c;
  1178.             if (!this.cDim) this.cDim = {
  1179.                 w: this.$c.width(),
  1180.                 h: this.$c.height()
  1181.             };
  1182.             this.$buffer.width(this.cDim.w).height(this.cDim.h);
  1183.             var d = f('<div class="' + this.config.cssID + '-full-image" style="position:absolute"></div>');
  1184.             a.appendTo(d);
  1185.             this.$buffer.append(d);
  1186.             this.$buffer.data("ic", d);
  1187.             this.$buffer.data("img", a);
  1188.             this.resize(this.$buffer);
  1189.             this.trigger("load_end", {
  1190.                 n: c,
  1191.                 content: a,
  1192.                 isImage: this.cached[c].isImage
  1193.             });
  1194.             if (this.$active != false) {
  1195.                 this.isInTransition = true;
  1196.                 this.unbindMouseEvents();
  1197.                 if (this.mouseIsOver) f(document).mousemove(f.proxy(this.onMouseMove, this));
  1198.                 else this.mouseCoor = {
  1199.                     x: 0,
  1200.                     y: 0
  1201.                 };
  1202.                 this.lastEnter = "leave";
  1203.                 this.ts.start(this.$active, this.$buffer, this.side)
  1204.             } else {
  1205.                 this.$active = this.$buffer;
  1206.                 this.trigger("transition", {
  1207.                     n: this.active
  1208.                 })
  1209.             }
  1210.             this.cached[c + 1] == undefined && this.data[c + 1] != undefined && this.startLoading(c + 1, false)
  1211.         },
  1212.         setSize: function (c, a) {
  1213.             this.isInTransition && this.ts.stop(this.$active, this.$buffer, this.ts.config);
  1214.             this.$c.width(c).height(a);
  1215.             this.cDim = {
  1216.                 w: this.$c.width(),
  1217.                 h: this.$c.height()
  1218.             };
  1219.             if (this.$active) {
  1220.                 this.$active.width(c).height(a);
  1221.                 this.resize(this.$active)
  1222.             }
  1223.         },
  1224.         resize: function (c) {
  1225.             if (c.data("img") == undefined) this.trigger("resize", {
  1226.                 w: this.cDim.w,
  1227.                 h: this.cDim.h,
  1228.                 left: 0,
  1229.                 top: 0
  1230.             });
  1231.             else this.cached[this.active].isImage ? this.resizeImage(c) : this.resizeContent(c)
  1232.         },
  1233.         resizeImage: function (c) {
  1234.             $img = c.data("img");
  1235.             $ic = c.data("ic");
  1236.             $img.width("").height("");
  1237.             c.data("scaled", false);
  1238.             var a = $img.width(),
  1239.                 d = $img.height(),
  1240.                 b = 0,
  1241.                 e = 0,
  1242.                 g = {
  1243.                     w: a,
  1244.                     h: d,
  1245.                     left: 0,
  1246.                     top: 0
  1247.                 };
  1248.             $img.attr("width", a).attr("height", d);
  1249.             if ($img.get(0).tagName.toUpperCase() == "IMG" && (a != this.cDim.w || d != this.cDim.h)) {
  1250.                 b = this.cDim.w / a;
  1251.                 e = this.cDim.h / d;
  1252.                 b = this.config.crop ? Math.max(b, e) : Math.min(b, e);
  1253.                 b = Math.min(this.config.maxZoom, b);
  1254.                 a = g.w = Math.round(a * b) - this.config.dif;
  1255.                 d = g.h = Math.round(d * b) - this.config.dif;
  1256.                 if (this.cDim.w >= a) b = g.left = (this.cDim.w - a) / 2;
  1257.                 else {
  1258.                     b = -(a - this.cDim.w) * 0.5;
  1259.                     g.w = this.cDim.w
  1260.                 }
  1261.                 if (this.cDim.h > d) e = g.top = (this.cDim.h - d) / 2;
  1262.                 else {
  1263.                     e = -(d - this.cDim.h) * 0.5;
  1264.                     g.h = this.cDim.h
  1265.                 }
  1266.                 $img.attr("width", a).attr("height", d);
  1267.                 $ic.width(a).height(d);
  1268.                 c.data("scaled", true)
  1269.             }
  1270.             $ic.css("left", b).css("top", e);
  1271.             this.bindMouseEvents($ic);
  1272.             this.trigger("resize", g)
  1273.         },
  1274.         resizeContent: function (c) {
  1275.             $ic = c.data("ic");
  1276.             $img = c.data("img");
  1277.             c.data("scaled", false);
  1278.             var a = $img.width(),
  1279.                 d = $img.height(),
  1280.                 b = {
  1281.                     w: a,
  1282.                     h: d,
  1283.                     left: 0,
  1284.                     top: 0
  1285.                 };
  1286.             if (this.config.stretch) {
  1287.                 $ic.width(this.cDim.w).height(this.cDim.h);
  1288.                 $img.width(this.cDim.w).height(this.cDim.h);
  1289.                 c.data("scaled", true)
  1290.             } else {
  1291.                 b.left = (this.cDim.w - a) * 0.5;
  1292.                 b.top = (this.cDim.h - d) * 0.5;
  1293.                 $ic.css("left", b.left).css("top", b.top)
  1294.             }
  1295.             this.bindMouseEvents($ic);
  1296.             this.trigger("resize", b)
  1297.         },
  1298.         onTransitionEnd: function () {
  1299.             this.$active.remove();
  1300.             this.$active = this.$buffer;
  1301.             this.isInTransition = false;
  1302.             this.trigger("transition", {
  1303.                 n: this.active
  1304.             });
  1305.             this.bindMouseEvents(this.$binder);
  1306.             var c = this.$binder.offset();
  1307.             this.mouseIsOver = false;
  1308.             if (this.mouseCoor.x >= c.left && this.mouseCoor.x <= c.left + this.$binder.width()) if (this.mouseCoor.y >= c.top && this.mouseCoor.y <= c.top + this.$binder.height()) {
  1309.                 this.lastEnter = "leave";
  1310.                 this.enterLeave("enter");
  1311.                 this.startIdle();
  1312.                 this.mouseIsOver = true;
  1313.                 f(document).mousemove(f.proxy(this.onMouseMove, this))
  1314.             }
  1315.             this.qid != null && this.show(this.qid)
  1316.         },
  1317.         trigger: function (c, a) {
  1318.             var d = f.Event("img_" + c),
  1319.                 b;
  1320.             for (b in a) d[b] = a[b];
  1321.             d.source = this;
  1322.             this.$c.trigger(d);
  1323.             this.config[c] && this.config[c].call(this, d)
  1324.         },
  1325.         destroy: function () {
  1326.             this.isInTransition && this.ts.stop(this.$active, this.$buffer);
  1327.             this.$active && this.$active.remove();
  1328.             this.$buffer.remove()
  1329.         },
  1330.         rebuild: function (c) {
  1331.             this.quid = null;
  1332.             this.isInTransition && this.ts.stop(this.$active, this.$buffer);
  1333.             this.$buffer && this.$buffer.remove();
  1334.             this.cached = [];
  1335.             this.data = c;
  1336.             this.loader && this.loader.cancel()
  1337.         }
  1338.     }
  1339. })(jQuery);
  1340. (function (f) {
  1341.     f.fn.tn3.Thumbnailer = function (c, a, d) {
  1342.         this.$c = c;
  1343.         this.data = a;
  1344.         this.config = f.extend({}, f.fn.tn3.Thumbnailer.config, d);
  1345.         f(window).resize(f.proxy(this.onWinResize, this));
  1346.         this.init()
  1347.     };
  1348.     f.fn.tn3.Thumbnailer.config = {
  1349.         overMove: true,
  1350.         buffer: 20,
  1351.         speed: 8,
  1352.         slowdown: 50,
  1353.         shaderColor: "#000000",
  1354.         shaderOpacity: 0.5,
  1355.         shaderDuration: 300,
  1356.         shaderOut: 300,
  1357.         useTitle: false,
  1358.         seqLoad: true,
  1359.         align: 1,
  1360.         mode: "thumbs",
  1361.         cssID: "tn3"
  1362.     };
  1363.     f.fn.tn3.Thumbnailer.prototype = {
  1364.         config: null,
  1365.         $c: null,
  1366.         $oc: null,
  1367.         $ul: null,
  1368.         data: null,
  1369.         active: -1,
  1370.         listSize: 0,
  1371.         containerSize: 0,
  1372.         containerPadding: 0,
  1373.         noBufSize: 0,
  1374.         containerOffset: 0,
  1375.         mcoor: "mouseX",
  1376.         edge: "left",
  1377.         size: "width",
  1378.         outerSize: "outerWidth",
  1379.         mouseX: 0,
  1380.         mouseY: 0,
  1381.         intID: false,
  1382.         pos: 0,
  1383.         difference: 0,
  1384.         cnt: 1,
  1385.         thumbCount: -1,
  1386.         initialized: false,
  1387.         clickWhenReady: -1,
  1388.         loaders: null,
  1389.         lis: null,
  1390.         isVertical: null,
  1391.         marginDif: 0,
  1392.         nloaded: 0,
  1393.         firstToLoad: 0,
  1394.         init: function () {
  1395.             this.$c.css("position", "absolute").css("cursor", "progress");
  1396.             this.lis = [];
  1397.             this.loaders = [];
  1398.             this.initialized = false;
  1399.             this.$oc = f("<div />");
  1400.             this.$ul = f("<ul />");
  1401.             this.$oc.appendTo(this.$c);
  1402.             this.$oc.css("position", "absolute").css("overflow", "hidden").width(this.$c.width()).height(this.$c.height());
  1403.             this.$ul.appendTo(this.$oc);
  1404.             this.$ul.css("position", "relative").css("margin", "0px").css("padding", "0px").css("border-width", "0px").css("width", "12000px").css("list-style", "none");
  1405.             if (this.isVertical == null) {
  1406.                 this.isVertical = this.$c.width() < this.$c.height();
  1407.                 if (this.isVertical = false) {
  1408.                     this.mcoor = "mouseY";
  1409.                     this.edge = "top";
  1410.                     this.size = "height";
  1411.                     this.outerSize = "outerHeight"
  1412.                 } else {
  1413.                     this.mcoor = "mouseX";
  1414.                     this.edge = "left";
  1415.                     this.size = "width";
  1416.                     this.outerSize = "outerWidth"
  1417.                 }
  1418.                 this.containerSize = this.$oc[this.size]();
  1419.                 this.noBufSize = this.containerSize - 2 * this.config.buffer;
  1420.                 this.containerOffset = this.$oc.offset()[this.edge];
  1421.                 this.containerPadding = parseInt(this.$c.css("padding-" + this.edge))
  1422.             }
  1423.             this.listSize = 0;
  1424.             if (navigator.userAgent.indexOf("MSIE") != -1) this.config.seqLoad = false;
  1425.             this.data.length > 0 && this.loadNextThumb()
  1426.         },
  1427.         loadNextThumb: function () {
  1428.             this.thumbCount++;
  1429.             var c = this.$ul.append("<li></li>").find(":last");
  1430.             if (this.config.mode == "thumbs") {
  1431.                 var a = this.data[this.thumbCount].thumb;
  1432.                 if (a) {
  1433.                     this.loaders.push(new f.fn.tn3.ImageLoader(a, this, this.onLoadThumb, [c, this.thumbCount]));
  1434.                     !this.config.seqLoad && this.thumbCount < this.data.length - 1 && this.loadNextThumb();
  1435.                     return
  1436.                 } else this.config.mode = "bullets"
  1437.             }
  1438.             this.config.mode == "numbers" && c.text(this.thumbCount + 1);
  1439.             this.onLoadThumb(null, c, this.thumbCount)
  1440.         },
  1441.         onLoadThumb: function (c, a, d, b) {
  1442.             this.lis[d] = {
  1443.                 li: a
  1444.             };
  1445.             a.addClass(this.config.cssID + "-thumb");
  1446.             a.css("float", this.isVertical ? "none" : "left");
  1447.             if (c) {
  1448.                 var e = this.lis[d].thumb = a.append(c).find(":last");
  1449.                 this.lis[d].pos = a.position()[this.edge]
  1450.             }
  1451.             this.config.useTitle && a.attr("title", this.data[d].title);
  1452.             if (this.config.mode == "thumbs") {
  1453.                 this.lis[d].shade = a.prepend("<div/>").find(":first");
  1454.                 this.lis[d].shade.css("background-color", this.config.shaderColor).css("width", e.width()).css("height", e.height()).css("position", "absolute")
  1455.             }
  1456.             this.initThumb(d);
  1457.             a.css("opacity", 0);
  1458.             a.animate({
  1459.                 opacity: 1
  1460.             }, 1E3);
  1461.             this.listSize += a[this.outerSize](true);
  1462.             if (!this.initialized) {
  1463.                 this.firstToLoad = d;
  1464.                 this.initialized = true;
  1465.                 this.initMouse(true)
  1466.             }
  1467.             b && this.trigger("error", {
  1468.                 description: b,
  1469.                 n: d
  1470.             });
  1471.             this.trigger("thumbLoad", {
  1472.                 n: d
  1473.             });
  1474.             this.nloaded++;
  1475.             if (this.nloaded < this.data.length) {
  1476.                 if (this.config.seqLoad || this.config.mode != "thumbs") this.loadNextThumb()
  1477.             } else {
  1478.                 if (c) this.loaders = null;
  1479.                 if (!this.config.seqLoad) for (c = 0; c < this.lis.length; c++) this.lis[c].pos = this.lis[c].li.position()[this.edge];
  1480.                 this.thumbsLoaded()
  1481.             }
  1482.             if (this.clickWhenReady == d) {
  1483.                 this.clickWhenReady = -1;
  1484.                 this.thumbClick(d)
  1485.             }
  1486.         },
  1487.         initThumb: function (c) {
  1488.             var a = this.lis[c];
  1489.             if (a.li) {
  1490.                 a.li.removeClass().addClass(this.config.cssID + "-thumb");
  1491.                 if (a.shade) {
  1492.                     a.shade.stop();
  1493.                     a.shade.css("opacity", this.config.shaderOpacity)
  1494.                 }
  1495.                 var d = this;
  1496.                 a.li.click(function () {
  1497.                     d.thumbClick(c);
  1498.                     d.trigger("click", {
  1499.                         n: c
  1500.                     });
  1501.                     return false
  1502.                 });
  1503.                 this.config.mode != "thumbs" && a.li.hover(function () {
  1504.                     d.mouseOver(c)
  1505.                 }, function () {
  1506.                     d.mouseOver(-1)
  1507.                 })
  1508.             }
  1509.         },
  1510.         lastOver: -1,
  1511.         mouseOver: function (c) {
  1512.             if (c != this.lastOver) {
  1513.                 if (this.lastOver != -1 && this.lastOver != this.active) {
  1514.                     a = this.lis[this.lastOver];
  1515.                     a.li.removeClass(this.config.cssID + "-thumb-over");
  1516.                     if (a.shade) {
  1517.                         a.shade.stop();
  1518.                         a.shade.animate({
  1519.                             opacity: this.config.shaderOpacity
  1520.                         }, {
  1521.                             duration: this.config.shaderOut,
  1522.                             easing: "easeOutCubic",
  1523.                             queue: false
  1524.                         })
  1525.                     }
  1526.                     this.trigger("thumbOut", {
  1527.                         n: c
  1528.                     })
  1529.                 }
  1530.                 this.lastOver = c;
  1531.                 if (!(c == -1 || c == this.active)) {
  1532.                     var a = this.lis[c];
  1533.                     a.li.addClass(this.config.cssID + "-thumb-over");
  1534.                     if (a.shade) {
  1535.                         a.shade.stop();
  1536.                         a.shade.animate({
  1537.                             opacity: 0
  1538.                         }, {
  1539.                             duration: this.config.shaderDuration,
  1540.                             easing: "easeOutCubic",
  1541.                             queue: false
  1542.                         })
  1543.                     }
  1544.                     this.trigger("thumbOver", {
  1545.                         n: c
  1546.                     })
  1547.                 }
  1548.             }
  1549.         },
  1550.         next: function (c) {
  1551.             if (c) this.listSize > this.containerSize && this.move(this.$ul.position()[this.edge] - this.containerSize);
  1552.             else {
  1553.                 c = this.active + 1;
  1554.                 if (this.active == -1 || this.active + 1 == this.data.length) c = 0;
  1555.                 this.thumbClick(c)
  1556.             }
  1557.         },
  1558.         prev: function (c) {
  1559.             if (c) this.listSize > this.containerSize && this.move(this.$ul.position()[this.edge] + this.containerSize);
  1560.             else {
  1561.                 c = this.active - 1;
  1562.                 if (this.active == -1 || this.active == 0) c = this.data.length - 1;
  1563.                 this.thumbClick(c)
  1564.             }
  1565.         },
  1566.         move: function (c) {
  1567.             var a = {};
  1568.             a[this.edge] = Math.min(0, Math.max(c, -(this.listSize - this.containerSize)));
  1569.             this.$ul.stop();
  1570.             this.$ul.animate(a, 300)
  1571.         },
  1572.         thumbClick: function (c) {
  1573.             if (this.active == -1) {
  1574.                 if (this.thumbCount <= c || this.lis.length <= c || this.lis[c] == null) {
  1575.                     this.clickWhenReady = c;
  1576.                     return
  1577.                 }
  1578.             } else if (c == this.active) return;
  1579.             else this.initThumb(this.active);
  1580.             if (c == "next") c = this.active + 1 < this.data.length ? this.active + 1 : 0;
  1581.             else if (c == "prev") c = this.active > 0 ? this.active - 1 : this.data.length - 1;
  1582.             var a = this.lis[c];
  1583.             a.li.addClass(this.config.cssID + "-thumb-selected").unbind("click mouseenter mouseleave");
  1584.             a.shade && a.shade.animate({
  1585.                 opacity: 0
  1586.             }, this.config.shaderDuration);
  1587.             this.active = c;
  1588.             this.centerActive()
  1589.         },
  1590.         centerActive: function (c) {
  1591.             if (this.active != -1) {
  1592.                 var a = this.lis[this.active].li,
  1593.                     d = this.$ul.position()[this.edge] + a.position()[this.edge],
  1594.                     b = a[this.outerSize]() / 2;
  1595.                 if (d + b > this.containerSize || d + b < 0) {
  1596.                     a = 10 - a.position()[this.edge] + this.containerSize / 2 - b;
  1597.                     a = Math.min(0, a);
  1598.                     a = Math.max(a, -this.listSize + this.containerSize);
  1599.                     d = {};
  1600.                     d[this.edge] = a;
  1601.                     c ? this.$ul.css(d) : this.$ul.animate(d, 200)
  1602.                 }
  1603.             }
  1604.         },
  1605.         thumbsLoaded: function () {
  1606.             this.$c.css("cursor", "auto");
  1607.             this.$ul.css("width", this.listSize + "px");
  1608.             this.centerList();
  1609.             this.trigger("load")
  1610.         },
  1611.         centerList: function (c) {
  1612.             if (this.listSize < this.containerSize) {
  1613.                 var a = {};
  1614.                 a[this.edge] = this.config.align ? this.config.align == 1 ? (this.containerSize - this.listSize) / 2 : this.containerSize - this.listSize : 0;
  1615.                 c || this.config.mode != "thumbs" ? this.$ul.css(a) : this.$ul.animate(a, 300)
  1616.             } else {
  1617.                 this.centerActive(c);
  1618.                 if (this.$ul.position()[this.edge] > 0) this.$ul.css(this.edge, 0);
  1619.                 else this.$ul.position()[this.edge] + this.listSize < this.containerSize && this.$ul.css(this.edge, -(this.listSize - this.containerSize))
  1620.             }
  1621.         },
  1622.         initMouse: function (c) {
  1623.             if (this.config.mode == "thumbs") {
  1624.                 c = c ? "bind" : "unbind";
  1625.                 this.$oc[c]("mouseenter", f.proxy(this.mouseenter, this));
  1626.                 this.$oc[c]("mouseleave", f.proxy(this.mouseleave, this))
  1627.             }
  1628.         },
  1629.         mouseenter: function () {
  1630.             this.trigger("over");
  1631.             clearInterval(this.intID);
  1632.             var c = this;
  1633.             this.$ul.stop();
  1634.             this.$c.mousemove(this.mcoor == "mouseX" ?
  1635.             function (a) {
  1636.                 c.mouseX = a.pageX - c.containerOffset
  1637.             } : function (a) {
  1638.                 c.mouseY = a.pageY - c.containerOffset
  1639.             });
  1640.             this.marginDif = parseInt(this.lis[this.firstToLoad].li.css("margin-" + this.edge));
  1641.             if (isNaN(this.marginDif)) this.marginDif = 0;
  1642.             c.intID = this.listSize > this.containerSize && this.config.overMove ? setInterval(function () {
  1643.                 c.slide.call(c)
  1644.             }, 10) : setInterval(function () {
  1645.                 c.mouseTrack.call(c)
  1646.             }, 10)
  1647.         },
  1648.         mouseleave: function () {
  1649.             this.trigger("out");
  1650.             this.$c.unbind("mousemove");
  1651.             clearInterval(this.intID);
  1652.             var c = this;
  1653.             this.intID = setInterval(function () {
  1654.                 c.slideOut.call(c)
  1655.             }, 10);
  1656.             this.mouseOver(-1)
  1657.         },
  1658.         slide: function () {
  1659.             this.cnt = 1;
  1660.             var c = this[this.mcoor];
  1661.             if (c <= this.config.buffer) this.pos = 0;
  1662.             else if (c >= this.containerSize - this.config.buffer) this.pos = this.containerSize - this.listSize - 1;
  1663.             else {
  1664.                 var a = this.containerSize * (c - this.config.buffer);
  1665.                 a /= this.noBufSize;
  1666.                 this.pos = a * (1 - this.listSize / this.containerSize)
  1667.             }
  1668.             for (a = this.lis.length - 1; a > -1; a--) {
  1669.                 var d = c - this.prevdx;
  1670.                 if (d >= this.lis[a].pos && d < this.lis[a].pos + this.lis[a].li.width()) {
  1671.                     this.mouseOver(a);
  1672.                     break
  1673.                 }
  1674.             }
  1675.             c = this.prevdx - this.marginDif;
  1676.             this.difference = c - this.pos;
  1677.             c = Math.round(c - this.difference / this.config.speed);
  1678.             if (this.prevdx != c) {
  1679.                 this.$ul.css(this.edge, c);
  1680.                 this.prevdx = c
  1681.             }
  1682.         },
  1683.         prevdx: 0,
  1684.         mouseTrack: function () {
  1685.             for (var c = this[this.mcoor], a = this.lis.length - 1; a > -1; a--) {
  1686.                 var d = c - this.$ul.position()[this.edge];
  1687.                 if (d >= this.lis[a].pos && d < this.lis[a].pos + this.lis[a].li.width()) {
  1688.                     this.mouseOver(a);
  1689.                     break
  1690.                 }
  1691.             }
  1692.         },
  1693.         slideOut: function () {
  1694.             if (this.config.slowdown != 0 && this.difference != 0) {
  1695.                 var c = this.$ul.position()[this.edge];
  1696.                 this.difference = c - this.pos;
  1697.                 this.$ul.css(this.edge, c - this.difference / (this.config.speed * this.cnt));
  1698.                 this.cnt *= 1 + 4 / this.config.slowdown;
  1699.                 if (this.cnt >= 40) {
  1700.                     this.difference = 0;
  1701.                     this.cnt = 1
  1702.                 }
  1703.             } else {
  1704.                 clearInterval(this.intID);
  1705.                 this.intID = null
  1706.             }
  1707.         },
  1708.         trigger: function (c, a) {
  1709.             var d = f.Event("tn_" + c),
  1710.                 b;
  1711.             for (b in a) d[b] = a[b];
  1712.             d.source = this;
  1713.             this.$c.trigger(d);
  1714.             this.config[c] && this.config[c].call(this, d)
  1715.         },
  1716.         destroy: function () {
  1717.             clearInterval(this.intID);
  1718.             this.$c.empty()
  1719.         },
  1720.         rebuild: function (c) {
  1721.             clearInterval(this.intID);
  1722.             this.$c.empty();
  1723.             this.data = c;
  1724.             this.active = this.thumbCount = -1;
  1725.             this.nloaded = 0;
  1726.             this.initMouse(false);
  1727.             this.loaders !== null && f.each(this.loaders, function (a, d) {
  1728.                 d.cancel()
  1729.             });
  1730.             this.init()
  1731.         },
  1732.         setSize: function (c, a) {
  1733.             if (this.config.mode == "thumbs") {
  1734.                 this.isVertical ? this.$c.height(a) : this.$c.width(c);
  1735.                 this.$oc.width(this.$c.width()).height(this.$c.height());
  1736.                 this.containerSize = this.$oc[this.size]();
  1737.                 this.noBufSize = this.containerSize - 2 * this.config.buffer;
  1738.                 this.containerOffset = this.$oc.offset()[this.edge];
  1739.                 this.initMouse(true);
  1740.                 this.loaders === null && this.centerList(true)
  1741.             }
  1742.         },
  1743.         onWinResize: function () {
  1744.             this.containerOffset = this.$oc.offset()[this.edge]
  1745.         }
  1746.     }
  1747. })(jQuery);
  1748. (function (f) {
  1749.     f.fn.tn3.altLink = null;
  1750.     f.fn.tn3.ImageLoader = function (c, a, d, b) {
  1751.         this.$img = f(new Image);
  1752.         b.unshift(this.$img);
  1753.         this.altLink = f.fn.tn3.altLink;
  1754.         a = {
  1755.             url: c,
  1756.             context: a,
  1757.             callback: d,
  1758.             args: b
  1759.         };
  1760.         this.$img.bind("load", a, this.load);
  1761.         this.$img.bind("error", a, f.proxy(this.error, this));
  1762.         this.$img.attr("src", c)
  1763.     };
  1764.     f.fn.tn3.ImageLoader.prototype = {
  1765.         $img: null,
  1766.         altLink: null,
  1767.         load: function (c) {
  1768.             c.data.callback.apply(c.data.context, c.data.args);
  1769.             c.data.args[0].unbind("load").unbind("error")
  1770.         },
  1771.         error: function (c) {
  1772.             if (this.altLink) {
  1773.                 this.altLink = null;
  1774.                 this.$img.attr("src", f.fn.tn3.altLink + c.data.url)
  1775.             } else {
  1776.                 c.data.args.push("image loading error: " + c.data.url);
  1777.                 c.data.callback.apply(c.data.context, c.data.args);
  1778.                 this.$img.unbind("load").unbind("error")
  1779.             }
  1780.         },
  1781.         cancel: function () {
  1782.             this.$img.unbind("load").unbind("error")
  1783.         }
  1784.     }
  1785. })(jQuery);
  1786. (function (f) {
  1787.     f.fn.tn3.Timer = function (c, a, d) {
  1788.         this.$target = c;
  1789.         this.duration = a;
  1790.         this.tickint = d
  1791.     };
  1792.     f.fn.tn3.Timer.prototype = {
  1793.         $target: null,
  1794.         duration: null,
  1795.         id: null,
  1796.         runs: false,
  1797.         counter: null,
  1798.         countDuration: null,
  1799.         tickid: null,
  1800.         ticks: null,
  1801.         tickint: 500,
  1802.         start: function () {
  1803.             if (!this.runs) {
  1804.                 this.runs = true;
  1805.                 this.startCount(this.duration);
  1806.                 this.trigger("timer_start")
  1807.             }
  1808.         },
  1809.         startCount: function (c) {
  1810.             this.clean();
  1811.             this.countDuration = c;
  1812.             this.counter = +new Date;
  1813.             var a = this;
  1814.             this.id = setTimeout(function () {
  1815.                 a.clean.call(a);
  1816.                 a.runs = false;
  1817.                 a.trigger.call(a, "timer_end")
  1818.             }, c);
  1819.             var d = this.duration / this.tickint;
  1820.             this.ticks = Math.round(c / d);
  1821.             this.tickid = setInterval(function () {
  1822.                 a.ticks = Math.ceil((c - new Date + a.counter) / d);
  1823.                 a.ticks > 0 && a.trigger.call(a, "timer_tick", {
  1824.                     tick: a.ticks,
  1825.                     totalTicks: a.tickint
  1826.                 })
  1827.             }, d);
  1828.             this.trigger("timer_tick", {
  1829.                 tick: this.ticks,
  1830.                 totalTicks: this.tickint
  1831.             })
  1832.         },
  1833.         stop: function () {
  1834.             this.clean();
  1835.             this.runs = false;
  1836.             this.trigger("timer_stop")
  1837.         },
  1838.         clean: function () {
  1839.             clearTimeout(this.id);
  1840.             this.id = null;
  1841.             clearInterval(this.tickid);
  1842.             this.elapsed = this.tickid = null
  1843.         },
  1844.         elapsed: null,
  1845.         pause: function (c) {
  1846.             if (this.runs) {
  1847.                 if (c) {
  1848.                     this.clean();
  1849.                     var a = this.duration / this.tickint;
  1850.                     this.elapsed = Math.floor((+new Date - this.counter) / a) * a
  1851.                 } else {
  1852.                     if (this.elapsed == null) return;
  1853.                     this.startCount(this.countDuration - this.elapsed);
  1854.                     this.elapsed = null
  1855.                 }
  1856.                 this.trigger("timer_pause", {
  1857.                     pause: c
  1858.                 })
  1859.             }
  1860.         },
  1861.         trigger: function (c, a) {
  1862.             var d = f.Event(c),
  1863.                 b;
  1864.             for (b in a) d[b] = a[b];
  1865.             this.$target.trigger(d)
  1866.         }
  1867.     }
  1868. })(jQuery);
  1869. (function (f) {
  1870.     var c = f.fn.tn3.Transitions = function (d, b, e, g, k) {
  1871.             this.ts = d;
  1872.             this.def = f.extend(true, {}, this[b.type + "Config"], b);
  1873.             if (!d) this.ts = [this.def];
  1874.             for (var j in this.ts) this.ts[j] = f.extend(true, {}, this[this.ts[j].type + "Config"], this.ts[j]);
  1875.             this.random = e;
  1876.             this.end = f.proxy(g, k)
  1877.         },
  1878.         a = c.prototype = {
  1879.             ts: null,
  1880.             def: {
  1881.                 type: "slide"
  1882.             },
  1883.             random: false,
  1884.             gs: [],
  1885.             end: null,
  1886.             ct: null,
  1887.             counter: -1,
  1888.             setTransition: function () {
  1889.                 if (this.ts.length == 1) this.ct = this.ts[0];
  1890.                 else {
  1891.                     this.counter++;
  1892.                     if (this.counter == this.ts.length) this.counter = 0;
  1893.                     this.random && this.counter == 0 && f.fn.tn3utils.shuffle(this.ts);
  1894.                     this.ct = this.ts[this.counter]
  1895.                 }
  1896.             },
  1897.             start: function (d, b, e) {
  1898.                 this.setTransition();
  1899.                 if (this[this.ct.type + "Condition"] !== undefined && !this[this.ct.type + "Condition"](d, b, this.ct)) this.ct = this.def;
  1900.                 this[this.ct.type](d, b, this.ct, e)
  1901.             },
  1902.             stop: function (d, b) {
  1903.                 this[this.ct.type + "Stop"](d, b, this.ct)
  1904.             },
  1905.             makeGrid: function (d, b, e) {
  1906.                 var g = d.width(),
  1907.                     k = Math.round(g / b);
  1908.                 g = g - k * b;
  1909.                 var j = d.height(),
  1910.                     n = Math.round(j / e);
  1911.                 j = j - n * e;
  1912.                 var h, i, l, m, p, q = 0,
  1913.                     r = 0,
  1914.                     t = "url(" + d.find("img").attr("src") + ") no-repeat scroll -";
  1915.                 for (h = 0; h < b; h++) {
  1916.                     this.gs[h] = [];
  1917.                     m = g > h ? k + 1 : k;
  1918.                     for (i = 0; i < e; i++) {
  1919.                         l = d.append("<div></div>").find(":last");
  1920.                         p = j > i ? n + 1 : n;
  1921.                         l.width(m).height(p).css("background", t + q + "px -" + r + "px").css("left", q).css("top", r).css("position", "absolute");
  1922.                         this.gs[h].push(l);
  1923.                         r += p
  1924.                     }
  1925.                     q += m;
  1926.                     r = 0
  1927.                 }
  1928.                 d.find("img").remove()
  1929.             },
  1930.             stopGrid: function () {
  1931.                 for (var d = 0; d < this.gs.length; d++) for (var b = 0; b < this.gs[d].length; b++) {
  1932.                     this.gs[d][b].clearQueue();
  1933.                     this.gs[d][b].remove()
  1934.                 }
  1935.                 this.gs = []
  1936.             },
  1937.             flatSort: function (d) {
  1938.                 for (var b = [], e = 0; e < this.gs.length; e++) for (var g = 0; g < this.gs[e].length; g++) b.push(this.gs[e][g]);
  1939.                 d && b.reverse();
  1940.                 return b
  1941.             },
  1942.             randomSort: function () {
  1943.                 var d = this.flatSort();
  1944.                 f.fn.tn3utils.shuffle(d);
  1945.                 return d
  1946.             },
  1947.             diagonalSort: function (d, b) {
  1948.                 for (var e = [], g = d > 0 ? this.gs.length - 1 : 0, k = b > 0 ? 0 : this.gs[0].length - 1; this.gs[g];) {
  1949.                     e.push(this.addDiagonal([], g, k, d, b));
  1950.                     g -= d
  1951.                 }
  1952.                 g += d;
  1953.                 for (k += b; this.gs[g][k];) {
  1954.                     e.push(this.addDiagonal([], g, k, d, b));
  1955.                     k += b
  1956.                 }
  1957.                 return e
  1958.             },
  1959.             addDiagonal: function (d, b, e, g, k) {
  1960.                 d.push(this.gs[b][e]);
  1961.                 return this.gs[b + g] && this.gs[b + g][e + k] ? this.addDiagonal(d, b + g, e + k, g, k) : d
  1962.             },
  1963.             circleSort: function (d) {
  1964.                 var b = [],
  1965.                     e = this.gs.length,
  1966.                     g = this.gs[0].length,
  1967.                     k = [Math.floor(e / 2), Math.floor(g / 2)];
  1968.                 e = e * g;
  1969.                 g = [
  1970.                     [1, 0],
  1971.                     [0, 1],
  1972.                     [-1, 0],
  1973.                     [0, -1]
  1974.                 ];
  1975.                 var j = 0,
  1976.                     n = 0,
  1977.                     h;
  1978.                 for (b.push(this.gs[k[0]][k[1]]); b.length < e;) {
  1979.                     for (h = 0; h <= j; h++) this.addGridPiece(b, k, g[n]);
  1980.                     if (n == g.length - 1) n = 0;
  1981.                     else n++;
  1982.                     j += 0.5
  1983.                 }
  1984.                 d && b.reverse();
  1985.                 return b
  1986.             },
  1987.             addGridPiece: function (d, b, e) {
  1988.                 b[0] += e[0];
  1989.                 b[1] += e[1];
  1990.                 this.gs[b[0]] && this.gs[b[0]][b[1]] && d.push(this.gs[b[0]][b[1]])
  1991.             },
  1992.             getSlidePositions: function (d, b) {
  1993.                 var e = {
  1994.                     dir: b
  1995.                 };
  1996.                 switch (b) {
  1997.                 case "left":
  1998.                     e.pos = d.outerWidth(true);
  1999.                     break;
  2000.                 case "right":
  2001.                     e.pos = -d.outerWidth(true);
  2002.                     e.dir = "left";
  2003.                     break;
  2004.                 case "top":
  2005.                     e.pos = -d.outerHeight(true);
  2006.                     break;
  2007.                 case "bottom":
  2008.                     e.pos = d.outerHeight(true);
  2009.                     e.dir = "top"
  2010.                 }
  2011.                 return e
  2012.             },
  2013.             animateGrid: function (d, b, e, g, k, j, n) {
  2014.                 var h = {
  2015.                     duration: g,
  2016.                     easing: e,
  2017.                     complete: function () {
  2018.                         f(this).remove()
  2019.                     }
  2020.                 };
  2021.                 for (e = 0; e < d.length; e++) {
  2022.                     g = f.easing[k](0, e, 0, j, d.length);
  2023.                     if (e == d.length - 1) {
  2024.                         var i = this;
  2025.                         h.complete = function () {
  2026.                             f(this).remove();
  2027.                             n.call(i)
  2028.                         }
  2029.                     }
  2030.                     if (f.isArray(d[e])) for (var l in d[e]) d[e][l].delay(g).animate(b[e], h);
  2031.                     else d[e].delay(g).animate(b[e], h)
  2032.                 }
  2033.             },
  2034.             getValueArray: function (d, b, e) {
  2035.                 var g = [],
  2036.                     k = f.isArray(b),
  2037.                     j = f.isArray(e),
  2038.                     n;
  2039.                 for (n = 0; n < d; n++) {
  2040.                     o = {};
  2041.                     o[k ? b[n % b.length] : b] = j ? e[n % e.length] : e;
  2042.                     g.push(o)
  2043.                 }
  2044.                 return g
  2045.             }
  2046.         };
  2047.     c.defined = [];
  2048.     c.define = function (d) {
  2049.         for (var b in d) switch (b) {
  2050.         case "type":
  2051.             c.defined.push(d.type);
  2052.             break;
  2053.         case "config":
  2054.             a[d.type + "Config"] = d.config;
  2055.             break;
  2056.         case "f":
  2057.             a[d.type] = d.f;
  2058.             break;
  2059.         case "stop":
  2060.             a[d.type + "Stop"] = d.stop;
  2061.             break;
  2062.         case "condition":
  2063.             a[d.type + "Condition"] = d.condition;
  2064.             break;
  2065.         default:
  2066.             a[b] = d[b]
  2067.         }
  2068.     };
  2069.     c.define({
  2070.         type: "none",
  2071.         config: {},
  2072.         f: function () {
  2073.             this.end()
  2074.         },
  2075.         stop: function () {
  2076.             this.end()
  2077.         }
  2078.     });
  2079.     c.define({
  2080.         type: "fade",
  2081.         config: {
  2082.             duration: 300,
  2083.             easing: "easeInQuad"
  2084.         },
  2085.         f: function (d, b, e) {
  2086.             var g = this;
  2087.             d.animate({
  2088.                 opacity: 0
  2089.             }, e.duration, e.easing, function () {
  2090.                 g.end()
  2091.             })
  2092.         },
  2093.         stop: function (d) {
  2094.             d.stop();
  2095.             this.end()
  2096.         }
  2097.     });
  2098.     c.define({
  2099.         type: "slide",
  2100.         config: {
  2101.             duration: 300,
  2102.             direction: "auto",
  2103.             easing: "easeInOutCirc"
  2104.         },
  2105.         f: function (d, b, e, g) {
  2106.             g = this.getSlidePositions(b, e.direction == "auto" ? g : e.direction);
  2107.             var k = {},
  2108.                 j = {};
  2109.             b.css(g.dir, g.pos);
  2110.             k[g.dir] = 0;
  2111.             b.animate(k, e.duration, e.easing, this.end);
  2112.             j[g.dir] = -g.pos;
  2113.             d.animate(j, e.duration, e.easing)
  2114.         },
  2115.         stop: function (d, b) {
  2116.             b.stop();
  2117.             d.stop();
  2118.             d.css("left", 0).css("top", 0);
  2119.             b.css("left", 0).css("top", 0);
  2120.             this.end()
  2121.         }
  2122.     });
  2123.     c.define({
  2124.         type: "blinds",
  2125.         config: {
  2126.             duration: 240,
  2127.             easing: "easeInQuad",
  2128.             direction: "vertical",
  2129.             parts: 12,
  2130.             partDuration: 100,
  2131.             partEasing: "easeInQuad",
  2132.             method: "fade",
  2133.             partDirection: "auto",
  2134.             cross: true
  2135.         },
  2136.         f: function (d, b, e, g) {
  2137.             e.direction == "horizontal" ? this.makeGrid(d, 1, e.parts) : this.makeGrid(d, e.parts, 1);
  2138.             g = e.partDirection == "auto" ? g : e.partDirection;
  2139.             d = this.flatSort(g == "left" || g == "top");
  2140.             var k;
  2141.             switch (e.method) {
  2142.             case "fade":
  2143.                 k = this.getValueArray(d.length, "opacity", 0);
  2144.                 break;
  2145.             case "scale":
  2146.                 k = this.getValueArray(d.length, g == "left" ? "width" : "height", "1px");
  2147.                 break;
  2148.             case "slide":
  2149.                 b = this.getSlidePositions(b, g);
  2150.                 k = this.getValueArray(d.length, b.dir, e.cross ? [b.pos, -b.pos] : b.pos)
  2151.             }
  2152.             this.animateGrid(d, k, e.partEasing, e.partDuration, e.easing, e.duration, this.blindsStop)
  2153.         },
  2154.         stop: function () {
  2155.             this.stopGrid();
  2156.             this.end()
  2157.         },
  2158.         condition: function (d, b) {
  2159.             return !d.data("scaled") || !b.data("scaled")
  2160.         }
  2161.     });
  2162.     c.define({
  2163.         type: "grid",
  2164.         config: {
  2165.             duration: 260,
  2166.             easing: "easeInQuad",
  2167.             gridX: 7,
  2168.             gridY: 5,
  2169.             sort: "diagonal",
  2170.             sortReverse: false,
  2171.             diagonalStart: "bl",
  2172.             method: "fade",
  2173.             partDuration: 300,
  2174.             partEasing: "easeOutSine",
  2175.             partDirection: "left"
  2176.         },
  2177.         f: function (d, b, e, g) {
  2178.             this.makeGrid(d, e.gridX, e.gridY);
  2179.             d = e.partDirection == "auto" ? g : e.partDirection;
  2180.             var k, j;
  2181.             if (e.sort == "diagonal") switch (e.diagonalStart) {
  2182.             case "tr":
  2183.                 k = this.diagonalSort(1, 1);
  2184.                 break;
  2185.             case "tl":
  2186.                 k = this.diagonalSort(-1, 1);
  2187.                 break;
  2188.             case "br":
  2189.                 k = this.diagonalSort(1, -1);
  2190.                 break;
  2191.             case "bl":
  2192.                 k = this.diagonalSort(-1, -1)
  2193.             } else k = this[e.sort + "Sort"](e.sortReverse);
  2194.             switch (e.method) {
  2195.             case "fade":
  2196.                 j = this.getValueArray(k.length, "opacity", 0);
  2197.                 break;
  2198.             case "scale":
  2199.                 j = this.getValueArray(k.length, d == "left" ? "width" : "height", "1px")
  2200.             }
  2201.             this.animateGrid(k, j, e.partEasing, e.partDuration, e.easing, e.duration, this.gridStop)
  2202.         },
  2203.         stop: function () {
  2204.             this.stopGrid();
  2205.             this.end()
  2206.         },
  2207.         condition: function (d, b) {
  2208.             return !d.data("scaled") || !b.data("scaled")
  2209.         }
  2210.     })
  2211. })(jQuery);
  2212. (function (f) {
  2213.     function c(h) {
  2214.         var i = h && h.message !== undefined ? h.message : undefined;
  2215.         h = f.extend({}, f.tn3block.defaults, h || {});
  2216.         i = i === undefined ? h.message : i;
  2217.         n && a({});
  2218.         var l = h.baseZ,
  2219.             m = f.browser.msie || h.forceIframe ? f('<iframe class="blockUI" style="z-index:' + l+++';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="' + h.iframeSrc + '"></iframe>') : f('<div class="blockUI" style="display:none"></div>'),
  2220.             p = f('<div class="blockUI ' + h.cssID + '-overlay" style="z-index:' + l+++';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
  2221.         l = f('<div class="blockUI ' + h.blockMsgClass + ' blockPage" style="z-index:' + l + ';display:none;position:fixed"></div>');
  2222.         l.css("left", "0px").css("top", "0px");
  2223.         if (!h.applyPlatformOpacityRules || !(f.browser.mozilla && /Linux/.test(navigator.platform))) p.css(h.overlayCSS);
  2224.         p.css("position", "fixed");
  2225.         if (f.browser.msie || h.forceIframe) m.css("opacity", 0);
  2226.         var q = [m, p, l],
  2227.             r = f("body");
  2228.         f.each(q, function () {
  2229.             this.appendTo(r)
  2230.         });
  2231.         q = k && (!f.boxModel || f("object,embed", null).length > 0);
  2232.         if (j || q) {
  2233.             h.allowBodyStretch && f.boxModel && f("html,body").css("height", "100%");
  2234.             f.each([m, p, l], function (t, u) {
  2235.                 var s = u[0].style;
  2236.                 s.position = "absolute";
  2237.                 if (t < 2) {
  2238.                     s.setExpression("height", "Math.max(document.body.scrollHeight, document.body.offsetHeight)- (jQuery.boxModel?0:" + h.quirksmodeOffsetHack + ') + "px"');
  2239.                     s.setExpression("width", 'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"')
  2240.                 } else if (h.centerY) {
  2241.                     s.setExpression("top", '(document.documentElement.clientHeight || document.body.clientHeight) / 2- (this.offsetHeight / 2)+ (blah = document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop)+ "px"');
  2242.                     s.marginTop = 0
  2243.                 } else h.centerY || s.setExpression("top", '(document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')
  2244.             })
  2245.         }
  2246.         if (i) {
  2247.             i.data("blockUI.parent", i.parent());
  2248.             l.append(i);
  2249.             if (i.jquery || i.nodeType) f(i).show()
  2250.         }
  2251.         if ((f.browser.msie || h.forceIframe) && h.showOverlay) m.show();
  2252.         h.showOverlay && p.show();
  2253.         i && l.show();
  2254.         h.onBlock && h.onBlock();
  2255.         b(1, h);
  2256.         n = i
  2257.     }
  2258.     function a(h) {
  2259.         h = f.extend({}, f.tn3block.defaults, h || {});
  2260.         b(0, h);
  2261.         var i = f("body").children().filter(".blockUI").add("body > .blockUI");
  2262.         d(i, h)
  2263.     }
  2264.     function d(h, i) {
  2265.         h.each(function () {
  2266.             this.parentNode && this.parentNode.removeChild(this)
  2267.         });
  2268.         n.data("blockUI.parent").append(n);
  2269.         n = null;
  2270.         typeof i.onUnblock == "function" && i.onUnblock.call(i.con)
  2271.     }
  2272.     function b(h, i) {
  2273.         if (h || n)!i.bindEvents || h && !i.showOverlay || (h ? f(document).bind("mousedown mouseup keydown keypress", i, e) : f(document).unbind("mousedown mouseup keydown keypress", e))
  2274.     }
  2275.     function e(h) {
  2276.         var i = h.data;
  2277.         if (f(h.target).parents("div." + i.blockMsgClass).length > 0) return true;
  2278.         return f(h.target).parents().children().filter("div.blockUI").length == 0
  2279.     }
  2280.     var g = document.documentMode || 0,
  2281.         k = f.browser.msie && (f.browser.version < 8 && !g || g < 8),
  2282.         j = f.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !g;
  2283.     f.tn3block = function (h) {
  2284.         c(h)
  2285.     };
  2286.     f.tn3unblock = function (h) {
  2287.         a(h)
  2288.     };
  2289.     var n = undefined;
  2290.     f.tn3block.defaults = {
  2291.         message: "<h1>Please wait...</h1>",
  2292.         overlayCSS: {},
  2293.         iframeSrc: /^https/i.test(window.location.href || "") ? "javascript:false" : "about:blank",
  2294.         forceIframe: false,
  2295.         baseZ: 1E3,
  2296.         allowBodyStretch: true,
  2297.         bindEvents: true,
  2298.         showOverlay: true,
  2299.         applyPlatformOpacityRules: true,
  2300.         onBlock: null,
  2301.         onUnblock: null,
  2302.         quirksmodeOffsetHack: 4,
  2303.         blockMsgClass: "blockMsg",
  2304.         cssID: "tn3"
  2305.     }
  2306. })(jQuery);
  2307. (function (f) {
  2308.     (f.fn.tn3.External = function (c, a) {
  2309.         if (c) {
  2310.             this.context = a;
  2311.             this.reqs = c.length;
  2312.             for (var d = 0; d < c.length; d++) new f.fn.tn3.External[c[d].origin](c[d], this)
  2313.         }
  2314.     }).prototype = {
  2315.         context: null,
  2316.         reqs: 0,
  2317.         getImages: function (c, a) {
  2318.             c.origin.getImages(c, a)
  2319.         },
  2320.         setAlbumData: function (c, a) {
  2321.             this.reqs--;
  2322.             this.context.setAlbumData.call(this.context, c, a)
  2323.         },
  2324.         setImageData: function (c, a, d) {
  2325.             this.context.setImageData.call(this.context, c, a, d)
  2326.         },
  2327.         getAlbumData: function (c) {
  2328.             return this.context.data[c]
  2329.         }
  2330.     }
  2331. })(jQuery);