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

Untitled

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