PageSourceSearch

https://koskeridis-law.gr/templates/look4website/layouts/async-min.js?ver=1573202540

js koskeridis-law.gr collected 2026-10-08 20:44:36 UTC 508,807 bytes, 10,228 lines download raw bytes

1var params = document.querySelector("script[data-smtitle]"),
2    smenable = params.getAttribute("data-smenable"),
3    smtitle = params.getAttribute("data-smtitle"),
4    smauthor = params.getAttribute("data-smauthor"),
5    smicon = params.getAttribute("data-smicon"),
6    rplayer = params.getAttribute("data-rplayer"),
7    enablewebpush = params.getAttribute("data-enablewebpush");
8if (jQuery.noConflict(), !window.FLAX || "full" != window.FLAX.TYPE) {
9    function log() {
10        FLAX.debug("log", arguments)
11    }
12
13    function info() {
14        FLAX.debug("info", arguments)
15    }
16
17    function error() {
18        FLAX.debug("error", arguments)
19    }
20
21    function warn() {
22        FLAX.debug("warn", arguments)
23    }
24
25    function id(e) {
26        return FLAX.get(e)
27    }
28
29    function back(e) {
30        FLAX.Html.thread[e].go(-1)
31    }
32
33    function forward(e) {
34        FLAX.Html.thread[e].go(1)
35    }
36
37    function go(e, t) {
38        FLAX.Html.thread[t].go(e)
39    }
40
41    function abort(e) {
42        FLAX.Html.thread[e] && FLAX.Html.thread[e].abort()
43    }
44
45    function hax(e, t) {
46        t || (t = {}), "string" == typeof e ? t.url = e : t = e, null == t.nohistory && (t.nohistory = t.noHistory);
47        var i = FLAX.Html.thread[t.id] ? FLAX.Html.thread[t.id] : FLAX.HTMLThread(t.id);
48        return i.setOptions(t, 1), FLAX.Html.ASYNCHRONOUS ? i.request() : (FLAX.Html.storage.push(i.id), 1 == FLAX.Html.storage.length && i.request()), i
49    }
50
51    function get(e, t, i, n, r) {
52        return hax(e, "object" == typeof t ? t : {
53            id: t,
54            form: i,
55            cb: n,
56            cbo: r
57        })
58    }
59
60    function post(e, t, i, n, r) {
61        return "object" == typeof t ? (t.method = "post", hax(e, t)) : hax(e, {
62            method: "post",
63            id: t,
64            form: i,
65            cb: n,
66            cbo: r
67        })
68    }
69
70    function dax(e, t) {
71        t || (t = {}), "string" == typeof e ? t.url = e : t = e, t.id || (t.id = "undefined");
72        var i = FLAX.Data.thread[t.id] ? FLAX.Data.thread[t.id] : FLAX.DATAThread(t.id);
73        return i.setOptions(t, 1).request(), i
74    }
75
76    function abortData(e) {
77        FLAX.Data.thread[e] && FLAX.Data.thread[e].abort()
78    }
79
80    function getData(e, t, i, n, r, o) {
81        return dax(e, {
82            cb: t,
83            id: i,
84            cbo: n,
85            anticache: r,
86            destroy: o
87        })
88    }
89
90    function postData(e, t, i, n, r, o, a) {
91        return dax(e, {
92            method: "post",
93            params: t,
94            cb: i,
95            id: n,
96            cbo: r,
97            anticache: o,
98            destroy: a
99        })
100    }
101    String.trim || (String.prototype.trim = function() {
102            return (this || "").replace(/^\s+|\s+$/g, "")
103        }), String.prototype.replaceAll = function(e, t) {
104            return this.split(e).join(t)
105        }, String.prototype.endWith = function(e, t) {
106            var i = t ? this.toLowerCase() : this,
107                n = t ? e.toLowerCase() : e;
108            return i.substring(i.length - n.length, i.length) == n
109        }, String.prototype.startWith = function(e, t) {
110            var i = t ? this.toLowerCase() : this,
111                n = t ? e.toLowerCase() : e;
112            return i.substring(0, n.length) == n
113        }, Array.prototype.indexOf || (Array.prototype.indexOf = function(e, t) {
114            for (var i = t || 0; i < this.length; i++)
115                if (this[i] === e) return i;
116            return -1
117        }), window.FLAX || (FLAX = SRAX = {}), FLAX.extend = function(e, t, i) {
118            var n = !i;
119            for (var r in t) !n && e.hasOwnProperty(r) || (e[r] = t[r]);
120            return e
121        },
122        function(e) {
123            e.extend(e, {
124                version: "1.3.2",
125                TYPE: "full",
126                Default: {
127                    prefix: "ax",
128                    sprt: ":",
129                    sprt_url: ":",
130                    lvl: "_lvl",
131                    loader: "loading",
132                    loader2: "loading2",
133                    loaderSufix: "_loading",
134                    DEBUG_AJAX: 0,
135                    DEBUG_SCRIPT: 0,
136                    DEBUG_LINK: 0,
137                    DEBUG_STYLE: 0,
138                    USE_FILTER_WRAP: 1,
139                    USE_HTML5_HISTORY: 1,
140                    NO_HISTORY: 0,
141                    USE_HISTORY_CACHE: 1,
142                    LENGTH_HISTORY_CACHE: 100,
143                    LINK_REPEAT: 0,
144                    USE_SCRIPT_CACHE: 1,
145                    SCRIPT_SRC_REPEAT_APPLY: 1,
146                    SCRIPT_NOAX: 0,
147                    RELATIVE_CORRECTION: 0,
148                    OVERWRITE: 0,
149                    model2Marker: {
150                        ax: "\x3c!-- :ax:",
151                        begin: ":begin: //--\x3e",
152                        end: ":end: //--\x3e"
153                    },
154                    HAX_AUTO_DESTROY: 0,
155                    HAX_ANTICACHE: 0,
156                    DAX_AUTO_DESTROY: 0,
157                    DAX_ANTICACHE: 0,
158                    CHARSET: "UTF-8"
159                },
160                debug: function(e, t) {
161                    var i = window.console;
162                    if (i && i[e]) i[e].apply(i, t), t[0] && t[0].stack && i[e].apply(i, [t[0].stack]);
163                    else if (window.runtime) {
164                        for (var n = [e + ": " + t[0]], r = 1, o = t.length; r < o; r++) n.push(t[r]);
165                        runtime.trace(n)
166                    }
167                },
168                getTime: function() {
169                    return (new Date).getTime()
170                },
171                LIST_NO_CACHE_SCRIPTS: [],
172                LIST_NO_LOAD_SCRIPTS: [],
173                LIST_NO_LOAD_LINKS: [],
174                init: function() {
175                    var i = navigator.userAgent.toLowerCase();
176                    if (e.browser = {
177                            webkit: /webkit/.test(i),
178                            safari: /safari/.test(i),
179                            opera: /opera/.test(i),
180                            msie: /msie/.test(i) && !/opera/.test(i),
181                            mozilla: /mozilla/.test(i) && !/(compatible|webkit)/.test(i),
182                            air: /adobeair/.test(i)
183                        }, e.browser.msie)
184                        for (var n = 0, r = [6, 7, 8], o = r.length; n < o; n++) new RegExp("msie " + r[n]).test(i) && (e.browser.msieV = r[n]);
185                    e.addEventsListener(e.History), e.addContainerListener(e.Html), e.addContainerListener(e.Data), e.LoadUnloadContainer = {}, e.scriptsCache = [
186                        [],
187                        []
188                    ], e.scriptsTemp = [
189                        [],
190                        []
191                    ], e.linksCache = [], e.History.prefixListener.ax = e.go2Hax, e.readyHndlr = [], e.onReady(function() {
192                        if (t.USE_FILTER_WRAP && e.Filter.wrap(), e.initCPLNLS(), e.initCPLNLL(), e.History.isHTML5Enabled()) setTimeout(function() {
193                            e.addEvent(window, "popstate", function(t) {
194                                if (!location.hash) {
195                                    e.History.setCurrent(e.getHash());
196                                    for (var i in e.History.prefixListener) e.History.prefixListener[i]();
197                                    history.popped = !0
198                                }
199                            })
200                        }, 300);
201                        else if (setInterval(e.History.check, 200), e.browser.opera) {
202                            var i = document.createElement("img");
203                            i.setAttribute("style", "position:absolute;left:-1px;top:-1px;opacity:0;width:0px;height:0px"), i.setAttribute("alt", ""), i.setAttribute("src", 'javascript:location.href="javascript:FLAX.xssLoading=0;FLAX.History.check()"'), document.body.appendChild(i)
204                        }
205                        e.Include.parse()
206                    }), document._write = document.write, document._writeln = document.writeln, e.write = function(e) {
207                        document._write(e)
208                    }, e.writeln = function(e) {
209                        document._writeln(e)
210                    }
211                },
212                initOnReady: function() {
213                    e.isReadyInited || (e.isReadyInited = 1, e.browser.mozilla || e.browser.opera ? e.addEvent(document, "DOMContentLoaded", e.ready) : e.browser.msie ? function() {
214                        try {
215                            document.documentElement.doScroll("left")
216                        } catch (e) {
217                            return void setTimeout(arguments.callee, 50)
218                        }
219                        e.ready()
220                    }() : e.browser.safari && (e.safariTimer = setInterval(function() {
221                        "loaded" != document.readyState && "complete" != document.readyState || (clearInterval(e.safariTimer), e.safariTimer = null, e.ready())
222                    }, 10)), e.addEvent(window, "load", e.ready))
223                },
224                onReady: function(t) {
225                    e.isReady ? t() : (e.readyHndlr.push(t), e.initOnReady())
226                },
227                ready: function() {
228                    if (!e.isReady) {
229                        e.isReady = 1;
230                        for (var t = 0, i = e.readyHndlr.length; t < i; t++) try {
231                            e.readyHndlr[t]()
232                        } catch (e) {
233                            error(e)
234                        }
235                        e.readyHndlr = null
236                    }
237                },
238                addEvent: function(e, t, i) {
239                    e.attachEvent ? e.attachEvent("on" + t, i) : e.addEventListener(t, i, !1)
240                },
241                delEvent: function(e, t, i) {
242                    e.detachEvent ? e.detachEvent("on" + t, i) : e.removeEventListener(t, i, !1)
243                },
244                get: function(e) {
245                    return "string" == typeof e ? document.getElementById(e) : e
246                },
247                clearLNLS: function() {
248                    e.LIST_NO_LOAD_SCRIPTS = []
249                },
250                initCPLNL: function(t) {
251                    for (var i = e.getHead().getElementsByTagName(t), n = "script" == t ? e.LIST_NO_LOAD_SCRIPTS : e.LIST_NO_LOAD_LINKS, r = 0, o = i.length; r < o; r++) {
252                        var a = i[r].src || i[r].href;
253                        a && n.push(a)
254                    }
255                },
256                initCPLNLS: function(t) {
257                    t && e.clearLNLS(), e.initCPLNL("script")
258                },
259                clearLNLL: function() {
260                    e.LIST_NO_LOAD_LINKS = []
261                },
262                initCPLNLL: function(t) {
263                    t && e.clearLNLL(), e.initCPLNL("link")
264                },
265                linkEqual: {},
266                replaceLinkEqual: function(t, i) {
267                    var n = "replaceAll",
268                        r = e.linkEqual;
269                    i || (t = t[n]("?", "[~q~]"));
270                    for (var o in r) t = i ? t[n](r[o], o) : t[n](o, r[o]);
271                    return i && (t = t[n]("[~q~]", "?")), t
272                },
273                Model2Blocks: {},
274                IE_XHR_ENGINE: ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"],
275                getXHR: function() {
276                    if (window.XMLHttpRequest && (!window.ActiveXObject || "file:" != location.protocol)) return new XMLHttpRequest;
277                    if (window.ActiveXObject)
278                        for (var t = 0; t < e.IE_XHR_ENGINE.length; t++) try {
279                            return new ActiveXObject(e.IE_XHR_ENGINE[t])
280                        } catch (e) {}
281                },
282                delHost: function(t) {
283                    return t && t.startWith(e.host) && (t = t.replace(e.host, "")), t
284                },
285                host: location.protocol + "//" + location.host,
286                DaxPreprocessor: function(e) {},
287                HtmlPreprocessor: function(e) {},
288                XHRThread: function(i) {
289                    var n, r = {
290                            options: {},
291                            inprocess: 0,
292                            id: i,
293                            setOptions: function(t, i) {
294                                return !t.url && t.src && (t.url = t.src), !t.cb && t.callback && (t.cb = t.callback), null == t.cbo && null != t.callbackOps && (t.cbo = t.callbackOps), null == t.anticache && null != t.nocache && (t.anticache = t.nocache), i && (o = {}), e.extend(o, t), null == o.async && (o.async = !0), o.url = e.delHost(o.url), this.options = o, r
295                            },
296                            getOptions: function() {
297                                return o
298                            },
299                            isProcess: function() {
300                                return r.inprocess
301                            },
302                            getXHR: function() {
303                                return n || (n = e.getXHR()), n
304                            },
305                            onProgressXHR: function() {
306                                var e = r.getXHR();
307                                try {
308                                    e.onprogress = function(e) {
309                                        r.fireEvent("progress", {
310                                            id: i,
311                                            thread: r,
312                                            event: e,
313                                            loaded: e.loaded,
314                                            total: e.total,
315                                            percent: Math.round(100 * e.loaded / e.total)
316                                        })
317                                    }
318                                } catch (e) {}
319                                return r
320                            },
321                            openXHR: function() {
322                                var t = r.getMethod(),
323                                    i = r.getXHR(),
324                                    n = (e.browser.msie && "file:" == location.protocol && o.url.startWith("/") ? "file://" : "") + o.url;
325                                return o.user ? i.open(t.toUpperCase(), n, o.async, o.user, o.pswd) : i.open(t.toUpperCase(), n, o.async), r
326                            },
327                            sendXHR: function(i, n, a) {
328                                var s = r.getMethod(),
329                                    l = r.getXHR();
330                                l.onreadystatechange = o.async ? n : function() {};
331                                var u = "setRequestHeader";
332                                if (o.cut && l[u]("Ajax-Cut-Block", o.cut), i && l[u]("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"), l[u]("Ajax-Engine", "Fullajax"), l[u]("X-Requested-With", "XMLHttpRequest"), o.headers)
333                                    for (var d in o.headers) l[u](d, o.headers[d]);
334                                "post" == s && l[u]("Content-Type", "application/x-www-form-urlencoded; Charset=" + t.CHARSET), e.showLoading(r.inprocess, r.getLoader()), l.send("post" == s ? a : null), o.async || n()
335                            },
336                            init: function() {
337                                return r.inprocess && r.abort(), r.inprocess = 1, r
338                            },
339                            getParams: function() {
340                                var t = e.createQuery(o.form);
341                                r.getMethod();
342                                return o.params && ("" != t && !o.params.startWith("&") && (t += "&"), t += o.params), t
343                            },
344                            buildUrl: function(e, t) {
345                                if ("post" != r.getMethod() && "" != t)
346                                    if (-1 == e.indexOf("?")) e += "?" + t;
347                                    else {
348                                        for (var i = t.split("&"), n = 0, o = i.length; n < o; n++)
349                                            if (i[n]) {
350                                                var a = i[n].split("="),
351                                                    s = -1,
352                                                    l = e.indexOf("&" + a[0] + "=");
353                                                if (-1 == l && (l = e.indexOf("?" + a[0] + "=")), l > -1) {
354                                                    var u = (s = e.indexOf("&", l + 1)) > -1 ? e.substring(s + 1) : "";
355                                                    e = e.substring(0, l + 1) + u
356                                                }
357                                            }
358                                        e += (e.endWith("?") || e.endWith("&") ? "" : "&") + t
359                                    }
360                                return e
361                            },
362                            abort: function() {
363                                if (r.inprocess = 0, n) {
364                                    try {
365                                        n.isAbort = 1, n.abort()
366                                    } catch (e) {}
367                                    n = null, e.showLoading(0, r.getLoader())
368                                }
369                            },
370                            _getLoader: function(t) {
371                                return r.loader || (r.loader = null == o.loader ? e.getLoader(i, t) : e.get(o.loader)), r.loader
372                            },
373                            getMethod: function() {
374                                var e = o.method ? o.method : o.form ? o.form.method : "get";
375                                return e && "post" == e.toLowerCase() ? "post" : "get"
376                            }
377                        },
378                        o = r.options;
379                    return e.addEventsListener(r), r
380                },
381                DATAThread: function(i) {
382                    function n(n) {
383                        n && n.readyState || (n = a.getXHR());
384                        try {
385                            if (4 == n.readyState) {
386                                a.inprocess = 0, e.showLoading(a.inprocess, a.getLoader());
387                                var s = n.isAbort ? -1 : n.status,
388                                    l = s >= 200 && s < 300 || 304 == s || 0 == s && "file:" == location.protocol,
389                                    u = n.responseText,
390                                    d = n.responseXML,
391                                    c = {
392                                        xhr: n,
393                                        url: r.url,
394                                        id: i,
395                                        status: s,
396                                        success: l,
397                                        cbo: r.cbo,
398                                        callbackOps: r.cbo,
399                                        options: r,
400                                        text: u,
401                                        xml: d,
402                                        thread: a,
403                                        responseText: u,
404                                        responseXML: d,
405                                        time: e.getTime() - o
406                                    };
407                                a.fireEvent("response", c), s > -1 && !1 !== e.DaxPreprocessor(c) && r.cb && (r.cb(c, i, l, r.cbo), t.DEBUG_AJAX && log("callback id:" + i)), (null != r.destroy ? r.destroy : t.DAX_AUTO_DESTROY) && a.destroy()
408                            }
409                        } catch (o) {
410                            error(o), a.fireEvent("exception", {
411                                xhr: n,
412                                url: r.url,
413                                id: i,
414                                exception: o,
415                                options: r
416                            }), a.inprocess = 0, e.showLoading(a.inprocess, a.getLoader()), (null != r.destroy ? r.destroy : t.DAX_AUTO_DESTROY) && a.destroy()
417                        }
418                    }
419                    var r, o, a = e.XHRThread(i);
420                    return e.Data.thread[i] = a, e.Data.register(a), a.getLoader = function() {
421                        return a._getLoader(1)
422                    }, a.repeat = function(e) {
423                        r.params = e, a.request()
424                    }, a.request = function() {
425                        r = a.getOptions();
426                        var s = a.getMethod();
427                        try {
428                            var l = {
429                                url: r.url,
430                                id: i,
431                                options: r,
432                                thread: a
433                            };
434                            if (!1 !== a.fireEvent("beforerequest", l)) {
435                                o = e.getTime();
436                                var u = a.init().getParams(),
437                                    d = null != r.anticache ? r.anticache : t.DAX_ANTICACHE;
438                                r.url = a.buildUrl(r.url, u), r.text || r.xml ? (n({
439                                    readyState: 4,
440                                    status: null == r.status ? 200 : r.status,
441                                    responseText: r.text,
442                                    responseXML: r.xml
443                                }), r.text = r.xml = null) : a.onProgressXHR().openXHR().sendXHR(d, n, u), t.DEBUG_AJAX && log(s + " " + r.url + " params:" + u + " id:" + i), a.fireEvent("afterrequest", l)
444                            }
445                        } catch (e) {
446                            throw a.abort(), error(e), e
447                        }
448                    }, a.destroy = function() {
449                        e.Data.thread[i] = null, delete e.Data.thread[i]
450                    }, a
451                },
452                showLoading: function(t, i) {
453                    var n = i ? i.style : 0;
454                    if (n)
455                        if (t) n.visibility ? n.visibility = "visible" : n.display = "block";
456                        else {
457                            function r(e, t) {
458                                for (var n in e)
459                                    if (e[n].getLoader() == i && e[n] && e[n].isProcess()) return 1
460                            }!r(e.Data.thread) && !r(e.Html.thread) && (n.visibility ? n.visibility = "hidden" : n.display = "none")
461                        }
462                },
463                getLoader: function(i, n) {
464                    var r = e.get;
465                    return i && (i = r(("string" == typeof i ? i : i.id) + t.loaderSufix)), i || r(n ? t.loader2 : t.loader) || r(n ? t.loader : t.loader2)
466                },
467                encode: encodeURIComponent,
468                decode: decodeURIComponent,
469                createQuery: function(t, i) {
470                    if (!(t = e.get(t))) return "";
471                    i || (i = {});
472                    for (var n = [], r = [], o = e.encode, a = t.getElementsByTagName("input"), s = 0; s < a.length; s++) {
473                        var l = a[s],
474                            u = l.type.toLowerCase(),
475                            d = l.name ? l.name : l.id,
476                            c = o(l.value);
477                        if (d) switch (d = o(d), u) {
478                            case "checkbox":
479                            case "radio":
480                                l.checked && (n.push(d), r.push(null == c || "" == c ? l.checked : c));
481                                break;
482                            default:
483                                n.push(d), r.push(c)
484                        }
485                    }
486                    var p = t.getElementsByTagName("select");
487                    for (s = 0; s < p.length; s++) {
488                        var g = p[s];
489                        u = g.type.toLowerCase();
490                        if ((d = g.name ? g.name : g.id) && -1 != g.selectedIndex)
491                            if ("select-multiple" == u)
492                                for (var h = 0, _ = g.options.length; h < _; h++) g.options[h].selected && (n.push(d), r.push(o(g.options[h].value)));
493                            else n.push(o(d)), r.push(o(g.options[g.selectedIndex].value))
494                    }
495                    var m = t.getElementsByTagName("textarea");
496                    for (s = 0; s < m.length; s++) {
497                        var f = m[s];
498                        (d = f.name ? f.name : f.id) && (n.push(o(d)), r.push(o(f.value)))
499                    }
500                    var v = [];
501                    for (s = 0, _ = n.length; s < _;
501 s++) i.skipEmpty && "" == r[s] || v.push(n[s] + "=" + r[s]);
502                    var b = v.join("&") + (t.submitValue || "");
503                    return t.submitValue = null, b
504                },
505                applyParams: function(t, i) {
506                    -1 == t.indexOf(" =") && -1 == t.indexOf("= ") || (t = t.replace(/\s*=\s*/g, "="));
507                    for (var n = t.split(" "), r = n.length - 1; r >= 0; r--) {
508                        var o = n[r],
509                            a = o.indexOf("=");
510                        if (a > -1) {
511                            var s = e.indexOfAttrMarks(o, a + 1),
512                                l = o.substring(0, a).trim(),
513                                u = o.substring(s[0] + 1, s[1]).trim();
514                            i[l] = u
515                        } else -1 == o.indexOf("<") && -1 == o.indexOf(">") && (i[o] = o)
516                    }
517                    return i
518                },
519                indexOfAttrMarks: function(e, t) {
520                    null == t && (t = 0);
521                    var i = "'",
522                        n = e.indexOf(i, t),
523                        r = e.indexOf('"', t);
524                    if (r > -1 && (r < n || -1 == n) && (n = r, i = '"'), n > -1) r = e.indexOf(i, n + 1);
525                    else {
526                        for (n = e.indexOf("="), n++; e.substring(n).startWith(" ");) n++;
527                        for (r = (e = e.replaceAll(">", "")).length - 1; e.substring(r, 1).endWith(" ");) r--;
528                        n--, r++
529                    }
530                    return [n, r]
531                },
532                getParam: function(t, i) {
533                    var n = t.toLowerCase().indexOf(" " + i);
534                    if (n > -1) {
535                        var r = e.indexOfAttrMarks(t, n + i.length + 1);
536                        return t.substring(r[0] + 1, r[1])
537                    }
538                },
539                entitiesConvertor: function(t) {
540                    return null == t ? t : (e.tempDiv || (e.tempDiv = document.createElement("div")), e.tempDiv.innerHTML = t, e.tempDiv[this.browser.msie ? "innerText" : "textContent"])
541                },
542                makeScript: function(t) {
543                    t.indexOf("FLAX.init()") > -1 && (t = '<script type="text/javascript"><\/script>');
544                    var i = document.createElement("script"),
545                        n = t.toLowerCase().indexOf("<script"),
546                        r = t.indexOf(">", n + 1),
547                        o = t.toLowerCase().lastIndexOf("<\/script>");
548                    if (n > -1 && r > -1) {
549                        var a = t.substring(n, r + 1);
550                        e.applyParams(a, i)
551                    }
552                    i.src && (i.src = e.entitiesConvertor(i.src)), t = o > -1 ? t.substring(r + 1, o) : "";
553                    var s = (i.src ? i.src : "").trim().toLowerCase(),
554                        l = s.startWith("javascript:");
555                    return ("//:" == s || l) && (l && (t += "\n" + s.substring(11)), i.src = ""), t.length > 0 && (e.browser.msie ? i.text = t : i.appendChild(document.createTextNode(t))), i.id || (i.id = i.src), i
556                },
557                addCss: function(t, i) {
558                    t.indexOf("{") > -1 ? e.addStyle("<style>" + t + "</style>", i, i) : e.addLink('<link rel="stylesheet" href="' + t + '">', i, i)
559                },
560                addStyle: function(n, r, o) {
561                    var a = n.toLowerCase().indexOf("<style"),
562                        s = n.indexOf(">", a + 1),
563                        l = n.toLowerCase().indexOf("</style>", s + 1),
564                        u = n.substring(a, s + 1),
565                        d = e.applyParams(u, {})[i("skip")];
566                    if ("true" != d && "1" != d) {
567                        for (a = (n = n.substring(s + 1, l)).toLowerCase().indexOf("@import "); a > -1;) {
568                            s = n.indexOf("(", a + 1), l = n.indexOf(")", s + 1);
569                            var c = n.substring(s + 1, l).replace(/["\']/g, "");
570                            c = '<link rel="stylesheet" type="text/css" href="' + c + '"/>', e.addLink(c, r, o), a = (n = n.substring(0, a) + n.substring(l + 1)).toLowerCase().indexOf("@import ")
571                        }
572                        if (o && "string" == typeof r && (n = e.sealStyle(n, r)), n.length > 0) {
573                            var p = document.createElement("style");
574                            if (p.type = "text/css", p.styleSheet) p.styleSheet.cssText = n;
575                            else if (e.browser.mozilla || e.browser.opera) p.innerHTML = n;
576                            else {
577                                var g = document.createTextNode(n);
578                                p.appendChild(g)
579                            }
580                            e.getHead().appendChild(p), t.DEBUG_STYLE && log("append style:\n " + n)
581                        }
582                    }
583                },
584                sealStyle: function(e, t) {
585                    t = t.trim();
586                    for (var i = -1, n = e.indexOf("{"), r = (t.startWith(".") || t.startWith("#") ? "" : "#") + t + " ", o = ""; n > -1;) o += r + e.substring(i + 1, n).trim().replaceAll(",", "," + r), i = e.indexOf("}", n), i > -1 && (o += e.substring(n, i + 1)), n = -1 == i ? -1 : e.indexOf("{", i);
587                    return o
588                },
589                addLink: function(n, r, o) {
590                    var a = n.toLowerCase().indexOf("<link"),
591                        s = n.indexOf(">", a + 1);
592                    if (a > -1 && s > -1) {
593                        var l = n.substring(a, s + 1),
594                            u = document.createElement("link");
595                        e.applyParams(l, u), u.href && (u.href = e.entitiesConvertor(u.href));
596                        var d = u[i("skip")];
597                        if ("true" == d || "1" == d) return;
598                        var c = o && "string" == typeof r ? r + ":" + u.href : u.href;
599                        if (e.indexOfCacheSrc(e.linksCache, c) > -1) {
600                            var p = u[i("repeat")];
601                            if (!t.LINK_REPEAT || "false" == p || "0" == p) return
602                        } else e.linksCache.push(c);
603                        if (e.indexOfCacheSrc(e.LIST_NO_LOAD_LINKS, c) > -1) return;
604                        if (o && "stylesheet" == u.rel) try {
605                            return void dax(u.href, {
606                                cb: function(t, i, n, r) {
607                                    var o = n ? t.responseText : "";
608                                    e.addStyle("<style>" + o + "</style>", r, 1)
609                                },
610                                id: (r ? r + ":" : "") + u.href,
611                                cbo: r
612                            })
613                        } catch (e) {
614                            error("error seal " + u.href)
615                        }
616                        document.createStyleSheet ? document.createStyleSheet(u.href) : e.getHead().appendChild(u), t.DEBUG_LINK && log("append LINK " + u.href)
617                    }
618                },
619                isHTMLComment: function(e) {
620                    var t = e.lastIndexOf("\x3c!--"),
621                        i = e.indexOf("--\x3e", t + 4);
622                    return t > -1 && -1 == i
623                },
624                isHTML: function(e) {
625                    function t(t) {
626                        var i = e.lastIndexOf("<" + t),
627                            n = e.indexOf("</" + t + ">", i + 1),
628                            r = e.indexOf(">", i + 1),
629                            o = e.indexOf("/>", i + 1);
630                        return !(i > -1 && r > -1 && -1 == n && o != r + 1)
631                    }
632                    return e = e.toLowerCase(), t("script") && t("style")
633                },
634                relativeCorrection: function(t, i, n) {
635                    -1 == i.indexOf("/") && (i = location.pathname);
636                    var r = i.lastIndexOf("/");
637                    for (i = i.substring(0, r + 1), r = t.toLowerCase().indexOf(" " + n); r > -1;) {
638                        var o = e.indexOfAttrMarks(t, r + 2);
639                        if (e.isHTML(t.substring(0, r + 2)) && o[0] > -1 && o[1] > -1) {
640                            var a = t.substring(o[0] + 1, o[1]);
641                            !a.startWith("/") && !a.startWith("#") && "" == e.parseUri(a).protocol && (t = t.substring(0, o[0] + 1) + i + t.substring(o[0] + 1))
642                        }
643                        r = t.toLowerCase().indexOf(n, r + 2)
644                    }
645                    return t
646                },
647                toSource: function(t) {
648                    switch (typeof t) {
649                        case "function":
650                            return t.toString();
651                        case "string":
652                            return '"' + t.replaceAll('"', '\\"') + '"';
653                        case "object":
654                            if (null == t) return null;
655                            var i = "";
656                            if (t instanceof Array) {
657                                for (var n = 0, r = t.length; n < r; n++) i += "," + e.toSource(t[n]);
658                                return i.length > 0 && (i = i.substring(1)), "[" + i + "]"
659                            }
660                            for (var n in t) i += "," + n + ":" + e.toSource(t[n]);
661                            return "{" + (i.length > 0 ? i.substring(1) : i) + "}"
662                    }
663                    return t
664                },
665                arrayRemoveOf: function(t, i, n) {
666                    n && (i = e.toSource(i));
667                    for (var r = 0; r < t.length; r++)(n && i == e.toSource(t[r]) || i == t[r]) && t.splice(r--, 1);
668                    return t
669                },
670                collectionToArray: function(e) {
671                    for (var t = [], i = 0, n = e.length; i < n; i++) t[i] = e[i];
672                    return t
673                },
674                indexOfCacheSrc: function(e, t) {
675                    var i = e.indexOf(t);
676                    return -1 == i && (t = t.startWith(location.protocol) ? t.replace(location.protocol + "//" + location.host, "") : location.protocol + "//" + location.host + t, i = e.indexOf(t)), i
677                },
678                parsingText: function(n) {
679                    n || (n = {});
680                    var r = n.owner;
681                    if (!1 !== e.Html.fireEvent(n.id, "beforeload", n)) {
682                        var o = n.text,
683                            a = n.id,
684                            s = n.url,
685                            l = n.add,
686                            u = "relativeCorrection";
687                        o = e.Include.fix(o), (null == n.rc ? t.RELATIVE_CORRECTION : n.rc) && (o = e[u](o, s, "src"), o = e[u](o, s, "href"), o = e[u](o, s, "action")), o = e.parsingLinkAndStyle(o, a, n.seal), u = "substring";
688                        var d = (o = e.parsingFrameset(o)).toLowerCase().indexOf("<head"),
689                            c = "";
690                        d > -1 ? (c += o[u](0, d), o = o[u](d)) : (c = o, o = "");
691                        var p = o.toLowerCase().indexOf("</head>"),
692                            g = "";
693                        p > -1 && (g += o[u](p + 7), o = o[u](0, p + 7));
694                        var h = e.Html.thread[a],
695                            _ = h ? h.getOptions().notitle : 0,
696                            m = e.parsingTitle(o, a, _);
697                        o = c + m.text + g, l || (o = e.parsingLoadUnload(o, a));
698                        var f = e.parsingScript(o, a, r && r[i("noax")]);
699                        new e.loadHtml(a, f.scripts, f.html, s, l, r, n.onload, n.scope, m.title)
700                    } else r.inprocess = 0
701                },
702                parsingLoadUnload: function(t, i) {
703                    var n, r, o = t.toLowerCase().indexOf("<body");
704                    if (o > -1) {
705                        var a = t.indexOf(">", o + 1);
706                        if (a > -1) {
707                            var s = t.substring(o, a + 1);
708                            n = e.getParam(s, "onload"), r = e.getParam(s, "onunload"), t = t.substring(0, o) + s.replaceAll("load", "") + t.substring(a + 1)
709                        }
710                    }
711                    var l = "LoadUnloadContainer";
712                    return e[l][i] || (e[l][i] = {}), e[l][i].onload = n, e[l][i].onunload = e[l][i].nextonunload, e[l][i].nextonunload = r, t
713                },
714                parsingTitle: function(t, i, n) {
715                    for (var r, o = t.toLowerCase(), a = o.indexOf("<title>"), s = o.indexOf("</title>", a + 1); a > -1 && s > -1;) !e.isHTMLComment(t.substring(0, a)) && !r && (r = t.substring(a + 7, s), n || e.titleChange(r, i)), t = t.substring(0, a) + t.substring(s + 8), o = t, a = o.indexOf("<title>", a + 1), s = o.indexOf("</title>", a + 1);
716                    return {
717                        text: t,
718                        title: r
719                    }
720                },
721                titleChange: function(t, i) {
722                    var n = {
723                        oldTitle: document.title,
724                        newTitle: t
725                    };
726                    return !1 !== e.Html.fireEvent(i, "beforetitlechange", n) && (document.title = e.entitiesConvertor(t), e.Html.fireEvent(i, "titlechange", n), t)
727                },
728                parsingFrameset: function(t) {
729                    var i = t.toLowerCase().indexOf("<frameset");
730                    if (i > -1) {
731                        var n = t.toLowerCase().indexOf(">", i),
732                            r = t.toLowerCase().indexOf("</frameset>");
733                        if (n > -1 && r > -1) {
734                            var o = t.substring(i, r + 11),
735                                a = e.genId();
736                            o = "<iframe style='height:100%;width:100%;border:0' href='javascript:true' id='" + a + "'></iframe><script>var obj = FLAX.get('" + a + "');var doc = obj[obj.contentWindow ? 'contentWindow' : 'contentDocument'].document;doc.open();doc.write('" + o.replaceAll("\n", "").replaceAll("\r", "").trim() + "');doc.close()<\/script>", t = t.substring(0, i) + o + t.substring(r + 11)
737                        }
738                    }
739                    return t
740                },
741                parsingLinkAndStyle: function(t, i, n) {
742                    var r = t.toLowerCase().indexOf("<link"),
743                        o = t.toLowerCase().indexOf("<style"),
744                        a = "",
745                        s = -1,
746                        l = -1;
747                    for (r < o && r > -1 || -1 == o ? (s = r, l = t.indexOf(">", s + 1)) : (s = o, l = t.toLowerCase().indexOf("</style>", s + 1)); s > -1 && l > -1;) s > 0 && (a += t.substring(0, s)), r < o && r > -1 || -1 == o ? (e.isHTMLComment(t.substring(0, s)) || e.addLink(t.substring(s, l + 1), i, n), t = t.substring(l + 1)) : (e.isHTMLComment(t.substring(0, s)) || e.addStyle(t.substring(s, l + 8), i, n), t = t.substring(l + 8)), r = t.toLowerCase().indexOf("<link"), o = t.toLowerCase().indexOf("<style"), r < o && r > -1 || -1 == o ? (s = r, l = t.indexOf(">", s + 1)) : (s = o, l = t.toLowerCase().indexOf("</style>", s + 1));
748                    return t.length > 0 && (a += t), a
749                },
750                parsingScript: function(n, o, a) {
751                    var s = n.toLowerCase(),
752                        l = s.indexOf("<script"),
753                        u = s.indexOf("<\/script>", l + 1),
754                        d = 9,
755                        c = n.indexOf(">", l + 1),
756                        p = n.indexOf("/>", l + 1);
757                    c > -1 && -1 != p && c == p + 1 && (u = p, d = 2);
758                    for (var g, h = [], _ = [], m = 0; l > -1 && u > -1;) {
759                        l > 0 && h.push(n.substring(0, l));
760                        var f = e.makeScript(n.substring(l, u + d));
761                        if (a && (f[i("noax")] = 1), l = (s = (n = n.substring(u + d)).toLowerCase()).indexOf("<script"), u = s.indexOf("<\/script>", l + 1), d = 9, c = n.indexOf(">", l + 1), p = n.indexOf("/>", l + 1), c > -1 && -1 != p && c == p + 1 && (u = p, d = 2), 0 == h.length || !e.isHTMLComment(h.join(""))) {
762                            0 != h.length && -1 != h[h.length - 1].indexOf("_place_of_script_") || (g = o + "_place_of_script_" + m++, h.push(r(g))), f.place = g;
763                            var v = e.get(g);
764                            v && (v.id += "_old");
765                            var b = f[i("skip")];
766                            if ("true" == b || "1" == b) continue;
767                            if (f.src) {
768                                if (f.src.indexOf("fullajax.js") > -1 || f.src.indexOf("fullajax.min") >
768 -1 || e.indexOfCacheSrc(e.LIST_NO_LOAD_SCRIPTS, f.src) > -1) continue;
769                                var y = e.indexOfCacheSrc(e.scriptsCache[0], f.src);
770                                if (y > -1) {
771                                    var w = f[i("repeat")];
772                                    (null == w || "false" != w && "0" != w) && t.SCRIPT_SRC_REPEAT_APPLY ? (e.scriptsCache[1][y].place = f.place, f = e.cloneScript(e.scriptsCache[1][y])) : f = e.makeScript('<script type="text/javascript">//no repeat ' + f.src + "<\/script>")
773                                } else try {
774                                    e.Data.thread[f.src] && e.Data.thread[f.src].isProcess() ? f = e.Data.thread[f.src].options.cbo : t.SCRIPT_NOAX || f[i("noax")] ? f.xss = 1 : new e.startLoadScript(f)
775                                } catch (e) {
776                                    error(e)
777                                }
778                            }
779                            var x = i("head"),
780                                E = f[x];
781                            s = n.toLowerCase(), f[x] = null == E ? -1 == s.indexOf("<head") && s.indexOf("</head>") > -1 : "1" == E || "true" == E, _.push(f)
782                        }
783                    }
784                    return n.length > 0 && h.push(n), {
785                        scripts: _,
786                        html: h
787                    }
788                },
789                finishLoadScript: function(n, r, o, a) {
790                    var s = o ? n.responseText : "",
791                        l = e.makeScript('<script type="text/javascript">' + s + "<\/script>");
792                    l.place = a.place, l.id = a.id ? a.id : r;
793                    var u = e.indexOfCacheSrc(e.scriptsTemp[0], r); - 1 == u && (u = e.scriptsTemp[0].length), e.scriptsTemp[0][u] = r, e.scriptsTemp[1][u] = l, t.USE_SCRIPT_CACHE && -1 == e.indexOfCacheSrc(e.LIST_NO_CACHE_SCRIPTS, r) && !a[i("nocache")] && (-1 == (u = e.indexOfCacheSrc(e.scriptsCache[0], r)) && (u = e.scriptsCache[0].length), e.scriptsCache[0][u] = r, e.scriptsCache[1][u] = e.cloneScript(l))
794                },
795                isXss: function(t) {
796                    return ((t = (t || "").toLowerCase()).startWith("http:") || t.startWith("https:")) && !t.startWith(e.host)
797                },
798                startLoadScript: function(t) {
799                    try {
800                        var n = t.src;
801                        if (e.isXss(n)) throw "xss";
802                        dax(n, {
803                            cb: e.finishLoadScript,
804                            id: n,
805                            cbo: t,
806                            anticache: t[i("nocache")]
807                        })
808                    } catch (e) {
809                        t.id || (t.id = t.src), t.xss = t.src
810                    }
811                },
812                cloneScript: function(e, t) {
813                    t || (t = {});
814                    for (var n = document.createElement("script"), r = ["src", "type", "language", "defer", "text", "id", "place", i("repeat"), i("noax"), i("skip"), i("head"), i("noblock")], o = 0, a = r.length; o < a; o++) try {
815                        var s = e[r[o]];
816                        null != t[r[o]] && (s = t[r[o]]), null != s && "" != s && (n[r[o]] = s)
817                    } catch (e) {}
818                    return n
819                },
820                serialApplyScripts: function(t, n, r, o) {
821                    var a = 0;
822                    this.checkload = function() {
823                        if (a >= t.length) {
824                            if (e.docWriteTraper.apply(n), !(e.xssLoading || a >= 1 && (t[a - 1].inprocess || t[a - 1].countproc))) return o ? o() : null
825                        } else {
826                            if (t[a].src) {
827                                var s = e.indexOfCacheSrc(e.scriptsTemp[0], t[a].src);
828                                if (s > -1 && (!t[a][i("noax")] || !t[a][i("nocache")])) {
829                                    var l = t[a].place;
830                                    t[a] = e.cloneScript(e.scriptsTemp[1][s]), t[a].place = l
831                                }
832                            }
833                            t[a].src || a > 0 && t[a - 1].inprocess ? t[a].src && !e.xssLoading && (t[a].loaded ? (e.docWriteTraper.apply(n), a++) : t[a].xss && (t[a].xss = 0, new e.addScript(t[a], n, r))) : (ne
833w e.addScript(t[a], n, r), e.docWriteTraper.apply(n), a++)
834                        }
835                        var u = this;
836                        this.recall = function() {
837                            u.checkload()
838                        }, setTimeout(this.recall, 10)
839                    }, this.checkload()
840                },
841                loadHtml: function(n, o, a, s, l, u, d, c, p) {
842                    e.removeScripts(o);
843                    var g = {
844                        id: n,
845                        scripts: o,
846                        html: a,
847                        url: s,
848                        add: l,
849                        owner: u,
850                        scope: c,
851                        title: p
852                    };
853                    e.Html.fireEvent(n, "unload", g), l || e.execUnloadBody(n);
854                    for (var h = [], _ = [], m = [], f = 0; f < o.length; f++) {
855                        var v = o[f],
856                            b = v[i("head")];
857                        (b ? h : _).push(v), b && m.push(r(v.place))
858                    }
859                    m.length && e[l ? "addTo" : "writeTo"](m, n), new e.serialApplyScripts(h, n, s, function() {
860                        e[e.Model2Blocks[n] ? "paintHtml2" : "paintHtml"](a.join(""), n, s, l), l || e.Effect.use(n), new e.serialApplyScripts(_, n, s, function() {
861                            if (t.USE_FILTER_WRAP) {
862                                var i = e.Model2Blocks[n];
863                                if (i)
864                                    for (var r in i) {
865                                        var o = e.get(i[r]);
866                                        o && e.Filter.wrap(o, s)
867                                    } else e.Filter.wrap(n, s)
868                            }
869                            e.Include.parse(), u && (u.inprocess = 0, u.countproc && u.countproc--), l || (e.execLoadBody(n, s), e.execFunc(d, [g], c)), e.Html.fireEvent(n, "load", g);
870                            var a = e.Html.thread[n];
871                            !e.Html.ASYNCHRONOUS && e.Html.storage[0] == n && (e.Html.storage.splice(0, 1), e.Html.storage.length > 0 && a.request()), a && e.showLoading(0, a.getLoader())
872                        })
873                    })
874                },
875                execLoadBody: function(n, r) {
876                    e.LoadUnloadContainer[n].onload && e.parsingText({
877                        id: n,
878                        url: r,
879                        text: '<script id="' + i("script" + t.sprt + "temp") + '" type="text/javascript">' + e.LoadUnloadContainer[n].onload + "<\/script>",
880                        add: 1
881                    }), e.isCOL && window._onload()
882                },
883                captureOnLoad: function() {
884                    window.onloadHandlers = [], window._onload = function() {
885                        var e = window.onloadHandlers;
886                        window.onloadHandlers = [], e.push(window.onload), window.onload = null;
887                        for (var t = 0, i = e.length; t < i; t++) try {
888                            e[t] && e[t]()
889                        } catch (e) {
890                            error(e)
891                        }
892                    }, window.onloadHandlers.push(window.onload), window.onload = function() {
893                        window.onload = null, window._onload()
894                    }, window._addEvent = window[window.attachEvent ? "attachEvent" : "addEventListener"], window.addEventListener = window.attachEvent = function(e, t, i) {
895                        "load" == e ? window.onloadHandlers.push(t) : window._addEvent(e, t, i)
896                    }, e.isCOL = 1
897                },
898                execUnloadBody: function(t, i) {
899                    var n = e.LoadUnloadContainer[t],
900                        r = i ? "nextonunload" : "onunload";
901                    e.execFunc(n[r]), n[r] = null
902                },
903                paintHtml: function(t, i, n, r) {
904                    var o = {
905                        html: t,
906                        id: i,
907                        url: n,
908                        add: r
909                    };
910                    r ? !1 !== e.Html.fireEvent(i, "beforepaintadd", o) && (e.addTo(t, i), e.Html.fireEvent(i, "afterpaintadd", o)) : !1 !== e.Html.fireEvent(i, "beforepaint", o) && (e.writeTo(t, i), e.Html.fireEvent(i, "afterpaint", o))
911                },
912                paintHtml2: function(i, n, r, o) {
913                    for (var a = e.Model2Blocks[n], s = t.model2Marker, l = i.indexOf(s.ax), u = i.indexOf(s.begin, l + 1), d = i.indexOf(s.ax, u + 1), c = i.indexOf(s.end, d + 1); l > -1 && u > -1 && d > -1 && c > -1;) {
914                        var p = i.substring(l + s.ax.length, u),
915                            g = i.substring(u + s.begin.length, d);
916                        if (a[p]) {
917                            var h = {
918                                html: g,
919                                id: p,
920                                url: r,
921                                block: a[p],
922                                add: o
923                            };
924                            o ? !1 !== e.Html.fireEvent(n, "beforepaintadd", h) && (e.addTo(g, a[p]), e.Html.fireEvent(n, "afterpaintadd")) : !1 !== e.Html.fireEvent(n, "beforepaint", h) && (e.writeTo(g, a[p]), e.Html.fireEvent(n, "afterpaint"))
925                        }
926                        l = i.indexOf(s.ax, c + 1), u = i.indexOf(s.begin, l + 1), d = i.indexOf(s.ax, u + 1), c = i.indexOf(s.end, d + 1)
927                    }
928                },
929                docWriteTraper: new function() {
930                    var t = {},
931                        i = {},
932                        r = {};
933                    this.add = function(e, n, o, a) {
934                        a.inprocessTO && clearTimeout(a.inprocessTO), a.inprocess = 1, t[n] = a, i[n] = o, r[n] || (r[n] = ""), r[n] += e, this.checkMutiLine(n)
935                    }, this.checkMutiLine = function(e) {
936                        for (var t = r[e], i = t.indexOf("<"); i > -1;) {
937                            for (var n = 1, o = t.charAt(i + n).trim();
938                                "" != o && ">" != o;) {
939                                if ("/" == o && ">" == t.charAt(i + n + 1)) return void this.apply(e);
940                                o = t.charAt(i + ++n).trim()
941                            }
942                            var a = t.substring(i + 1, i + n);
943                            if (t.indexOf("</" + a + ">", i) > -1) {
944                                this.apply(e);
945                                break
946                            }
947                            if (t.indexOf(">", i + 1 + a.length) > -1 && ("img" == a || "input" == a || "br" == a || "hr" == a)) return void this.apply(e);
948                            i = t.indexOf("<", i + 1)
949                        }
950                    }, this.apply = function(o) {
951                        if (r[o]) {
952                            var a = r[o];
953                            delete r[o], t[o].countproc ? t[o].countproc++ : t[o].countproc = 1, n(e.get(t[o].place), 1), e.parsingText({
954                                text: a,
955                                id: t[o].place,
956                                url: i[o],
957                                add: 1,
958                                owner: t[o]
959                            })
960                        }
961                    }, this.applyAll = function() {
962                        for (var t in r) r[t] && e.docWriteTraper.apply(t)
963                    }
964                },
965                addScript: function(r, o, a, s, l, u, d) {
966                    if ("object" == typeof r && "SCRIPT" != r.nodeName && (o = r.callback || r.cb, a = r.noax, l = r.place, s = null == r.anticache ? r.nocache : r.anticache, u = r.storage, d = r.noblock, r = r.src || r.url), e.Storage && (null == u ? t.USE_STORAGE : u) && e.Storage.isPosible() && !e.Storage.isReady) e.Storage.onReady(function() {
967                        e.addScript(r, o, a, s, l, u)
968                    });
969                    else {
970                        if ("string" == typeof r) {
971                            var c = document.createElement("span");
972                            c.cb = o || function() {}, c.id = e.genId(), c.style.display = "none", n(c, 1);
973                            var p = document.getElementsByTagName("script");
974                            if (l = e.get(l)) l.innerHTML = "", l = l.appendChild(c);
975                            else
976                                for (var g = 0, h = p.length; g < h; g++) {
977                                    var _ = p[g].innerHTML,
978                                        m = _.indexOf("FLAX.addScript");
979                                    if (m > -1)
980                                        if (_.indexOf(r) > m) {
981                                            l = p[g].place ? e.get(p[g].place) : p[g];
982                                            break
983                                        }
984                                }
985                            return l ? l.parentNode.insertBefore(c, l) : document.body.appendChild(c), void hax({
986                                id: c.id,
987                                url: r,
988                                html: "<body onload=\"FLAX.get('" + c.id + '\').cb()"><script type="text/javascript" src="' + r + '"' + (a ? " " + i("noax") + '="1"' : "") + (s ? " " + i("nocache") + '="1"' : "") + (d ? " " + i("noblock") + '="1"' : "") + "><\/script></body>",
989                                nohistory: 1,
990                                storage: u
991                            })
992                        }
993                        if (e.docWriteTraper.apply(o), document.write = function(t) {
994                                e.docWriteTraper.add(t, o, a, r)
995                            }, document.writeln = function(e) {
996                                document.write(e + "\n")
997                            }, t.DEBUG_SCRIPT) {
998                            var f = r.id;
999                            f && "" != f || (f = r.innerHTML.trim().substring(0, 100) + "\n..."), log("append script:\n" + f)
1000                        }
1001                        r.src && (r.inprocess = 1, e.xssLoading = !r[i("noblock")], r.onerror = r.onload = r.onreadystatechange = function() {
1002                            var t = this;
1003                            !t.loaded && (!t.readyState || "loaded" == t.readyState || "complete" == t.readyState) && (t.loaded = 1, t.onerror = t.onload = t.onreadystatechange = null, e.xssLoading = 0, t.inprocessTO = setTimeout(function() {
1004                                t.inprocess = 0
1005                            }, 100))
1006                        }), e.getHead().appendChild(r)
1007                    }
1008                },
1009                evalScript: function(t) {
1010                    try {
1011                        e.browser.safari ? (window._evalCode = t, new e.addScript(e.makeScript('<script type="text/javascript">eval(window._evalCode)<\/script>'))) : window.execScript ? window.execScript(t) : window.eval(t)
1012                    } catch (e) {
1013                        return error(e), 0
1014                    }
1015                    return 1
1016                },
1017                removeScripts: function(n) {
1018                    for (var r = e.getHead().getElementsByTagName("script"), o = [], a = 0, s = n.length; a <= s; a++)
1019                        if (!(a < n.length && "string" == typeof n[a])) {
1020                            var l = a < n.length ? n[a].id : i("script" + t.sprt + "temp"),
1021                                u = 0;
1022                            for (s = r.length; u < s; u++)
1023                                if (l ? r[u].id == l : r[u].innerHTML == n[a].innerHTML) {
1024                                    o.push(r[u]);
1025                                    break
1026                                }
1027                        }
1028                    for (a = 0, s = o.length; a < s; a++) o[a].parentNode && (t.DEBUG_SCRIPT && log("remove script " + (o[a].id ? o[a].id : o[a].innerHTML)), o[a].parentNode.removeChild(o[a]))
1029                },
1030                execFunc: function(t, i, n) {
1031                    if (t instanceof Array)
1032                        for (var r = 0, o = t.length; r < o; r++) e.execFunc(t[r], i, n);
1033                    else if (t) try {
1034                        if (n || (n = window), "string" == typeof t && ((t = t.trim()).startWith("function") && t.endWith("}") && (t = e.browser.msie ? "FLAX.tmp=" + t : "(" + t + ")"), function() {
1035                                t = window.eval(t)
1036                            }.call(n), "function" != typeof t)) return;
1037                        t.apply(n, i)
1038                    } catch (e) {
1039                        error(e)
1040                    }
1041                },
1042                HTMLThread: function(i) {
1043                    function n(n) {
1044                        n && n.readyState || (n = a.getXHR());
1045                        try {
1046                            if (4 == n.readyState) {
1047                                var l = n.isAbort ? -1 : n.status,
1048                                    u = l >= 200 && l < 300 || 304 == l || 0 == l && "file:" == location.protocol,
1049                                    d = n.responseText;
1050                                try {
1051                                    var c = [],
1052                                        p = {};
1053                                    try {
1054                                        c = n.getAllResponseHeaders().split("\n")
1055                                    } catch (e) {}
1056                                    for (var g = 0, h = c.length; g < h; g++) {
1057                                        var _ = c[g].indexOf(":");
1058                                        _ > -1 && (p[c[g].substring(0, _).toLowerCase()] = c[g].substring(_ + 2))
1059                                    }
1060                                    var m = p["content-type"];
1061                                    if (m) {
1062                                        var f = ["application/x-javascript", "application/javascript", "text/javascript", "application/json", "text/json"];
1063                                        for (g = 0, h = f.length; g < h; g++)
1064                                            if (m.indexOf(f[g]) > -1) {
1065                                                d = "<script>" + d + "<\/script>", r.add = 1;
1066                                                break
1067                                            }
1068                                    }
1069                                } catch (e) {}
1070                                var v = {
1071                                    xhr: n,
1072                                    url: r.url,
1073                                    id: i,
1074                                    status: l,
1075                                    success: u,
1076                                    cbo: r.cbo,
1077                                    callbackOps: r.cbo,
1078                                    options: r,
1079                                    text: d,
1080                                    thread: a,
1081                                    responseText: d,
1082                                    time: e.getTime() - o
1083                                };
1084                                a.fireEvent("response", v), l > -1 && !1 !== e.HtmlPreprocessor(v) && (r.cb && (e.execFunc(r.cb, [v, i, u, r.cbo], r.scope), t.DEBUG_AJAX && log("callback id:" + i)), a.inprocess = 0, u ? (v.text ? (s.add(v.url, v.text, r), a.inprocess = 1, e.parsingText({
1085                                    owner: a,
1086                                    text: v.text,
1087                                    id: i,
1088                                    url: r.url,
1089                                    add: r.add,
1090                                    rc: r.rc,
1091                                    seal: r.seal,
1092                                    onload: r.onload,
1093                                    scope: r.scope
1094                                })) : (warn("empty response: " + i + " => " + r.url), e.Effect.use(i)), t.DEBUG_AJAX && log("response ok:" + r.url)) : (e.execFunc(r.onerror, [r], r.scope), e.showMessage(r.url, n.status, n.statusText), e.Effect.use(i))), e.showLoading(a.inprocess, a.getLoader()), (null != r.destroy ? r.destroy : t.HAX_AUTO_DESTROY) && a.destroy()
1095                            }
1096                        }
1096 catch (o) {
1097                            error(o), a.fireEvent("exception", {
1098                                xhr: n,
1099                                url: r.url,
1100                                id: i,
1101                                exception: o,
1102                                options: r
1103                            }), e.Effect.use(i), a.inprocess = 0, e.showLoading(a.inprocess, a.getLoader()), (null != r.destroy ? r.destroy : t.HAX_AUTO_DESTROY) && a.destroy()
1104                        }
1105                    }
1106                    var r, o, a = e.XHRThread(i);
1107                    e.Html.thread[i] = a, e.Html.register(a), a.getLoader = a._getLoader, a.repeat = function(e, t, i) {
1108                        r.form = e, r.nohistory = t, r.params = i, a.request()
1109                    }, a.request = function() {
1110                        r = a.getOptions();
1111                        var l = a.getMethod();
1112                        try {
1113                            var u = {
1114                                url: r.url,
1115                                id: i,
1116                                options: r,
1117                                thread: a
1118                            };
1119                            if (!1 !== a.fireEvent("beforerequest", u)) {
1120                                var d = function() {
1121                                    o = e.getTime();
1122                                    var u = a.init().getParams(),
1123                                        d = location.href.indexOf("#"),
1124                                        c = -1 == d ? location.href : location.href.substring(0, d),
1125                                        p = null != r.html || c.endWith(r.url) || (null != r.anticache ? r.anticache : t.HAX_ANTICACHE);
1126                                    r.url = a.buildUrl(r.url, u), d = s.getIndex(r.url);
1127                                    var g = null;
1128                                    if (!p && d > -1 && "post" != l && (r.html = s.storage[d][1], g = 1), r.html) n({
1129                                        readyState: 4,
1130                                        status: 200,
1131                                        responseText: r.html,
1132                                        cache: g
1133                                    }), r.html = null;
1134                                    else try {
1135                                        a.onProgressXHR().openXHR().sendXHR(p, n, u)
1136                                    } catch (t) {
1137                                        throw e.Effect.use(i), t
1138                                    }
1139                                    t.DEBUG_AJAX && log(l + " " + r.url + " params:" + u + " id:" + i)
1140                                };
1141                                e.Effect.use(i, 1, d) || d(), a.fireEvent("afterrequest", u)
1142                            }
1143                        } catch (e) {
1144                            throw a.abort(), error(e), e
1145                        }
1146                    }, a.destroy = function() {
1147                        e.Html.thread[i] = null, delete e.Html.thread[i]
1148                    };
1149                    var s = a.history = {
1150                        storage: [],
1151                        startPageHtml: null,
1152                        startPageOps: null,
1153                        startPageUrl: null,
1154                        current: 0,
1155                        currentUrl: function() {
1156                            return 0 == this.storage.length || this.current <= 0 ? null : this.storage[s.current][0]
1157                        },
1158                        add: function(n, o, a) {
1159                            (n = decodeURIComponent(n)).href && (n = n.href), this.current++;
1160                            var l = location.host,
1161                                u = n.indexOf(l);
1162                            u > -1 && (n = n.substring(u + l.length)), n = e.replaceLinkEqual(n), r.startpage && (r.startpage = 0, s.startPageHtml = o, s.startPageUrl = n, s.startPageOps = e.extend({}, r), e.History.setCurrent(e.getHash()));
1163                            var d = null != r.nohistory ? !r.nohistory : !t.NO_HISTORY;
1164                            if (null == s.startPageHtml) {
1165                                var c = ["<head><title>" + document.title + "</title></head>"],
1166                                    p = e.Model2Blocks[i];
1167                                if (p)
1168                                    for (var g in p) {
1169                                        var h;
1170                                        if (h = e.get(p[g])) {
1171                                            var _ = h.innerHTML,
1172                                                m = t.model2Marker.ax,
1173                                                f = m + g + t.model2Marker.begin,
1174                                                v = m + g + t.model2Marker.end;
1175                                            _ = _.replaceAll(f, "").replaceAll(v, ""), c.push(f + _ + v)
1176                                        }
1177                                    } else(h = e.get(i)) || (h = document.body), c.push(h.innerHTML);
1178                                s.startPageHtml = c.join(""), s.startPageUrl = location.href
1179                            }
1180                            if (d) {
1181                                var b = e.parsingTitle(o, i, 1).title;
1182                                e.History.add(i, n, null, b)
1183                            }
1184                            this.current > t.LENGTH_HISTORY_CACHE && (this.current--, this.storage.splice(0, 1)), this.storage.length = this.current, this.storage.push([e.replaceLinkEqual(n, 1), o, a])
1185                        },
1186                        get: function(e) {
1187                            return this.storage[e]
1188                        },
1189                        getIndex: function(e, t) {
1190                            for (var i = t || 0, n = this.storage.length; i < n; i++)
1191                                if (null != this.storage[i] && e == this.storage[i][0]) return i;
1192                            return -1
1193                        }
1194                    };
1195                    return a.go2History = function(i) {
1196                        if (s.currentUrl() != i && (!(null != r.historycache ? r.historycache : t.USE_HISTORY_CACHE) || !a.go2UrlHistory(i))) {
1197                            i = e.replaceLinkEqual(i, 1);
1198                            var n = s.getIndex(i, 2),
1199                                o = {
1200                                    url: i,
1201                                    nohistory: 1
1202                                };
1203                            n > -1 && e.extend(o, s.storage[n][2], 1), a.setOptions(o, n > -1).request()
1204                        }
1205                    }, a.go2UrlHistory = function(t) {
1206                        var i = s.getIndex(t);
1207                        if (i > -1) return a.go(i - s.current), e.History.setCurrent(e.getHash()), !0
1208                    }, a.go = function(t) {
1209                        var n = s.current + t;
1210                        if (n < 0 ? n = 0 : n > s.storage.length - 1 && (n = s.storage.length - 1), 0 == n) return a.go2StartPage();
1211                        s.current = n;
1212                        var o = s.storage[n],
1213                            l = o[0],
1214                            u = o[1],
1215                            d = o[2] || r;
1216                        l && u && e.parsingText({
1217                            owner: a,
1218                            text: u,
1219                            id: i,
1220                            url: s.storage[n][0],
1221                            add: d.add,
1222                            rc: d.rc,
1223                            seal: d.seal,
1224                            onload: d.onload,
1225                            scope: d.scope
1226                        })
1227                    }, a.go2StartPage = function() {
1228                        var t = s;
1229                        if (t.startPageHtml) {
1230                            var n = e.extend({
1231                                startpage: 1,
1232                                owner: a,
1233                                text: t.startPageHtml,
1234                                id: i,
1235                                url: t.startPageUrl
1236                            }, t.startPageOps || r, 1);
1237                            e.parsingText(n)
1238                        }
1239                        s.current = 0
1240                    }, a.getSrartPageUrl = function() {
1241                        return s.startPageUrl
1242                    }, a
1243                },
1244                replaceHref: function() {
1245                    var t = location,
1246                        i = t.href,
1247                        n = i.indexOf("#");
1248                    n > -1 && i.length > n + 1 && t.replace(i.substring(0, n) + e.replaceLinkEqual(i.substring(n)))
1249                },
1250                go: function(t, i) {
1251                    var n = e.parseAxHash(t);
1252                    for (var r in n) hax(e.extend({
1253                        id: r,
1254                        url: n[r]
1255                    }, i))
1256                },
1257                directLink: function() {
1258                    e.onReady(function() {
1259                        e.replaceHref();
1260                        var i = e.getHash();
1261                        if (i.length && e.History.isHTML5Enabled()) {
1262                            i = e.replaceLinkEqual(i, 1);
1263                            var n = new RegExp(t.sprt_url + t.prefix + t.sprt_url + "[A-Za-z0-9_-]+" + t.sprt_url, "g"),
1264                                r = i.replace("#", "").replace(n, "");
1265                            history.replaceState(null, null, r)
1266                        }
1267                        e.History.setCurrent(i), e.go2Hax(1, i)
1268                    })
1269                },
1270                isDirectLink: function(t) {
1271                    var i = e.parseAxHash(e.getHash());
1272                    if (t) return !!i[t];
1273                    for (var n in i) return !0;
1274                    return !1
1275                },
1276                go2Hax: function(t, i) {
1277                    var n = e.parseAxHash(e.History.previous);
1278                    i || (i = e.History.current);
1279                    var r = e.parseAxHash(i),
1280                        o = 0,
1281                        a = {
1282                            oldHash: e.History.previous,
1283                            newHash: e.History.current
1284                        };
1285                    for (var s in r)
1286                        if (o++, n[s] != r[s]) {
1287                            if (n[s] = null, a.id = s, a.url = r[s], !1 !== e.Html.fireEvent(s, "beforehistorychange", a))
1288                                if (e.Html.thread[s]) {
1289                                    var l = function() {
1290                                        e.Html.thread[s].go2History(r[s])
1291                                    };
1292                                    e.Effect.use(s, 1, l) || l()
1293                                } else {
1294                                    var u = e.replaceLinkEqual(r[s], 1),
1295                                        d = e.parseUri(u);
1296                                    a = e.Filter.getOptions(d.path, d.query);
1297                                    if (ind = u.indexOf("?"), ind > -1 && a && a.params) {
1298                                        for (var c = "&" + u.substring(ind + 1) + "&", p = a.params.split("&"), g = 0; g < p.length; g++) c.indexOf("&" + p[g] + "&") > -1 && p.splice(g--, 1);
1299                                        a.params = p.join("&")
1300                                    }
1301                                    a || (a = {}), a.id = s, a.nohistory = t, a.startPage = t, hax(u, a)
1302                                }
1303                        } else n[s] = null;
1304                    for (var s in n)
1305                        if (n[s] && e.Html.thread[s]) {
1306                            if (a.id = s, a.url = e.Html.thread[s].getSrartPageUrl(), a.startpage = 1, !1 === e.Html.fireEvent(s, "beforehistorychange", a)) continue;
1307                            l = e.Html.thread[s].go2StartPage;
1308                            e.Effect.use(s, 1, l) || l()
1309                        }
1310                    return r.size = o, r
1311                },
1312                makeAxHash: function(i, n, r, o) {
1313                    o || (o = "ax");
1314                    var a = n.id || n,
1315                        s = t.sprt_url,
1316                        l = s + o + s + a + s,
1317                        u = i.indexOf(l);
1318                    if (u > -1) {
1319                        for (var d = i.substring(u), c = d.indexOf(s, u + l.length); c > -1 && d.substring(c, c + 2) == s + "/";) c = d.indexOf(s, c + 1);
1320                        c > -1 && (d = d.substring(0, c)), i = i.replace(d, l + r)
1321                    } else i = l + r;
1322                    return e.makeAxLevel((i.startWith("#") ? "" : "#") + i, o, a)
1323                },
1324                makeAxLevel: function(e, i, n) {
1325                    var r = n.indexOf(t.lvl);
1326                    if (r > -1)
1327                        for (var o = t.lvl.length, a = t.sprt_url, s = parseInt(n.substring(r + o)), l = a + i + a, u = e.indexOf(l); u > -1;) {
1328                            var d = e.indexOf(a, u + l.length),
1329                                c = e.substring(u + l.length, d),
1330                                p = c.indexOf(t.lvl);
1331                            if (p > -1)
1332                                if (parseInt(c.substring(p + o)) > s) {
1333                                    var g = e.indexOf(a, d + 1);
1334                                    e = e.substring(0, u) + (g > -1 ? e.substring(g) : ""), d = u - 1
1335                                }
1336                            u = e.indexOf(l, d + 1)
1337                        }
1338                    return e
1339                },
1340                attrs: ["id", "src", "url", "method", "form", "params", "callback", "cb", "callbackOps", "cbo", "nohistory", "cut", "rc", "overwrite", "destroy", "html", "anticache", "nocache", "startpage", "async", "historycache", "seal", "user", "pswd", "storage", "etag", "headers", "add", "target", "onload", "loader"],
1341                parseAttr: function(t, i) {
1342                    var n = null,
1343                        r = t.attributes;
1344                    if (!r) return n;
1345                    i || (i = "");
1346                    for (var o = 0, a = (e.browser.msie ? e.attrs : r).length; o < a; o++) {
1347                        var s = e.browser.msie ? r[i + e.attrs[o]] : r[o];
1348                        if (s && s.nodeName.startWith(i)) {
1349                            var l = s.nodeName.substring(i.length),
1350                                u = s.nodeValue;
1351                            u = "1" == u || "true" == u ? 1 : "0" == u || "false" == u ? 0 : u, n || (n = {}), n[l] = u
1352                        }
1353                    }
1354                    return n
1355                },
1356                parseAxHash: function(i, n) {
1357                    n || (n = "ax");
1358                    var r = {},
1359                        o = t.sprt_url;
1360                    if (!i) return r;
1361                    for (var a = (i = e.replaceLinkEqual(i, 1)).indexOf(o + n + o); a > -1;) {
1362                        var s, l = i.indexOf(o, a + n.length + 2);
1363                        l > -1 ? s = i.substring(a + n.length + 2, l) : l = a, a = i.indexOf(o + n + o, l + 1);
1364                        for (var u = i.substring(l + 1), d = u.indexOf(o); d > -1 && u.substring(d, d + 2) == o + "/";) d = u.indexOf(o, d + 1);
1365                        d > -1 && (u = u.substring(0, d)), u && s && (r[s] = u)
1366                    }
1367                    return r
1368                },
1369                getHead: function() {
1370                    return document.getElementsByTagName("head")[0]
1371                },
1372                getHash: function() {
1373                    return e.History.isHTML5Enabled() && history.state && history.state.fullajax ? history.state.fullajax.hash || "" : location.hash2 || location.hash
1374                },
1375                setHash: function(e) {
1376                    var t = location;
1377                    t.hash = e, (t.hash2 || decodeURIComponent(t.hash) != decode
1377URIComponent(e)) && (t.hash2 = e)
1378                },
1379                History: {
1380                    previous: null,
1381                    current: null,
1382                    setCurrent: function(t) {
1383                        e.History.previous = e.History.current, e.History.current = t
1384                    },
1385                    prefixListener: {},
1386                    check: function() {
1387                        var t = e.getHash(),
1388                            i = e.History.current;
1389                        if (e.browser.msie && e.History.frame) {
1390                            var n = e.replaceLinkEqual(t);
1391                            if (n != i && n != "#" + i) e.History.write(document.title, n);
1392                            else {
1393                                var r = e.History.frame,
1394                                    o = (r.contentWindow || r.contentDocument).document.body,
1395                                    a = e.replaceLinkEqual(o.innerText);
1396                                a != i && "#" + a != i && (t = a, e.setHash(t))
1397                            }
1398                        }
1399                        t = e.replaceLinkEqual(t);
1400                        if (null != i && t != i) {
1401                            e.History.setCurrent(t);
1402                            for (var s in e.History.prefixListener) e.History.prefixListener[s]()
1403                        }
1404                    },
1405                    write: function(t, i) {
1406                        var n = e.History.frame,
1407                            r = (n.contentWindow || n.contentDocument).document;
1408                        r.open(), r.write("<head><title>" + (t || "") + "</title></head><body>" + i + "</body>"), r.close()
1409                    },
1410                    add: function(t, i, n, r) {
1411                        var o = e.replaceLinkEqual(e.getHash(), 1);
1412                        o = e.makeAxHash(o, t, i, n);
1413                        var a = e.replaceLinkEqual(o),
1414                            s = e.History.fireEvent("beforeadd", {
1415                                hash: o,
1416                                rhash: a,
1417                                id: t,
1418                                url: i,
1419                                prefix: n
1420                            });
1421                        if (!1 !== s) {
1422                            if ("string" == typeof s && (a = e.replaceLinkEqual(s)), this.isHTML5Enabled()) history.popped ? history.popped = !1 : history.pushState({
1423                                fullajax: {
1424                                    id: t,
1425                                    hash: o
1426                                }
1427                            }, r, i);
1428                            else if (e.setHash(a), e.browser.msie && e.browser.msieV < 8) {
1429                                var l = e.History.frame;
1430                                l || (e.History.frame = l = document.createElement("iframe"), l.style.display = "none", l.src = "javascript:true", document.body.appendChild(l), e.History.write(document.title, e.History.previous || "")), e.History.write(r, a)
1431                            }
1432                            e.History.setCurrent(a)
1433                        }
1434                    },
1435                    isHTML5Enabled: function() {
1436                        return history.pushState && t.USE_HTML5_HISTORY
1437                    }
1438                },
1439                Effect: {
1440                    effects: {},
1441                    add: function(t) {
1442                        t || (t = {}), t.id || (t.id = "document.body");
1443                        var i = e.Effect.effects[t.id];
1444                        i || (i = []), i.push(t), e.Effect.effects[t.id] = i
1445                    },
1446                    get: function(t) {
1447                        t || (t = "document.body");
1448                        for (var i in e.Effect.effects)
1449                            if (i == t || "*" == i) return e.Effect.effects[i]
1450                    },
1451                    use: function(t, i, n) {
1452                        try {
1453                            var r = e.Effect.get(t);
1454                            if (r)
1455                                for (var o = 0, a = r.length; o < a; o++) {
1456                                    var s = o == r.length - 1 ? n : null;
1457                                    r[o] && (i ? r[o].start && r[o].start(t, s) : r[o].end && r[o].end(t, s))
1458                                }
1459                            return !!r
1460                        } catch (e) {
1461                            error(e)
1462                        }
1463                    }
1464                },
1465                Filter: {
1466                    schema: {},
1467                    add: function(e) {
1468                        e || (e = {}), e.id || (e.id = "document.body"), this.remove(e);
1469                        var t = this.schema[e.id];
1470                        return t || (t = []), t.push(e), this.schema[e.id] = t, this
1471                    },
1472                    remove: function(t) {
1473                        t || (t = {}), t.id || (t.id = "document.body");
1474                        var i = this.schema[t.id];
1475                        i && (e.arrayRemoveOf(i, t, 1), this.schema[t.id] = i)
1476                    },
1477                    clear: function(e) {
1478                        this.schema[e || "document.body"] = null
1479                    },
1480                    clearAll: function() {
1481                        for (var e in this.schema) delete this.schema[e]
1482                    },
1483                    getOptions: function(e, t, i) {
1484                        function n(e, t, i) {
1485                            for (var n = 0, r = 0, o = e.length; r < o; r++) {
1486                                var a = e[r];
1487                                a && t && ("*" == a || a instanceof RegExp && a.test(t) || (!i || "contain" == i) && t.indexOf(a) > -1 || "start" == i && t.startWith(a) || "end" == i && t.endWith(a)) && n < a.length && (n = a.toString().length)
1488                            }
1489                            return n
1490                        }
1491
1492                        function r(e, t) {
1493                            if (!t) return null;
1494                            var i = "id";
1495                            0 === t.indexOf(".") && (i = "class", t = t.replace(".", ""));
1496                            for (var n = e.parentNode; n && n !== document.body; n = n.parentNode) {
1497                                var r = n.getAttribute(i);
1498                                if (r && -1 !== r.indexOf(t)) return n
1499                            }
1500                            return null
1501                        }
1502                        var o = null,
1503                            a = 0,
1504                            s = i ? i.getAttribute("name") : null,
1505                            l = i ? i.getAttribute("id") : null;
1506                        for (var u in this.schema) {
1507                            var d = this.schema[u];
1508                            if (d)
1509                                for (var c = 0, p = d.length; c < p; c++) {
1510                                    var g = n(d[c].url instanceof Array ? d[c].url : [d[c].url], e, d[c].urlType),
1511                                        h = n(d[c].query instanceof Array ? d[c].query : [d[c].query], t, d[c].queryType),
1512                                        _ = "and" == (d[c].join || d[c].joinLogic) ? g + h : g > h ? g : h;
1513                                    if (a < _ || i && (d[c].form === s || d[c].form === l || r(i, d[c].parent))) {
1514                                        a = _, o = {};
1515                                        for (var m in d[c]) o[m] = d[c][m];
1516                                        if (o.filterSchemaId = u, i && "FORM" == i.nodeName) {
1517                                            var f = i.getAttribute("method");
1518                                            f && (o.method = f), o.form = i
1519                                        }
1520                                    }
1521                                }
1522                        }
1523                        return o
1524                    },
1525                    parseStartUrl: function(e) {
1526                        return e.substring(0, e.indexOf("/", 1))
1527                    },
1528                    getParentPath: function() {
1529                        var e = location.pathname,
1530                            t = e.lastIndexOf("/");
1531                        return t > -1 ? e.substring(0, t + 1) : ""
1532                    },
1533                    parseAxAttr: function(t) {
1534                        if (!t.iswrapped) {
1535                            var n = e.parseAttr(t, i(""));
1536                            return n && ("FORM" == t.nodeName && (n.method = t.getAttribute("method"), n.form = t), n.scope = t), n
1537                        }
1538                    },
1539                    wrapAnchor: function(t, i) {
1540                        if ("mailto:" != t.protocol && "javascript:" != t.protocol && !t.iswrapped) {
1541                            var n, r;
1542                            if ("FORM" == t.nodeName) {
1543                                if (!(n = t.getAttribute("action"))) {
1544                                    var o = (n = location.href).indexOf("#");
1545                                    n = -1 == o ? n : n.substring(0, o)
1546                                }
1547                                var a = document.createElement("a");
1548                                a.href = n, n = (s = e.parseUri(a.href)).path, r = s.query, delete a
1549                            } else {
1550                                if (!t.href) return;
1551                                var s;
1552                                n = (s = e.parseUri(t.href)).path, r = s.query
1553                            }
1554                            r && r.startWith("?") && (r = r.substring(1)), (e.browser.opera || e.browser.msie) && (n = "/" + n);
1555                            var l = this.getOptions(n, r, t);
1556                            (l || i) && (l || (l = {}), i || (i = {}), e.extend(i, l, 1), "skip" == i.type || "nowrap" == i.type || null != i.wrap && !i.wrap || i.nowrap || !i.target && t.getAttribute("target") || null != i.id && this.wrapOps(t, i))
1557                        }
1558                    },
1559                    wrapSharp: function(t, i, n) {
1560                        if (!t.iswrapped) {
1561                            var r = location.protocol,
1562                                o = location.host,
1563                                a = r + "//" + o + location.pathname + location.search + "#",
1564                                s = "FORM" == t.nodeName ? t.getAttribute("action") : t.href;
1565                            if (s && s.endWith("#")) {
1566                                if (s.startWith(r) || (s = r + "//" + o + s), n) {
1567                                    var l = document.createElement("a");
1568                                    if (l.href = n + "#", n = l.href, delete l, !n.startWith(r)) n = r + "//" + o + (n.startWith("/") ? "" : e.parseUri(location.href).directory) + n
1569                                }
1570                                s != a && s != n || (i || (i = {}), t.sharp = i.sharp = 1, this.wrapOps(t, i))
1571                            }
1572                        }
1573                    },
1574                    wrapOps: function(i, n) {
1575                        if (n) {
1576                            i.options = n, i.iswrapped = 1;
1577                            var r = document.createAttribute("iswrapped");
1578                            r.nodeValue = 1, i.setAttributeNode(r);
1579                            var o = "FORM" == i.nodeName ? "submit" : "click",
1580                                a = "onprev" + o,
1581                                s = "on" + o;
1582                            if (!n.overwrite && !t.OVERWRITE)
1583                                if (e.browser.msie) {
1584                                    if (i[s]) {
1585                                        var l = document.createAttribute(a),
1586                                            u = i.attributes[s] || {};
1587                                        l.nodeValue = u.nodeValue || i[s], i.setAttributeNode(l)
1588                                    }
1589                                } else i[a] = i[s];
1590                            if ("submit" == o)
1591                                for (var d = i.getElementsByTagName("input"), c = 0, p = d.length; c < p; c++) {
1592                                    var g = d[c].type;
1593                                    "image" != g && "submit" != g || FLAX.addEvent(d[c], "click", "image" == g ? function(e) {
1594                                        e || (e = window.event);
1595                                        var t = e.target || e.srcElement,
1596                                            n = null != e.offsetX ? e.offsetX : e.pageX - t.offsetLeft + 1,
1597                                            r = null != e.offsetY ? e.offsetY : e.pageY - t.offsetTop + 1,
1598                                            o = "",
1599                                            a = t.getAttribute("name"),
1600                                            s = t.getAttribute("value"),
1601                                            l = a || "";
1602                                        l && (l += "."), s && null != a && (o += a + "=" + s + "&"), o = "&" + o + l + "x=" + n + "&" + l + "y=" + r, i.submitValue = o
1603                                    } : function(e) {
1604                                        e || (e = window.event);
1605                                        var t = e.target || e.srcElement,
1606                                            n = t.getAttribute("name"),
1607                                            r = t.getAttribute("value"),
1608                                            o = "";
1609                                        null != n && (o += "&" + n + "=" + r), i.submitValue = o
1610                                    })
1611                                }
1612                            i[s] = function(t) {
1613                                if (!(t = t || window.event || {}).ctrlKey && !t.shiftKey) {
1614                                    try {
1615                                        var i = null;
1616                                        if (e.browser.msie) {
1617                                            if (this.attributes[a]) {
1618                                                var n = this.attributes[a].nodeValue;
1619                                                n && ("string" == typeof n && (n.trim().startWith("function") || (n = "function(e){" + n + "}"), n = window.eval("FLAX.tmp=" + n)), i = n.call(this, t))
1620                                            }
1621                                        } else this[a] && "function" == typeof this[a] && (i = this[a](t));
1622                                        if (!1 === i) return !1
1623                                    } catch (e) {
1624                                        error(e)
1625                                    }
1626                                    var r = this.options;
1627                                    if ("FORM" == this.nodeName && "multipart/form-data" == this.enctype) return r.multipart && r.multipart(this), !0;
1628                                    if (!r.sharp) try {
1629                                        if (r.handler) r.handler(this, r);
1630                                        else {
1631                                            var o = this.getAttribute("action") || this.href;
1632                                            if (o || (o = location.href), o = e.browser.msie ? encodeURI(o) : o, "FORM" == this.nodeName && (!r.method || "post" != r.method.toLowerCase())) {
1633                                                var s = e.parseUri(o);
1634                                                o = o.replace("?" + s.query, "").replace("#" + s.anchor, "")
1635                                            }
1636                                            o = e.delHost(o);
1637                                            var l = r.changer || r.urlChanger,
1638                                                u = (o = l ? l(o, this) : o).indexOf("#");
1639                                            u > -1 && (o = o.substring(0, u)), window["data" == r.type ? "dax" : "hax"](o, r)
1640                                        }
1641                                    } catch (e) {
1642                                        error(e)
1643                                    }
1644                                    return !1
1645                                }
1646                            }, "submit" == o && (i.submit = i.onsubmit)
1647                        }
1648                    },
1649                    wrap: function(t, r) {
1650                        if (!t) {
1651                            t = document;
1652                            for (var o in this.schema) this.wrap(o, r)
1653                        }
1654                        var a, s = t.nodeName;
1655                        if ("A" == s || "FORM" == s || "AREA" == s) a = [t];
1656                        else {
1657                            if (!(t = e.get(t))) return;
1658                            n(t) && (t = document);
1659                            var l = e.collectionToArray,
1660                                u = "getElementsByTagName";
1661                            a = l(t[u]("a")).concat(l(t[u]("form")), l(t[u]("area")))
1662                        }
1663                        for (var d = 0, c = a.length; d < c; d++) {
1664                            var p = a[d],
1665                                g = p.attributes[i("wrap")],
1666                                h = null == g || "false" != g.nodeValue && "0" != g.nodeValue && 0 != g.nodeValue;
1667                            if (p.getAttribute("iswrapped") && p.setAttribute("iswrapped", !!p.getAttribute("onclick") || !!p.getAttribute("onsubmit")), !e.isXss(p.getAttribute("href") || p.getAttribute("action")) && !p.getAttribute("iswrapped") && h) {
1668                                var _ = this.parseAxAttr(p);
1669                                if (!1 === this.fireEvent("beforewrap", {
1670                                        el: p,
1671                                        ops: _,
1672                                        layer: t,
1673                                        url: r
1674                                    })) continue;
1675                                this.wrapSharp(p, _, r), this.wrapAnchor(p, _)
1676                            }
1677                            p = null
1678                        }
1679                        return a = null, this
1680                    }
1681                },
1682                Include: {
1683                    parse: function(t) {
1684                        for (var i = (t = t ? e.get(t) : document).getElementsByTagName("include"); i.length > 0;) e.Include.apply(i[0])
1685                    },
1686                    apply: function(t) {
1687                        t = e.get(t);
1688                        var r = e.parseAttr(t),
1689                            o = e.parseAttr(t, i(""));
1690                        if (e.extend(r, o), r && (r.url || r.src)) {
1691                            var a = document.createElement("a");
1692                            r.url || (r.url = r.src), a.href = r.url, o = e.Filter.getOptions(a.pathname, a.search), delete a, o && e.extend(r, o, 1);
1693                            var s = document.createElement("span");
1694                            s.style.display = "none", s.id = r.id = t.id ? t.id : e.genId(), n(s, 1), t.parentNode.replaceChild(s, t), null == r.nohistory && (r.nohistory = 1), hax(r)
1695                        }
1696                    },
1697                    fix: function(t) {
1698                        return e.browser.msie && /<include/i.test(t) ? t = '<div style="display:none">&nbsp;</div>' + t : e.browser.mozilla && (t = t.replaceAll("<INCLUDE", "<include")), t
1699                    }
1700                },
1701                Uploader: function(t, i, n, r, o) {
1702                    "object" == typeof t && "FORM" != t.nodeName && (i = t.beforeStart, n = t.afterFinish, r = t.manual, o = t.html, t = from.form);
1703                    var a, s = null,
1704                        l = this;
1705                    this.init = function() {
1706                        t = e.get(t);
1707                        var u = e.genId();
1708                        if (t.setAttribute("target", u), (a = document.createElement("div")).innerHTML = '<iframe style="display:none" src="javascript:true" onload="this._onload()" id="' + u + '" name="' + u + '"></iframe>', this.iframe = s = a.firstChild, this.setAfterFinish = setAfterFinish = function(t) {
1709                                s._onload = function() {
1710                                    var i = (this.contentWindow || this.contentDocument).document.body[o ? "innerHTML" : e.browser.msie ? "innerText" : "textContent"];
1711                                    t(i, l)
1712                                }
1713                            }, n) {
1714                            var d = function() {
1715                                setAfterFinish(n), r && t.submit()
1716                            };
1717                            r ? s._onload = d : d()
1718                        } else s._onload = function() {};
1719                        t.appendChild(a), t.setAttribute("target", u), i && i(l)
1720                    }, this.init(), this.getIframe = function() {
1721                        return s
1722                    }, this.cancel = function() {
1723                        t.reset(), l.destroy()
1724                    }, this.destroy = function() {
1725                        s.src = "javascript:true", FLAX.remove(a), a = null
1726                    }
1727                },
1728                addEventsListener: function(t) {
1729                    return t.prototype && (t = t.prototype), t.on = function(e, t, i) {
1730                        e instanceof Array || (e = [e]);
1731                        for (var n = 0, r = e.length; n < r; n++) {
1732                            var o = e[n];
1733                            i || this.un(o, t), this.events || (this.events = {}), this.events[o] || (this.events[o] = []), this.events[o].push(t)
1734                        }
1735                    }, t.un = function(t, i, n) {
1736                        t instanceof Array || (t = [t]);
1737                        for (var r = 0, o = t.length; r < o; r++) {
1738                            var a = t[r];
1739                            if (!i) return this.unall(a);
1740                            var s = this.events ? this.events[a] : null;
1741                            s && (e.arrayRemoveOf(s, i, !n), this.events[a] = s
1741)
1742                        }
1743                    }, t.unall = function(e) {
1744                        this.events && (e ? delete this.events[e] : delete this.events)
1745                    }, t.fireEvent = function(e, t) {
1746                        var i = this.events ? this.events[e] : null;
1747                        if (i) {
1748                            var n = null,
1749                                r = [].slice.call(arguments);
1750                            r.shift(), r.push(e);
1751                            for (var o = 0; o < i.length; o++) try {
1752                                var a = i[o].apply(this, r);
1753                                !1 !== n && null != a && (n = a)
1754                            } catch (e) {
1755                                error(e)
1756                            }
1757                            return n
1758                        }
1759                    }, t
1760                },
1761                addContainerListener: function(t) {
1762                    t.prototype && (t = t.prototype);
1763                    var i = {},
1764                        n = {};
1765                    return t.register = function(e) {
1766                        if (a = i[e.id])
1767                            for (var t in a)
1768                                for (var r = 0, o = a[t].length; r < o; r++) e.on(t, a[t][r]);
1769                        for (var t in n) {
1770                            var a;
1771                            for (r = 0, o = (a = n[t]).length; r < o; r++) e.on(t, a[r])
1772                        }
1773                    }, t.on = function(e, t, n, r) {
1774                        e instanceof Array || (e = [e]);
1775                        for (var o = 0, a = e.length; o < a; o++) {
1776                            var s = e[o];
1777                            i[s] || (i[s] = {}), i[s][t] || (i[s][t] = []), i[s][t].push(n), this.thread[s] && this.thread[s].on(t, n, r)
1778                        }
1779                    }, t.onall = function(e, t, i) {
1780                        n[e] || (n[e] = []), n[e].push(t);
1781                        var r = this.thread;
1782                        for (var o in r) r[o] && r[o].on(e, t, i)
1783                    }, t.unall = function(t, i, r) {
1784                        if (t)
1785                            if (i) {
1786                                var o = n[t];
1787                                e.arrayRemoveOf(o, i, !r), n[t] = o
1788                            } else n[t] = [];
1789                        else n = {};
1790                        var a = this.thread;
1791                        for (var s in a) a[s] && a[s].un(t, i, r)
1792                    }, t.un = function(t, n, r, o) {
1793                        t instanceof Array || (t = [t]);
1794                        for (var a = 0, s = t.length; a < s; a++) {
1795                            var l = t[a];
1796                            if (r) {
1797                                var u = i[l] ? i[l][n] : null;
1798                                u && (e.arrayRemoveOf(u, r, !o), i[l][n] = u), this.thread[l] && this.thread[l].un(n, r, o)
1799                            } else {
1800                                l ? i[l] && (n ? delete i[l][n] : delete i[l]) : i = {};
1801                                var d = {};
1802                                l ? d[l] = this.thread[l] : d = this.thread;
1803                                for (var c in d) d[c] && d[c].unall(n)
1804                            }
1805                        }
1806                    }, t.fireEvent = function(e, t, i) {
1807                        if (this.thread[e]) return this.thread[e].fireEvent(t, i)
1808                    }, t
1809                },
1810                Html: {
1811                    thread: {},
1812                    ASYNCHRONOUS: 1,
1813                    storage: []
1814                },
1815                Data: {
1816                    thread: {}
1817                },
1818                playsound: function(e, t) {
1819                    var i = document.createElement("div");
1820                    if (null == t && (t = 10), i.setAttribute("style", "position:absolute;top:-1000px;left:-1000px"), window.ActiveXObject) {
1821                        var n = document.createElement("bgsound");
1822                        n.src = e, i.appendChild(n)
1823                    } else i.innerHTML = '<embed src="' + e + '" loop="false" autostart="true" hidden="true" mastersound>';
1824                    document.body.appendChild(i), t > 0 && setTimeout(function() {
1825                        i.firstChild.src = "", document.body.removeChild(i)
1826                    }, 1e3 * t)
1827                },
1828                enableUBR: function() {
1829                    netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead")
1830                },
1831                Loader: {
1832                    show: function() {
1833                        e.showLoading(1, e.getLoader())
1834                    },
1835                    hide: function() {
1836                        e.showLoading(0, e.getLoader())
1837                    }
1838                },
1839                parseUri: function(e, t) {
1840                    for (var i = t || {
1841                            strictMode: 0,
1842                            key: ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"],
1843                            q: {
1844                                name: "queryKey",
1845                                parser: /(?:^|&)([^&=]*)=?([^&]*)/g
1846                            },
1847                            parser: {
1848                                strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
1849                                loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
1850                            }
1851                        }, n = i.parser[i.strictMode ? "strict" : "loose"].exec(e), r = 0, o = {}; r < 14; r++) o[i.key[r]] = n[r] || "";
1852                    return o[i.q.name] = {}, o[i.key[12]].replace(i.q.parser, function(e, t, n) {
1853                        t && (o[i.q.name][t] = n)
1854                    }), o
1855                },
1856                showMessage: function(e, t, i) {
1857                    0 != t && alert("Error " + t + " : " + e + "\n" + i)
1858                },
1859                replaceHtml: function(e, t) {
1860                    var i = "string" == typeof e ? document.getElementById(e) : e,
1861                        n = i.cloneNode(!1);
1862                    return n.innerHTML = t, i.parentNode.replaceChild(n, i), n
1863                },
1864                addTo: function(t, i) {
1865                    var r = i ? e.get(i) : document.body;
1866                    if (t = t.join ? t.join("") : t, !r) return warn("Warning => addTo : element = " + i + " not found, html = " + t.trim().substring(0, 20) + "...");
1867                    var o = document.createElement("div");
1868                    o.innerHTML = t;
1869                    for (var a = n(r); o.childNodes.length > 0;) a ? r.parentNode.insertBefore(o.childNodes[0], r) : r.appendChild(o.childNodes[0]);
1870                    return r
1871                },
1872                writeTo: function(t, i) {
1873                    var r = i ? e.get(i) : document.body;
1874                    return t = t.join ? t.join("") : t, r ? (n(r) ? e.addTo(t, r) : r.innerHTML = t, r) : warn("Warning => writeTo : element = " + i + " not found, html = " + t.trim().substring(0, 20) + "...")
1875                },
1876                remove: function(t) {
1877                    for (var i = 0, n = (t = t instanceof Array ? t : [t]).length; i < n; i++) {
1878                        var r = e.get(t[i]);
1879                        r && r.parentNode.removeChild(r)
1880                    }
1881                },
1882                replace: function(t, i) {
1883                    return t = e.get(t), (i = e.get(i)).parentNode.replaceChild(t, i)
1884                },
1885                genId: function() {
1886                    return i("genid" + t.sprt) + (e.lastGenId ? ++e.lastGenId : e.lastGenId = 1)
1887                }
1888            });
1889            var t = e.Default,
1890                i = function(e) {
1891                    return t.prefix + t.sprt + e
1892                },
1893                n = e.placeMark = function(e, n) {
1894                    var r = i("place" + t.sprt + "mark");
1895                    return e && null != n && (e[r] = n), e ? null == n ? e[r] : e : r
1896                },
1897                r = function(e) {
1898                    return '<span id="' + e + '" style="display:none">\x3c!--place of script # ' + e + "//--\x3e</span>"
1899                };
1900            e.addEventsListener(e.Filter)
1901        }(FLAX), FLAX.init()
1902}
1903
1904function debugLine(e, t, i) {
1905    !0 === e && (e = "true"), !1 === e && (e = "false");
1906    var n = e;
1907    if ("object" == typeof e) {
1908        n = "";
1909        for (name in e) {
1910            var r = e[name];
1911            n += " " + name + ": " + r
1912        }
1913    }
1914    if (1 != t || i || (n += " " + Math.random()), 1 == i) {
1915        var o = jQuery("#debug_line");
1916        o.width(200), o.height() >= 500 && o.html(""), n = o.html() + "<br> -------------- <br>" + n
1917    }
1918    jQuery("#debug_line").show().html(n)
1919}
1920
1921function debugSide(e) {
1922    var t = "";
1923    for (name in e) {
1924        var i = e[name];
1925        t += name + " : " + i + "<br>"
1926    }
1927    jQuery("#debug_side").show().html(t)
1928}
1929
1930function trace(e) {
1931    "undefined" != typeof console && console.log(e)
1932}
1933
1934function UGFunctions() {
1935    function e(e, t, i) {
1936        t.addEventListener ? t.addEventListener(e, i, !1) : t.attachEvent ? t.attachEvent("on" + e, i) : t[e] = i
1937    }
1938    var t = null,
1939        i = this,
1940        n = {
1941            starTime: 0,
1942            arrThemes: [],
1943            isTouchDevice: -1,
1944            isRgbaSupported: -1,
1945            timeCache: {},
1946            dataCache: {},
1947            lastEventType: "",
1948            lastEventTime: 0,
1949            handle: null
1950        };
1951    this.debugVar = "", this.z__________FULL_SCREEN___________ = function() {}, this.normalizePercent = function(e) {
1952        return 0 > e && (e = 0), e > 1 && (e = 1), e
1953    }, this.toFullscreen = function(e) {
1954        if (e.requestFullscreen) e.requestFullscreen();
1955        else if (e.mozRequestFullScreen) e.mozRequestFullScreen();
1956        else {
1957            if (!e.webkitRequestFullscreen) return !1;
1958            e.webkitRequestFullscreen()
1959        }
1960        return !0
1961    }, this.exitFullscreen = function() {
1962        if (0 == i.isFullScreen()) return !1;
1963        if (document.exitFullscreen) document.exitFullscreen();
1964        else if (document.mozCancelFullScreen) document.mozCancelFullScreen();
1965        else {
1966            if (!document.webkitExitFullscreen) return !1;
1967            document.webkitExitFullscreen()
1968        }
1969        return !0
1970    }, this.addFullScreenChangeEvent = function(t) {
1971        e("fullscreenchange", document, t), e("mozfullscreenchange", document, t), e("webkitfullscreenchange", document, t), e("msfullscreenchange", document, t)
1972    }, this.destroyFullScreenChangeEvent = function() {
1973        jQuery(document).unbind("fullscreenchange"), jQuery(document).unbind("mozfullscreenchange"), jQuery(document).unbind("webkitfullscreenchange"), jQuery(document).unbind("msfullscreenchange")
1974    }, this.getFullScreenElement = function() {
1975        return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement
1976    }, this.isFullScreen = function() {
1977        var e = document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement;
1978        return e || (e = !1), e
1979    }, this.z__________END_FULL_SCREEN___________ = function() {}, this.z__________GET_PROPS___________ = function() {}, this.getBrowserPrefix = function() {
1980        if (null !== t) return t;
1981        var e = ["webkit", "Moz", "ms", "O"],
1982            i = document.createElement("div");
1983        for (var n in e) {
1984            var r = e[n];
1985            if (r + "Transform" in i.style) return r = r.toLowerCase(), t = r, r
1986        }
1987        return t = "", ""
1988    }, this.getImageInsideParentDataByImage = function(e, t, n) {
1989        var r = e.parent(),
1990            o = i.getImageOriginalSize(e);
1991        return i.getImageInsideParentData(r, o.width, o.height, t, n)
1992    }, this.getImageInsideParentData = function(e, t, i, n, r, o, a) {
1993        if (!r) r = {};
1994        var s = {};
1995        if (void 0 === o) o = e.width();
1996        if (void 0 === a) a = e.height();
1997        r.padding_left && (o -= r.padding_left), r.padding_right && (o -= r.padding_right), r.padding_top && (a -= r.padding_top), r.padding_bottom && (a -= r.padding_bottom);
1998        var l = null,
1999            u = "100%",
2000            d = null,
2001            c = null,
2002            p = "display:block;margin:0px auto;";
2003        if (t > 0 && i > 0) {
2004            if ("down" == n && o > t && a > i) u = i, l = t, c = (o - l) / 2, d = (a - u) / 2;
2005            else if ("fill" == n) {
2006                o > (l = (u = a) * (g = t / i)) ? (u = (l = o) / g, c = 0, d = Math.round((u - a) / 2 * -1)) : (d = 0, c = Math.round((l - o) / 2 * -1))
2007            } else {
2008                var g;
2009                d = 0, c = (o - (l = (u = a) * (g = t / i))) / 2, "fitvert" != n && l > o && (c = 0, d = (a - (u = (l = o) / g)) / 2)
2010            }
2011            l = Math.floor(l), u = Math.floor(u), d = Math.floor(d), c = Math.floor(c), p = "position:absolute;"
2012        }
2013        return r.padding_top && (d += r.padding_top), r.padding_left && (c += r.padding_left), s.imageWidth = l, s.imageHeight = u, s.imageTop = d, s.imageLeft = c, s.imageRight = c + l, s.imageBottom = 0 == d || "100%" == u ? null : d + u, s.style = p, s
2014    }, this.getElementCenterPosition = function(e, t) {
2015        var n = e.parent(),
2016            r = i.getElementSize(e),
2017            o = i.getElementSize(n),
2018            a = o.width,
2019            s = o.height;
2020        t && void 0 !== t.padding_top && (s -= t.padding_top), t && void 0 !== t.padding_bottom && (s -= t.padding_bottom), t && void 0 !== t.padding_left && (a -= t.padding_left), t && void 0 !== t.padding_right && (a -= t.padding_right);
2021        var l = {};
2022        return l.left = Math.round((a - r.width) / 2), l.top = Math.round((s - r.height) / 2), t && void 0 !== t.padding_top && (l.top += t.padding_top), t && void 0 !== t.padding_left && (l.left += t.padding_left), l
2023    }, this.getElementCenterPoint = function(e, t) {
2024        if (!t) t = !1;
2025        var n = i.getElementSize(e),
2026            r = {};
2027        return r.x = n.width / 2, r.y = n.height / 2, 1 == t && (r.x += n.left, r.y += n.top), r.x = Math.round(r.x), r.y = Math.round(r.y), r
2028    }, this.getMousePosition = function(e, t) {
2029        var i = {
2030            pageX: e.pageX,
2031            pageY: e.pageY,
2032            clientX: e.clientX,
2033            clientY: e.clientY
2034        };
2035        if (e.originalEvent && e.originalEvent.touches && e.originalEvent.touches.length > 0 && (i.pageX = e.originalEvent.touches[0].pageX, i.pageY = e.originalEvent.touches[0].pageY, i.clientX = e.originalEvent.touches[0].clientX, i.clientY = e.originalEvent.touches[0].clientY), t) {
2036            var n = t.offset();
2037            i.mouseX = i.pageX - n.left, i.mouseY = i.pageY - n.top
2038        }
2039        return i
2040    }, this.getMouseElementPoint = function(e, t) {
2041        var n = {
2042            x: e.pageX,
2043            y: e.pageY
2044        };
2045        return i.getElementLocalPoint(n, t)
2046    }, this.getElementLocalPoint = function(e, t) {
2047        var i = {},
2048            n = t.offset();
2049        return i.x = Math.round(e.x - n.left), i.y = Math.round(e.y - n.top), i
2050    }, this.getImageOriginalSize = function(e, t, i) {
2051        if (void 0 !== t && void 0 !== i) return {
2052            width: t,
2053            height: i
2054        };
2055        var n = e[0],
2056            r = {};
2057        if (void 0 === n.naturalWidth) {
2058            if ("number" == typeof e.data("naturalWidth")) return (r = {}).width = e.data("naturalWidth"), r.height = e.data("naturalHeight"), r;
2059            var o = new Image;
2060            return o.src = n.src, o.complete ? (r.width = o.width, r.height = o.height, e.data("naturalWidth", r.width), e.data("naturalHeight", r.height), r) : {
2061                width: 0,
2062                height: 0
2063            }
2064        }
2065        return r.width = n.naturalWidth, r.height = n.naturalHeight, r
2066    }, this.getimageRatio = function(e) {
2067        var t = i.getImageOriginalSize(e);
2068        return i.getElementSize(e).width / t.width
2069    }, this.isImageFitParent = function(e) {
2070        var t = e.parent(),
2071            n = i.getElementSize(e),
2072            r = i.getElementSize(t);
2073        return n.width <= r.width && n.height <= r.height
2074    }, this.getElementSize = function(e) {
2075        if (void 0 === e) throw new Error("Can't get size, empty element");
2076        var t = e.position();
2077        return t.height = e.outerHeight(), t.width = e.outerWidth(), t.left = Math.round(t.left), t.top = Math.round(t.top), t.right = t.left + t.width, t.bottom = t.top + t.height, t
2078    }, this.isElementBiggerThenParent = function(e) {
2079        var t = e.parent(),
2080            n = i.getElementSize(e),
2081            r = i.getElementSize(t);
2082        return n.width > r.width || n.height > r.height
2083    }, this.isPointInsideElement = function(e, t) {
2084        return 0 != (e.x >= 0 && e.x < t.width) && 0 != (e.y >= 0 && e.y < t.height)
2085    }, this.getElementRelativePos = function(e, t, n, r) {
2086        if (!r) r = e.parent();
2087        var o = i.getElementSize(e),
2088            a = i.getElementSize(r);
2089        switch (t) {
2090            case "top":
2091            case "left":
2092                t = 0, n && (t += n);
2093                break;
2094            case "center":
2095                t = Math.round((a.width - o.width) / 2), n && (t += n);
2096                break;
2097            case "right":
2098                t = a.width - o.width, n && (t -= n);
2099                break;
2100            case "middle":
2101                t = Math.round((a.height - o.height) / 2), n && (t += n);
2102                break;
2103            case "bottom":
2104                t = a.height - o.height, n && (t -= n)
2105        }
2106        return t
2107    }, this.z__________END_GET_PROPS___________ = function() {}, this.z_________SET_ELEMENT_PROPS_______ = function() {}, this.zoomImageInsideParent = function(e, t, n, r, o, a, s) {
2108        if (!n) n = 1.2;
2109        if (!o) o = "fit";
2110        var l, u, d, c, p = n,
2111            g = e.parent(),
2112            h = i.getElementSize(e),
2113            _ = i.getImageOriginalSize(e),
2114            m = !1,
2115            f = 0,
2116            v = 0,
2117            b = 0,
2118            y = 0;
2119        if (r) {
2120            var w = i.getMouseElementPoint(r, e);
2121            m = i.isPointInsideElement(w, h), b = w.x, y = w.y
2122        } else m = !1;
2123        if (0 == m) {
2124            var x = i.getElementCenterPoint(e);
2125            b = x.x, y = x.y
2126        }
2127        if (1 == t) l = h.height * p, u = h.width * p, 0 != b && (f = -(b * p - b)), 0 != y && (v = -(y * p - y));
2128        else {
2129            if (l = h.height / p, (u = h.width / p) < i.getImageInsideParentData(g, _.width, _.height, o, s).imageWidth) return i.scaleImageFitParent(e, _.width, _.height, o, s), !0;
2130            1 == m && (0 != b && (f = -(b / p - b)), 0 != y && (v = -(y / p - y)))
2131        }
2132        if (a) {
2133            var E = 1;
2134            if (0 != _.width && (E = u / _.width), E > a) return !1
2135        }
2136        if (i.setElementSize(e, u, l), 0 == t && 0 == m) {
2137            var I = i.getElementCenterPosition(e);
2138            d = I.left, c = I.top
2139        }
2139 else d = h.left + f, c = h.top + v;
2140        return i.placeElement(e, d, c), !0
2141    }, this.placeElement = function(e, t, n, r, o, a) {
2142        if (0 == jQuery.isNumeric(t) || 0 == jQuery.isNumeric(n)) {
2143            if (!a) a = e.parent();
2144            var s = i.getElementSize(e),
2145                l = i.getElementSize(a)
2146        }
2147        if (0 == jQuery.isNumeric(t)) switch (t) {
2148            case "left":
2149                t = 0, r && (t += r);
2150                break;
2151            case "center":
2152                t = Math.round((l.width - s.width) / 2), r && (t += r);
2153                break;
2154            case "right":
2155                t = l.width - s.width, r && (t -= r)
2156        }
2157        if (0 == jQuery.isNumeric(n)) switch (n) {
2158            case "top":
2159                n = 0, o && (n += o);
2160                break;
2161            case "middle":
2162            case "center":
2163                n = Math.round((l.height - s.height) / 2), o && (n += o);
2164                break;
2165            case "bottom":
2166                n = l.height - s.height, o && (n -= o)
2167        }
2168        var u = {
2169            position: "absolute",
2170            margin: "0px"
2171        };
2172        null !== t && (u.left = t), null !== n && (u.top = n), e.css(u)
2173    }, this.placeElementInParentCenter = function(e) {
2174        i.placeElement(e, "center", "middle")
2175    }, this.setElementSizeAndPosition = function(e, t, i, n, r) {
2176        var o = {
2177            width: n + "px",
2178            height: r + "px",
2179            left: t + "px",
2180            top: i + "px",
2181            position: "absolute",
2182            margin: "0px"
2183        };
2184        e.css(o)
2185    }, this.setElementSize = function(e, t, i) {
2186        var n = {
2187            width: t + "px",
2188            height: i + "px"
2189        };
2190        e.css(n)
2191    }, this.cloneElementSizeAndPos = function(e, t, n, r, o) {
2192        var a = e.position();
2193        if (void 0 == a) throw new Error("Can't get size, empty element");
2194        !0 === n ? (a.height = e.outerHeight(), a.width = e.outerWidth()) : (a.height = e.height(), a.width = e.width()), a.left = Math.round(a.left), a.top = Math.round(a.top), r && (a.left += r), o && (a.top += o), i.setElementSizeAndPosition(t, a.left, a.top, a.width, a.height)
2195    }, this.placeImageInsideParent = function(e, t, n, r, o, a) {
2196        var s = i.getImageInsideParentData(t, n, r, o, a),
2197            l = "<img";
2198        return null !== s.imageWidth && (l += " width = '" + s.imageWidth + "'", s.style += "width:" + s.imageWidth + ";"), null != s.imageHeight && ("100%" == s.imageHeight ? (l += " height = '" + s.imageHeight + "'", s.style += "height:" + s.imageHeight + ";") : (l += " height = '" + s.imageHeight + "'", s.style += "height:" + s.imageHeight + "px;")), null !== s.imageTop && (s.style += "top:" + s.imageTop + "px;"), null !== s.imageLeft && (s.style += "left:" + s.imageLeft + "px;"), l += " style='" + s.style + "'", l += " src='" + e + "'", l += ">", t.html(l), t.children("img")
2199    }, this.scaleImageCoverParent = function(e, t, n) {
2200        if ("number" == typeof t) var r = t,
2201            o = n;
2202        else r = t.outerWidth(), o = t.outerHeight();
2203        var a = i.getImageOriginalSize(e),
2204            s = a.width / a.height,
2205            l = o,
2206            u = l * s,
2207            d = 0,
2208            c = 0;
2209        r > u ? (l = (u = r) / s, c = 0, d = Math.round((l - o) / 2 * -1)) : (d = 0, c = Math.round((u - r) / 2 * -1)), u = Math.round(u), l = Math.round(l), e.css({
2210            width: u + "px",
2211            height: l + "px",
2212            left: c + "px",
2213            top: d + "px"
2214        })
2215    }, this.scaleImageFitParent = function(e, t, n, r, o) {
2216        var a = e.parent(),
2217            s = i.getImageInsideParentData(a, t, n, r, o),
2218            l = !1,
2219            u = {};
2220        null !== s.imageWidth && (e.removeAttr("width"), u.width = s.imageWidth + "px"), null != s.imageHeight && (e.removeAttr("height"), u.height = s.imageHeight + "px"), null !== s.imageTop && (l = !0, u.top = s.imageTop + "px"), null !== s.imageLeft && (l = !0, u.left = s.imageLeft + "px"), 1 == l && (u.position = "absolute", u.margin = "0px 0px", e.css(u))
2221    }, this.scaleImageByHeight = function(e, t, n, r) {
2222        var o = i.getImageOriginalSize(e, n, r),
2223            a = o.width / o.height,
2224            s = Math.round(t * a);
2225        t = Math.round(t), i.setElementSize(e, s, t)
2226    }, this.scaleImageByWidth = function(e, t, n, r) {
2227        var o = i.getImageOriginalSize(e, n, r),
2228            a = o.width / o.height,
2229            s = Math.round(t / a);
2230        t = Math.round(t), i.setElementSize(e, t, s)
2231    }, this.scaleImageExactSizeInParent = function(e, t, n, r, o, a) {
2232        var s = e.parent(),
2233            l = i.getElementSize(s);
2234        l.width < r && (r = l.width), l.height < o && (o = l.height);
2235        var u, d = i.getImageInsideParentData(null, t, n, a, null, r, o),
2236            c = r,
2237            p = o,
2238            g = d.imageLeft,
2239            h = d.imageLeft,
2240            _ = d.imageTop,
2241            m = d.imageTop,
2242            f = Math.round((l.width - r) / 2),
2243            v = Math.round((l.height - o) / 2);
2244        0 != (u = r - (d.imageWidth + g + h)) && (h += u), 0 != (u = o - (d.imageHeight + _ + m)) && (m += u), e.removeAttr("width"), e.removeAttr("height");
2245        var b = {
2246            position: "absolute",
2247            margin: "0px 0px"
2248        };
2249        b.width = c + "px", b.height = p + "px", b.left = f + "px", b.top = v + "px", b["padding-left"] = g + "px", b["padding-top"] = _ + "px", b["padding-right"] = h + "px", b["padding-bottom"] = m + "px", e.css(b)
2250    }, this.showElement = function(e, t, i) {
2251        e.show().fadeTo(0, 1), t && t.show().fadeTo(0, 1), i && i.show().fadeTo(0, 1)
2252    }, this.z_________END_SET_ELEMENT_PROPS_______ = function() {}, this.z_________GALLERY_RELATED_FUNCTIONS_______ = function() {}, this.disableButton = function(e, t) {
2253        if (!t) t = "ug-button-disabled";
2254        0 == i.isButtonDisabled(e, t) && e.addClass(t)
2255    }, this.convertCustomPrefixOptions = function(e, t, i) {
2256        if (!t) return e;
2257        var n = {};
2258        return jQuery.each(e, function(e, r) {
2259            if (0 === e.indexOf(t + "_" + i + "_")) {
2260                var o = e.replace(t + "_" + i + "_", i + "_");
2261                n[o] = r
2262            } else n[e] = r
2263        }), n
2264    }, this.enableButton = function(e, t) {
2265        if (!t) t = "ug-button-disabled";
2266        1 == i.isButtonDisabled(e, t) && e.removeClass(t)
2267    }, this.isButtonDisabled = function(e, t) {
2268        if (!t) t = "ug-button-disabled";
2269        return !!e.hasClass(t)
2270    }, this.z_________END_GALLERY_RELATED_FUNCTIONS_______ = function() {}, this.z_________MATH_FUNCTIONS_______ = function() {}, this.normalizeSetting = function(e, t, i, n, r, o) {
2271        if (!o) o = !1;
2272        return r = e + (t - e) * ((r - i) / (n - i)), 1 == o && (e > r && (r = e), r > t && (r = t)), r
2273    }, this.getNormalizedValue = function(e, t, i, n, r) {
2274        return e + (n - i) * ((r - e) / (t - e))
2275    }, this.getDistance = function(e, t, i, n) {
2276        return Math.round(Math.sqrt(Math.abs((i - e) * (i - e) + (n - t) * (n - t))))
2277    }, this.getMiddlePoint = function(e, t, i, n) {
2278        var r = {};
2279        return r.x = e + Math.round((i - e) / 2), r.y = t + Math.round((n - t) / 2), r
2280    }, this.getNumItemsInSpace = function(e, t, i) {
2281        return Math.floor((e + i) / (t + i))
2282    }, this.getNumItemsInSpaceRound = function(e, t, i) {
2283        return Math.round((e + i) / (t + i))
2284    }, this.getSpaceByNumItems = function(e, t, i) {
2285        return e * t + (e - 1) * i
2286    }, this.getColX = function(e, t, i) {
2287        return e * (t + i)
2288    }, this.getColByIndex = function(e, t) {
2289        return t % e
2290    }, this.getColRowByIndex = function(e, t) {
2291        var i = Math.floor(e / t);
2292        return {
2293            col: Math.floor(e % t),
2294            row: i
2295        }
2296    }, this.getIndexByRowCol = function(e, t, i) {
2297        return 0 > e ? -1 : 0 > t ? -1 : e * i + t
2298    }, this.getPrevRowSameColIndex = function(e, t) {
2299        var n = i.getColRowByIndex(e, t);
2300        return i.getIndexByRowCol(n.row - 1, n.col, t)
2301    }, this.getNextRowSameColIndex = function(e, t) {
2302        var n = i.getColRowByIndex(e, t);
2303        return i.getIndexByRowCol(n.row + 1, n.col, t)
2304    }, this.z_________DATA_FUNCTIONS_______ = function() {}, this.setGlobalData = function(e, t) {
2305        jQuery.data(document.body, e, t)
2306    }, this.getGlobalData = function(e) {
2307        return jQuery.data(document.body, e)
2308    }, this.z_________EVENT_DATA_FUNCTIONS_______ = function() {}, this.handleScrollTop = function(e) {
2309        if (0 == i.isTouchDevice()) return null;
2310        var t = i.getStoredEventData(e);
2311        if (null === t.scrollDir && (Math.abs(t.diffMouseX) > 15 ? t.scrollDir = "hor" : Math.abs(t.diffMouseY) > 15 && Math.abs(t.diffMouseY) > Math.abs(t.diffMouseX) && (t.scrollDir = "vert", t.scrollStartY = t.lastMouseClientY, t.scrollOrigin = jQuery(document).scrollTop(), n.dataCache[e].scrollStartY = t.lastMouseClientY, n.dataCache[e].scrollOrigin = t.scrollOrigin), n.dataCache[e].scrollDir = t.scrollDir), "vert" !== t.scrollDir) return t.scrollDir;
2312        var r = (jQuery(document).scrollTop(), t.scrollOrigin - (t.lastMouseClientY - t.scrollStartY));
2313        return r >= 0 && jQuery(document).scrollTop(r), t.scrollDir
2314    }, this.wasVerticalScroll = function(e) {
2315        return "vert" === i.getStoredEventData(e).scrollDir
2316    }, this.storeEventData = function(e, t, r) {
2317        var o = i.getMousePosition(e),
2318            a = jQuery.now(),
2319            s = {
2320                startTime: a,
2321                lastTime: a,
2322                startMouseX: o.pageX,
2323                startMouseY: o.pageY,
2324                lastMouseX: o.pageX,
2325                lastMouseY: o.pageY,
2326                startMouseClientY: o.clientY,
2327                lastMouseClientY: o.clientY,
2328                scrollTop: jQuery(document).scrollTop(),
2329                scrollDir: null
2330            };
2331        r && (s = jQuery.extend(s, r)), n.dataCache[t] = s
2332    }, this.updateStoredEventData = function(e, t, r) {
2333        if (!n.dataCache[t]) throw new Error("updateEventData error: must have stored cache object");
2334        var o = n.dataCache[t],
2335            a = i.getMousePosition(e);
2336        o.lastTime = jQuery.now(), void 0 !== a.pageX && (o.lastMouseX = a.pageX, o.lastMouseY = a.pageY, o.lastMouseClientY = a.clientY), r && (o = jQuery.extend(o, r)), n.dataCache[t] = o
2337    }
2337, this.getStoredEventData = function(e, t) {
2338        if (!n.dataCache[e]) throw new Error("updateEventData error: must have stored cache object");
2339        var i = n.dataCache[e];
2340        return i.diffMouseX = i.lastMouseX - i.startMouseX, i.diffMouseY = i.lastMouseY - i.startMouseY, i.diffMouseClientY = i.lastMouseClientY - i.startMouseClientY, i.diffTime = i.lastTime - i.startTime, !0 === t ? (i.startMousePos = i.lastMouseY, i.lastMousePos = i.lastMouseY, i.diffMousePos = i.diffMouseY) : (i.startMousePos = i.lastMouseX, i.lastMousePos = i.lastMouseX, i.diffMousePos = i.diffMouseX), i
2341    }, this.isApproveStoredEventClick = function(e, t) {
2342        if (!n.dataCache[e]) return !0;
2343        var r = i.getStoredEventData(e, t),
2344            o = Math.abs(r.diffMousePos);
2345        return !(r.diffTime > 400) && !(o > 30)
2346    }, this.clearStoredEventData = function(e) {
2347        n.dataCache[e] = null
2348    }, this.z_________CHECK_SUPPORT_FUNCTIONS_______ = function() {}, this.isCanvasExists = function() {
2349        return "function" == typeof jQuery('<canvas width="500" height="500" > </canvas>')[0].getContext
2350    }, this.isScrollbarExists = function() {
2351        return window.innerWidth > document.documentElement.clientWidth
2352    }, this.isTouchDevice = function() {
2353        if (-1 !== n.isTouchDevice) return n.isTouchDevice;
2354        try {
2355            document.createEvent("TouchEvent"), n.isTouchDevice = !0
2356        } catch (e) {
2357            n.isTouchDevice = !1
2358        }
2359        return n.isTouchDevice
2360    }, this.isDesktopDevice = function() {
2361        return void 0 !== typeof window.screenX && !i.isTouchDevice()
2362    }, this.isRgbaSupported = function() {
2363        if (-1 !== n.isRgbaSupported) return n.isRgbaSupported;
2364        var e = document.getElementsByTagName("script")[0],
2365            t = e.style.color;
2366        try {
2367            e.style.color = "rgba(1,5,13,0.44)"
2368        } catch (e) {}
2369        var i = e.style.color != t;
2370        return e.style.color = t, n.isRgbaSupported = i, i
2371    }, this.z_________GENERAL_FUNCTIONS_______ = function() {}, this.checkMinJqueryVersion = function(e) {
2372        for (var t = jQuery.fn.jquery.split("."), i = e.split("."), n = 0, r = t.length; r > n; n++) {
2373            var o = parseInt(t[n]),
2374                a = parseInt(i[n]);
2375            if (void 0 === i[n]) return !0;
2376            if (a > o) return !1;
2377            if (o > a) return !0
2378        }
2379        return !0
2380    }, this.getCssSizeParam = function(e) {
2381        return jQuery.isNumeric(e) ? e + "px" : e
2382    }, this.convertHexToRGB = function(e, t) {
2383        var i = e.replace("#", "");
2384        return i === e ? e : (r = parseInt(i.substring(0, 2), 16), g = parseInt(i.substring(2, 4), 16), b = parseInt(i.substring(4, 6), 16), result = "rgba(" + r + "," + g + "," + b + "," + t + ")")
2385    }, this.timestampToString = function(e) {
2386        var t = new Date(e);
2387        return t.getDate() + "/" + t.getMonth() + " " + t.getHours() + ":" + t.getMinutes() + ":" + t.getSeconds() + ":" + t.getMilliseconds()
2388    }, this.getArrTouches = function(e) {
2389        var t = [];
2390        return e.originalEvent && e.originalEvent.touches && e.originalEvent.touches.length > 0 && (t = e.originalEvent.touches), t
2391    }, this.getArrTouchPositions = function(e) {
2392        for (var t = [], i = 0; i < e.length; i++) {
2393            var n = {
2394                pageX: e[i].pageX,
2395                pageY: e[i].pageY
2396            };
2397            t.push(n)
2398        }
2399        return t
2400    }, this.startTimeDebug = function() {
2401        n.starTime = jQuery.now()
2402    }, this.showTimeDebug = function() {
2403        debugLine({
2404            "Time Passed": jQuery.now() - n.starTime
2405        }, !0)
2406    }, this.initProgressIndicator = function(e, t, n) {
2407        switch ("bar" != e && 0 == i.isCanvasExists() && (e = "bar"), e) {
2408            case "bar":
2409                (r = new UGProgressBar).putHidden(n, t);
2410                break;
2411            default:
2412            case "pie":
2413                (r = new UGProgressPie).putHidden(n, t);
2414                break;
2415            case "pie2":
2416                var r;
2417                t.type_fill = !0, (r = new UGProgressPie).putHidden(n, t)
2418        }
2419        return r
2420    }, this.setButtonMobileReady = function(e) {
2421        e.on("touchstart", function() {
2422            jQuery(this).addClass("ug-nohover")
2423        }), e.on("mousedown touchend", function(e) {
2424            return e.stopPropagation(), e.stopImmediatePropagation(), !1
2425        })
2426    }, this.registerTheme = function(e) {
2427        n.arrThemes.push(e)
2428    }, this.getArrThemes = function() {
2429        return n.arrThemes
2430    }, this.isThemeRegistered = function(e) {
2431        return -1 !== jQuery.inArray(e, n.arrThemes)
2432    }, this.getFirstRegisteredTheme = function() {
2433        return 0 == n.arrThemes.length ? "" : n.arrThemes[0]
2434    }, this.isTimePassed = function(e, t) {
2435        if (!t) t = 100;
2436        var i = jQuery.now();
2437        lastTime = 0 == n.timeCache.hasOwnProperty(e) ? 0 : n.timeCache[e];
2438        var r = i - lastTime;
2439        return n.timeCache[e] = i, !(t >= r)
2440    }, this.whenContiniousEventOver = function(e, t, i) {
2441        if (!i) i = 300;
2442        1 == n.timeCache.hasOwnProperty(e) && null != n.timeCache[e] && (clearTimeout(n.timeCache[e]), n.timeCache[e] = null), n.timeCache[e] = setTimeout(t, i)
2443    }, this.validateClickTouchstartEvent = function(e) {
2444        var t = !0,
2445            i = jQuery.now() - n.lastEventTime;
2446        return "click" == e && "touchstart" == n.lastEventType && 1e3 > i && (t = !1), n.lastEventTime = jQuery.now(), n.lastEventType = e, t
2447    }, this.addClassOnHover = function(e, t) {
2448        if (!t) t = "ug-button-hover";
2449        e.hover(function() {
2450            jQuery(this).addClass(t)
2451        }, function() {
2452            jQuery(this).removeClass(t)
2453        })
2454    }, this.destroyButton = function(e) {
2455        e.off("mouseenter"), e.off("mouseleave"), e.off("click"), e.off("touchstart"), e.off("touchend"), e.off("mousedown")
2456    }, this.setButtonOnClick = function(e, t) {
2457        i.setButtonMobileReady(e), e.on("click touchstart", function(e) {
2458            return objThis = jQuery(this), e.stopPropagation(), e.stopImmediatePropagation(), 0 == i.validateClickTouchstartEvent(e.type) || void t(objThis, e)
2459        })
2460    }, this.loadJs = function(e, t) {
2461        !0 === t && (e = location.protocol + "//" + e);
2462        var i = document.createElement("script");
2463        i.src = e;
2464        var n = document.getElementsByTagName("script")[0];
2465        n.parentNode.insertBefore(i, n)
2466    }, this.loadCss = function(e, t) {
2467        !0 === t && (e = location.protocol + "//" + e);
2468        var i = document.createElement("link");
2469        i.setAttribute("rel", "stylesheet"), i.setAttribute("type", "text/css"), i.setAttribute("href", e), document.getElementsByTagName("head")[0].appendChild(i)
2470    }, this.addEvent = function(e, t, i) {
2471        void 0 !== e.addEventListener ? e.addEventListener(t, i, !1) : e.attachEvent && e.attachEvent("on" + t, i)
2472    }, this.checkImagesLoaded = function(e, t, i) {
2473        function n(e, n) {
2474            r++, "function" == typeof i && setTimeout(function() {
2475                i(e, n)
2476            }), r == o && "function" == typeof t && setTimeout(function() {
2477                t()
2478            })
2479        }
2480        var r = 0,
2481            o = e.length;
2482        return 0 == o && t ? (t(), !1) : void setTimeout(function() {
2483            for (var t = 0; o > t; t++) {
2484                var i = e[t];
2485                if (void 0 !== i.naturalWidth && 0 !== i.naturalWidth) n(e[t], !1);
2486                else {
2487                    var r = jQuery("<img/>");
2488                    r.data("index", t), r.on("load", function() {
2489                        var t = jQuery(this).data("index");
2490                        n(e[t], !1)
2491                    }), r.on("error", function() {
2492                        var t = jQuery(this).data("index");
2493                        n(e[t], !0)
2494                    }), r.attr("src", i.src)
2495                }
2496            }
2497        })
2498    }, this.waitForWidth = function(e, t) {
2499        var i = e.width();
2500        return 0 != i ? (t(), !1) : void(n.handle = setInterval(function() {
2501            0 != (i = e.width()) && (clearInterval(n.handle), t())
2502        }, 300))
2503    }, this.arrayShuffle = function(e) {
2504        if ("object" != typeof e) return e;
2505        for (var t, i, n = e.length; n; t = parseInt(Math.random() * n), i = e[--n], e[n] = e[t], e[t] = i);
2506        return e
2507    }, this.z_________END_GENERAL_FUNCTIONS_______ = function() {}
2508}
2509
2510function UGThumbsGeneral() {
2511    function e(e, t, i, n) {
2512        var r = {
2513                width: e + "px",
2514                height: t + "px"
2515            },
2516            o = {
2517                width: e - v.thumbInnerReduce + "px",
2518                height: t - v.thumbInnerReduce + "px"
2519            },
2520            a = ".ug-thumb-loader, .ug-thumb-error, .ug-thumb-border-overlay, .ug-thumb-overlay";
2521        i ? (!0 !== n && i.css(r), i.children(a).css(o)) : (p.children(".ug-thumb-wrapper").css(r), p.find(a).css(o))
2522    }
2523
2524    function t(e, t, i, n) {
2525        if (!n) n = !1;
2526        _.isFakeFullscreen() && (n = !0);
2527        var r, o = e.children(".ug-thumb-border-overlay"),
2528            a = {};
2529        a["border-width"] = t + "px", 0 != t && (a["border-color"] = i), n && !0 === n ? (o.css(a), 0 == t ? o.hide() : o.show()) : (0 == t ? o.stop().fadeOut(f.thumb_transition_duration) : o.show().stop().fadeIn(f.thumb_transition_duration), r = a, o.stop(!0).animate(r, {
2530            duration: f.thumb_transition_duration,
2531            easing: f.thumb_transition_easing,
2532            queue: !1
2533        }))
2534    }
2535
2536    function i(e, t, i) {
2537        var n = e.children(".ug-thumb-overlay"),
2538            r = f.thumb_transition_duration;
2539        i && !0 === i && (r = 0), t ? n.stop(!0).fadeTo(r, v.colorOverlayOpacity) : n.stop(!0).fadeTo(r, 0)
2540    }
2541
2542    function n(e, t, i) {
2543        var n = e.children("img.ug-thumb-image"),
2544            r = e.children("img.ug-thumb-image-overlay"),
2545            o = f.thumb_transition_duration;
2546        i && !0 === i && (o = 0), t ? r.stop(!0).fadeTo(o, 1) : (n.fadeTo(0, 1), r.stop(!0).fadeTo(o, 0))
2547    }
2548
2549    function r(e, r) {
2550        (v.isEffectBorder && t(e, f.thumb_selected_border_width, f.thumb_selected_border_color, r), v.isEffectOverlay) && i(e, 1 == f.thumb_overlay_reverse, r);
2551        v.isEffectImage && n(e, !1, r)
2552    }
2553
2554    function o(t, i) {
2555        if (1 == f.thumb_fixed_size) m.scaleImageCoverParent(i, t);
2556        else {
2557            "height" == f.thumb_resize_by ? m.scaleImageByHeight(i, f.thumb_height) : m.scaleImageByWidth(i, f.thumb_width);
2558            var n = m.getElementSize(i);
2559            m.placeElement(i, 0, 0), e(n.width, n.height, t)
2560        }
2561        var o;
2562        t.children(".ug-thumb-loader").hide(), i.show(), 0 == f.thumb_image_overlay_effect ? i.fadeTo(0, 1) : (1 == f.thumb_image_overlay_effect && function(e) {
2563            var t = e.siblings(".ug-thumb-image-overlay");
2564            if (0 == t.length) return !1;
2565            var i = m.getElementSize(e),
2566                n = {
2567                    width: i.width + "px",
2568                    height: i.height + "px",
2569                    left: i.left + "px",
2570                    top: i.top + "px"
2571                };
2572            t.css(n), 0 == v.customThumbs && t.fadeTo(0, 1)
2573        }(i), i.fadeTo(0, 0), 1 == a(o = t) ? r(o, !0) : g.setThumbNormalStyle(o, !0)), h.trigger(g.events.AFTERPLACEIMAGE, t)
2574    }
2575
2576    function a(e) {
2577        return !!e.hasClass("ug-thumb-selected")
2578    }
2579
2580    function s(t, i) {
2581        i = jQuery(i);
2582        var n = (g.getItemByThumb(i), m.getElementSize(i));
2583        e(n.width, n.height, i, !0), g.setThumbNormalStyle(i, !0)
2584    }
2585
2586    function l(e, t, i) {
2587        objItem = g.getItemByThumb(t), objItem.isLoaded = !0, objItem.isThumbImageLoaded = !0;
2588        var n = m.getImageOriginalSize(i);
2589        objItem.thumbWidth = n.width, objItem.thumbHeight = n.height, objItem.thumbRatioByWidth = n.width / n.height, objItem.thumbRatioByHeight = n.height / n.width
2590    }
2591    var u, d, c, p, g = this,
2592        h = jQuery(g),
2593        _ = new UniteGalleryMain,
2594        m = new UGFunctions;
2595    this.events = {
2596        SETOVERSTYLE: "thumbmouseover",
2597        SETNORMALSTYLE: "thumbmouseout",
2598        PLACEIMAGE: "thumbplaceimage",
2599        AFTERPLACEIMAGE: "thumb_after_place_image",
2600        IMAGELOADERROR: "thumbimageloaderror",
2601        THUMB_IMAGE_LOADED: "thumb_image_loaded"
2602    };
2603    var f = {
2604            thumb_width: 88,
2605            thumb_height: 50,
2606            thumb_fixed_size: !0,
2607            thumb_resize_by: "height",
2608            thumb_border_effect: !0,
2609            thumb_border_width: 0,
2610            thumb_border_color: "#000000",
2611            thumb_over_border_width: 0,
2612            thumb_over_border_color: "#d9d9d9",
2613            thumb_selected_border_width: 1,
2614            thumb_selected_border_color: "#d9d9d9",
2615            thumb_round_corners_radius: 0,
2616            thumb_color_overlay_effect: !0,
2617            thumb_overlay_color: "#000000",
2618            thumb_overlay_opacity: .4,
2619            thumb_overlay_reverse: !1,
2620            thumb_image_overlay_effect: !1,
2621            thumb_image_overlay_type: "bw",
2622            thumb_transition_duration: 200,
2623            thumb_transition_easing: "easeOutQuad",
2624            thumb_show_loader: !0,
2625            thumb_loader_type: "dark",
2626            thumb_wrapper_as_link: !1,
2627            thumb_link_newpage: !1
2628        },
2629        v = {
2630            touchEnabled: !1,
2631            num_thumbs_checking: 0,
2632            customThumbs: !1,
2633            funcSetCustomThumbHtml: null,
2634            isEffectBorder: !1,
2635            isEffectOverlay: !1,
2636            isEffectImage: !1,
2637            colorOverlayOpacity: 1,
2638            thumbInnerReduce: 0
2639        },
2640        b = "thumb_size_change";
2641    this.init = function(e, t) {
2642        u = e.getObjects(), _ = e, jQuery(e), d = u.g_objWrapper, c = u.g_arrItems, f = jQuery.extend(f, t), v.isEffectBorder = f.thumb_border_effect, v.isEffectOverlay = f.thumb_color_overlay_effect, v.isEffectImage = f.thumb_image_overlay_effect
2643    }, this._____________EXTERNAL_SETTERS__________ = function() {}, this.setHtmlThumbs = function(e) {
2644        p = e;
2645        var t = _.getNumItems();
2646        if (1 == v.isEffectImage) var i = function() {
2647            var e = "",
2648                t = f.thumb_image_overlay_type.split(",");
2649            for (var i in t) switch (t[i]) {
2650                case "bw":
2651                    e += " ug-bw-effect";
2652                    break;
2653                case "blur":
2654                    e += " ug-blur-effect";
2655                    break;
2656                case "sepia":
2657                    e += " ug-sepia-effect"
2658            }
2659            return e
2660        }();
2661        for (var n = 0; t > n; n++) {
2662            var r = c[n],
2663                o = "";
2664            0 == v.customThumbs && (o = " ug-thumb-generated");
2665            var a = "<div class='ug-thumb-wrapper" + o + "'></div>";
2666            if (1 == f.thumb_wrapper_as_link) {
2667                var s = r.link;
2668                "" == r.link && (s = "javascript:void(0)");
2669                var l = "";
2670                1 == f.thumb_link_newpage && r.link && (l = " target='_blank'");
2671                a = "<a href='" + s + "'" + l + " class='ug-thumb-wrapper" + o + "'></a>"
2672            }
2673            var u = jQuery(a),
2674                d = r.objThumbImage;
2675            if (0 == v.customThumbs) {
2676                if (1 == f.thumb_show_loader && d) {
2677                    var g = "ug-thumb-loader-dark";
2678                    "bright" == f.thumb_loader_type && (g = "ug-thumb-loader-bright"), u.a
2678ppend("<div class='ug-thumb-loader " + g + "'></div>"), u.append("<div class='ug-thumb-error' style='display:none'></div>")
2679                }
2680                if (d) {
2681                    if (d.addClass("ug-thumb-image"), 1 == f.thumb_image_overlay_effect) {
2682                        var h = d.clone().appendTo(u);
2683                        h.addClass("ug-thumb-image-overlay " + i).removeClass("ug-thumb-image"), h.fadeTo(0, 0), r.objImageOverlay = h
2684                    }
2685                    u.append(d)
2686                }
2687            }
2688            v.isEffectBorder && u.append("<div class='ug-thumb-border-overlay'></div>"), v.isEffectOverlay && u.append("<div class='ug-thumb-overlay'></div>"), p.append(u), v.customThumbs && v.funcSetCustomThumbHtml(u, r), c[n].objThumbWrapper = u
2689        }
2690    }, this.setThumbNormalStyle = function(e, r) {
2691        (1 == v.customThumbs && e.removeClass("ug-thumb-over"), v.isEffectBorder && t(e, f.thumb_border_width, f.thumb_border_color, r), v.isEffectOverlay) && i(e, 1 != f.thumb_overlay_reverse, r);
2692        v.isEffectImage && n(e, !0, r), h.trigger(g.events.SETNORMALSTYLE, e)
2693    }, this.setThumbOverStyle = function(e) {
2694        (1 == v.customThumbs && e.addClass("ug-thumb-over"), v.isEffectBorder && t(e, f.thumb_over_border_width, f.thumb_over_border_color), v.isEffectOverlay) && i(e, 1 == f.thumb_overlay_reverse);
2695        1 == v.isEffectImage && n(e, !1), h.trigger(g.events.SETOVERSTYLE, e)
2696    }, this.setHtmlProperties = function() {
2697        if (0 == v.customThumbs && (1 == f.thumb_fixed_size && e(f.thumb_width, f.thumb_height), function() {
2698                if (f.thumb_round_corners_radius <= 0) return !1;
2699                var e = {
2700                    "border-radius": f.thumb_round_corners_radius + "px"
2701                };
2702                p.find(".ug-thumb-wrapper, .ug-thumb-wrapper .ug-thumb-border-overlay").css(e)
2703            }()), p.children(".ug-thumb-wrapper").each(function() {
2704                var e = jQuery(this);
2705                g.setThumbNormalStyle(e, !0)
2706            }), v.isEffectOverlay && f.thumb_overlay_color) {
2707            var t = {};
2708            if (m.isRgbaSupported()) {
2709                var i = m.convertHexToRGB(f.thumb_overlay_color, f.thumb_overlay_opacity);
2710                t["background-color"] = i
2711            } else t["background-color"] = f.thumb_overlay_color, v.colorOverlayOpacity = f.thumb_overlay_opacity;
2712            p.find(".ug-thumb-wrapper .ug-thumb-overlay").css(t)
2713        }
2714    }, this.setThumbSelected = function(e) {
2715        return 1 == v.customThumbs && e.removeClass("ug-thumb-over"), 1 == a(e) || (e.addClass("ug-thumb-selected"), void r(e))
2716    }, this.setThumbUnselected = function(e) {
2717        e.removeClass("ug-thumb-selected"), g.setThumbNormalStyle(e)
2718    }, this.setOptions = function(e) {
2719        f = jQuery.extend(f, e)
2720    }, this.setThumbInnerReduce = function(e) {
2721        v.thumbInnerReduce = e
2722    }, this.setCustomThumbs = function(e, t) {
2723        if (v.customThumbs = !0, "function" != typeof e) throw new Error("The argument should be function");
2724        v.funcSetCustomThumbHtml = e, -1 == jQuery.inArray("overlay", t) && (v.isEffectOverlay = !1), -1 == jQuery.inArray("border", t) && (v.isEffectBorder = !1), v.isEffectImage = !1
2725    }, this._____________EXTERNAL_GETTERS__________ = function() {}, this.getOptions = function() {
2726        return f
2727    }, this.getNumThumbs = function() {
2728        return c.length
2729    }, this.getThumbImage = function(e) {
2730        return e.children(".ug-thumb-image")
2731    }, this.getThumbByIndex = function(e) {
2732        var t = g.getThumbs();
2733        if (e >= t.length || 0 > e) throw new Error("Wrong thumb index");
2734        return jQuery(t[e])
2735    }, this.getThumbs = function() {
2736        return p.children(".ug-thumb-wrapper")
2737    }, this.getItemByThumb = function(e) {
2738        var t = e.data("index");
2739        return void 0 === t && (t = e.index()), c[t]
2740    }, this.isThumbLoaded = function(e) {
2741        return g.getItemByThumb(e).isLoaded
2742    }, this._____________EXTERNAL_OTHERS__________ = function() {}, this.initEvents = function() {
2743        var e = p.find(".ug-thumb-wrapper");
2744        e.on("touchstart", function() {
2745            v.touchEnabled = !0, e.off("mouseenter").off("mouseleave")
2746        }), d.on(b, s), e.hover(function() {
2747            var e, t = jQuery(this);
2748            e = t, 1 == v.touchEnabled ? objThumbs.off("mouseenter").off("mouseleave") : 0 == a(e) && g.setThumbOverStyle(e)
2749        }, function() {
2750            var e, t = jQuery(this);
2751            e = t, 1 == v.touchEnabled || 0 == a(e) && g.setThumbNormalStyle(e)
2752        }), h.on(g.events.THUMB_IMAGE_LOADED, l)
2753    }, this.destroy = function() {
2754        var e = p.find(".ug-thumb-wrapper");
2755        e.off("touchstart"), d.off(b), e.off("mouseenter"), e.off("mouseleave"), h.off(g.events.THUMB_IMAGE_LOADED)
2756    }, this.loadThumbsImages = function() {
2757        var e = p.find(".ug-thumb-image");
2758        m.checkImagesLoaded(e, null, function(e, t) {
2759            if (0 == t) ! function(e, t) {
2760                t || (t = !1);
2761                var i = jQuery(e),
2762                    n = i.parent();
2763                0 != n.parent().length && (objItem = g.getItemByThumb(n), (1 != objItem.isLoaded || !1 !== t) && (g.triggerImageLoadedEvent(n, i), 1 == v.customThumbs ? h.trigger(g.events.PLACEIMAGE, [n, i]) : o(n, i, objItem)))
2764            }(e, !0);
2765            else {
2766                var i = jQuery(e).parent();
2767                n = i, (r = g.getItemByThumb(n)).isLoaded = !0, r.isThumbImageLoaded = !1, 1 == v.customThumbs ? h.trigger(g.events.IMAGELOADERROR, n) : (n.children(".ug-thumb-loader").hide(), n.children(".ug-thumb-error").show())
2768            }
2769            var n, r
2770        })
2771    }, this.triggerImageLoadedEvent = function(e, t) {
2772        h.trigger(g.events.THUMB_IMAGE_LOADED, [e, t])
2773    }, this.hideThumbs = function() {
2774        p.find(".ug-thumb-wrapper").hide()
2775    }
2776}
2777
2778function UGThumbsStrip() {
2779    function e() {
2780        var e = x.getOptions();
2781        I.isNotFixedThumbs = !1 === e.thumb_fixed_size, w = E.strip_vertical_type
2782    }
2783
2784    function t() {
2785        var e, t, i, r, l;
2786        x.setHtmlProperties(), e = _.children(".ug-thumb-wrapper"), t = jQuery(e[0]), i = t.outerWidth(), r = t.outerHeight(), l = x.getOptions(), 0 == w ? (T.thumbSize = i, T.thumbSecondSize = 1 == l.thumb_fixed_size ? r : l.thumb_height, T.stripSize = h.width(), T.stripInnerSize = _.width()) : (T.thumbSize = r, T.thumbSecondSize = 1 == l.thumb_fixed_size ? i : l.thumb_width, T.stripSize = h.height(), T.stripInnerSize = _.height()),
2787            function() {
2788                if (0 == w) {
2789                    var e = T.thumbSecondSize,
2790                        t = {};
2791                    t.height = e + "px";
2792                    var i = {};
2793                    i.height = e + "px"
2794                } else {
2795                    var n = T.thumbSecondSize,
2796                        t = {};
2797                    t.width = n + "px";
2798                    var i = {};
2799                    i.width = n + "px"
2800                }
2801                h.css(t), _.css(i)
2802            }
2802(), n(), 0 == I.isRunOnce && (1 == E.strip_control_touch && (f = new UGTouchThumbsControl).init(v), 1 == E.strip_control_avia && (m = new UGAviaControl).init(v), a(), x.loadThumbsImages(), x.initEvents(), h.find(".ug-thumb-wrapper").on("click touchend", function() {
2803                var e = jQuery(this);
2804                ! function(e) {
2805                    if (v.isTouchMotionActive()) {
2806                        var t = f.isSignificantPassed();
2807                        if (1 == t) return !0
2808                    }
2809                    var i = x.getItemByThumb(e);
2810                    b.selectItem(i)
2811                }(e)
2812            }), d.on(b.events.ITEM_CHANGE, function() {
2813                var e = b.getSelectedItem();
2814                x.setThumbSelected(e.objThumbWrapper), o(e.objThumbWrapper)
2815            }), I.isNotFixedThumbs && jQuery(x).on(x.events.AFTERPLACEIMAGE, s)), I.isRunOnce = !0
2816    }
2817
2818    function n() {
2819        var e, t = _.children(".ug-thumb-wrapper"),
2820            n = 0,
2821            r = 0;
2822        for (i = 0; i < t.length; i++) {
2823            var o = jQuery(t[i]);
2824            if (1 == I.isNotFixedThumbs) {
2825                if (objItem = x.getItemByThumb(o), 0 == objItem.isLoaded) continue;
2826                o.show()
2827            }
2828            y.placeElement(o, n, r), 0 == w ? n += o.outerWidth() + E.strip_space_between_thumbs : r += o.outerHeight() + E.strip_space_between_thumbs
2829        }
2830        if (0 == w) var s = n - E.strip_space_between_thumbs;
2831        else s = r - E.strip_space_between_thumbs;
2832        e = s, 0 == w ? _.width(e) : _.height(e), T.stripInnerSize = e, a()
2833    }
2834
2835    function r(e) {
2836        var t = v.getInnerStripPos() + e;
2837        t = v.fixInnerStripLimits(t), v.positionInnerStrip(t, !0)
2838    }
2839
2840    function o(e) {
2841        if (0 == l()) return !1;
2842        var t, i, n, r, o, a, s = (t = {}, i = v.getInnerStripPos(), t.minPosThumbs = -1 * i + 1, t.maxPosThumbs = -1 * i + T.stripSize - 1, t),
2843            d = u(e);
2844        if (d.min < s.minPosThumbs) {
2845            var c = e.prev();
2846            o = c.length ? c : e, a = -1 * u(o).min, a = v.fixInnerStripLimits(a), v.positionInnerStrip(a, !0)
2847        } else if (d.max > s.maxPosThumbs) {
2848            var p = e.next();
2849            n = p.length ? p : e, r = -1 * u(n).max + T.stripSize, r = v.fixInnerStripLimits(r), v.positionInnerStrip(r, !0)
2850        }
2851    }
2852
2853    function a() {
2854        1 == l() ? (m && m.enable(), f && f.enable()) : (m && m.disable(), f && f.disable())
2855    }
2856
2857    function s() {
2858        clearTimeout(I.handle), I.handle = setTimeout(function() {
2859            n()
2860        }, 50)
2861    }
2862
2863    function l() {
2864        return 0 == w ? _.width() > h.width() : _.height() > h.height()
2865    }
2866
2867    function u(e) {
2868        var t = {},
2869            i = e.position();
2870        return 0 == w ? (t.min = i.left, t.max = i.left + T.thumbSize) : (t.min = i.top, t.max = i.top + T.thumbSize), t
2871    }
2872    var d, c, p, g, h, _, m, f, v = this,
2873        b = new UniteGalleryMain,
2874        y = new UGFunctions,
2875        w = !1,
2876        x = new UGThumbsGeneral,
2877        E = (y = new UGFunctions, {
2878            strip_vertical_type: !1,
2879            strip_thumbs_align: "left",
2880            strip_space_between_thumbs: 6,
2881            strip_thumb_touch_sensetivity: 15,
2882            strip_scroll_to_thumb_duration: 500,
2883            strip_scroll_to_thumb_easing: "easeOutCubic",
2884            strip_control_avia: !0,
2885            strip_control_touch: !0
2886        }),
2887        I = {
2888            isRunOnce: !1,
2889            is_placed: !1,
2890            isNotFixedThumbs: !1,
2891            handle: null
2892        },
2893        T = {
2894            stripSize: 0,
2895            stripInnerSize: 0,
2896            thumbSize: 0,
2897            thumbSecondSize: 0
2898        };
2899    this.events = {
2900        STRIP_MOVE: "stripmove"
2901    };
2902    var S = {
2903        strip_thumbs_align: "top",
2904        thumb_resize_by: "width"
2905    };
2906    this.setHtml = function(e) {
2907        if (!e) {
2908            e = p;
2909            null != E.parent_container && (e = E.parent_container)
2910        }
2911        e.append("<div class='ug-thumbs-strip'><div class='ug-thumbs-strip-inner'></div></div>
2911"), h = e.children(".ug-thumbs-strip"), _ = h.children(".ug-thumbs-strip-inner"), x.setHtmlThumbs(_), 1 == I.isNotFixedThumbs && x.hideThumbs()
2912    }, this.destroy = function() {
2913        var e = h.find(".ug-thumb-wrapper");
2914        e.off("click"), e.off("touchend"), d.off(b.events.ITEM_CHANGE), jQuery(x).off(x.events.AFTERPLACEIMAGE), f && f.destroy(), m && m.destroy(), x.destroy()
2915    }, this.________EXTERNAL_GENERAL___________ = function() {}, this.init = function(t, i) {
2916        var n, r;
2917        r = i, c = (n = t).getObjects(), b = n, d = jQuery(n), p = c.g_objWrapper, g = c.g_arrItems, E = jQuery.extend(E, r), 1 == (w = E.strip_vertical_type) && (E = jQuery.extend(E, S), E = jQuery.extend(E, r), r.thumb_resize_by = "width"), x.init(n, r), e()
2918    }, this.run = function() {
2919        t()
2920    }, this.fixInnerStripLimits = function(e) {
2921        var t;
2922        return t = 0 == w ? -(_.width() - h.width()) : -(_.height() - h.height()), e > 0 && (e = 0), t > e && (e = t), e
2923    }, this.positionInnerStrip = function(e, t) {
2924        if (void 0 === t) t = !1;
2925        if (0 == w) var i = {
2926            left: e + "px"
2927        };
2928        else i = {
2929            top: e + "px"
2930        };
2931        0 == t ? (_.css(i), v.triggerStripMoveEvent()) : (v.triggerStripMoveEvent(), _.stop(!0).animate(i, {
2932            duration: E.strip_scroll_to_thumb_duration,
2933            easing: E.strip_scroll_to_thumb_easing,
2934            queue: !1,
2935            progress: function() {
2936                v.triggerStripMoveEvent()
2937            },
2938            always: function() {
2939                v.triggerStripMoveEvent()
2940            }
2941        }))
2942    }, this.triggerStripMoveEvent = function() {
2943        jQuery(v).trigger(v.events.STRIP_MOVE)
2944    }, this.isTouchMotionActive = function() {
2945        return !!f && f.isTouchActive()
2946    }, this.isItemThumbVisible = function(e) {
2947        var t = e.objThumbWrapper,
2948            i = t.position(),
2949            n = -1 * v.getInnerStripPos();
2950        if (0 == w) var r = n + h.width(),
2951            o = i.left,
2952            a = i.left + t.width();
2953        else r = n + h.height(), o = i.top, a = i.top + t.height();
2954        var s = !1;
2955        return a >= n && r >= o && (s = !0), s
2956    }, this.getInnerStripPos = function() {
2957        return 0 == w ? _.position().left : _.position().top
2958    }, this.getInnerStripLimits = function() {
2959        var e = {
2960            maxPos: 0
2961        };
2962        return e.minPos = 0 == w ? -(_.width() - h.width()) : -(_.height() - h.height()), e
2963    }, this.scrollForeward = function() {
2964        r(-T.stripSize)
2965    }, this.scrollBack = function() {
2966        r(T.stripSize)
2967    }, this.________EXTERNAL_SETTERS___________ = function() {}, this.setOptions = function(t) {
2968        E = jQuery.extend(E, t), x.setOptions(t), e()
2969    }, this.setSizeVertical = function(e) {
2970        if (0 == w) throw new Error("setSizeVertical error, the strip size is not vertical");
2971        var t = T.thumbSecondSize,
2972            i = {};
2973        i.width = t + "px", i.height = e + "px", h.css(i);
2974        var n = {};
2975        n.width = t + "px", n.left = "0px", n.top = "0px", _.css(n), I.is_placed = !0, a()
2976    }, this.setSizeHorizontal = function(e) {
2977        if (0 == w) throw new Error("setSizeHorizontal error, the strip size is not horizontal");
2978        var t = T.thumbSecondSize,
2979            i = {};
2980        i.width = e + "px", i.height = t + "px", h.css(i);
2981        var n = {};
2982        n.height = t + "px", n.left = "0px", n.top = "0px", _.css(n), I.is_placed = !0, a()
2983    }, this.setPosition = function(e, t, i, n) {
2984        y.placeElement(h, e, t, i, n)
2985    }, this.resize = function(e) {
2986        0 == w ? h.width(e) : h.height(e), T.stripSize = e, a(),
2987            function() {
2988                if (0 == l()) return !1;
2989                var e = v.getInnerStripPos(),
2990                    t = v.fixInnerStripLimits(e);
2991                e != t && v.positionInnerStrip(t, !0)
2992            }(), !l() && (0 == w ? y.placeElement(_, E.strip_thumbs_align, 0) : y.placeElement(_, 0, E.strip_thumbs_align)),
2993            function() {
2994                var e = b.getSelectedItem();
2995                if (null == e) return !0;
2996                var t = e.objThumbWrapper;
2997                t && o(t)
2998            }()
2999    }, this.setThumbUnselected = function(e) {
3000        x.setThumbUnselected(e)
3001    }, this.setCustomThumbs = function(e) {
3002        x.setCustomThumbs(e)
3003    }, this.________EXTERNAL_GETTERS___________ = function() {}, this.getObjects = function() {
3004        var e = x.getOptions(),
3005            t = jQuery.extend(E, e);
3006        return {
3007            g_gallery: b,
3008            g_objGallery: d,
3009            g_objWrapper: p,
3010            g_arrItems: g,
3011            g_objStrip: h,
3012            g_objStripInner: _,
3013            g_aviaControl: m,
3014            g_touchThumbsControl: f,
3015            isVertical: w,
3016            g_options: t
3017        }
3018    }
3018, this.getSizeAndPosition = function() {
3019        return y.getElementSize(h)
3020    }, this.getHeight = function() {
3021        return h.outerHeight()
3022    }, this.getWidth = function() {
3023        return h.outerWidth()
3024    }, this.getSizes = function() {
3025        return T
3026    }, this.isVertical = function() {
3027        return w
3028    }, this.isPlaced = function() {
3029        return I.is_placed
3030    }, this.isMoveEnabled = function() {
3031        return l()
3032    }
3033}
3034
3035function UGTouchThumbsControl() {
3036    function e() {
3037        var e = jQuery.now(),
3038            t = {};
3039        return t.passedTime = m.lastTime - m.startTime, t.lastActiveTime = e - m.buttonReleaseTime, t.passedDistance = m.lastPos - m.startPos, t.passedDistanceAbs = Math.abs(t.passedDistance), t
3040    }
3041
3042    function t(e) {
3043        return 0 == g ? h.getMousePosition(e).pageX : h.getMousePosition(e).pageY
3044    }
3045
3046    function i() {
3047        var e = jQuery.now();
3048        e - m.lastTime >= _.touch_portion_time && (m.lastDeltaTime = e - m.lastTime, m.lastDeltaTime > _.touch_portion_time && (m.lastDeltaTime = _.touch_portion_time), m.lastDeltaPos = m.lastPos - m.lastPortionPos, m.lastPortionPos = m.lastPos, m.lastTime = e)
3049    }
3050
3051    function n() {
3052        m.lastPos = l.getInnerStripPos(), l.triggerStripMoveEvent()
3053    }
3054
3055    function r(e) {
3056        if (0 == m.loop_active) return !0;
3057        if (e) {
3058            t(e);
3059            ! function() {
3060                var e = _.thumb_touch_slowFactor,
3061                    t = _.minDeltaTime,
3062                    i = _.minPath,
3063                    r = l.getInnerStripPos(),
3064                    o = jQuery.now() - m.lastTime,
3065                    a = r - m.lastPortionPos;
3066                t > o && m.lastDeltaTime > 0 && (o = m.lastDeltaTime, a = m.lastDeltaPos + a), t > o && (o = t);
3067                var s = 0;
3068                o > 0 && (s = a / o);
3069                var u = s * s / (2 * e) * (a > 0 ? 1 : -1);
3070                Math.abs(u) <= i && (u = 0);
3071                var d = l.getInnerStripPos(),
3072                    p = d + u,
3073                    h = l.fixInnerStripLimits(p),
3074                    f = l.getInnerStripLimits(),
3075                    v = _.limitsBreakAddition,
3076                    b = !1,
3077                    y = h;
3078                if (p > f.maxPos && (b = !0, h = v, v > p && (h = p)), p < f.minPos) {
3079                    b = !0;
3080                    var w = f.minPos - v;
3081                    h = w, p > w && (h = p)
3082                }
3083                var x = h - d,
3084                    E = Math.abs(Math.round(s / e));
3085                if (0 != u && (E = E * x / u), d != h) {
3086                    var I = {
3087                        left: h + "px"
3088                    };
3089                    1 == g && (I = {
3090                        top: h + "px"
3091                    }), c.animate(I, {
3092                        duration: E,
3093                        easing: _.animationEasing,
3094                        queue: !0,
3095                        progress: n
3096                    })
3097                }
3098                if (1 == b) {
3099                    var T = _.returnAnimateSpeed,
3100                        S = {
3101                            left: y + "px"
3102                        };
3103                    1 == g && (S = {
3104                        top: y + "px"
3105                    }), c.animate(S, {
3106                        duration: T,
3107                        easing: _.returnAnimationEasing,
3108                        queue: !0,
3109                        progress: n
3110                    })
3111                }
3112            }()
3113        }
3114        m.loop_active = !1, m.handle = clearInterval(m.handle)
3115    }
3116
3117    function o(e) {
3118        return 0 == m.isControlEnabled || (m.buttonReleaseTime = jQuery.now(), 0 == m.touch_active ? (r(e), !0) : (e.preventDefault(), m.touch_active = !1, r(e), void d.removeClass("ug-dragging")))
3119    }
3120
3121    function a(e) {
3122        if (0 == m.isControlEnabled) return !0;
3123        e.preventDefault(), m.touch_active = !0;
3124        var n, r, o = t(e);
3125        c.stop(!0), n = o, r = l.getInnerStripPos(), m.mousePos = n, m.innerPos = r, m.lastPortionPos = r, m.lastDeltaTime = 0, m.lastDeltaPos = 0, m.startTime = jQuery.now(), m.startPos = m.innerPos, m.lastTime = m.startTime, m.lastPos 
3125= m.startPos, m.speed = 0, 1 == m.loop_active || (m.loop_active = !0, m.handle = setInterval(i, 10)), d.addClass("ug-dragging")
3126    }
3127
3128    function s(e) {
3129        if (0 == m.isControlEnabled) return !0;
3130        if (0 == m.touch_active) return !0;
3131        if (e.preventDefault(), 0 == e.buttons) return m.touch_active = !1, r(e), !0;
3132        var n = t(e);
3133        m.lastPos = l.getInnerStripPos(),
3134            function(e) {
3135                var t = m.mousePos - e,
3136                    i = m.innerPos - t,
3137                    n = l.getInnerStripLimits();
3138                if (i > n.maxPos) {
3139                    var r = i - n.maxPos;
3140                    i = n.maxPos + r / 3
3141                }
3142                i < n.minPos && (r = n.minPos - i, i = n.minPos - r / 3);
3143                l.positionInnerStrip(i)
3144            }(n), i()
3145    }
3146    var l, u, d, c, p, g, h = new UGFunctions,
3147        _ = {
3148            touch_portion_time: 200,
3149            thumb_touch_slowFactor: 0,
3150            minDeltaTime: 70,
3151            minPath: 10,
3152            limitsBreakAddition: 30,
3153            returnAnimateSpeed: 500,
3154            animationEasing: "easeOutCubic",
3155            returnAnimationEasing: "easeOutCubic"
3156        },
3157        m = {
3158            touch_active: !1,
3159            loop_active: !1,
3160            mousePos: 0,
3161            innerPos: 0,
3162            startPos: 0,
3163            startTime: 0,
3164            lastTime: 0,
3165            buttonReleaseTime: 0,
3166            lastPos: 0,
3167            lastPortionPos: 0,
3168            lastDeltaTime: 0,
3169            lastDeltaPos: 0,
3170            speed: 0,
3171            handle: "",
3172            touchEnabled: !1,
3173            isControlEnabled: !0
3174        };
3175    this.enable = function() {
3176        m.isControlEnabled = !0
3177    }, this.disable = function() {
3178        m.isControlEnabled = !1
3179    }, this.init = function(e) {
3180        l = e, u = e.getObjects(), u.g_gallery, u.g_objGallery, d = u.g_objStrip, c = u.g_objStripInner, p = u.g_options, g = u.isVertical, _.thumb_touch_slowFactor = h.normalizeSetting(5e-5, .01, 1, 100, p.strip_thumb_touch_sensetivity, !0), d.bind("mousedown touchstart", a), jQuery(window).add("body").bind("mouseup touchend", o), jQuery("body").bind("mousemove touchmove", s)
3181    }, this.isSignificantPassed = function() {
3182        var t = e();
3183        return t.passedTime > 300 || t.passedDistanceAbs > 30
3184    }, this.isTouchActive = function() {
3185        return 1 == m.touch_active || (1 == c.is(":animated") || e().lastActiveTime < 50)
3186    }, this.destroy = function() {
3187        d.unbind("mousedown"), d.unbind("touchstart"), jQuery(window).add("body").unbind("mouseup").unbind("touchend"), jQuery("body").unbind("mousemove").unbind("touchmove")
3188    }
3189}
3190
3191function UGPanelsBase() {
3192    function e(e, t) {
3193        switch (n.orientation) {
3194            case "right":
3195            case "left":
3196                var i = {
3197                    left: e + "px"
3198                };
3199                break;
3200            case "top":
3201            case "bottom":
3202                i = {
3203                    top: e + "px"
3204                }
3205        }
3206        o.stop(!0).animate(i, {
3207            duration: 300,
3208            easing: "easeInOutQuad",
3209            queue: !1,
3210            complete: function() {
3211                t && t()
3212            }
3213        })
3214    }
3215
3216    function t(e) {
3217        switch (n.orientation) {
3218            case "right":
3219            case "left":
3220                p.placeElement(o, e, null);
3221                break;
3222            case "top":
3223            case "bottom":
3224                p.placeElement(o, null, e)
3225        }
3226    }
3227
3228    function i() {
3229        s.trigger(r.events.FINISH_MOVE)
3230    }
3231    var n, r, o, a, s, l, u, d = new UniteGalleryMain,
3232        c = this,
3233        p = new UGFunctions;
3234    this.init = function(e, t, i, o, l) {
3235        n = t, r = i, d = e, a = o, s = l, u = jQuery(d)
3236    }, this.setHtml = function(e) {
3237        if (o = e, "strip" == n.panelType) var t = a.strippanel_enable_handle;
3238        else t = a.gridpanel_enable_handle;
3239        if (1 == t && ((l = new UGPanelHandle).init(r, o, a, n.panelType, d), l.setHtml()), !0 === n.isDisabledAtStart) {
3240            o.append("<div class='ug-overlay-disabled'></div>"), setTimeout(function() {
3241                o.children(".ug-overlay-disabled").hide()
3242            }, n.disabledAtStartTimeout)
3243        }
3244    }, this.placeElements = function() {
3245        l && l.placeHandle()
3246    }, this.initEvents = function() {
3247        l && (l.initEvents(), u.on(d.events.SLIDER_ACTION_START, function() {
3248            l.hideHandle()
3249        }), u.on(d.events.SLIDER_ACTION_END, function() {
3250            l.showHandle()
3251        }))
3252    }, this.destroy = function() {
3253        l && (l.destroy(), u.off(d.events.SLIDER_ACTION_START), u.off(d.events.SLIDER_ACTION_END))
3254    }, this.openPanel = function(a) {
3255        if (!a) a = !1;
3256        return !o.is(":animated") && (0 != n.isClosed && (n.isClosed = !1, s.trigger(r.events.OPEN_PANEL), void(!1 === a ? e(n.originalPos, i) : (t(n.originalPos), i()))))
3257    }, this.closePanel = function(a) {
3258        if (!a) a = !1;
3259        if (o.is(":animated")) return !1;
3260        if (1 == n.isClosed) return !1;
3261        var l = c.getClosedPanelDest();
3262        n.isClosed = !0, s.trigger(r.events.CLOSE_PANEL), !1 === a ? e(l, i) : (t(l), i())
3263    }, this.setClosedState = function(e) {
3264        n.originalPos = e, s.trigger(r.events.CLOSE_PANEL), n.isClosed = !0
3265    }, this.setOpenedState = function() {
3266        s.trigger(r.events.OPEN_PANEL), n.isClosed = !1
3267    }, this.getClosedPanelDest = function() {
3268        var e, t = p.getElementSize(o);
3269        switch (n.orientation) {
3270            case "left":
3271                n.originalPos = t.left, e = -n.panelWidth;
3272                break;
3273            case "right":
3274                n.originalPos = t.left, e = d.getSize().width;
3275                break;
3276            case "top":
3277                n.originalPos = t.top, e = -n.panelHeight;
3278                break;
3279            case "bottom":
3280                n.originalPos = t.top, e = d.getSize().height
3281        }
3282        return e
3283    }, this.isPanelClosed = function() {
3284        return n.isClosed
3285    }, this.setDisabledAtStart = function(e) {
3286        return !(0 >= e) && (n.isDisabledAtStart = !0, void(n.disabledAtStartTimeout = e))
3287    }
3288}
3289
3290function UGPanelHandle() {
3291    function e() {
3292        r.removeClass("ug-button-hover")
3293    }
3294
3295    function t(e) {
3296        return e.stopPropagation(), e.stopImmediatePropagation(), 0 == o.validateClickTouchstartEvent(e.type) || void(n.isPanelClosed() ? n.openPanel() : n.closePanel())
3297    }
3298    var i, n, r, o = new UGFunctions,
3299        a = {
3300            panel_handle_align: "top",
3301            panel_handle_offset: 0,
3302            panel_handle_skin: 0
3303        };
3304    this.init = function(e, t, r, o, s) {
3305        switch (n = e, i = t, o) {
3306            case "grid":
3307                a.panel_handle_align = r.gridpanel_handle_align, a.panel_handle_offset = r.gridpanel_handle_offset, a.panel_handle_skin = r.gridpanel_handle_skin;
3308                break;
3309            case "strip":
3310                a.panel_handle_align = r.strippanel_handle_align, a.panel_handle_offset = r.strippanel_handle_offset, a.panel_handle_skin = r.strippanel_handle_skin;
3311                break;
3312            default:
3313                throw new Error("Panel handle error: wrong panel type: " + o)
3314        }
3315        var l = s.getOptions().gallery_skin;
3316        "" == a.panel_handle_skin && (a.panel_handle_skin = l)
3317    }, this.setHtml = function() {
3318        var e = "ug-panel-handle-tip";
3319        switch (n.getOrientation()) {
3320            case "right":
3321                e += " ug-handle-tip-left";
3322                break;
3323            case "left":
3324                e += " ug-handle-tip-right";
3325                break;
3326            case "bottom":
3327                e += " ug-handle-tip-top";
3328                break;
3329            case "top":
3330                e += " ug-handle-tip-bottom"
3331        }
3332        i.append("<div class='" + e + " ug-skin-" + a.panel_handle_skin + "'></div>"), r = i.children(".ug-panel-handle-tip")
3333    }, this.initEvents = function() {
3334        o.addClassOnHover(r), r.bind("click touchstart", t), jQuery(n).on(n.events.OPEN_PANEL, function() {
3335            e(), r.removeClass("ug-button-closed")
3336        }), jQuery(n).on(n.events.CLOSE_PANEL, function() {
3337            e(), r.addClass("ug-button-closed")
3338        })
3339    }, this.destroy = function() {
3340        o.destroyButton(r), jQuery(n).off(n.events.OPEN_PANEL), jQuery(n).off(n.events.CLOSE_PANEL)
3341    }, this.placeHandle = function() {
3342        var e = o.getElementSize(r);
3343        ! function() {
3344            switch (n.getOrientation()) {
3345                case "right":
3346                case "left":
3347                    "top" != a.panel_handle_align && "bottom" != a.panel_handle_align && (a.panel_handle_align = "top");
3348                    break;
3349                case "bottom":
3350                    "left" != a.panel_handle_align && "right" != a.panel_handle_align && (a.panel_handle_align = "left");
3351                    break;
3352                case "top":
3353                    "left" != a.panel_handle_align && "right" != a.panel_handle_align && (a.panel_handle_align = "right")
3354            }
3355        }();
3356        var t = n.getOrientation();
3357        switch (t) {
3358            case "left":
3359                o.placeElement(r, "right", a.panel_handle_align, -e.width);
3360                break;
3361            case "right":
3362                o.placeElement(r, -e.width, a.panel_handle_align, 0, a.panel_handle_offset);
3363                break;
3364            case "top":
3365                o.placeElement(r, a.panel_handle_align, "bottom", a.panel_handle_offset, -e.height);
3366                break;
3367            case "bottom":
3368                o.placeElement(r, a.panel_handle_align, "top", a.panel_handle_offset, -e.height);
3369                break;
3370            default:
3371                throw new Error("Wrong panel orientation: " + t)
3372        }
3373    }, this.hideHandle = function() {
3374        1 == r.is(":visible") && r.hide()
3375    }, this.showHandle = function() {
3376        0 == r.is(":visible") && r.show()
3377    }
3378}
3379
3380function UGStripPanel() {
3381    function e() {
3382        return (1 != E.isFirstRun || 0 != function() {
3383            if (0 == y.strippanel_vertical_type) {
3384                if (0 == E.panelWidth) throw new Error("Strip panel error: The width not set, please set width")
3385            } else if (0 == E.panelHeight) throw new Error("Strip panel error: The height not set, please set height");
3386            if (null == E.orientation) throw new Error("Wrong orientation, please set panel orientation before run");
3387            return !0
3388        }()) && (v.run(), i(), n(), function() {
3389            if (1 == E.isEventsInited) return !1;
3390            if (E.isEventsInited = !0, p)
3391                if (f.addClassOnHover(p, "ug-button-hover"), f.addClassOnHover(g, "ug-button-hover"), f.setButtonOnClick(g, o), f.setButtonOnClick(p, r), "advance_item" != y.strippanel_buttons_role) jQuery(v).on(v.events.STRIP_MOVE, s), u.on(m.events.SIZE_CHANGE, a);
3392                else {
3393                    var e = m.getOptions();
3394                    0 == e.gallery_carousel && jQuery(m).on(m.events.ITEM_CHANGE, l)
3395                }
3396            b.initEvents()
3397        }(), E.isFirstRun = !1, void a())
3398    }
3399
3400    function t(e) {
3401        if (!e) e = d;
3402        if (e.append("<div class='ug-strip-panel'></div>"), c = e.children(".ug-strip-panel"), 1 == y.strippanel_enable_buttons) {
3403            var t = "ug-strip-arrow-left",
3404                i = "ug-strip-arrow-right";
3405            1 == y.strippanel_vertical_type && (t = "ug-strip-arrow-up", i = "ug-strip-arrow-down"), c.append("<div class='ug-strip-arrow " + t + " ug-skin-" + y.strippanel_buttons_skin + "'><div class='ug-strip-arrow-tip'></div></div>"), c.append("<div class='ug-strip-arrow " + i + " ug-skin-" + y.strippanel_buttons_skin + "'><div class='ug-strip-arrow-tip'></div></div>")
3406        }
3407        b.setHtml(c), v.setHtml(c), 1 == y.strippanel_enable_buttons && (g = c.children("." + t), p = c.children("." + i)), "" != y.strippanel_background_color && c.css("background-color", y.strippanel_background_color)
3408    }
3409
3410    function i() {
3411        0 == y.strippanel_vertical_type ? function() {
3412            var e = v.getHeight(),
3413                t = E.panelWidth;
3414            if (p) {
3415                g.height(e), p.height(e);
3416                var i = g.children(".ug-strip-arrow-tip");
3417                f.placeElement(i, "center", "middle");
3418                var n = p.children(".ug-strip-arrow-tip");
3419                f.placeElement(n, "center", "middle")
3420            }
3421            var r = e + y.strippanel_padding_top + y.strippanel_padding_bottom;
3422            c.width(t), c.height(r), E.panelHeight = r;
3423            var o = t - y.strippanel_padding_left - y.strippanel_padding_right;
3424            p && (o = o - 2 * p.outerWidth() - 2 * y.strippanel_padding_buttons), v.resize(o)
3425        }() : function() {
3426            var e = v.getWidth(),
3427                t = E.panelHeight;
3428            if (p) {
3429                g.width(e), p.width(e);
3430                var i = g.children(".ug-strip-arrow-tip");
3431                f.placeElement(i, "center", "middle");
3432                var n = p.children(".ug-strip-arrow-tip");
3433                f.placeElement(n, "center", "middle")
3434            }
3435            var r = e + y.strippanel_padding_left + y.strippanel_padding_right;
3436            c.width(r), c.height(t), E.panelWidth = r;
3437            var o = t - y.strippanel_padding_top - y.strippanel_padding_bottom;
3438            p && (o = o - 2 * p.outerHeight() - 2 * y.strippanel_padding_buttons), v.resize(o)
3439        }()
3440    }
3441
3442    function n() {
3443        0 == y.strippanel_vertical_type ? function() {
3444            p && (f.placeElement(g, "left", "top", y.strippanel_padding_left, y.strippanel_padding_top), f.placeElement(p, "right", "top", y.strippanel_padding_right, y.strippanel_padding_top));
3445            var e = y.strippanel_padding_left;
3446            p && (e += p.outerWidth() + y.strippanel_padding_buttons), v.setPosition(e, y.strippanel_padding_top)
3447        }() : function() {
3448            p && (f.placeElement(g, "left", "top", y.strippanel_padding_left, y.strippanel_padding_top), f.placeElement(p, "left", "bottom", y.strippanel_padding_left, y.strippanel_padding_bottom));
3449            var e = y.strippanel_padding_top;
3450            p && (e += p.outerHeight() + y.strippanel_padding_buttons), v.setPosition(y.strippanel_padding_left, e)
3451        }(), b.placeElements()
3452    }
3453
3454    function r(e) {
3455        return !!f.isButtonDisabled(e) || void("advance_item" == y.strippanel_buttons_role ? m.nextItem() : v.scrollForeward())
3456    }
3457
3458    function o(e) {
3459        return !!f.isButtonDisabled(e) || void("advance_item" == y.strippanel_buttons_role ? m.prevItem() : v.scrollBack())
3460    }
3461
3462    function a() {
3463        if (!p) return !0;
3464        if (0 == v.isMoveEnabled()) return f.disableButton(g), f.disableButton(p), !0;
3465        var e = v.getInnerStripLimits(),
3466            t = v.getInnerStripPos();
3467        t >= e.maxPos ? f.disableButton(g) : f.enableButton(g), t <= e.minPos ? f.disableButton(p) : f.enableButton(p)
3468    }
3469
3470    function s() {
3471        a()
3472    }
3473
3474    function l() {
3475        m.isLastItem() ? f.disableButton(p) : f.enableButton(p), m.isFirstItem() ? f.disableButton(g) : f.enableButton(g)
3476    }
3477    var u, d, c, p, g, h = this,
3478        _ = jQuery(this),
3479        m = new UniteGalleryMain,
3480        f = new UGFunctions,
3481        v = new UGThumbsStrip,
3482        b = new UGPanelsBase;
3483    this.events = {
3484        FINISH_MOVE: "gridpanel_move_finish",
3485        OPEN_PANEL: "open_panel",
3486        CLOSE_PANEL: "close_panel"
3487    };
3488    var y = {
3489            strippanel_vertical_type: !1,
3490            strippanel_padding_top: 8,
3491            strippanel_padding_bottom: 8,
3492            strippanel_padding_left: 0,
3493            strippanel_padding_right: 0,
3494            strippanel_enable_buttons: !0,
3495            strippanel_buttons_skin: "",
3496            strippanel_padding_buttons: 2,
3497            strippanel_buttons_role: "scroll_strip",
3498            strippanel_enable_handle: !0,
3499            strippanel_handle_align: "top",
3500            strippanel_handle_offset: 0,
3501            strippanel_handle_skin: "",
3502            strippanel_background_color: ""
3503        },
3504        w = {
3505            strip_vertical_type: !0,
3506            strippanel_padding_left: 8,
3507            strippanel_padding_right: 8,
3508            strippanel_padding_top: 0,
3509            strippanel_padding_bottom: 0
3510        },
3511        x = {
3512            strippanel_padding_left: 8,
3513            strippanel_padding_right: 8,
3514            strippanel_padding_top: 8,
3515            strippanel_padding_bottom: 8
3516        },
3517        E = {
3518            panelType: "strip",
3519            panelWidth: 0,
3520            panelHeight: 0,
3521            isEventsInited: !1,
3522            isClosed: !1,
3523            orientation: null,
3524            originalPos: null,
3525            isFirstRun: !0
3526        };
3527    this.destroy = function() {
3528        p && (f.destroyButton(p), f.destroyButton(g), jQuery(v).off(v.events.STRIP_MOVE), jQuery(m).off(m.events.ITEM_CHANGE), jQuery(m).off(m.events.SIZE_CHANGE)), b.destroy(), v.destroy()
3529    }, this.getOrientation = function() {
3530        return E.orientation
3531    }, this.setOrientation = function(e) {
3532        E.orientation = e
3533    }, this.init = function(e, t) {
3534        ! function(e, t) {
3535            m = e, u = jQuery(m);
3536            var i = !1;
3537            1 == (y = jQuery.extend(y, t)).strippanel_vertical_type && (y = jQuery.extend(y, w), i = !0), 0 == y.strippanel_enable_buttons && (y = jQuery.extend(y, x), i = !0), 1 == i && (y = jQuery.extend(y, t));
3538            var n = m.getOptions().gallery_skin;
3539            "" == y.strippanel_buttons_skin && (y.strippanel_buttons_skin = n), d = m.getElement(), b.init(m, E, h, y, _), m.initThumbsPanel
3539("strip", y);
3540            var r = m.getObjects();
3541            v = r.g_objThumbs
3542        }(e, t)
3543    }, this.run = function() {
3544        e()
3545    }, this.setHtml = function(e) {
3546        t(e)
3547    }, this.getElement = function() {
3548        return c
3549    }, this.getSize = function() {
3550        return f.getElementSize(c)
3551    }, this.setWidth = function(e) {
3552        E.panelWidth = e
3553    }, this.setHeight = function(e) {
3554        E.panelHeight = e
3555    }, this.resize = function(e) {
3556        h.setWidth(e), i(), n()
3557    }, this.__________Functions_From_Base_____ = function() {}, this.isPanelClosed = function() {
3558        return b.isPanelClosed()
3559    }, this.getClosedPanelDest = function() {
3560        return b.getClosedPanelDest()
3561    }, this.openPanel = function(e) {
3562        b.openPanel(e)
3563    }, this.closePanel = function(e) {
3564        b.closePanel(e)
3565    }, this.setOpenedState = function(e) {
3566        b.setOpenedState(e)
3567    }, this.setClosedState = function(e) {
3568        b.setClosedState(e)
3569    }, this.setCustomThumbs = function(e) {
3570        v.setCustomThumbs(e)
3571    }, this.setDisabledAtStart = function(e) {
3572        b.setDisabledAtStart(e)
3573    }
3574}
3575
3576function UGGridPanel() {
3577    function e() {
3578        if (null == v.orientation) throw new Error("Wrong orientation, please set panel orientation before run")
3579    }
3580
3581    function t() {
3582        var t;
3583        e(), "center" == _.gridpanel_grid_align && (_.gridpanel_grid_align = "middle"), g.run(),
3584            function() {
3585                var e = !1;
3586                if (1 == _.gridpanel_arrows_always_on) e = !0;
3587                else {
3588                    var t = g.getNumPanes();
3589                    t > 1 && (e = !0)
3590                }
3591                1 == e ? (s.show().fadeTo(0, 1), l.show().fadeTo(0, 1), v.arrowsVisible = !0) : (s.hide(), l.hide(), v.arrowsVisible = !1)
3592            }(), t = g.getSize(), 1 == v.isHorType ? v.panelHeight = t.height + _.gridpanel_padding_border_top + _.gridpanel_padding_border_bottom : v.panelWidth = t.width + _.gridpanel_padding_border_left + _.gridpanel_padding_border_right, p.setElementSize(a, v.panelWidth, v.panelHeight), 0 == v.isHorType ? 1 == _.gridpanel_vertical_scroll ? 1 == v.arrowsVisible ? function() {
3593                var e, t, i, r, o = p.getElementSize(l),
3594                    a = g.getSize();
3595                switch (_.gridpanel_grid_align) {
3596                    default:
3597                        case "top":
3598                        e = _.gridpanel_padding_border_top + o.height + _.gridpanel_arrows_padding_vert;
3599                    break;
3600                    case "middle":
3601                            e = "middle";
3602                        break;
3603                    case "bottom":
3604                            e = v.panelHeight - a.height - o.height - _.gridpanel_padding_border_bottom - _.gridpanel_arrows_padding_vert
3605                }
3606                var u = n(),
3607                    d = g.getElement();
3608                p.placeElement(d, u, e);
3609                var a = g.getSize();
3610                switch (_.gridpanel_arrows_align_vert) {
3611                    default:
3612                        case "center":
3613                        case "middle":
3614                        t = (a.top - o.height) / 2,
3615                    i = a.bottom + (v.panelHeight - a.bottom - o.height) / 2,
3616                    r = 0;
3617                    break;
3618                    case "grid":
3619                            t = a.top - o.height - _.gridpanel_arrows_padding_vert_vert,
3620                        i = a.bottom + _.gridpanel_arrows_padding_vert,
3621                        r = 0;
3622                        break;
3623                    case "border":
3624                            case "borders":
3625                            t = _.gridpanel_padding_border_top,
3626                        i = "bottom",
3627                        r = _.gridpanel_padding_border_bottom
3628                }
3629                p.placeElement(l, "center", t), p.placeElement(s, "center", i, 0, r)
3630            }() : r() : 1 == v.arrowsVisible ? function() {
3631                var e, t, i, r = p.getElementSize(l),
3632                    o = g.getSize(),
3633                    a = _.gridpanel_padding_border_top;
3634                switch (_.gridpanel_grid_align) {
3635                    case "middle":
3636                        switch (_.gridpanel_arrows_align_vert) {
3637                            default: var u = o.height + _.gridpanel_arrows_padding_vert + r.height;a = (v.panelHeight - u) / 2;
3638                            break;
3639                            case "border":
3640                                    case "borders":
3641                                    var d = v.panelHeight - r.height - _.gridpanel_padding_border_bottom;a = (d - o.height) / 2
3642                        }
3643                        break;
3644                    case "bottom":
3645                        var u = o.height + r.height + _.gridpanel_arrows_padding_vert;
3646                        a = v.panelHeight - u - _.gridpanel_padding_border_bottom
3647                }
3648                var c = g.getElement(),
3649                    h = n();
3650                p.placeElement(c, h, a);
3651                var o = g.getSize();
3652                switch (_.gridpanel_arrows_align_vert) {
3653                    default:
3654                        case "center":
3655                        case "middle":
3656                        e = o.bottom + (v.panelHeight - o.bottom - r.height) / 2,
3657                    i = 0;
3658                    break;
3659                    case "grid":
3660                            e = o.bottom + _.gridpanel_arrows_padding_vert,
3661                        i = 0;
3662                        break;
3663                    case "border":
3664                            case "borders":
3665                            e = "bottom",
3666                        i = _.gridpanel_padding_border_bottom
3667                }
3668                t = -r.width / 2 - _.gridpanel_space_between_arrows / 2, p.placeElement(l, "center", e, t, i);
3669                var m = Math.abs(t);
3670                p.placeElement(s, "center", e, m, i)
3671            }() : r() : 1 == v.arrowsVisible ? function() {
3672                var e, t, i, n, r = p.getElementSize(l),
3673                    o = g.getSize();
3674                switch (_.gridpanel_grid_align) {
3675                    default:
3676                        case "left":
3677                        e = _.gridpanel_padding_border_left + _.gridpanel_arrows_padding_hor + r.width;
3678                    break;
3679                    case "middle":
3680                            case "center":
3681                            e = "center";
3682                        break;
3683                    case "right":
3684                            e = v.panelWidth - o.width - r.width - _.gridpanel_padding_border_right - _.gridpanel_arrows_padding_hor
3685                }
3686                var a = g.getElement();
3687                switch (p.placeElement(a, e, _.gridpanel_padding_border_top), o = g.getSize(), _.gridpanel_arrows_align_vert) {
3688                    default:
3689                        case "center":
3690                        case "middle":
3691                        n = (o.height - r.height) / 2 + o.top;
3692                    break;
3693                    case "top":
3694                            n = _.gridpanel_padding_border_top + _.gridpanel_arrows_padding_vert;
3695                        break;
3696                    case "bottom":
3697                            n = v.panelHeight - _.gridpanel_padding_border_bottom - _.gridpanel_arrows_padding_vert - r.height
3698                }
3699                switch (_.gridpanel_arrows_align_hor) {
3700                    default:
3701                        case "borders":
3702                        t = _.gridpanel_padding_border_left,
3703                    i = v.panelWidth - _.gridpanel_padding_border_right - r.width;
3704                    break;
3705                    case "grid":
3706                            t = o.left - _.gridpanel_arrows_padding_hor - r.width,
3707                        i = o.right + _.gridpanel_arrows_padding_hor;
3708                        break;
3709                    case "center":
3710                            t = (o.left - r.width) / 2,
3711                        i = o.right + (v.panelWidth - o.right - r.width) / 2
3712                }
3713                p.placeElement(l, t, n), p.placeElement(s, i, n)
3714            }() : function() {
3715                var e, t = g.getSize();
3716                switch (_.gridpanel_grid_align) {
3717                    default:
3718                        case "left":
3719                        e = _.gridpanel_padding_border_left;
3720                    break;
3721                    case "middle":
3722                            case "center":
3723                            e = "center";
3724                        break;
3725                    case "right":
3726                            e = v.panelWidth - t.width - _.gridpanel_padding_border_right
3727                }
3728                var i = g.getElement();
3729                p.placeElement(i, e, _.gridpanel_padding_border_top)
3730            }(), h.placeElements(), 1 != v.isEventsInited && (v.isEventsInited = !0, l && (p.addClassOnHover(l), g.attachPrevPaneButton(l)), s && (p.addClassOnHover(s), g.attachNextPaneButton(s)), h.initEvents())
3731    }
3732
3733    function i() {
3734        o.append("<div class='ug-grid-panel'></div>"), a = o.children(".ug-grid-panel"), v.isHorType ? (a.append("<div class='grid-arrow grid-arrow-left-hortype ug-skin-" + _.gridpanel_arrows_skin + "'></div>"), a.append("<div class='grid-arrow grid-arrow-right-hortype ug-skin-" + _.gridpanel_arrows_skin + "'></div>"), l = a.children(".grid-arrow-left-hortype"), s = a.children(".grid-arrow-right-hortype")) : 0 == _.gridpanel_vertical_scroll ? (a.append("<div class='grid-arrow grid-arrow-left ug-skin-" + _.gridpanel_arrows_skin + "'></div>"), a.append("<div class='grid-arrow grid-arrow-right ug-skin-" + _.gridpanel_arrows_skin + "'></div>"), l = a.children(".grid-arrow-left"), s = a.children(".grid-arrow-right")) : (a.append("<div class='grid-arrow grid-arrow-up ug-skin-" + _.gridpanel_arrows_skin + "'></div>"), a.append("<div class='grid-arrow grid-arrow-down ug-skin-" + _.gridpanel_arrows_skin + "'></div>"), l = a.children(".grid-arrow-up"), s = a.children(".grid-arrow-down")), h.setHtml(a), l.fadeTo(0, 0), s.fadeTo(0, 0), c.initThumbsPanel("grid", _);
3735        var e = c.getObjects();
3736        (g = e.g_objThumbs).setHtml(a), "" != _.gridpanel_background_color && a.css("background-color", _.gridpanel_background_color)
3737    }
3738
3739    function n() {
3740        return _.gridpanel_padding_border_left
3741    }
3742
3743    function r() {
3744        var e = _.gridpanel_grid_align,
3745            t = 0;
3746        switch (e) {
3747            case "top":
3748                t = _.gridpanel_padding_border_top;
3749                break;
3750            case "bottom":
3751                t = _.gridpanel_padding_border_bottom
3752        }
3753        var i = n(),
3754            r = g.getElement();
3755        p.placeElement(r, i, e, 0, t)
3756    }
3757    var o, a, s, l, u = this,
3758        d = jQuery(this),
3759        c = new UniteGalleryMain,
3760        p = new UGFunctions,
3761        g = new UGThumbsGrid,
3762        h = new UGPanelsBase;
3763    this.events = {
3764        FINISH_MOVE: "gridpanel_move_finish",
3765        OPEN_PANEL: "open_panel",
3766        CLOSE_PANEL: "close_panel"
3767    };
3768    var _ = {
3769            gridpanel_vertical_scroll: !0,
3770            gridpanel_grid_align: "middle",
3771            gridpanel_padding_border_top: 10,
3772            gridpanel_padding_border_bottom: 4,
3773            gridpanel_padding_border_left: 10,
3774            gridpanel_padding_border_right: 10,
3775            gridpanel_arrows_skin: "",
3776            gridpanel_arrows_align_vert: "middle",
3777            gridpanel_arrows_padding_vert: 4,
3778            gridpanel_arrows_align_hor: "center",
3779            gridpanel_arrows_padding_hor: 10,
3780            gridpanel_space_between_arrows: 20,
3781            gridpanel_arrows_always_on: !1,
3782            gridpanel_enable_handle: !0,
3783            gridpanel_handle_align: "top",
3784            gridpanel_handle_offset: 0,
3785            gridpanel_handle_skin: "",
3786            gridpanel_background_color: ""
3787        },
3788        m = {
3789            gridpanel_grid_align: "middle",
3790            gridpanel_padding_border_top: 2,
3791            gridpanel_padding_border_bottom: 2
3792        },
3793        f = {
3794            gridpanel_grid_align: "center"
3795        },
3796        v = {
3797            panelType: "grid",
3798            isHorType: !1,
3799            arrowsVisible: !1,
3800            panelHeight: 0,
3801            panelWidth: 0,
3802            originalPosX: null,
3803            isEventsInited: !1,
3804            isClosed: !1,
3805            orientation: null
3806        };
3807    this.destroy = function() {
3808        l && p.destroyButton(l), s && p.destroyButton(s), h.destroy(), g.destroy()
3809    }, this.getOrientation = function() {
3810        return v.orientation
3811    }, this.setOrientation = function(e) {
3812        switch (v.orientation = e, e) {
3813            case "right":
3814            case "left":
3815                v.isHorType = !1;
3816                break;
3817            case "top":
3818            case "bottom":
3819                v.isHorType = !0;
3820                break;
3821            default:
3822                throw new Error("Wrong grid panel orientation: " + e)
3823        }
3824    }, this.setHeight = function(e) {
3825        if (1 == v.isHorType) throw new Error("setHeight is not appliable to this orientatio (" + v.orientation + "). Please use setWidth");
3826        v.panelHeight = e;
3827        var t, i, n = (t = _.gridpanel_padding_border_top + _.gridpanel_padding_border_bottom, i = v.panelHeight - t, 0 == _.gridpanel_arrows_always_on && 1 == g.getNumPanesEstimationByHeight(i) ? i : (t = p.getElementSize(s).height + _.gridpanel_arrows_padding_vert, 1 == _.gridpanel_vertical_scroll && (t *= 2), t += _.gridpanel_padding_border_top + _.gridpanel_padding_border_bottom, v.panelHeight - t));
3828        g.setMaxHeight(n)
3829    }, this.setWidth = function(e) {
3830        if (0 == v.isHorType) throw new Error("setWidth is not appliable to this orientatio (" + v.orientation + "). Please use setHeight");
3831        v.panelWidth = e;
3832        var t, i, n = (t = _.gridpanel_padding_border_left + _.gridpanel_padding_border_right, i = v.panelWidth - t, 0 == _.gridpanel_arrows_always_on && 1 == g.getNumPanesEstimationByWidth(i) ? i : (t += 2 * (p.getElementSize(s).width + _.gridpanel_arrows_padding_hor), v.panelWidth - t));
3833        g.setMaxWidth(n)
3834    }, this.init = function(t, i) {
3835        ! function(t, i) {
3836            c = t, e(), i && i.vertical_scroll && (_.gridpanel_vertical_scroll = i.vertical_scroll), _ = jQuery.extend(_, i), 1 == v.isHorType ? (_ = jQuery.extend(_, f), _ = jQuery.extend(_, i)) : 1 == _.gridpanel_vertical_scroll && (_ = jQuery.extend(_, m), (_ = jQuery.extend(_, i)).grid_panes_direction = "bottom");
3837            var n = c.getOptions().gallery_skin;
3838            "" == _.gridpanel_arrows_skin && (_.gridpanel_arrows_skin = n);
3839            var r = t.getObjects();
3840            o = r.g_objWrapper, h.init(c, v, u, _, d)
3841        }(t, i)
3842    }, this.setHtml = function() {
3843        i()
3844    }, this.run = function() {
3845        t()
3846    }, this.getElement = function() {
3847        return a
3848    }, this.getSize = function() {
3849        return p.getElementSize(a)
3850    }, this.__________Functions_From_Base_____ = function() {}, this.isPanelClosed = function() {
3851        return h.isPanelClosed()
3852    }, this.getClosedPanelDest = function() {
3853        return h.getClosedPanelDest()
3854    }, this.openPanel = function(e) {
3855        h.openPanel(e)
3856    }, this.closePanel = function(e) {
3857        h.closePanel(e)
3858    }, this.setOpenedState = function(e) {
3859        h.setOpenedState(e)
3860    }, this.setClosedState = function(e) {
3861        h.setClosedState(e)
3862    }, this.setDisabledAtStart = function(e) {
3863        h.setDisabledAtStart(e)
3864    }
3865}
3866
3867function UGThumbsGrid() {
3868    function e(e, t, i) {
3869        var n;
3870        v = e.getObjects(), T = e, f = jQuery(e), b = v.g_objWrapper, y = v.g_arrItems, !0 === i && (A.isTilesMode = !0), A.numThumbs = y.length, n = t, C = jQuery.extend(C, n), j.setOptions(n), A.isNavigationVertical = "top" == C.grid_panes_direction || "bottom" == C.grid_panes_direction, 1 == A.isTilesMode ? (P.setFixedMode(), P.setApproveClickFunction(c), P.init(e, C), j = P.getObjThumbs()) : (t.thumb_fixed_size = !0, j.init(e, t))
3871    }
3872
3873    function t() {
3874        var e = T.getSelectedItem();
3875        if (function() {
3876                if (0 == A.isHorizontal) {
3877                    if (0 == A.gridHeight) throw new Error("You must set height before run.")
3878                } else if (0 == A.gridWidth) throw new Error("You must set width before run.")
3879            }(), 1 == A.isFirstTimeRun && (1 == A.isTilesMode ? (n(), P.run()) : (j.setHtmlProperties(), n(), j.loadThumbsImages()), function() {
3880                if (0 == A.isTilesMode) {
3881                    j.initEvents();
3882                    var e = w.find(".ug-thumb-wrapper");
3883                    e.on("click touchend", p), f.on(T.events.ITEM_CHANGE, m)
3884                } else P.initEvents();
3885                w.bind("mousedown touchstart", g), jQuery("body").bind("mousemove touchmove", h), jQuery(window).add("body").bind("mouseup touchend", _)
3886            }()), 0 == A.isHorizontal ? A.isNavigationVertical ? function() {
3887                var e = x.children(".ug-thumb-wrapper"),
3888                    t = 0,
3889                    n = 0,
3890                    r = 0,
3891                    o = 0,
3892                    a = 0,
3893                    s = 0;
3894                A.innerWidth = 0, A.numPanes = 1, A.arrPanes = [], A.numThumbsInPane = 0, A.arrPanes.push(a);
3895                var l = e.length;
3896                for (i = 0; l > i; i++) {
3897                    var u = jQuery(e[i]);
3898                    S.placeElement(u, t, n);
3899                    var d = u.outerWidth(),
3900                        c = u.outerHeight();
3901                    t += d + C.grid_space_between_cols;
3902                    var p = n + c;
3903                    p > r && (r = p), ++o >= C.grid_num_cols && (n += c + C.grid_space_between_rows, t = a, o = 0), 1 == A.numPanes && A.numThumbsInPane++, p = n + c;
3904                    var g = s + A.gridHeight;
3905                    p > g && (1 == A.isMaxHeight && 1 == A.numPanes && (A.gridHeight = r, w.height(A.gridHeight), g = A.gridHeight), n = g + C.grid_space_between_rows, s = n, t = a = 0, o = 0, l - 1 > i && (A.numPanes++, A.arrPanes.push(n)))
3906                }
3907                x.height(r), A.innerHeight = r, 1 == A.isMaxHeight && 1 == A.numPanes && (A.gridHeight = r, w.height(r))
3908            }() : function() {
3909                var e = x.children(".ug-thumb-wrapper"),
3910                    t = 0,
3911                    n = 0,
3912                    r = 0,
3913                    o = 0,
3914                    a = 0,
3915                    s = 0;
3916                A.innerWidth = 0, A.numPanes = 1, A.arrPanes = [], A.numThumbsInPane = 0, A.arrPanes.push(o);
3917                var l = e.length;
3918                for (i = 0; l > i; i++) {
3919                    var u = jQuery(e[i]);
3920                    S.placeElement(u, t, n);
3921                    var d = u.outerWidth(),
3922                        c = u.outerHeight();
3923                    t > a && (a = t);
3924                    var p = n + c;
3925                    p > s && (s = p);
3926                    var g = a + d;
3927                    g > A.innerWidth && (A.innerWidth = g), t += d + C.grid_space_between_cols, ++r >= C.grid_num_cols && (n += c + C.grid_space_between_rows, t = o, r = 0), 1 == A.numPanes && A.numThumbsInPane++, n + c > A.gridHeight && (n = 0, o = A.innerWidth + C.grid_space_between_cols, t = o, r = 0, 1 == A.isMaxHeight && 1 == A.numPanes && (A.gridHeight = s, w.height(A.gridHeight)), l - 1 > i && (A.numPanes++, A.arrPanes.push(o)))
3928                }
3929                x.width(A.innerWidth), 1 == A.isMaxHeight && 1 == A.numPanes && (A.gridHeight = s, w.height(s))
3930            }() : function() {
3931                var e = x.children(".ug-thumb-wrapper"),
3932                    t = C.grid_padding,
3933                    n = C.grid_padding,
3934                    r = n,
3935                    o = t,
3936                    a = 0,
3937                    s = 0,
3938                    l = 0,
3939                    u = 0;
3940                A.innerWidth = 0, A.numPanes = 1, A.arrPanes = [], A.numThumbsInPane = 0, A.arrPanes.push(t - C.grid_padding);
3941                var d = e.length;
3942                for (i = 0; d > i; i++) {
3943                    var c = jQuery(e[i]),
3944                        p = c.outerWidth(),
3945                        g = c.outerHeight();
3946                    o - t + p > A.gridWidth && (r = 0, ++u >= C.grid_num_rows ? (u = 0, t = o, l = 0, r = n, 1 == A.numPanes && (A.gridWidth = a + C.grid_padding, w.width(A.gridWidth)), A.numPanes++, A.arrPanes.push(t - C.grid_padding)) : (o = t, r = l + C.grid_space_between_rows)), S.placeElement(c, o, r);
3947                    var h = o + p;
3948                    h > a && (a = h);
3949                    var _ = r + g;
3950                    _ > l && (l = _), _ > s && (s = _);
3951                    var h = a + p;
3952                    h > A.innerWidth && (A.innerWidth = h), o += p + C.grid_space_between_cols, 1 == A.numPanes && A.numThumbsInPane++
3953                }
3954                A.innerWidth = a, A.innerHeight = l, x.width(A.innerWidth), x.height(A.innerHeight), 1 == A.numPanes && (A.gridWidth = a + C.grid_padding, A.gridHeight = s + C.grid_padding, w.width(A.gridWidth), w.height(A.gridHeight))
3955            }(), 1 == A.isFirstTimeRun && A.isTilesMode) {
3956            var t = j.getThumbs();
3957            t.each(function(e, t) {
3958                b.trigger(A.eventSizeChange, jQuery(t))
3959            }), t.fadeTo(0, 1)
3960        }
3961        null != e && r(e.index), I.trigger(E.events.PANE_CHANGE, A.currentPane), A.isFirstTimeRun = !1
3962    }
3963
3964    function n() {
3965        var e, t, i, n, r, o, a, s;
3966        0 == A.isHorizontal ? (r = x.children(".ug-thumb-wrapper"), o = jQuery(r[0]).outerWidth(), a = C.grid_num_cols * o + (C.grid_num_cols - 1) * C.grid_space_between_cols + 2 * C.grid_padding, s = A.gridHeight, A.gridWidth = a, S.setElementSize(w, a, s), S.setElementSize(x, a, s), A.innerWidth = a, A.innerHeight = s) : (e = x.children(".ug-thumb-wrapper"), t = jQuery(e[0]).outerHeight(), i = A.gridWidth, n = C.grid_num_rows * t + (C.grid_num_rows - 1) * C.grid_space_between_rows + 2 * C.grid_padding, A.gridHeight = n, S.setElementSize(w, i, n), S.setElementSize(x, i, n), A.innerWidth = i, A.innerHeight = n)
3967    }
3968
3969    function r(e) {
3970        var t = u(e);
3971        return -1 != t && void E.gotoPane(t, "scroll")
3972    }
3973
3974    function o(e) {
3975        var t = s(e);
3976        return 0 != t && void x.stop(!0).animate(t, {
3977            duration: C.grid_transition_duration,
3978            easing: C.grid_transition_easing,
3979            queue: !1
3980        })
3981    }
3982
3983    function a() {
3984        o(-A.arrPanes[A.currentPane])
3985    }
3986
3987    function s(e) {
3988        var t = {};
3989        return 1 == A.isNavigationVertical ? t.top = e + "px" : t.left = e + "px", t
3990    }
3991
3992    function l() {
3993        var e = S.getElementSize(x);
3994        return 1 == A.isNavigationVertical ? e.top : e.left
3995    }
3996
3997    function u(e) {
3998        return 0 == function(e) {
3999            if (0 > e || e >= A.numThumbs) throw new Error("Thumb not exists: " + e);
4000            return !0
4001        }(e) ? -1 : Math.floor(e / A.numThumbsInPane)
4002    }
4003
4004    function d() {
4005        var e = S.getStoredEventData(A.storedEventID),
4006            t = l();
4007        diffPos = Math.abs(e.startInnerPos - t);
4008        var i = 1 == A.isNavigationVertical ? A.gridHeight : A.gridWidth,
4009            n = Math.round(3 * i / 8);
4010        return diffPos >= n || e.diffTime < 300 && diffPos > 25
4011    }
4012
4013    function c() {
4014        return 1 == A.numPanes || S.isApproveStoredEventClick(A.storedEventID, A.isNavigationVertical)
4015    }
4016
4017    function p() {
4018        if (1 == function() {
4019                if (1 == A.numPanes) return !1;
4020                var e = S.getStoredEventData(A.storedEventID),
4021                    t = e.diffTime,
4022                    i = l(),
4023                    n = Math.abs(i - e.startInnerPos);
4024                return n > 30 || n > 5 && t > 300
4025            }()) return !0;
4026        var e = jQuery(this),
4027            t = j.getItemByThumb(e);
4028        T.selectItem(t)
4029    }
4030
4031    function g(e) {
4032        if (1 == A.numPanes) return !0;
4033        if (1 == A.touchActive) return !0;
4034        0 == A.isTilesMode && e.preventDefault(), A.touchActive = !0;
4035        var t = {
4036            startInnerPos: l()
4037        };
4038        S.storeEventData(e, A.storedEventID, t)
4039    }
4040
4041    function h(e) {
4042        if (0 == A.touchActive) return !0;
4043        e.preventDefault(), S.updateStoredEventData(e, A.storedEventID);
4044        var t = S.getStoredEventData(A.storedEventID, A.isNavigationVertical);
4045        if (0 != C.grid_vertical_scroll_ondrag && 1 != A.isNavigationVertical && "vert" === S.handleScrollTop(A.storedEventID)) return !0;
4046        var i, n = t.diffMousePos,
4047            r = t.startInnerPos + n,
4048            o = n > 0 ? "prev" : "next",
4049            a = A.arrPanes[A.numPanes - 1];
4050        0 == C.grid_carousel && r > 0 && "prev" == o && (r /= 3), 0 == C.grid_carousel && -a > r && "next" == o && (r = t.startInnerPos + n / 3), 0 != (i = s(r)) && x.css(i)
4051    }
4052
4053    function _(e) {
4054        if (0 == A.touchActive) return !0;
4055        S.updateStoredEventData(e, A.storedEventID);
4056        var t = S.getStoredEventData(A.storedEventID, A.isNavigationVertical);
4057        if (A.touchActive = !1, 0 == d()) return a(), !0;
4058        "next" == (l() - t.startInnerPos > 0 ? "prev" : "next") ? 0 == C.grid_carousel && E.isLastPane() ? a() : E.nextPane(): 0 == C.grid_carousel && E.isFirstPane() ? a() : E.prevPane()
4059    }
4060
4061    function m() {
4062        var e = T.getSelectedItem();
4063        j.setThumbSelected(e.objThumbWrapper), r(e.index)
4064    }
4065    var f, v, b, y, w, x, E = this,
4066        I = jQuery(this),
4067        T = new UniteGalleryMain,
4068        S = new UGFunctions,
4069        j = new UGThumbsGeneral,
4070        P = new UGTileDesign,
4071        C = {
4072            grid_panes_direction: "left",
4073            grid_num_cols: 2,
4074            grid_num_rows: 2,
4075            grid_space_between_cols: 10,
4076            grid_space_between_rows: 10,
4077            grid_transition_duration: 300,
4078            grid_transition_easing: "easeInOutQuad",
4079            grid_carousel: !1,
4080            grid_padding: 0,
4081            grid_vertical_scroll_ondrag: !1
4082        };
4083    this.events = {
4084        PANE_CHANGE: "pane_change"
4085    };
4086    var A = {
4087        eventSizeChange: "thumb_size_change",
4088        isHorizontal: !1,
4089        isMaxHeight: !1,
4090        isMaxWidth: !1,
4091        gridHeight: 0,
4092        gridWidth: 0,
4093        innerWidth: 0,
4094        innerHeight: 0,
4095        numPanes: 0,
4096        arrPanes: 0,
4097        numThumbs: 0,
4098        currentPane: 0,
4099        numThumbsInPane: 0,
4100        isNavigationVertical: !1,
4101        touchActive: !1,
4102        startScrollPos: 0,
4103        isFirstTimeRun: !0,
4104        isTilesMode: !1,
4105        storedEventID: "thumbsgrid"
4106    };
4107    this.destroy = function() {
4108        if (0 == A.isTilesMode) {
4109            var e = w.find(".ug-thumb-wrapper");
4110            e.off("click"), e.off("touchend"), f.on(T.events.ITEM_CHANGE), j.destroy()
4111        } else P.destroy();
4112        w.unbind("mousedown"), w.unbind("touchstart"), jQuery("body").unbind("mousemove"), jQuery("body").unbind("touchmove"), jQuery(window).add("body").unbind("touchend"), jQuery(window).add("body").unbind("mouseup"), I.off(E.events.PANE_CHANGE)
4113    }, this.__________EXTERNAL_GENERAL_________ = function() {}, this.setThumbUnselected = function(e) {
4114        j.setThumbUnselected(e)
4115    }, this.isItemThumbVisible = function(e) {
4116        return u(e.index) == A.currentPane
4117    }, this.__________EXTERNAL_API_________ = function() {}, this.getNumPanesEstimationByHeight = function(e) {
4118        if (1 == A.isTilesMode) var t = C.tile_height;
4119        else {
4120            var i = j.getOptions();
4121            t = i.thumb_height
4122        }
4123        var n = j.getNumThumbs(),
4124            r = Math.ceil(n / C.grid_num_cols),
4125            o = r * t + (r - 1) * C.grid_space_between_rows;
4126        return Math.ceil(o / e)
4127    }, this.getNumPanesEstimationByWidth = function(e) {
4128        if (A.isTilesMode) var t = C.tile_width;
4129        else {
4130            var i = j.getOptions();
4131            t = i.thumb_width
4132        }
4133        var n = j.getNumThumbs(),
4134            r = Math.ceil(n / C.grid_num_rows),
4135            o = r * t + (r - 1) * C.grid_space_between_cols;
4136        return Math.ceil(o / e)
4137    }, this.getHeightEstimationByWidth = function(e) {
4138        if (0 == A.isTilesMode) throw new Error("This function works only with tiles mode");
4139        var t = j.getNumThumbs(),
4140            i = S.getNumItemsInSpace(e, C.tile_width, C.grid_space_between_cols),
4141            n = Math.ceil(t / i);
4142        return n > C.grid_num_rows && (n = C.grid_num_rows), S.getSpaceByNumItems(n, C.tile_height, C.grid_space_between_rows) + 2 * C.grid_padding
4143    }, this.getElement = function() {
4144        return w
4145    }, this.getSize = function() {
4146        return S.getElementSize(w)
4147    }, this.getNumPanes = function() {
4148        return A.numPanes
4149    }, this.isFirstPane = function() {
4150        return 0 == A.currentPane
4151    }, this.isLastPane = function() {
4152        return A.currentPane == A.numPanes - 1
4153    }, this.getPaneInfo = function() {
4154        return {
4155            pane: A.currentPane,
4156            total: A.numPanes
4157        }
4158    }, this.getPane = function() {
4159        return A.currentPane
4160    }, this.setWidth = function(e) {
4161        A.gridWidth = e, A.isHorizontal = !0
4162    }, this.setMaxWidth = function(e) {
4163        A.gridWidth = e, A.isMaxWidth = !0, A.isHorizontal = !0
4164    }, this.setHeight = function(e) {
4165        A.gridHeight = e, A.isHorizontal = !1
4166    }, this.setMaxHeight = function(e) {
4167        A.gridHeight = e, A.isMaxHeight = !0, A.isHorizontal = !1
4168    }, this.gotoPane = function(e) {
4169        if (0 == function(e) {
4170                if (e >= A.numPanes || 0 > e) throw new Error("Pane " + index + " doesn't exists.");
4171                return !0
4172            }(e)) return !1;
4173        if (e == A.currentPane) return !1;
4174        var t = -A.arrPanes[e];
4175        A.currentPane = e, o(t), I.trigger(E.events.PANE_CHANGE, e)
4176    }, this.nextPane = function() {
4177        var e = A.currentPane + 1;
4178        if (e >= A.numPanes) {
4179            if (0 == C.grid_carousel) return !0;
4180            e = 0
4181        }
4182        E.gotoPane(e, "next")
4183    }, this.prevPane = function() {
4184        var e = A.currentPane - 1;
4185        return !(0 > e && (e = A.numPanes - 1, 0 == C.grid_carousel)) && void E.gotoPane(e, "prev")
4186    }, this.attachNextPaneButton = function(e) {
4187        return S.setButtonOnClick(e, E.nextPane), 1 == C.grid_carousel || (E.isLastPane() && e.addClass("ug-button-disabled"), void I.on(E.events.PANE_CHANGE, function() {
4188            E.isLastPane() ? e.addClass("ug-button-disabled") : e.removeClass("ug-button-disabled")
4189        }))
4190    }, this.attachPrevPaneButton = function(e) {
4191        return S.setButtonOnClick(e, E.prevPane), 1 == C.grid_carousel || (E.isFirstPane() && e.addClass("ug-button-disabled"), void I.on(E.events.PANE_CHANGE, function() {
4192            E.isFirstPane() ? e.addClass("ug-button-disabled") : e.removeClass("ug-button-disabled")
4193        }))
4194    }, this.attachBullets = function(e) {
4195        e.setActive(A.currentPane), jQuery(e).on(e.events.BULLET_CLICK, function(t, i) {
4196            E.gotoPane(i, "theme"), e.setActive(i)
4197        }), jQuery(E).on(E.events.PANE_CHANGE, function(t, i) {
4198            e.setActive(i)
4199        })
4200    }, this.getObjTileDesign = function() {
4201        return P
4202    }, this.init = function(t, i, n) {
4203        e(t, i, n)
4204    }, this.run = function() {
4205        t()
4206    }, this.setHtml = function(e) {
4207        var t, i;
4208        i = b, (t = e) && (i = t), i.append("<div class='ug-thumbs-grid'><div class='ug-thumbs-grid-inner'></div></div>"), w = i.children(".ug-thumbs-grid"), x = w.children(".ug-thumbs-grid-inner"), 1 == A.isTilesMode ? P.setHtml(x) : j.setHtmlThumbs(x)
4209    }
4210}
4211
4212function UGTiles() {
4213    function e(e, t) {
4214        g_objects = e.getObjects(), w = e, m = jQuery(e), f = g_objects.g_objWrapper, g_objects.g_arrItems, S = jQuery.extend(S, t), E.init(e, S), I = E.getObjThumbs(), S.tiles_min_columns < 1 && (S.tiles_min_columns = 1), 0 != S.tiles_max_columns && S.tiles_max_columns < S.tiles_min_columns && (S.tiles_max_columns = S.tiles_min_columns)
4215    }
4216
4217    function t() {
4218        if (v.addClass("ug-tiles-rest-mode"), j.isTransInited = !0, 1 == S.tiles_enable_transition) {
4219            v.addClass("ug-tiles-transit");
4220            var e = E.getOptions();
4221            1 == e.tile_enable_image_effect && 0 == e.tile_image_effect_reverse && v.addClass("ug-tiles-transit-overlays"), j.isTransActive = !0
4222        }
4223    }
4224
4225    function i() {
4226        return x.getElementSize(v).width
4227    }
4228
4229    function n() {
4230        return 0 != j.isTransInited && (v.addClass("ug-tiles-transition-active"), v.removeClass("ug-tiles-rest-mode"), 0 != j.isTransActive && void E.disableEvents())
4231    }
4232
4233    function r() {
4234        return 0 != j.isTransInited && (v.removeClass("ug-tiles-transition-active"), void v.addClass("ug-tiles-rest-mode"))
4235    }
4236
4237    function o() {
4238        1 == j.isTransActive ? (setTimeout(function() {
4239            E.enableEvents(), E.triggerSizeChangeEventAllTiles(), r()
4240        }, 800), j.handle && clearTimeout(j.handle), j.handle = setTimeout(function() {
4241            r(), E.triggerSizeChangeEventAllTiles(), j.handle = null
4242        }
4242, 2e3)) : (E.triggerSizeChangeEventAllTiles(), r())
4243    }
4244
4245    function a() {
4246        T.colWidth = (T.availWidth - T.colGap * (T.numCols - 1)) / T.numCols, T.colWidth = Math.floor(T.colWidth), T.totalWidth = x.getSpaceByNumItems(T.numCols, T.colWidth, T.colGap)
4247    }
4248
4249    function s() {
4250        if (T.colWidth = S.tiles_col_width, T.minCols = S.tiles_min_columns, T.colGap = 0 == w.isMobileMode() ? S.tiles_space_between_cols : S.tiles_space_between_cols_mobile, T.galleryWidth = i(), T.availWidth = T.galleryWidth, 1 == S.tiles_include_padding && (T.availWidth = T.galleryWidth - 2 * T.colGap), 1 == S.tiles_exact_width) T.numCols = x.getNumItemsInSpace(T.availWidth, T.colWidth, T.colGap), T.maxCols > 0 && T.numCols > T.maxCols && (T.numCols = T.maxCols), T.numCols < T.minCols ? (T.numCols = T.minCols, a()) : T.totalWidth = T.numCols * (T.colWidth + T.colGap) - T.colGap;
4251        else {
4252            var e = x.getNumItemsInSpaceRound(T.availWidth, T.colWidth, T.colGap);
4253            e < T.minCols ? e = T.minCols : 0 != T.maxCols && e > T.maxCols && (e = T.maxCols), T.numCols = e, a()
4254        }
4255        switch (S.tiles_align) {
4256            case "center":
4257            default:
4258                T.addX = Math.round((T.galleryWidth - T.totalWidth) / 2);
4259                break;
4260            case "left":
4261                T.addX = 0;
4262                break;
4263            case "right":
4264                T.addX = T.galleryWidth - T.totalWidth
4265        }
4266        for (T.maxColHeight = 0, T.arrPosx = [], col = 0; col < T.numCols; col++) {
4267            var t = x.getColX(col, T.colWidth, T.colGap);
4268            T.arrPosx[col] = t + T.addX
4269        }
4270        T.colHeights = [0]
4271    }
4272
4273    function l(e, t, i, n) {
4274        if (null === n || void 0 === n) n = function() {
4275            var e = 0,
4276                t = 999999999;
4277            for (col = 0; col < T.numCols; col++) {
4278                if (void 0 == T.colHeights[col] || 0 == T.colHeights[col]) return col;
4279                T.colHeights[col] < t && (e = col, t = T.colHeights[col])
4280            }
4281            return e
4282        }();
4283        var r = 0;
4284        void 0 !== T.colHeights[n] && (r = T.colHeights[n]);
4285        var o = E.getTileHeightByWidth(e, T.colWidth),
4286            a = T.arrPosx[n];
4287        x.placeElement(e, a, r);
4288        var s = r + o;
4289        T.colHeights[n] = s + T.colGap, T.maxColHeight < s && (T.maxColHeight = s), 1 == t && e.show().fadeTo(0, 1), 1 == i && v.height(T.maxColHeight)
4290    }
4291
4292    function u(e) {
4293        e || (e = !1), s();
4294        var t = I.getThumbs();
4295        n(), E.setAllTilesWidth(T.colWidth);
4296        for (var i = 0; i < t.length; i++) {
4297            var r = jQuery(t[i]),
4298                a = void 0;
4299            1 == S.tiles_keep_order && (a = x.getColByIndex(T.numCols, i)), l(r, e, !1, a)
4300        }
4301        o();
4302        var u = v.height();
4303        1 == j.isTransActive && u > T.maxColHeight ? setTimeout(function() {
4304            v.height(T.maxColHeight)
4305        }, 700) : v.height(T.maxColHeight)
4306    }
4307
4308    function d(e, t) {
4309        if (!0 !== t && 0 == function(e) {
4310                var t = e.index();
4311                if (!0 === w.getItem(t).ordered_placed) return !1;
4312                var i = x.getPrevRowSameColIndex(t, T.numCols);
4313                return 0 > i || !0 === w.getItem(i).ordered_placed
4314            }(e)) return !1;
4315        var i = e.index(),
4316            n = x.getColByIndex(T.numCols, i),
4317            r = w.getItem(i);
4318        l(e, !0, !0, n), r.ordered_placed = !0, E.triggerSizeChangeEvent(e);
4319        var o = w.getNumItems(),
4320            a = x.getNextRowSameColIndex(i, T.numCols);
4321        if (a >= o) return !1;
4322        var s = I.getThumbByIndex(a),
4323            u = w.getItem(a);
4324        I.isThumbLoaded(s), I.isThumbLoaded(s) && !u.ordered_placed && d(s, !0)
4325    }
4326
4327    function c() {
4328        var e = I.getThumbs();
4329        s();
4330        var i = Math.abs(T.galleryWidth - T.totalWidth);
4331        if (1 == S.tiles_set_initial_height && 0 == x.isScrollbarExists() && 25 > i) {
4332            var n = (e.length, Math.ceil(e.length / T.numCols)) * S.tiles_col_width * .75;
4333            v.height(n), s()
4334        }
4335        if (e.css("width", T.colWidth + "px"), 1 == j.isFixedMode) {
4336            var r = E.getTileHeightByWidth(null, T.colWidth);
4337            e.css("height", r + "px")
4338        }
4339        e.fadeTo(0, 0);
4340        var o = jQuery(v).find("img.ug-thumb-image");
4341        if (1 == j.isFixedMode) y.trigger(b.events.TILES_FIRST_PLACED), u(!0), x.checkImagesLoaded(o, function() {
4342            t()
4343        });
4344        else {
4345            var a = T.numCols,
4346                c = T.galleryWidth,
4347                p = !1;
4348            x.checkImagesLoaded(o, function() {
4349                s(), (a != T.numCols || c != T.galleryWidth) && u(!1), t()
4350            }, function(e, t) {
4351                0 == p && y.trigger(b.events.TILES_FIRST_PLACED), p = !0,
4352                    function(e, t) {
4353                        if (1 == t) return !1;
4354                        e = jQuery(e);
4355                        var i = jQuery(e).parent();
4356                        I.triggerImageLoadedEvent(i, e), 1 == S.tiles_keep_order ? d(i) : (l(i, !0, !0), E.triggerSizeChangeEvent(i))
4357                    }(e, t)
4358            })
4359        }
4360    }
4361
4362    function p() {
4363        var e = i(),
4364            t = I.getThumbs(),
4365            n = S.tiles_justified_row_height,
4366            r = [],
4367            o = 0,
4368            a = S.tiles_justified_space_between,
4369            s = t.length;
4370        jQuery.each(t, function(e, t) {
4371            t = jQuery(t);
4372            var i = (E.getTileImage(t), I.getItemByThumb(t)),
4373                a = i.thumbWidth;
4374            i.thumbHeight !== n && (a = Math.floor(i.thumbRatioByWidth * n)), r[e] = a, o += a
4375        });
4376        var l = Math.ceil(o / e);
4377        l > s && (l = s);
4378        var u = o / l,
4379            d = [],
4380            c = 0,
4381            p = [],
4382            g = [],
4383            h = 0,
4384            _ = 0;
4385        jQuery.each(t, function(e, t) {
4386            var i = r[e];
4387            h + i / 2 > (_ + 1) * u && (p[d.length] = c, d.push(g), g = [], c = 0, _++), h += i, c += i, g.push(t)
4388        }), p[d.length] = c, d.push(g);
4389        var m = [],
4390            f = [],
4391            v = 0;
4392        return jQuery.each(d, function(t, i) {
4393            var o = (i.length, p[t]),
4394                s = (i.length - 1) * a,
4395                l = (e - s) / o,
4396                u = Math.round(n * l);
4397            v += u, t > 0 && (v += a), f.push(u);
4398            var d = u / n,
4399                c = [],
4400                g = s;
4401            jQuery.each(i, function(e, t) {
4402                var i = jQuery(t).index(),
4403                    n = r[i],
4404                    o = Math.round(n * d);
4405                c[e] = o, g += o
4406            });
4407            var h = g - e;
4408            jQuery.each(c, function(e, t) {
4409                return 0 != h && (0 > h ? (c[e] = t + 1, h++) : (c[e] = t - 1, h--), void(e == c.length - 1 && 0 != h && (c[e] -= h)))
4410            }), m[t] = c
4411        }), {
4412            arrRows: d,
4413            arrRowWidths: m,
4414            arrRowHeights: f,
4415            gap: a,
4416            totalHeight: v
4417        }
4418    }
4419
4420    function g(e) {
4421        if (!e) e = !1;
4422        var t = i(),
4423            r = p();
4424        v.height(r.totalHeight), i() != t && (r = p()), n();
4425        var a = 0,
4426            s = 0;
4427        jQuery.each(r.arrRows, function(t, i) {
4428            var n = r.arrRowWidths[t],
4429                o = r.arrRowHeights[t],
4430                l = 0;
4431            jQuery.each(i, function(t, i) {
4432                var u = jQuery(i),
4433                    d = o,
4434                    c = n[t];
4435                E.resizeTile(u, c, d), x.placeElement(u, l, a), (l += c) > s && (s = l), l += r.gap, 1 == e && jQuery(i).show()
4436            }), a += o + r.gap
4437        }), o()
4438    }
4439
4440    function h() {
4441        switch (f.children(".ug-tile").show(), E.run(), S.tiles_type) {
4442            default:
4443                case "columns":
4444                c();
4445            break;
4446            case "justified":
4447                    e = jQuery(f).find("img.ug-thumb-image"),
4448                (i = I.getThumbs()).fadeTo(0, 0),
4449                x.checkImagesLoaded(e, function() {
4450                    setTimeout(function() {
4451                        g(!0), i.fadeTo(0, 1), y.trigger(b.events.TILES_FIRST_PLACED), t()
4452                    })
4453                }, function(e) {
4454                    e = jQuery(e);
4455                    var t = jQuery(e).parent();
4456                    I.triggerImageLoadedEvent(t, e)
4457                })
4458        }
4459        var e, i;
4460        1 == j.isFirstTimeRun && (m.on(w.events.SIZE_CHANGE, _), E.initEvents()), j.isFirstTimeRun = !1
4461    }
4462
4463    function _() {
4464        if (1 == j.isFirstTimeRun) return !0;
4465        switch (S.tiles_type) {
4466            case "columns":
4467                u(!1);
4468                break;
4469            case "justified":
4470                g(!1)
4471        }
4472    }
4473    var m, f, v, b = this,
4474        y = jQuery(this),
4475        w = new UniteGalleryMain,
4476        x = new UGFunctions,
4477        E = new UGTileDesign,
4478        I = new UGThumbsGeneral,
4479        T = {},
4480        S = {
4481            tiles_type: "columns",
4482            tiles_col_width: 250,
4483            tiles_align: "center",
4484            tiles_exact_width: !1,
4485            tiles_space_between_cols: 3,
4486            tiles_space_between_cols_mobile: 3,
4487            tiles_include_padding: !0,
4488            tiles_min_columns: 2,
4489            tiles_max_columns: 0,
4490            tiles_keep_order: !1,
4491            tiles_justified_row_height: 150,
4492            tiles_justified_space_between: 3,
4493            tiles_set_initial_height: !0,
4494            tiles_enable_transition: !0
4495        };
4496    this.events = {
4497        THUMB_SIZE_CHANGE: "thumb_size_change",
4498        TILES_FIRST_PLACED: "tiles_first_placed"
4499    };
4500    var j = {
4501        isFixedMode: !1,
4502        isFirstTimeRun: !0,
4503        handle: null,
4504        isTransActive: !1,
4505        isTransInited: !1,
4506        arrWaitList: []
4507    };
4508    this.destroy = function() {
4509        m.off(w.events.SIZE_CHANGE), E.destroy()
4510    }, this.setFixedSizeMode = function() {
4511        j.isFixedMode = !0, E.setFixedMode()
4512    }, this.init = function(t, i) {
4513        e(t, i)
4514    }, this.setHtml = function(e) {
4515        ! function(e) {
4516            e || (e = f);
4517            v = e;
4518            var t = S.tiles_type;
4519            e.addClass("ug-tiletype-" + t), E.setHtml(e), e.children(".ug-thumb-wrapper").hide()
4520        }(e)
4521    }, this.getObjTileDesign = function() {
4522        return E
4523    }, this.run = function() {
4524        h()
4525    }
4526}
4527
4528function UGTileDesign() {
4529    function e(e, i) {
4530        T = e, jQuery(e);
4531        var n = T.getObjects();
4532        x = n.g_objWrapper, T.getArrItems(), P = jQuery.extend(P, C), 1 == (P = jQuery.extend(P, i)).tile_enable_overlay ? (P.thumb_overlay_opacity = P.tile_overlay_opacity, P.thumb_overlay_color = P.tile_overlay_color) : 0 == P.tile_enable_icons ? P.thumb_color_overlay_effect = !1 : P.thumb_overlay_opacity = 0, P.tile_as_link && (P.thumb_wrapper_as_link = !0, P.thumb_link_newpage = P.tile_link_newpage), 1 == P.tile_enable_outline && 0 == P.tile_enable_border && (P.tile_enable_outline = !1), A.tileInnerReduce = 0, P.tile_enable_border && (A.tileInnerReduce = 2 * P.tile_border_width, j.setThumbInnerReduce(A.tileInnerReduce)), j.init(e, P);
4533        j.setCustomThumbs(t, ["overlay"], {});
4534        var r = j.getOptions();
4535        P = jQuery.extend(P, r), A.isSaparateIcons = !S.isRgbaSupported(), 1 == A.isFixedMode && (A.ratioByWidth = P.tile_width / P.tile_height, A.ratioByHeight = P.tile_height / P.tile_width)
4536    }
4537
4538    function t(e, t) {
4539        var i = "<img src='" + t.urlThumb + "' alt='" + t.title + "' class='ug-thumb-image'>";
4540        e.append(i), e.addClass("ug-tile"), e.children(".ug-thumb-image"), 1 == A.isFixedMode && (e.fadeTo(0, 0), S.setElementSize(e, P.tile_width, P.tile_height), e.addClass("ug-tile-fixed"));
4541        var n = {};
4542        if (1 == P.tile_enable_border && (n["border-width"] = P.tile_border_width + "px", n["border-style"] = "solid", n["border-color"] = P.tile_border_color, P.tile_border_radius && (n["border-radius"] = P.tile_border_radius + "px")), 1 == P.tile_enable_outline && (n.outline = "1px solid " + P.tile_outline_color), 1 == P.tile_enable_shadow) {
4543            var r = P.tile_shadow_h + "px ";
4544            r += P.tile_shadow_v + "px ", r += P.tile_shadow_blur + "px ", r += P.tile_shadow_spread + "px ", r += P.tile_shadow_color, n["box-shadow"] = r
4545        }
4546        e.css(n);
4547        var o = "";
4548        if (P.tile_enable_icons) {
4549            if (0 == P.tile_as_link && 1 == P.tile_enable_action) {
4550                var a = "ug-button-play ug-icon-zoom";
4551                "image" != t.type && (a = "ug-button-play ug-icon-play"), o += "<div class='ug-tile-icon " + a + "' style='display:none'></div>"
4552            }
4553            if (t.link && 1 == P.tile_show_link_icon || 1 == P.tile_as_link)
4554                if (0 == P.tile_as_link) {
4555                    var s = "";
4556                    1 == P.tile_link_newpage && (s = " target='_blank'"), o += "<a href='" + t.link + "'" + s + " class='ug-tile-icon ug-icon-link'></a>"
4557                } else o += "<div class='ug-tile-icon ug-icon-link' style='display:none'></div>";
4558            var l = A.isSaparateIcons;
4559            if (0 == l && "image" != t.type && 1 == P.tile_videoplay_icon_always_on && (l = !0), l) var u = e;
4560            else u = e.children(".ug-thumb-overlay");
4561            u.append(o);
4562            var d = u.children("." + a);
4563            0 == d.length ? d = null : d.hide();
4564            var c = u.children(".ug-icon-link");
4565            0 == c.length ? c = null : c.hide(), c || 1 != P.tile_enable_action || e.addClass("ug-tile-clickable")
4566        } else 1 == P.tile_enable_action && e.addClass("ug-tile-clickable");
4567        if (1 == P.tile_enable_image_effect) {
4568            var p = "<div class='ug-tile-image-overlay' style='display:none'>",
4569                g = " ug-" + P.tile_image_effect_type + "-effect";
4570            p += "<img src='" + t.urlThumb + "' alt='" + t.title + "' class='" + g + "'>", p += "</div>", e.append(p)
4571        }
4572        if (1 == P.tile_enable_textpanel) {
4573            var h = new UGTextPanel;
4574            h.init(T, P, "tile"), h.appendHTML(e);
4575            var _ = t.title;
4576            switch (P.tile_textpanel_source) {
4577                case "desc":
4578                case "description":
4579                    _ = t.description;
4580                    break;
4581                case "desc_title":
4582                    "" != t.description && (_ = t.description)
4583            }
4584            h.setTextPlain(_, ""), 0 == P.tile_textpanel_always_on && h.getElement().fadeTo(0, 0), e.data("objTextPanel", h)
4585        }
4586        null !== t.addHtml && e.append(t.addHtml)
4587    }
4588
4589    function i(e) {
4590        return e.children(".ug-tile-image-overlay")
4591    }
4592
4593    function n(e) {
4594        return e.data("objTextPanel")
4595    }
4596
4597    function r(e) {
4598        return e.find(".ug-textpanel")
4599    }
4600
4601    function o(e) {
4602        var t = e.find(".ug-icon-link");
4603        return 0 == t.length ? null : t
4604    }
4605
4606    function a(e) {
4607        var t = e.find(".ug-button-play");
4608        return 0 == t.length ? null : t
4609    }
4610
4611    function s(e) {
4612        return !!e.hasClass("ug-thumb-over")
4613    }
4614
4615    function l(e) {
4616        return e.hasClass("ug-tile-clickable")
4617    }
4618
4619    function u(e) {
4620        var t = (E.getItemByTile(e), a(e)),
4621            s = o(e),
4622            l = S.getElementSize(e),
4623            u = i(e),
4624            d = E.getTileImage(e),
4625            c = e.find(".ug-tile-image-overlay img");
4626        1 == P.tile_enable_image_effect && S.setElementSize(u, l.width - A.tileInnerReduce, l.height - A.tileInnerReduce), A.isFixedMode && (0 == P.tile_enable_image_effect ? S.scaleImageCoverParent(d, e) : (S.scaleImageCoverParent(c, u), S.cloneElementSizeAndPos(c, d), setTimeout(function() {
4627            S.cloneElementSizeAndPos(c, d)
4628        }, 500)));
4629        var p = n(e);
4630        if (1 == P.tile_enable_textpanel && p && (p.refresh(!1, !0), (1 == P.tile_textpanel_always_on || "fade" == P.tile_textpanel_appear_type) && p.positionPanel()), t || s) {
4631            var g = 0;
4632            if (1 == P.tile_enable_textpanel) {
4633                var h = r(e),
4634                    _ = S.getElementSize(h);
4635                _.height > 0 && (g = Math.floor(_.height / 2 * -1))
4636            }
4637        }
4638        if (t && s) {
4639            var m = S.getElementSize(t),
4640                f = S.getElementSize(s),
4641                v = P.tile_space_between_icons,
4642                b = m.width + v + f.width,
4643                y = Math.floor((l.width - b) / 2);
4644            v > y && (v = Math.floor((l.width - m.width - f.width) / 3), b = m.width + v + f.width, y = Math.floor((l.width - b) / 2)), S.placeElement(t, y, "middle", 0, g), S.placeElement(s, y + m.width + v, "middle", 0, g)
4645        } else t && S.placeElement(t, "center", "middle", 0, g), s && S.placeElement(s, "center", "middle", 0, g);
4646        t && t.show(), s && s.show()
4647    }
4648
4649    function d(e, t) {
4650        var n = (E.getItemByTile(e), i(e)),
4651            r = P.thumb_transition_duration;
4652        if (0 == P.tile_image_effect_reverse) {
4653            var o = E.getTileImage(e);
4654            t ? (o.fadeTo(1, 1), n.stop(!0).fadeTo(r, 0)) : n.stop(!0).fadeTo(r, 1)
4655        } else t ? n.stop(!0).fadeTo(r, 1) : n.stop(!0).fadeTo(r, 0)
4656    }
4657
4658    function c(e, t) {
4659        var i = P.thumb_transition_duration,
4660            n = r(e);
4661        if (!n) return !0;
4662        if ("slide" == P.tile_textpanel_appear_type) {
4663            var o = S.getElementSize(n);
4664            if (0 == o.width) return !1;
4665            var a = -o.height;
4666            1 == t ? (n.fadeTo(0, 1), 0 == n.is(":animated") && n.css("bottom", a + "px"), n.stop(!0).animate({
4667                bottom: "0px"
4668            }, i)) : n.stop(!0).animate({
4669                bottom: a + "px"
4670            }, i)
4671        } else 1 == t ? n.stop(!0).fadeTo(i, 1) : n.stop(!0).fadeTo(i, 0)
4672    }
4673
4674    function p(e, t, i) {
4675        var n = P.thumb_transition_duration;
4676        i && !0 === i && (n = 0);
4677        var r = a(e),
4678            s = o(e),
4679            l = t ? 1 : 0;
4680        r && r.stop(!0).fadeTo(n, l), s && s.stop(!0).fadeTo(n, l)
4681    }
4682
4683    function g(e, t) {
4684        if (t = jQuery(t), P.tile_enable_image_effect && d(t, !0), 1 == P.tile_enable_textpanel && 0 == P.tile_textpanel_always_on && c(t, !0), A.isSaparateIcons && 1 == P.tile_enable_icons) {
4685            var i = 1 == P.thumb_overlay_reverse,
4686                n = E.getItemByTile(t);
4687            (1 != P.tile_videoplay_icon_always_on || "image" == n.type) && p(t, i, !1)
4688        }
4689    }
4690
4691    function h(e, t) {
4692        (t = jQuery(t), P.tile_enable_image_effect && d(t, !1), 1 == P.tile_enable_textpanel && 0 == P.tile_textpanel_always_on && c(t, !1), A.isSaparateIcons && 1 == P.tile_enable_icons) && p(t, 1 != P.thumb_overlay_reverse, !1)
4693    }
4694
4695    function _(e, t, i) {
4696        return t = jQuery(t), 1 == A.isFixedMode && !0 !== t.data("image_placed") && !0 !== i || void u(t)
4697    }
4698
4699    function m(e, t, i) {
4700        u(t), i.fadeTo(0, 1), t.data("image_placed", !0)
4701    }
4702
4703    function f(e) {
4704        return 1 == l(e) ? (I.trigger(E.events.TILE_CLICK, e), !0) : void(0 == s(e) && (t = e, j.getThumbs().not(t).each(function(e, t) {
4705            j.setThumbNormalStyle(jQuery(t))
4706        }), j.setThumbOverStyle(e)));
4707        var t
4708    }
4709
4710    function v(e) {
4711        var t = jQuery(this),
4712            i = t.prop("tagName").toLowerCase(),
4713            n = !0;
4714        if (A.funcParentApproveClick && 0 == A.funcParentApproveClick() && (n = !1), "a" == i) 0 == n && e.preventDefault();
4715        else if (0 == s(t)) 1 == n && f(t);
4716        else {
4717            if (0 == l(t)) return !0;
4718            1 == n && I.trigger(E.events.TILE_CLICK, t)
4719        }
4720    }
4721
4722    function b(e) {
4723        e.stopPropagation();
4724        var t = jQuery(this).parents(".ug-tile"),
4725            i = !0;
4726        return A.funcParentApproveClick && 0 == A.funcParentApproveClick() && (i = !1), 0 == s(t) ? (f(t), !0) : 1 == i ? (I.trigger(E.events.TILE_CLICK, t), !1) : void 0
4727    }
4728
4729    function y(e) {
4730        var t = jQuery(this).parents(".ug-tile");
4731        A.funcParentApproveClick && 0 == A.funcParentApproveClick() && e.preventDefault(), 0 == s(t) && 0 == P.tile_as_link && (e.preventDefault(), f(t))
4732    }
4733    var w, x, E = this,
4734        I = jQuery(this),
4735        T = new UniteGalleryMain,
4736        S = new UGFunctions,
4737        j = new UGThumbsGeneral;
4738    this.events = {
4739        TILE_CLICK: "tile_click"
4740    };
4741    var P = {
4742            tile_width: 250,
4743            tile_height: 200,
4744            tile_enable_border: !1,
4745            tile_border_width: 3,
4746            tile_border_color: "#F0F0F0",
4747            tile_border_radius: 0,
4748            tile_enable_outline: !1,
4749            tile_outline_color: "#8B8B8B",
4750            tile_enable_shadow: !1,
4751            tile_shadow_h: 1,
4752            tile_shadow_v: 1,
4753            tile_shadow_blur: 3,
4754            tile_shadow_spread: 2,
4755            tile_shadow_color: "#8B8B8B",
4756            tile_enable_action: !0,
4757            tile_as_link: !1,
4758            tile_link_newpage: !0,
4759            tile_enable_overlay: !0,
4760            tile_overlay_opacity: .4,
4761            tile_overlay_color: "#000000",
4762            tile_enable_icons: !0,
4763            tile_show_link_icon: !1,
4764            tile_videoplay_icon_always_on: !1,
4765            tile_space_between_icons: 26,
4766            tile_enable_image_effect: !1,
4767            tile_image_effect_type: "bw",
4768            tile_image_effect_reverse: !1,
4769            tile_enable_textpanel: !1,
4770            tile_textpanel_source: "title",
4771            tile_textpanel_always_on: !1,
4772            tile_textpanel_appear_type: "slide"
4773        },
4774        C = {
4775            thumb_color_overlay_effect: !0,
4776            thumb_overlay_reverse: !0,
4777            thumb_image_overlay_effect: !1,
4778            tile_textpanel_enable_description: !1,
4779            tile_textpanel_bg_opacity: .6,
4780            tile_textpanel_padding_top: 8,
4781            tile_textpanel_padding_bottom: 8
4782        },
4783        A = {
4784            isFixedMode: !1,
4785            ratioByHeight: 0,
4786            ratioByWidth: 0,
4787            eventSizeChange: "thumb_size_change",
4788            funcParentApproveClick: null,
4789            isSaparateIcons: !1,
4790            tileInnerReduce: 0
4791        };
4792    this.loadTileImage = function(e) {
4793        var t = E.getTileImage(e);
4794        S.checkImagesLoaded(t, null, function(t) {
4795            m(0, e, jQuery(t))
4796        })
4797    }, this.setHtml = function(e) {
4798        w = e, j.setHtmlThumbs(e)
4799    }, this.initEvents = function() {
4800        j.initEvents(), jQuery(j).on(j.events.SETOVERSTYLE, g), jQuery(j).on(j.events.SETNORMALSTYLE, h), jQuery(j).on(j.events.PLACEIMAGE, m), x.on(A.eventSizeChange, _), w.delegate(".ug-tile .ug-button-play", "click", b), w.delegate(".ug-tile", "click", v), w.delegate(".ug-tile .ug-icon-link", "click", y)
4801    }, this.destroy = function() {
4802        if (jQuery(j).off(j.events.SETOVERSTYLE), jQuery(j).off(j.events.SETNORMALSTYLE), jQuery(j).off(j.events.PLACEIMAGE), x.off(A.eventSizeChange), 1 == P.tile_enable_textpanel) {
4803            var e = j.getThumbs();
4804            jQuery.each(e, function(e, t) {
4805                var i = n(jQuery(t));
4806                i && i.destroy()
4807            })
4808        }
4809        j.destroy()
4810    }, this.init = function(t, i, n) {
4811        e(t, i)
4812    }, this.setFixedMode = function() {
4813        A.isFixedMode = !0
4814    }, this.setApproveClickFunction = function(e) {
4815        A.funcParentApproveClick = e
4816    }, this.resizeTile = function(e, t, i) {
4817        if (1 == A.isFixedMode) {
4818            if (t) {
4819                if (!i) i = P.tile_height / P.tile_width * t
4820            } else t = P.tile_width, i = P.tile_height;
4821            S.setElementSize(e, t, i), E.triggerSizeChangeEvent(e, !0)
4822        } else {
4823            var n = {},
4824                r = {};
4825            null !== t && (n.width = t + "px", r.width = t - A.tileInnerReduce + "px"), null !== i && (n.height = i + "px", r.he
4825ight = i - A.tileInnerReduce + "px"), e.css(n), 1 == P.tile_enable_textpanel && 1 == P.tile_textpanel_always_on && t && E.resizeTileTextPanel(e, t - A.tileInnerReduce), 1 == P.tile_enable_image_effect && e.find(".ug-tile-image-overlay").css(r)
4826        }
4827    }, this.resizeAllTiles = function(e, t) {
4828        if (!t) t = P.tile_height / P.tile_width * e;
4829        j.getThumbs().each(function(i, n) {
4830            E.resizeTile(jQuery(n), e, t)
4831        })
4832    }, this.resizeTileTextPanel = function(e, t) {
4833        var i = n(e);
4834        return !!i && (!(t < S.getElementSize(e).width) && void i.refresh(!1, !0, t))
4835    }, this.setAllTilesWidth = function(e) {
4836        var t = j.getThumbs();
4837        if (t.css("width", e + "px"), 1 == A.isFixedMode) {
4838            var i = E.getTileHeightByWidth(null, e);
4839            t.css("height", i + "px");
4840            for (var n = 0; n < t.length; n++) {
4841                var r = jQuery(t[n]),
4842                    o = E.getTileImage(r);
4843                S.scaleImageCoverParent(o, e, i)
4844            }
4845        }
4846        var a = e - A.tileInnerReduce;
4847        if (1 == P.tile_enable_textpanel && 1 == P.tile_textpanel_always_on)
4848            for (n = 0; n < t.length; n++) {
4849                r = jQuery(t[n]);
4850                E.resizeTileTextPanel(r, a)
4851            }
4852        1 == P.tile_enable_image_effect && 0 == P.tile_image_effect_reverse && t.find(".ug-tile-image-overlay").css("width", a + "px")
4853    }, this.triggerSizeChangeEvent = function(e, t) {
4854        if (!e) return !1;
4855        if (!t) t = !1;
4856        x.trigger(A.eventSizeChange, [e, t])
4857    }, this.triggerSizeChangeEventAllTiles = function(e) {
4858        j.getThumbs().each(function() {
4859            var t = jQuery(this);
4860            E.triggerSizeChangeEvent(t, e)
4861        })
4862    }, this.disableEvents = function() {
4863        j.getThumbs().css("pointer-events", "none")
4864    }, this.enableEvents = function() {
4865        j.getThumbs().css("pointer-events", "auto")
4866    }, this.setOptions = function(e) {
4867        P = jQuery.extend(P, e), j.setOptions(e)
4868    }, this.run = function() {
4869        var e = j.getThumbs();
4870        1 == P.tile_enable_image_effect && 0 == P.tile_image_effect_reverse && e.children(".ug-thumb-image").fadeTo(0, 0), j.setHtmlProperties(), 1 == A.isFixedMode && (e.children(".ug-thumb-image").fadeTo(0, 0), j.loadThumbsImages())
4871    }, this._____________EXTERNAL_GETTERS____________ = function() {}, this.getTileHeightByWidth = function(e, t) {
4872        if (A.isFixedMode) var i = Math.round(A.ratioByHeight * t);
4873        else {
4874            i = t * E.getItemByTile(e).thumbRatioByHeight;
4875            i = Math.floor(i)
4876        }
4877        return i
4878    }, this.getObjThumbs = function() {
4879        return j
4880    }, this.getOptions = function() {
4881        return P
4882    }, this.getTileImage = function(e) {
4883        return e.children("img.ug-thumb-image")
4884    }, this.getItemByTile = function(e) {
4885        return j.getItemByThumb(e)
4886    }
4887}
4888
4889function UGAviaControl() {
4890    function e() {
4891        jQuery("body").on("touchstart", function() {
4892            return 0 == u.isControlEnabled || void(u.touchEnabled = !0)
4893        }), jQuery("body").mousemove(function(e) {
4894            if (0 == u.isControlEnabled) return !0;
4895            if (1 == u.touchEnabled) return jQuery("body").off("mousemove"), !0;
4896            u.isMouseInsideStrip = o.ismouseover();
4897            var r, d, c, p = n.isTouchMotionActive();
4898            if (1 == u.isMouseInsideStrip && 0 == p) {
4899                var g = (c = e, 0 == l ? c.pageX : c.pageY);
4900                d = g, r = 0 == l ? function(e) {
4901                    var t = o.width(),
4902                        i = a.width();
4903                    if (t > i) return !1;
4904                    var n = o.offset().left,
4905                        r = e - n,
4906                        l = s.thumb_width,
4907                        u = t - s.thumb_width;
4908                    l > r && (r = l), r > u && (r = u);
4909                    var d = (r - l) / (u - l) * (i - t);
4910                    return d = -1 * (d = Math.round(d))
4911                }(d) : function(e) {
4912                    var t = o.height(),
4913                        i = a.height();
4914                    if (t > i) return !1;
4915                    var n = o.offset().top,
4916                        r = e - n,
4917                        l = s.thumb_height,
4918                        u = t - s.thumb_height;
4919                    l > r && (r = l), r > u && (r = u);
4920                    var d = (r - l) / (u - l) * (i - t);
4921                    return d = -1 * (d = Math.round(d))
4922                }(d), u.is_strip_moving = !0, u.strip_finalPos = r, 1 != u.isStripMoving && (u.isStripMoving = !0, u.handle_timeout = setInterval(t, 10))
4923            } else i()
4924        })
4925    }
4926
4927    function t() {
4928        if (0 == u.is_strip_moving) return !1;
4929        var e = n.getInnerStripPos();
4930        Math.floor(e) == Math.floor(u.strip_finalPos) && i();
4931        var t, r = Math.abs(Math.abs(u.strip_finalPos) - Math.abs(e));
4932        1 > r ? t = r : (t = r / 4) > 0 && 1 > t && (t = 1), u.strip_finalPos < e && (t *= -1);
4933        var o = e + t;
4934        n.positionInnerStrip(o)
4935    }
4936
4937    function i() {
4938        return 0 != u.isStripMoving && (u.isStripMoving = !1, void(u.handle_timeout = clearInterval(u.handle_timeout)))
4939    }
4940    var n, r, o, a, s, l, u = {
4941        touchEnabled: !1,
4942        isMouseInsideStrip: !1,
4943        strip_finalPos: 0,
4944        handle_timeout: "",
4945        isStripMoving: !1,
4946        isControlEnabled: !0
4947    };
4948    this.enable = function() {
4949        u.isControlEnabled = !0
4950    }, this.disable = function() {
4951        u.isControlEnabled = !1
4952    }, this.init = function(t) {
4953        n = t, r = t.getObjects(), r.g_gallery, o = r.g_objStrip, a = r.g_objStripInner, s = r.g_options, l = r.isVertical, e()
4954    }, this.destroy = function() {
4955        jQuery("body").off("touchstart"), jQuery("body").off("mousemove")
4956    }
4957}
4958
4959function UGSlider() {
4960    function e(e, t, i) {
4961        te = e, i && (J = i, t = ae.convertCustomPrefixOptions(t, J, "slider")), D = jQuery(e);
4962        var n, r, o = te.getObjects();
4963        if (F = o.g_objWrapper, o.g_objThumbs, t.hasOwnProperty("slider_progress_indicator_type") && (ue.slider_progress_indicator_type = t.slider_progress_indicator_type), "bar" == ue.slider_progress_indicator_type && (ue = jQuery.extend(ue, de)), t && $.setOptions(t), n = te.getOptions(), r = n.gallery_skin, "" == ue.slider_bullets_skin && (ue.slider_bullets_skin = r), "" == ue.slider_arrows_skin && (ue.slider_arrows_skin = r), "" == ue.slider_zoompanel_skin && (ue.slider_zoompanel_skin = r), "" == ue.slider_play_button_skin && (ue.slider_play_button_skin = r), "" == ue.slider_fullscreen_button_skin && (ue.slider_fullscreen_button_skin = r), ue.video_enable_closebutton = ue.slider_video_enable_closebutton, "zoom" != n.gallery_mousewheel_role && (ue.slider_zoom_mousewheel = !1), 1 == ue.slider_enable_bullets) {
4964            re = new UGBullets;
4965            var a = {
4966                bullets_skin: ue.slider_bullets_skin,
4967                bullets_space_between: ue.slider_bullets_space_between
4968            };
4969            re.init(te, a)
4970        }
4971        ue.slider_enable_text_panel && (le = new UGTextPanel).init(te, ue, "slider"), ue.slider_enable_zoom_panel && (K = new UGZoomButtonsPanel).init($, ue);
4972        var s = te.getGalleryID();
4973        oe.init(ue, !1, s)
4974    }
4975
4976    function t() {
4977        if (1 == ce.isRunOnce) return !1;
4978        if (ce.isRunOnce = !0, ue.slider_background_color) {
4979            var e = ue.slider_background_color;
4980            1 != ue.slider_background_opacity && (e = ae.convertHexToRGB(e, ue.slider_background_opacity)), G.css("background-color", e)
4981        } else 1 != ue.slider_background_opacity && (e = ae.convertHexToRGB("#000000", ue.slider_background_opacity), G.css("background-color", e));
4982        1 == ue.slider_control_swipe && (q = new UGTouchSliderControl).init($, ue), 1 == ue.slider_control_zoom && (Z = new UGZoomSliderControl).init($, ue), le && le.run(), D.on(te.events.ITEM_IMAGE_UPDATED, M), D.on(te.events.ITEM_CHANGE, E), re && jQuery(re).on(re.events.BULLET_CLICK, I), 1 == ue.slider_enable_arrows && (ae.addClassOnHover(V, "ug-arrow-hover"), ae.addClassOnHover(X, "ug-arrow-hover"), te.setNextButton(V), te.setPrevButton(X)), 0 == ue.slider_controls_always_on && G.hover(P, C), G.on("touchend click", T), ee.on($.events.CLICK, S), le && 1 == ce.isTextPanelSaparateHover && G.hover(h, g), ie && (ae.addClassOnHover(ie, "ug-button-hover"), te.setPlayButton(ie)), ne && (ae.addClassOnHover(ne, "ug-button-hover"), te.setFullScreenToggleButton(ne)), Z && ee.on($.events.ZOOM_CHANGE, j), K && K.initEvents(), oe.initEvents(), jQuery(oe).on(oe.events.SHOW, k), jQuery(oe).on(oe.events.HIDE, O), H(B), H(U), H(Y), ee.on($.events.AFTER_PUT_IMAGE, L), G.delegate(".ug-item-wrapper img", "mouseenter", function() {
4983            ee.trigger($.events.IMAGE_MOUSEENTER)
4984        }), G.delegate(".ug-item-wrapper img", "mouseleave", function(e) {
4985            var t = $.isMouseInsideSlideImage(e);
4986            0 == t && ee.trigger($.events.IMAGE_MOUSELEAVE)
4987        })
4988    }
4989
4990    function i(e, t) {
4991        var i = "ug-type-square";
4992        return "round" == ue.slider_videoplay_button_type && (i = "ug-type-round"), html = "", html += "<div class='ug-slide-wrapper ug-slide" + t + "'>", html += "<div class='ug-item-wrapper'></div>", html += "<div class='ug-slider-preloader " + e + "'></div>", html += "<div class='ug-button-videoplay " + i + "' style='display:none'></div>", html += "</div>"
4993    }
4994
4995    function n(e) {
4996        e && (F = e);
4997        var t = function() {
4998                var e;
4999                switch (ue.slider_loader_type) {
5000                    default:
5001                        case 1:
5002                        e = "ug-loader1";
5003                    break;
5004                    case 2:
5005                            e = "ug-loader2";
5006                        break;
5007                    case 3:
5008                            e = "ug-loader3";
5009                        break;
5010                    case 4:
5011                            e = "ug-loader4";
5012                        break;
5013                    case 5:
5014                            e = "ug-loader5";
5015                        break;
5016                    case 6:
5017                            e = "ug-loader6";
5018                        break;
5019                    case 7:
5020                            e = "ug-loader7";
5021                        break;
5022                    case 8:
5023                            e = "ug-loader8";
5024                        break;
5025                    case 9:
5026                            e = "ug-loader9"
5027                }
5028                return "black" == ue.slider_loader_color && (e += " ug-loader-black"), e
5029            }(),
5030            n = (te.getOptions(), "<div class='ug-slider-wrapper'>");
5031        (n += "<div class='ug-slider-inner'>", n += i(t, 1), n += i(t, 2), n += i(t, 3), n += "</div>", 1 == ue.slider_enable_arrows && (n += "<div class='ug-slider-control ug-arrow-left ug-skin-" + ue.slider_arrows_skin + "'></div>", n += "<div class='ug-slider-control ug-arrow-right ug-skin-" + ue.slider_arrows_skin + "'></div>"), 1 == ue.slider_enable_play_button && (n += "<div class='ug-slider-control ug-button-play ug-skin-" + ue.slider_play_button_skin + "'></div>"), 1 == ue.slider_enable_fullscreen_button && (n += "<div class='ug-slider-control ug-button-fullscreen ug-skin-" + ue.slider_fullscreen_button_skin + "'></div>"), n += "</div>", F.append(n), G = F.children(".ug-slider-wrapper"), W = G.children(".ug-slider-inner"), B = W.children(".ug-slide1"), U = W.children(".ug-slide2"), Y = W.children(".ug-slide3"), B.data("slidenum", 1), U.data("slidenum", 2), Y.data("slidenum", 3), re && re.appendHTML(G), 1 == ue.slider_enable_arrows && (X = G.children(".ug-arrow-left"), V = G.children(".ug-arrow-right")), 1 == ue.slider_enable_play_button && (ie = G.children(".ug-button-play")), 1 == ue.slider_enable_fullscreen_button && (ne = G.children(".ug-button-fullscreen")), 1 == ue.slider_enable_progress_indicator) && ("bar" == (se = ae.initProgressIndicator(ue.slider_progress_indicator_type, ue, G)).getType() && "pie" == ue.slider_progress_indicator_type && (ue.slider_progress_indicator_type = "bar", ue = jQuery.extend(ue, de)), te.setProgressIndicator(se));
5032        1 == ue.slider_enable_text_panel && (le.appendHTML(G), 0 == ue.slider_textpanel_always_on) && (le.getElement().hide().data("isHidden", !0), ce.isTextPanelSaparateHover = !0);
5033        1 == ue.slider_enable_zoom_panel && K.appendHTML(G), oe.setHtml(W)
5034    }
5035
5036    function r(e) {
5037        var t = R(e);
5038        ae.placeElementInParentCenter(t);
5039        var i = Q(e);
5040        ae.placeElementInParentCenter(i)
5041    }
5042
5043    function o() {
5044        if (re && (objBullets = re.getElement(), ae.placeElement(objBullets, ue.slider_bullets_align_hor, ue.slider_bullets_align_vert, ue.slider_bullets_offset_hor, ue.slider_bullets_offset_vert), ae.placeElement(objBullets, ue.slider_bullets_align_hor, ue.slider_bullets_align_vert, ue.slider_bullets_offset_hor, ue.slider_bullets_offset_vert)), 1 == ue.slider_enable_arrows && (ae.placeElement(X, ue.slider_arrow_left_align_hor, ue.slider_arrow_left_align_vert, ue.slider_arrow_left_offset_hor, ue.slider_arrow_left_offset_vert), ae.placeElement(V, ue.slider_arrow_right_align_hor, ue.slider_arrow_left_align_vert, ue.slider_arrow_right_offset_hor, ue.slider_arrow_right_offset_vert)), 0 == ue.slider_controls_always_on && w(!0), se) {
5045            var e = se.getElement();
5046            if ("bar" == ue.slider_progress_indicator_type) {
5047                var t = G.width();
5048                se.setSize(t), ae.placeElement(e, "left", ue.slider_progress_indicator_align_vert, 0, ue.slider_progress_indicator_offset_vert)
5049            } else ae.placeElement(e, ue.slider_progress_indicator_align_hor, ue.slider_progress_indicator_align_vert, ue.slider_progress_indicator_offset_hor, ue.slider_progress_indicator_offset_vert)
5050        }
5051        le && le.positionPanel(),
5052            function() {
5053                if (ie && ae.placeElement(ie, ue.slider_play_button_align_hor, ue.slider_play_button_align_vert, ue.slider_play_button_offset_hor, ue.slider_play_button_offset_vert), ne && ae.placeElement(ne, ue.slider_fullscreen_button_align_hor, ue.slider_fullscreen_button_align_vert, ue.slider_fullscreen_button_offset_hor, ue.slider_fullscreen_button_offset_vert), K) {
5054                    var e = K.getElement();
5055                    ae.placeElement(e, ue.slider_zoompanel_align_hor, ue.slider_zoompanel_align_vert, ue.slider_zoompanel_offset_hor, ue.slider_zoompanel_offset_vert)
5056                }
5057            }(), r(B), r(U), r(Y), te.isMobileMode() ? (1 == ue.slider_fullscreen_button_mobilehide && ne && ne.hide(), 1 == ue.slider_play_button_mobilehide && ie && ie.hide(), 1 == ue.slider_zoompanel_mobilehide && K && K.getElement().hide()) : (1 == ue.slider_fullscreen_button_mobilehide && ne && ne.show(), 1 == ue.slider_play_button_mobilehide && ie && ie.show(), 1 == ue.slider_zoompanel_mobilehide && K && K.getElement().show())
5058    }
5059
5060    function a() {
5061        var e, t, i, n, r = $.getSlidesReference(),
5062            o = 0;
5063        i = $.isSlideHasItem(r.objNextSlide), (n = $.isSlideHasItem(r.objPrevSlide)) ? (o = r.objPrevSlide.outerWidth(), r.objPrevSlide.css("z-index", 1)) : r.objPrevSlide.hide(), e = t = o + r.objCurrentSlide.outerWidth(), i ? (e = t + r.objNextSlide.outerWidth(), r.objPrevSlide.css("z-index", 2)) : r.objNextSlide.hide(), r.objCurrentSlide.css("z-index", 3), ae.placeElement(r.objCurrentSlide, o, 0), W.css({
5064            left: -o + "px",
5065            width: e + "px"
5066        }), n && (ae.placeElement(r.objPrevSlide, 0, 0), ae.showElement(r.objPrevSlide)), i && (ae.showElement(r.objNextSlide), ae.placeElement(r.objNextSlide, t, 0))
5067    }
5068
5069    function s(e) {
5070        var t = e.data("index");
5071        if (void 0 === t || null == t) return !1;
5072        var i = te.getItem(t);
5073        return !!i && void p(e, i)
5074    }
5075
5076    function l(e) {
5077        e.stop(!0).hide(100)
5078    }
5079
5080    function u(e, t) {
5081        var i = {};
5082        1 == ue.slider_image_border && (i["border-style"] = "solid", i["border-width"] = ue.slider_image_border_width + "px", i["border-color"] = ue.slider_image_border_color, i["border-radius"] = ue.slider_image_border_radius), "image" != t && 1 == ue.slider_video_constantsize && (i["background-color"] = "#000000"), 1 == ue.slider_image_shadow && (i["box-shadow"] = "3px 3px 10px 0px #353535"), e.css(i)
5083    }
5084
5085    function d(e, t) {
5086        var i = ue.slider_video_constantsize_width,
5087            n = ue.slider_video_constantsize_height,
5088            r = ue.slider_video_constantsize_scalemode;
5089        ae.scaleImageExactSizeInParent(e, t.imageWidth, t.imageHeight, i, n, r)
5090    }
5091
5092    function c(e, t, i) {
5093        var n = e.children(".ug-item-wrapper"),
5094            r = R(e),
5095            o = t.urlImage,
5096            a = e.data("urlImage");
5097        e.data("urlImage", o);
5098        var s, c = $.getScaleMode(e),
5099            p = $.getSlideType(e);
5100        if (objPadding = $.getObjImagePadding(), a == o && !0 !== i) {
5101            var g = n.children("img");
5102            (0 == t.imageWidth || 0 == t.imageHeight) && te.checkFillImageSize(g, t), "image" != p && 1 == ue.slider_video_constantsize ? d(g, t) : ae.scaleImageFitParent(g, t.imageWidth, t.imageHeight, c, objPadding), ee.trigger($.events.AFTER_PUT_IMAGE, e)
5103        } else g = ae.placeImageInsideParent(o, n, t.imageWidth, t.imageHeight, c, objPadding), 1 == t.isBigImageLoaded ? (g.fadeTo(0, 1), l(r), "image" != p && 1 == ue.slider_video_constantsize && d(g, t), ee.trigger($.events.AFTER_PUT_IMAGE, e)) : (g.fadeTo(0, 0), s = r, s.stop(!0).show(100), e.data("isLoading", !0), $.isSlideCurrent(e) && ee.trigger($.events.CURRENTSLIDE_LOAD_START), g.data("itemIndex", t.index), g.on("load", function() {
5104            var e = jQuery(this),
5105                t = e.data("itemIndex");
5106            e.fadeTo(0, 1);
5107            var i = e.parent().parent(),
5108                n = $.getSlideType(i),
5109                r = R(i),
5110                o = $.getObjImagePadding(),
5111                a = $.getScaleMode(i);
5112            l(r), i.data("isLoading", !1), $.isSlideCurrent(i) && ee.trigger($.events.CURRENTSLIDE_LOAD_END), te.onItemBigImageLoaded(null, e);
5113            var s = te.getItem(t);
5114            "image" != n && 1 == ue.slider_video_constantsize ? d(e, s) : ae.scaleImageFitParent(e, s.imageWidth, s.imageHeight, a, o), e.fadeTo(0, 1), ee.trigger($.events.AFTER_PUT_IMAGE, i)
5115        }));
5116        g && u(g, p)
5117    }
5118
5119    function p(e, t) {
5120        try {
5121            var i = e.children(".ug-item-wrapper");
5122            if (null == t) return i.html(""), e.removeData("index"), e.removeData("type"), e.removeData("urlImage"), !1;
5123            e.data("index"), e.data("index", t.index), e.data("type", t.type), 1 == ue.slider_enable_links && "image" == t.type && (t.link ? e.addClass("ug-slide-clickable") : e.removeClass("ug-slide-clickable")), c(e, t);
5124            var n = Q(e);
5125            switch (t.type) {
5126                case "image":
5127                    n.hide();
5128                    break;
5129                default:
5130                    n.show()
5131            }
5132        } catch (e) {
5133            throw i.html(""), new Error(e)
5134        }
5135    }
5136
5137    function g() {
5138        if (!le) return !1;
5139        if (1 == _()) return !1;
5140        var e = le.getElement(),
5141            t = 0;
5142        (1 == ce.isTextPanelSaparateHover || 1 == ue.slider_textpanel_always_on) && (t = ue.slider_controls_appear_duration), e.stop().fadeTo(t, 0), e.data("isHidden", !0)
5143    }
5144
5145    function h() {
5146        if (!le) return !1;
5147        if (0 == _()) return !1;
5148        var e = le.getElement(),
5149            t = 0;
5150        (1 == ce.isTextPanelSaparateHover || 1 == ue.slider_textpanel_always_on) && (e.show(), le.positionElements(), t = ue.slider_controls_appear_duration), e.stop().show().fadeTo(t, 1), e.data("isHidden", !1)
5151    }
5152
5153    function _() {
5154        return !1 !== le.getElement().data("isHidden")
5155    }
5156
5157    function m() {
5158        var e = ue.slider_video_constantsize_width,
5159            t = ue.slider_video_constantsize_height;
5160        oe.setSize(e, t), u(oe.getObject())
5161    }
5162
5163    function f(e, t, i) {
5164        ee.trigger($.events.TRANSITION_START);
5165        var n = ue.slider_transition;
5166        switch (i && (n = i), $.stopSlideAction(null, !0), n) {
5167            default:
5168                case "fade":
5169                b(t);
5170            break;
5171            case "slide":
5172                    ! function e(t, i) {
5173                    var n = $.isAnimating();
5174                    if (1 == n) return ce.itemWaiting = i, !0;
5175                    null != ce.itemWaiting && (ce.itemWaiting = null);
5176                    var r = $.getSlidesReference();
5177                    switch (t) {
5178                        case "right":
5179                            p(r.objPrevSlide, i), a();
5180                            var o = ae.getElementSize(r.objPrevSlide),
5181                                s = -o.left;
5182                            $.switchSlideNums("right");
5183                            break;
5184                        case "left":
5185                            p(r.objNextSlide, i), a();
5186                            var l = ae.getElementSize(r.objNextSlide),
5187                                s = -l.left;
5188                            $.switchSlideNums("left");
5189                            break;
5190                        default:
5191                            throw new Error("wrong direction: " + t)
5192                    }
5193                    var u = ue.slider_transition_speed,
5194                        d = ue.slider_transition_easing,
5195                        c = {
5196                            duration: u,
5197                            easing: d,
5198                            queue: !1,
5199                            always: function() {
5200                                if ($.stopSlideAction(), oe.hide(), null != ce.itemWaiting) {
5201                                    var t = (i = ce.itemWaiting, n = $.getSlidesReference().objCurrentSlide.data("index"), r = i.index, o = "left", n > r && (o = "right"), o);
5202                                    e(t, ce.itemWaiting)
5203                                } else $.placeNabourItems(), ee.trigger($.events.TRANSITION_END);
5204                                var i, n, r, o
5205                            }
5206                        };
5207                    W.animate({
5208                        left: s + "px"
5209                    }, c)
5210                }(e, t);
5211                break;
5212            case "lightbox_open":
5213                    b(t, !1, !0)
5214        }
5215    }
5216
5217    function v(e, t, i) {
5218        i ? e.fadeTo(ue.slider_transition_speed, t, i) : e.fadeTo(ue.slider_transition_speed, t)
5219    }
5220
5221    function b(e, t, i) {
5222        if (!t) t = !1;
5223        var n = $.getSlidesReference();
5224        p(n.objNextSlide, e);
5225        var r = ae.getElementSize(n.objCurrentSlide);
5226        ae.placeElement(n.objNextSlide, r.left, r.top);
5227        var o = ce.numCurrent;
5228        if (ce.numCurrent = ce.numNext, ce.numNext = o, ee.trigger($.events.ITEM_CHANGED), n.objNextSlide.stop(!0), n.objCurrentSlide.stop(!0), 1 == t) n.objCurrentSlide.fadeTo(0, 0), n.objNextSlide.fadeTo(0, 1), $.placeNabourItems(), ee.trigger($.events.TRANSITION_END), !0 !== i && oe.hide();
5229        else {
5230            if (n.objNextSlide.fadeTo(0, 0), v(n.objCurrentSlide, 0, function() {
5231                    $.placeNabourItems(), ee.trigger($.events.TRANSITION_END), !0 !== i && oe.hide()
5232                }), 1 == oe.isVisible()) v(oe.getObject(), 0);
5233            v(n.objNextSlide, 1)
5234        }
5235    }
5236
5237    function y() {
5238        return G.children(".ug-slider-control")
5239    }
5240
5241    function w(e) {
5242        if (0 == ae.isTimePassed("sliderControlsToggle")) return !1;
5243        if (0 == ce.isControlsVisible) return !1;
5244        if (!e) e = !1;
5245        var t = y();
5246        !0 === e ? t.stop().fadeTo(0, 0).hide() : t.stop().fadeTo(ue.slider_controls_appear_duration, 0, function() {
5247            t.hide()
5248        }), ce.isControlsVisible = !1
5249    }
5250
5251    function x(e) {
5252        if (0 == ae.isTimePassed("sliderControlsToggle")) return !1;
5253        if (1 == ce.isControlsVisible) return !0;
5254        if (!e) e = !1;
5255        var t = y();
5256        !0 === e ? t.stop().show() : (t.stop().show().fadeTo(0, 0), t.fadeTo(ue.slider_controls_appear_duration, 1)), ce.isControlsVisible = !0
5257    }
5258
5259    function E() {
5260        var e = te.getSelectedItem();
5261        $.setItem(e);
5262        var t = e.index;
5263        re && re.setActive(t), le && 0 == ce.isTextPanelSaparateHover && h(),
5264            function(e) {
5265                if (e == ce.currentControlsMode) return !1;
5266                switch (e) {
5267                    case "image":
5268                        K && K.getElement().show();
5269                        break;
5270                    case "video":
5271                        K && K.getElement().hide();
5272                        break;
5273                    default:
5274                        throw new Error("wrong controld mode: " + e)
5275                }
5276                ce.currentControlsMode = e
5277            }("image" == e.type ? "image" : "video")
5278    }
5279
5280    function I(e, t) {
5281        te.selectItem(t)
5282    }
5283
5284    function T(e) {
5285        return !(!q || 0 != q.isTapEventOccured(e)) || void ee.trigger($.events.CLICK, e)
5286    }
5287
5288    function S() {
5289        var e = $.getCurrentSlide().hasClass("ug-slide-clickable"),
5290            t = $.getCurrentItem();
5291        return e ? (0 == ue.slider_links_newpage ? location.href = t.link : window.open(t.link, "_blank"), !0) : void(0 == ue.slider_controls_always_on && 1 == ue.slider_controls_appear_ontap && 1 == $.isCurrentSlideType("image") && (0 == ce.isControlsVisible ? x() : w(), le && 1 == ue.slider_textpanel_always_on && $.isCurrentSlideType("image") && $.isCurrentSlideImageFit() && h()))
5292    }
5293
5294    function j() {
5295        le && $.isCurrentSlideType("image") && 0 == $.isCurrentSlideImageFit() && g()
5296    }
5297
5298    function P() {
5299        x()
5300    }
5301
5302    function C() {
5303        w()
5304    }
5305
5306    function A(e) {
5307        var t = e.parent();
5308        $.startSlideAction(t)
5309    }
5310
5311    function k() {
5312        te.isPlayMode() && te.pausePlaying(), ee.trigger($.events.ACTION_START)
5313    }
5314
5315    function O() {
5316        te.isPlayMode() && te.continuePlaying(), ee.trigger($.events.ACTION_END)
5317    }
5318
5319    function M(e, t) {
5320        B.data("index") == t && (objItem = te.getItem(t), c(B, objItem, !0)), U.data("index") == t && (objItem = te.getItem(t), c(U, objItem, !0)), Y.data("index") == t && (objItem = te.getItem(t), c(Y, objItem, !0))
5321    }
5322
5323    function L(e, t) {
5324        t = jQuery(t);
5325        var i = $.getSlideImage(t),
5326            n = Q(t),
5327            r = ae.getElementSize(i);
5328        ae.placeElement(n, "center", "middle", r.left, r.top, i)
5329    }
5330
5331    function H(e) {
5332        var t = Q(e);
5333        ae.addClassOnHover(t), ae.setButtonOnClick(t, A)
5334    }
5335
5336    function N(e) {
5337        switch (e) {
5338            case 1:
5339                return B;
5340            case 2:
5341                return U;
5342            case 3:
5343                return Y;
5344            default:
5345                throw new Error("wrong num: " + e)
5346        }
5347    }
5348
5349    function R(e) {
5350        if (!e) e = $.getCurrentSlide();
5351        return e.children(".ug-slider-preloader")
5352    }
5353
5354    function Q(e) {
5355        return e.children(".ug-button-videoplay")
5356    }
5357
5358    function z(e) {
5359        if (!e) e = $.getCurrentSlide();
5360        var t = e.data("index");
5361        return void 0 == t ? null : te.getItem(t)
5362    }
5363    var D, F, G, W, B, U, Y, X, V, q, Z, K, J, $ = this,
5364        ee = jQuery($),
5365        te = new UniteGalleryMain,
5366        ie = null,
5367        ne = null,
5368        re = null,
5369        oe = new UGVideoPlayer,
5370        ae = new UGFunctions,
5371        se = null,
5372        le = null;
5373    this.events = {
5374        ITEM_CHANGED: "item_changed",
5375        BEFORE_SWITCH_SLIDES: "before_switch",
5376        BEFORE_RETURN: "before_return",
5377        AFTER_RETURN: "after_return",
5378        ZOOM_START: "slider_zoom_start",
5379        ZOOM_END: "slider_zoom_end",
5380        ZOOMING: "slider_zooming",
5381        ZOOM_CHANGE: "slider_zoom_change",
5382        START_DRAG: "start_drag",
5383        AFTER_DRAG_CHANGE: "after_drag_change",
5384        ACTION_START: "action_start",
5385        ACTION_END: "action_end",
5386        CLICK: "slider_click",
5387        TRANSITION_START: "slider_transition_start",
5388        TRANSITION_END: "slider_transition_end",
5389        AFTER_PUT_IMAGE: "after_put_image",
5390        IMAGE_MOUSEENTER: "slider_image_mouseenter",
5391        IMAGE_MOUSELEAVE: "slider_image_mouseleave",
5392        CURRENTSLIDE_LOAD_START: "slider_current_loadstart",
5393        CURRENTSLIDE_LOAD_END: "slider_current_loadend"
5394    };
5395    var ue = {
5396            slider_scale_mode: "fill",
5397            slider_scale_mode_media: "fill",
5398            slider_scale_mode_fullscreen: "down",
5399            slider_item_padding_top: 0,
5400            slider_item_padding_bottom: 0,
5401            slider_item_padding_left: 0,
5402            slider_item_padding_right: 0,
5403            slider_background_color: "",
5404            slider_background_opacity: 1,
5405            slider_image_padding_top: 0,
5406            slider_image_padding_bottom: 0,
5407            slider_image_padding_left: 0,
5408            slider_image_padding_right: 0,
5409            slider_image_border: !1,
5410            slider_image_border_width: 10,
5411            slider_image_border_color: "#ffffff",
5412            slider_image_border_radius: 0,
5413            slider_image_shadow: !1,
5414            slider_video_constantsize: !1,
5415            slider_video_constantsize_scalemode: "fit",
5416            slider_video_constantsize_width: 854,
5417            slider_video_constantsize_height: 480,
5418            slider_video_padding_top: 0,
5419            slider_video_padding_bottom: 0,
5420            slider_video_padding_left: 0,
5421            slider_video_padding_right: 0,
5422            slider_video_enable_closebutton: !0,
5423            slider_transition: "slide",
5424            slider_transition_speed: 300,
5425            slider_transition_easing: "easeInOutQuad",
5426            slider_control_swipe: !0,
5427            slider_control_zoom: !0,
5428            slider_zoom_mousewheel: !0,
5429            slider_vertical_scroll_ondrag: !1,
5430            slider_loader_type: 1,
5431            slider_loader_color: "white",
5432            slider_enable_links: !0,
5433            slider_links_newpage: !1,
5434            slider_enable_bullets: !1,
5435            slider_bullets_skin: "",
5436            slider_bullets_space_between: -1,
5437            slider_bullets_align_hor: "center",
5438            slider_bullets_align_vert: "bottom",
5439            slider_bullets_offset_hor: 0,
5440            slider_bullets_offset_vert: 10,
5441            slider_enable_arrows: !0,
5442            slider_arrows_skin: "",
5443            slider_arrow_left_align_hor: "left",
5444            slider_arrow_left_align_vert: "middle",
5445            slider_arrow_left_offset_hor: 20,
5446            slider_arrow_left_offset_vert: 0,
5447            slider_arrow_right_align_hor: "right",
5448            slider_arrow_right_align_vert: "middle",
5449            slider_arrow_right_offset_hor: 20,
5450            slider_arrow_right_offset_vert: 0,
5451            slider_enable_progress_indicator: !0,
5452            slider_progress_indicator_type: "pie",
5453            slider_progress_indicator_align_hor: "right",
5454            slider_progress_indicator_align_vert: "top",
5455            slider_progress_indicator_offset_hor: 10,
5456            slider_progress_indicator_offset_vert: 10,
5457            slider_enable_play_button: !0,
5458            slider_play_button_skin: "",
5459            slider_play_button_align_hor: "left",
5460            slider_play_button_align_vert: "top",
5461            slider_play_button_offset_hor: 40,
5462            slider_play_button_offset_vert: 8,
5463            slider_play_button_mobilehide: !1,
5464            slider_enable_fullscreen_button: !0,
5465            slider_fullscreen_button_skin: "",
5466            slider_fullscreen_button_align_hor: "left",
5467            slider_fullscreen_button_align_vert: "top",
5468            slider_fullscreen_button_offset_hor: 11,
5469            slider_fullscreen_button_offset_vert: 9,
5470            slider_fullscreen_button_mobilehide: !1,
5471            slider_enable_zoom_panel: !0,
5472            slider_zoompanel_skin: "",
5473            slider_zoompanel_align_hor: "left",
5474            slider_zoompanel_align_vert: "top",
5475            slider_zoompanel_offset_hor: 12,
5476            slider_zoompanel_offset_vert: 92,
5477            slider_zoompanel_mobilehide: !1,
5478            slider_controls_always_on: !1,
5479            slider_controls_appear_ontap: !0,
5480            slider_controls_appear_duration: 300,
5481            slider_enable_text_panel: !0,
5482            slider_textpanel_always_on: !0,
5483            slider_videoplay_button_type: "square"
5484        },
5485        de = {
5486            slider_progress_indicator_align_hor: "left",
5487            slider_progress_indicator_align_vert: "bottom",
5488            slider_progress_indicator_offset_hor: 0,
5489            slider_progress_indicator_offset_vert: 0
5490        },
5491        ce = {
5492            isRunOnce: !1,
5493            isTextPanelSaparateHover: !1,
5494            numPrev: 1,
5495            numCurrent: 2,
5496            numNext: 3,
5497            isControlsVisible: !0,
5498            currentControlsMode: "image"
5499        };
5500    this.switchSlideNums = function(e) {
5501        switch (ee.trigger($.events.BEFORE_SWITCH_SLIDES), e) {
5502            case "left":
5503                var t = ce.numCurrent;
5504                ce.numCurrent = ce.numNext, ce.numNext = ce.numPrev, ce.numPrev = t;
5505                break;
5506            case "right":
5507                t = ce.numCurrent;
5508                ce.numCurrent = ce.numPrev, ce.numPrev = ce.numNext, ce.numNext = t;
5509                break;
5510            default:
5511                throw new Error("wrong direction: " + e)
5512        }
5513        ee.trigger($.events.ITEM_CHANGED)
5514    }, this.destroy = function() {
5515        ee.off($.events.AFTER_PUT_IMAGE), D.off(te.events.ITEM_IMAGE_UPDATED), D.off(te.events.ITEM_CHANGE), re && jQuery(re).on(re.events.BULLET_CLICK), G.off("mouseenter"), G.off("mouseleave"), G.off("touchend"), G.off("click"), ee.off($.events.CLICK), Z && ee.off($.events.ZOOM_CHANGE), ee.off($.events.BEFORE_SWITCH_SLIDES), jQuery(oe).off(oe.events.SHOW), jQuery(oe).off(oe.events.HIDE), oe.destroy(), G.undelegate(".ug-item-wrapper img", "mouseenter"), G.undelegate(".ug-item-wrapper img", "mouseleave")
5516    }, this.________EXTERNAL_GENERAL___________ = function() {}, this.init = function(t, i, n) {
5517        e(t, i, n)
5518    }, this.getSlideImage = function(e) {
5519        if (!e) e = $.getCurrentSlide();
5520        return e.find(".ug-item-wrapper img")
5521    }, this.setHtml = function(e) {
5522        n(e)
5523    }, this.run = function() {
5524        t()
5525    }, this.isInnerInPlace = function() {
5526        var e = $.getSlidesReference();
5527        return -ae.getElementSize(e.objCurrentSlide).left == ae.getElementSize(W).left
5528    }, this.isAnimating = function() {
5529        return W.is(":animated")
5530    }, this.isSlideCurrent = function(e) {
5531        var t = e.data("slidenum");
5532        return ce.numCurrent == t
5533    }, this.isSlideHasItem = function(e) {
5534        var t = e.data("index");
5535        return void 0 !== t && null !== t
5536    }, this.getObjImagePadding = function() {
5537        return {
5538            padding_top: ue.slider_image_padding_top,
5539            padding_bottom: ue.slider_image_padding_bottom,
5540            padding_left: ue.slider_image_padding_left,
5541            padding_right: ue.slider_image_padding_right
5542        }
5543    }, this.getSlidesReference = function() {
5544        return {
5545            objPrevSlide: N(ce.numPrev),
5546            objNextSlide: N(ce.numNext),
5547            objCurrentSlide: N(ce.numCurrent)
5548        }
5549    }, this.getCurrentSlide = function() {
5550        return $.getSlidesReference().objCurrentSlide
5551    }, this.getCurrentItemIndex = function() {
5552        var e = $.getSlidesReference().objCurrentSlide.data("index");
5553        return (null === e || void 0 === e) && (e = -1), e
5554    }, this.getCurrentItem = function() {
5555        var e = $.getCurrentItemIndex();
5556        return -1 == e ? null : te.getItem(e)
5557    }, this.getSlideType = function(e) {
5558        return void 0 == e && (e = $.getCurrentSlide()), e.data("type")
5559    }, this.isMouseInsideSlideImage = function(e) {
5560        var t = $.getSlideImage(),
5561            i = ae.getMousePosition(e);
5562        void 0 === i.pageX && (i = q.getLastMousePos());
5563        var n = ae.getMouseElementPoint(i, t),
5564            r = ae.getElementSize(t);
5565        return isMouseInside = ae.isPointInsideElement(n, r)
5566    }, this.isCurrentSlideType = function(e) {
5567        return $.getSlideType() == e
5568    }, this.isCurrentSlideLoadingImage = function() {
5569        return !0 === $.getCurrentSlide().data("isLoading")
5570    }, this.setItem = function(e, t) {
5571        var i = $.getSlidesReference(),
5572            n = i.objCurrentSlide.data("index"),
5573            r = e.index;
5574        if (r == n) return !0;
5575        if (void 0 == n) p(i.objCurrentSlide, e), $.placeNabourItems();
5576        else {
5577            var o = "left",
5578                a = te.getNumItems();
5579            n == a - 1 && 0 == r ? o = "left" : 0 == n && r == a - 1 ? o = "right" : n > r && (o = "right"), f(o, e, t)
5580        }
5581    }, this.placeNabourItems = function() {
5582        var e = $.getSlidesReference(),
5583            t = e.objCurrentSlide.data("index"),
5584            i = te.getPrevItem(t),
5585            n = te.getNextItem(t);
5586        p(e.objNextSlide, n), p(e.objPrevSlide, i), a()
5587    }, this.________EXTERNAL_API___________ = function() {}, this.stopSlideAction = function(e, t) {
5588        e || (e = $.getCurrentSlide()), !0 === t ? oe.pause() : oe.hide()
5589    }, this.startSlideAction = function(e) {
5590        e || (e = $.getCurrentSlide());
5591        var t = z(e);
5592        if ("image" == t.type) return !0;
5593        switch (1 == ue.slider_video_constantsize && m(), function() {
5594            var e = $.getCurrentSlide(),
5595                t = $.getSlideImage(e),
5596                i = ae.getElementSize(e),
5597                n = i.left,
5598                r = i.top;
5599            if (1 == ue.slider_video_constantsize) {
5600                var o = ae.getElementSize(t);
5601                n += o.left, r += o.top
5602            } else n += ue.slider_video_padding_left, r += ue.slider_video_padding_top;
5603            oe.setPosition(n, r)
5604        }(), oe.show(), t.type) {
5605            case "youtube":
5606                oe.playYoutube(t.videoid);
5607                break;
5608            case "vimeo":
5609                oe.playVimeo(t.videoid);
5610                break;
5611            case "html5video":
5612                oe.playHtml5Video(t.videoogv, t.videowebm, t.videomp4, t.urlImage);
5613                break;
5614            case "soundcloud":
5615                oe.playSoundCloud(t.trackid);
5616                break;
5617            case "wistia":
5618                oe.playWistia(t.videoid)
5619        }
5620    }
5620, this.getScaleMode = function(e) {
5621        if (!e) e = $.getCurrentSlide();
5622        return "image" != $.getSlideType(e) ? ue.slider_scale_mode_media : ue.slider_scale_mode == ue.slider_scale_mode_fullscreen ? ue.slider_scale_mode : 1 == te.isFullScreen() ? ue.slider_scale_mode_fullscreen : ue.slider_scale_mode
5623    }, this.getObjects = function() {
5624        return {
5625            g_objSlider: G,
5626            g_objInner: W,
5627            g_options: ue,
5628            g_objZoomSlider: Z
5629        }
5630    }, this.getObjZoom = function() {
5631        return Z
5632    }, this.getOptions = function() {
5633        return ue
5634    }, this.getElement = function() {
5635        return G
5636    }, this.getVideoObject = function() {
5637        return oe
5638    }, this.isCurrentSlideImageFit = function() {
5639        var e = $.getCurrentSlide();
5640        $.getSlideType(e),
5641            function(e, t) {
5642                void 0 == t && (t = $.getCurrentSlide());
5643                var i = $.getSlideType(t);
5644                if (i != e) throw new Error("Wrong slide type: " + i + ", should be: " + e)
5645            }("image", e);
5646        var t = $.getSlideImage(e);
5647        return 0 != t.length && ae.isImageFitParent(t)
5648    }, this.isCurrentImageInPlace = function() {
5649        var e = $.getSlideImage();
5650        if (0 == e.length) return !1;
5651        var t = $.getScaleMode(),
5652            i = $.getObjImagePadding(),
5653            n = z(),
5654            r = e.parent(),
5655            o = ae.getImageInsideParentData(r, n.imageWidth, n.imageHeight, t, i),
5656            a = ae.getElementSize(e);
5657        return o.imageWidth == a.width
5658    }, this.isSlideActionActive = function() {
5659        return oe.isVisible()
5660    }, this.isSwiping = function() {
5661        return !!q && q.isTouchActive()
5662    }, this.isPreloading = function() {
5663        return !!R().is(":visible")
5664    }, this.setOptions = function(e) {
5665        J && (e = ae.convertCustomPrefixOptions(e, J, "slider")), ue = jQuery.extend(ue, e)
5666    }, this.setSize = function(e, t) {
5667        if (0 > e || 0 > t) return !0;
5668        var i = {};
5669        i.width = e + "px", i.height = t + "px", G.css(i);
5670        var n = {};
5671        n.height = t + "px", n.top = "0px", n.left = "0px", W.css(n);
5672        var r = {};
5673        r.height = t + "px", r.width = e + "px", B.css(r), U.css(r), Y.css(r);
5674        var l = e - ue.slider_item_padding_left - ue.slider_item_padding_right,
5675            u = t - ue.slider_item_padding_top - ue.slider_item_padding_bottom,
5676            d = {};
5677        if (d.width = l + "px", d.height = u + "px", d.top = ue.slider_item_padding_top + "px", d.left = ue.slider_item_padding_left + "px", G.find(".ug-item-wrapper").css(d), le && le.setSizeByParent(), "image" != $.getSlideType() && 1 == ue.slider_video_constantsize) m();
5678        else {
5679            var c = e - ue.slider_video_padding_left - ue.slider_video_padding_right,
5680                p = t - ue.slider_video_padding_top - ue.slider_video_padding_bottom;
5681            oe.setSize(c, p)
5682        }
5683        o(), s(B), s(U), s(Y), a()
5684    }, this.refreshSlideItems = function() {
5685        return 1 == $.isAnimating() || (s(B), s(U), s(Y), void a())
5686    }, this.isMouseOver = function() {
5687        return G.ismouseover()
5688    }, this.setPosition = function(e, t) {
5689        ae.placeElement(G, e, t)
5690    }, this.zoomIn = function() {
5691        return !Z || void Z.zoomIn()
5692    }, this.zoomOut = function() {
5693        return !Z || void Z.zoomOut()
5694    }, this.zoomBack = function() {
5695        return !Z || void Z.zoomBack()
5696    }
5697}
5698
5699function UGTextPanel() {
5700    function e(e, t) {
5701        if (!t) t = h.textpanel_padding_top;
5702        var i = t;
5703        if (a) {
5704            var n = i;
5705            p.placeElement(a, 0, n);
5706            i = p.getElementSize(a).bottom
5707        }
5708        var o = "";
5709        if (s && (o = jQuery.trim(s.text())), "" != o) {
5710            var d = i;
5711            a && (d += h.textpanel_padding_title_description), p.placeElement(s, 0, d), i = p.getElementSize(s).bottom
5712        }
5713        h.textpanel_height || function(e, t) {
5714            if (!t) var t = !1;
5715            if (1 == t) {
5716                if (l) {
5717                    var i = l.height();
5718                    e > i && l.height(e)
5719                }
5720                var n = {
5721                    height: e + "px"
5722                };
5723                r.add(u).animate(n, h.textpanel_fade_duration)
5724            } else l && l.height(e), r.add(u).height(e)
5725        }(i + h.textpanel_padding_bottom, e)
5726    }
5727
5728    function t() {
5729        var e = 0;
5730        if (a && (e += a.outerHeight()), s) {
5731            var t = "";
5732            s && (t = jQuery.trim(s.text())), "" != t && (a && (e += h.textpanel_padding_title_description), e += s.outerHeight())
5733        }
5734        return e
5735    }
5736
5737    function i() {
5738        if (1 == h.textpanel_enable_bg) {
5739            (l = r.children(".ug-textpanel-bg")).fadeTo(0, h.textpanel_bg_opacity);
5740            var e = {
5741                "background-color": h.textpanel_bg_color
5742            };
5743            e = jQuery.extend(e, h.textpanel_bg_css), l.css(e)
5744        }
5745        if (1 == h.textpanel_enable_title) {
5746            a = u.children(".ug-textpanel-title");
5747            var t = {};
5748            null !== h.textpanel_title_color && (t.color = h.textpanel_title_color), null !== h.textpanel_title_font_family && (t["font-family"] = h.textpanel_title_font_family), null !== h.textpanel_title_text_align && (t["text-align"] = h.textpanel_title_text_align), null !== h.textpanel_title_font_size && (t["font-size"] = h.textpanel_title_font_size + "px"), null !== h.textpanel_title_bold && (t["font-weight"] = !0 === h.textpanel_title_bold ? "bold" : "normal"), h.textpanel_css_title && (t = jQuery.extend(t, h.textpanel_css_title)), a.css(t)
5749        }
5750        if (1 == h.textpanel_enable_description) {
5751            s = u.children(".ug-textpanel-description");
5752            var i = {};
5753            null !== h.textpanel_desc_color && (i.color = h.textpanel_desc_color), null !== h.textpanel_desc_font_family && (i["font-family"] = h.textpanel_desc_font_family), null !== h.textpanel_desc_text_align && (i["text-align"] = h.textpanel_desc_text_align), null !== h.textpanel_desc_font_size && (i["font-size"] = h.textpanel_desc_font_size + "px"), null !== h.textpanel_desc_bold && (i["font-weight"] = !0 === h.textpanel_desc_bold ? "bold" : "normal"), h.textpanel_css_title && (i = jQuery.extend(i, h.textpanel_css_description)), s.css(i)
5754        }
5755    }
5756
5757    function n() {
5758        var e = d.getSelectedItem();
5759        c.setText(e.title, e.description)
5760    }
5761    var r, o, a, s, l, u, d, c = this,
5762        p = new UGFunctions,
5763        g = "",
5764        h = {
5765            textpanel_align: "bottom",
5766            textpanel_margin: 0,
5767            textpanel_text_valign: "middle",
5768            textpanel_padding_top: 10,
5769            textpanel_padding_bottom: 10,
5770            textpanel_height: null,
5771            textpanel_padding_title_description: 5,
5772            textpanel_padding_right: 11,
5773            textpanel_padding_left: 11,
5774            textpanel_fade_duration: 200,
5775            textpanel_enable_title: !0,
5776            textpanel_enable_description: !0,
5777            textpanel_enable_bg: !0,
5778            textpanel_bg_color: "#000000",
5779            textpanel_bg_opacity: .4,
5780            textpanel_title_color: null,
5781            textpanel_title_font_family: null,
5782            textpanel_title_text_align: null,
5783            textpanel_title_font_size: null,
5784            textpanel_title_bold: null,
5785            textpanel_css_title: {},
5786            textpanel_desc_color: null,
5787            textpanel_desc_font_family: null,
5788            textpanel_desc_text_align: null,
5789            textpanel_desc_font_size: null,
5790            textpanel_desc_bold: null,
5791            textpanel_css_description: {},
5792            textpanel_bg_css: {}
5793        },
5794        _ = {
5795            isFirstTime: !0
5796        };
5797    this.positionElements = function(i) {
5798        if (!h.textpanel_height || "top" == h.textpanel_text_valign) return e(i), !1;
5799        switch (h.textpanel_text_valign) {
5800            default:
5801                case "top":
5802                e(!1);
5803            break;
5804            case "bottom":
5805                    r = t(),
5806                e(!1, u.height() - r - h.textpanel_padding_bottom);
5807                break;
5808            case "center":
5809                    case "middle":
5810                    n = t(),
5811                e(!1, (u.height() - n) / 2)
5812        }
5813        var n, r
5814    }, this.init = function(e, t, i) {
5815        if (d = e, i && (g = i, t = p.convertCustomPrefixOptions(t, g, "textpanel")), t && (h = jQuery.extend(h, t)), 0 == h.textpanel_enable_title && 0 == h.textpanel_enable_description) throw new Error("Textpanel Error: The title or description must be enabled");
5816        h.textpanel_height && h.textpanel_height < 0 && (h.textpanel_height = null)
5817    }, this.appendHTML = function(e) {
5818        o = e;
5819        var t = "<div class='ug-textpanel'>";
5820        1 == h.textpanel_enable_bg && (t += "<div class='ug-textpanel-bg'></div>"), t += "<div class='ug-textpanel-textwrapper'>", 1 == h.textpanel_enable_title && (t += "<div class='ug-textpanel-title'></div>"), 1 == h.textpanel_enable_description && (t += "<div class='ug-textpanel-description'></div>"), t += "</div></div>", e.append(t), r = e.children(".ug-textpanel"), u = r.children(".ug-textpanel-textwrapper"), i()
5821    }, this.destroy = function() {
5822        jQuery(d).off(d.events.ITEM_CHANGE)
5823    }, this.run = function() {
5824        c.setSizeByParent(), jQuery(d).on(d.events.ITEM_CHANGE, n)
5825    }, this.setPanelSize = function(e) {
5826        var t = 80;
5827        h.textpanel_height && (t = h.textpanel_height), r.width(e), r.height(t), l && (l.width(e), l.height(t));
5828        var i = e - h.textpanel_padding_left - h.textpanel_padding_right,
5829            n = h.textpanel_padding_left;
5830        p.setElementSizeAndPosition(u, n, 0, i, t), a && a.width(i), s && s.width(i), 0 == _.isFirstTime && c.positionElements(!1)
5831    }, this.setSizeByParent = function() {
5832        var e = p.getElementSize(o);
5833        c.setPanelSize(e.width)
5834    }, this.setTextPlain = function(e, t) {
5835        a && a.html(e), s && s.html(t)
5836    }, this.setText = function(e, t) {
5837        1 == _.isFirstTime ? (c.setTextPlain(e, t), _.isFirstTime = !1, c.positionElements(!1)) : u.stop().fadeTo(h.textpanel_fade_duration, 0, function() {
5838            c.setTextPlain(e, t), c.positionElements(!0), jQuery(this).fadeTo(h.textpanel_fade_duration, 1)
5839        })
5840    }, this.positionPanel = function(e, t) {
5841        var i = {};
5842        if (void 0 !== e && null !== e) i.top = e;
5843        else switch (h.textpanel_align) {
5844            case "top":
5845                i.top = h.textpanel_margin + "px";
5846                break;
5847            case "bottom":
5848                i.top = "auto", i.bottom = h.textpanel_margin + "px";
5849                break;
5850            case "middle":
5851                i.top = p.getElementRelativePos(r, "middle", h.textpanel_margin)
5852        }
5853        void 0 !== t && null !== t && (i.left = t), r.css(i)
5854    }, this.setOptions = function(e) {
5855        g && (e = p.convertCustomPrefixOptions(e, g, "textpanel")), h = jQuery.extend(h, e)
5856    }, this.getElement = function() {
5857        return r
5858    }
5858, this.getSize = function() {
5859        return p.getElementSize(r)
5860    }, this.refresh = function(e, t, n) {
5861        i(), n ? c.setPanelSize(n) : c.setSizeByParent(), c.positionElements(!1), !0 !== t && c.positionPanel(), !0 === e && c.show()
5862    }, this.hide = function() {
5863        r.hide()
5864    }, this.show = function() {
5865        r.show()
5866    }, this.getOptions = function() {
5867        return h
5868    }, this.getOption = function(e) {
5869        return 0 == h.hasOwnProperty(e) ? null : h[e]
5870    }
5871}
5872
5873function UGZoomButtonsPanel() {
5874    function e(e) {
5875        return !!e.hasClass("ug-zoompanel-button-disabled")
5876    }
5877
5878    function t(e) {
5879        e.addClass("ug-zoompanel-button-disabled")
5880    }
5881
5882    function i(e) {
5883        e.removeClass("ug-zoompanel-button-disabled")
5884    }
5885
5886    function n() {
5887        if (0 == l.isCurrentSlideType("image")) return !0;
5888        1 == l.isCurrentSlideImageFit() ? 0 == e(a) && (t(a), t(s)) : 1 == e(a) && (i(a), i(s))
5889    }
5890    var r, o, a, s, l = new UGSlider,
5891        u = new UGFunctions,
5892        d = {
5893            slider_zoompanel_skin: ""
5894        };
5895    this.init = function(e, t) {
5896        l = e, t && (d = jQuery.extend(d, t))
5897    }, this.appendHTML = function(e) {
5898        e;
5899        var t = "<div class='ug-slider-control ug-zoompanel ug-skin-" + d.slider_zoompanel_skin + "'>";
5900        t += "<div class='ug-zoompanel-button ug-zoompanel-plus'></div>", t += "<div class='ug-zoompanel-button ug-zoompanel-minus ug-zoompanel-button-disabled'></div>", t += "<div class='ug-zoompanel-button ug-zoompanel-return ug-zoompanel-button-disabled'></div>", t += "</div>", e.append(t), r = e.children(".ug-zoompanel"), o = r.children(".ug-zoompanel-plus"), a = r.children(".ug-zoompanel-minus"), s = r.children(".ug-zoompanel-return")
5901    }, this.getElement = function() {
5902        return r
5903    }, this.initEvents = function() {
5904        u.addClassOnHover(o, "ug-button-hover"), u.addClassOnHover(a, "ug-button-hover"), u.addClassOnHover(s, "ug-button-hover"), u.setButtonOnClick(o, function() {
5905            return 1 == e(o) || void l.zoomIn()
5906        }), u.setButtonOnClick(a, function() {
5907            return 1 == e(a) || void l.zoomOut()
5908        }), u.setButtonOnClick(s, function() {
5909            return 1 == e(s) || void l.zoomBack()
5910        }), jQuery(l).on(l.events.ZOOM_CHANGE, n), jQuery(l).on(l.events.ITEM_CHANGED, n)
5911    }
5912}
5913
5914function UGBullets() {
5915    function e() {
5916        var e = "",
5917            t = ""; - 1 != d.bullets_space_between && (t = " style='margin-left:" + d.bullets_space_between + "px'");
5918        for (var i = 0; s > i; i++) e += 0 == i ? "<div class='ug-bullet'></div>" : "<div class='ug-bullet'" + t + "></div>";
5919        o.html(e)
5920    }
5921
5922    function t(e) {
5923        if (1 == a.isActive(e)) return !0;
5924        var t = e.index();
5925        jQuery(a).trigger(a.events.BULLET_CLICK, t)
5926    }
5927
5928    function i() {
5929        var e = o.children(".ug-bullet");
5930        l.setButtonOnClick(e, t), e.on("mousedown mouseup", function() {
5931            return !1
5932        })
5933    }
5934
5935    function n(e) {
5936        if (0 > e || e >= s) throw new Error("wrong bullet index: " + e)
5937    }
5938
5939    function r() {
5940        if (1 == u.isInited) return !0;
5941        throw new Error("The bullets are not inited!")
5942    }
5943    var o, a = this,
5944        s = 0,
5945        l = (new UniteGalleryMain, new UGFunctions),
5946        u = {
5947            isInited: !1
5948        },
5949        d = {
5950            bullets_skin: "",
5951            bullets_addclass: "",
5952            bullets_space_between: -1
5953        };
5954    this.events = {
5955        BULLET_CLICK: "bullet_click"
5956    }, this.init = function(e, t, i) {
5957        s = i || e.getNumItems(), u.isInited = !0, "" == (d = jQuery.extend(d, t)).bullets_skin && (d.bullets_skin = d.gallery_skin)
5958    }, this.appendHTML = function(t) {
5959        t, r();
5960        var n = "";
5961        "" != d.bullets_addclass && (n = " " + d.bullets_addclass);
5962        var a = "<div class='ug-slider-control ug-bullets ug-skin-" + d.bullets_skin + n + "'>";
5963        o = jQuery(a += "</div>"), t.append(o), e(), i()
5964    }, this.updateNumBullets = function(t) {
5965        s = t, e(), i()
5966    }, this.getElement = function() {
5967        return o
5968    }, this.setActive = function(e) {
5969        r(), n(e);
5970        var t = o.children(".ug-bullet");
5971        t.removeClass("ug-bullet-active"), jQuery(t[e]).addClass("ug-bullet-active"), e
5972    }, this.isActive = function(e) {
5973        if (n(e), "number" != typeof e) var t = e;
5974        else t = o.children(".ug-bullet")[e];
5975        return !!t.hasClass("ug-bullet-active")
5976    }
5977}
5978
5979function UGProgressBar() {
5980    var e, t, i = this,
5981        n = 0,
5982        r = new UGFunctions,
5983        o = {
5984            slider_progressbar_color: "#ffffff",
5985            slider_progressbar_opacity: .6,
5986            slider_progressbar_line_width: 5
5987        };
5988    this.put = function(i, n) {
5989        n && (o = jQuery.extend(o, n)), i.append("<div class='ug-progress-bar'><div class='ug-progress-bar-inner'></div></div>"), e = i.children(".ug-progress-bar"), (t = e.children(".ug-progress-bar-inner")).css("background-color", o.slider_progressbar_color), e.height(o.slider_progressbar_line_width), t.height(o.slider_progressbar_line_width), t.width("0%");
5990        var r = o.slider_progressbar_opacity,
5991            a = t[0];
5992        a.style.opacity = r, a.style.filter = "alpha(opacity=" + 100 * r + ")"
5993    }, this.putHidden = function(t, n) {
5994        i.put(t, n), e.hide()
5995    }, this.getElement = function() {
5996        return e
5997    }, this.setSize = function(n) {
5998        e.width(n), t.width(n), i.draw()
5999    }, this.setPosition = function(t, i, n, o) {
6000        r.placeElement(e, t, i, n, o)
6001    }, this.draw = function() {
6002        var e = 100 * n;
6003        t.width(e + "%")
6004    }, this.setProgress = function(e) {
6005        n = r.normalizePercent(e), i.draw()
6006    }, this.getType = function() {
6007        return "bar"
6008    }
6009}
6010
6011function UGProgressPie() {
6012    function e(e) {
6013        if (!e) e = 0;
6014        var i = Math.min(o.slider_progresspie_width, o.slider_progresspie_height) / 2,
6015            r = t[0].getContext("2d");
6016        0 == n && (n = !0, r.rotate(1.5 * Math.PI), r.translate(-2 * i, 0)), r.clearRect(0, 0, o.slider_progresspie_width, o.slider_progresspie_height);
6017        var a = o.slider_progresspie_width / 2,
6018            s = o.slider_progresspie_height / 2,
6019            l = 0,
6020            u = e * Math.PI * 2;
6021        if (1 == o.slider_progresspie_type_fill) r.beginPath(), r.moveTo(a, s), r.arc(a, s, i, l, u), r.lineTo(a, s), r.fillStyle = o.slider_progresspie_color1, r.fill(), r.closePath();
6022        else {
6023            r.globalCompositeOperation = "source-over", r.beginPath(), r.moveTo(a, s), r.arc(a, s, i, l, u), r.lineTo(a, s), r.fillStyle = o.slider_progresspie_color1, r.fill(), r.closePath(), r.globalCompositeOperation = "destination-out";
6024            var d = i - o.slider_progresspie_stroke_width;
6025            r.beginPath(), r.moveTo(a, s), r.arc(a, s, d, l, u), r.lineTo(a, s), r.fillStyle = o.slider_progresspie_color1, r.fill(), r.closePath()
6026        }
6027        1 == o.slider_progresspie_type_fill && (l = u, u = 2 * Math.PI, r.beginPath(), r.arc(a, s, i, l, u), r.lineTo(a, s), r.fillStyle = o.slider_progresspie_color2, r.fill(), r.closePath())
6028    }
6029    var t, i = this,
6030        n = !1,
6031        r = new UGFunctions,
6032        o = {
6033            slider_progresspie_type_fill: !1,
6034            slider_progresspie_color1: "#B5B5B5",
6035            slider_progresspie_color2: "#E5E5E5",
6036            slider_progresspie_stroke_width: 6,
6037            slider_progresspie_width: 30,
6038            slider_progresspie_height: 30
6039        };
6040    this.put = function(e, i) {
6041        i && (o = jQuery.extend(o, i)), e.append("<canvas class='ug-canvas-pie' width='" + o.slider_progresspie_width + "' height='" + o.slider_progresspie_height + "'></canvas>"), t = e.children(".ug-canvas-pie")
6042    }, this.putHidden = function(n, r) {
6043        i.put(n, r), e(.1), t.hide()
6044    }, this.getElement = function() {
6045        return t
6046    }, this.setPosition = function(e, i) {
6047        r.placeElement(t, e, i)
6048    }, this.getSize = function() {
6049        return {
6050            width: o.slider_progresspie_width,
6051            height: o.slider_progresspie_height
6052        }
6053    }, this.setProgress = function(t) {
6054        t = r.normalizePercent(t), t, e(t)
6055    }, this.getType = function() {
6056        return "pie"
6057    }
6058}
6059
6060function UGTouchSliderControl() {
6061    function e(e) {
6062        if (!e) e = p.getSlidesReference();
6063        return -g.getElementSize(e.objCurrentSlide).left - g.getElementSize(d).left
6064    }
6065
6066    function t(e) {
6067        if (1 == p.isInnerInPlace()) return !1;
6068        if (c.trigger(p.events.BEFORE_RETURN), !e) e = p.getSlidesReference();
6069        var t = -g.getElementSize(e.objCurrentSlide).left;
6070        d.animate({
6071            left: t + "px"
6072        }, {
6073            duration: h.slider_transition_return_speed,
6074            easing: h.slider_transition_continuedrag_easing,
6075            queue: !1,
6076            progress: function() {
6077                if (1 == _.isDragVideo) {
6078                    var e = g.getElementSize(d).left - t,
6079                        i = _.videoStartX + e;
6080                    _.videoObject.css("left", i)
6081                }
6082            },
6083            complete: function() {
6084                c.trigger(p.events.AFTER_RETURN)
6085            }
6086        })
6087    }
6088
6089    function i() {
6090        var i = p.getSlidesReference(),
6091            n = e(i);
6092        if (0 == n) return !1;
6093        var r = n > 0 ? "left" : "right",
6094            o = !1;
6095        switch (r) {
6096            case "right":
6097                if (p.isSlideHasItem(i.objPrevSlide)) var a = g.getElementSize(i.objPrevSlide),
6098                    s = -a.left;
6099                else o = !0;
6100                break;
6101            case "left":
6102                if (p.isSlideHasItem(i.objNextSlide)) {
6103                    var l = g.getElementSize(i.objNextSlide);
6104                    s = -l.left
6105                } else o = !0
6106        }
6107        1 == o ? t(i) : d.stop().animate({
6108            left: s + "px"
6109        }, {
6110            duration: h.slider_transition_continuedrag_speed,
6111            easing: h.slider_transition_continuedrag_easing,
6112            queue: !1,
6113            progress: function() {
6114                if (1 == _.isDragVideo) {
6115                    var e = g.getElementSize(d).left - _.startPosx,
6116                        t = _.videoStartX + e;
6117                    _.videoObject.css("left", t)
6118                }
6119            },
6120            always: function() {
6121                var e;
6122                e = r, p.getVideoObject().hide(), p.switchSlideNums(e), p.placeNabourItems(), c.trigger(p.events.AFTER_DRAG_CHANGE)
6123            }
6124        })
6125    }
6126
6127    function n(e) {
6128        var t = g.getMousePosition(e);
6129        _.startMouseX = t.pageX, _.startMouseY = t.pageY, _.lastMouseX = _.startMouseX, _.lastMouseY = _.startMouseY, _.startTime = jQuery.now();
6130        var i = g.getArrTouches(e);
6131        _.startArrTouches = g.getArrTouchPositions(i);
6132        var n = g.getElementSize(d);
6133        _.startPosx = n.left, _.isInitDataValid = !0, _.isDragVideo = !1, g.storeEventData(e, _.storedEventID)
6134    }
6135
6136    function r() {
6137        _.touch_active = !1
6138    }
6139
6140    function o(e, t) {
6141        _.touch_active = !0, n(t)
6142    }
6143
6144    function a(e) {
6145        return e.preventDefault(), _.isDragging = !1, 1 == p.isAnimating() && d.stop(!0, !0), g.getArrTouches(e).length > 1 ? (1 == _.touch_active && r(), !0) : 1 == _.touch_active || void o(0, e)
6146    }
6147
6148    function s(e) {
6149        if (0 == _.touch_active) return !0;
6150        if (0 == e.buttons) return r(), i(), !0;
6151        g.updateStoredEventData(e, _.storedEventID), e.preventDefault();
6152        var t = g.getMousePosition(e);
6153        _.lastMouseX = t.pageX, _.lastMouseY = t.pageY;
6154        var o = null;
6155        1 == h.slider_vertical_scroll_ondrag && (o = g.handleScrollTop(_.storedEventID)), "vert" !== o && function(e) {
6156            var t = _.lastMouseX - _.startMouseX;
6157            if (0 == t) return !0;
6158            var i = 0 > t ? "left" : "right",
6159                r = p.getObjZoom();
6160            if (r) {
6161                if (1 == r.isPanEnabled(e, i)) return _.isInitDataValid = !1, !0;
6162                if (0 == _.isInitDataValid) return n(e), !0
6163            }
6164            var o = _.startPosx + t;
6165            if (t > 0 && o > 0) o /= 3;
6166            else if (0 > t) {
6167                var a = o + d.width();
6168                u.width() > a && (o = _.startPosx + t / 3)
6169            }
6170            if (0 == _.isDragging && (_.isDragging = !0, c.trigger(p.events.START_DRAG)), d.css("left", o + "px"), 1 == _.isDragVideo) {
6171                var s = o - _.startPosx,
6172                    l = _.videoStartX + s;
6173                _.videoObject.css("left", l)
6174            }
6175        }(e)
6176    }
6177
6178    function l(n) {
6179        var a = g.getArrTouches(n).length;
6180        if (1 == p.isInnerInPlace() && 0 == _.touch_active && 0 == a) return !0;
6181        if (0 == a && 1 == _.touch_active) {
6182            r();
6183            var s = !1;
6184            0 == g.wasVerticalScroll(_.storedEventID) && (s = function() {
6185                var t = p.getSlidesReference(),
6186                    i = e(t),
6187                    n = Math.round(3 * t.objCurrentSlide.width() / 8);
6188                if (Math.abs(i) >= n) return !0;
6189                var r = Math.abs(_.lastMouseX - _.startMouseX);
6190                return Math.abs(_.lastMouseY - _.startMouseY), !(20 > r) && 500 > jQuery.now() - _.startTime
6191            }()), 1 == s ? i() : t()
6192        } else 1 == a && 0 == _.touch_active && o(0, n)
6193    }
6194    var u, d, c, p = new UGSlider,
6195        g = new UGFunctions,
6196        h = {
6197            slider_transition_continuedrag_speed: 250,
6198            slider_transition_continuedrag_easing: "linear",
6199            slider_transition_return_speed: 300,
6200            slider_transition_return_easing: "easeInOutQuad"
6201        },
6202        _ = {
6203            touch_active: !1,
6204            startMouseX: 0,
6205            startMouseY: 0,
6206            lastMouseX: 0,
6207            lastMouseY: 0,
6208            startPosx: 0,
6209            startTime: 0,
6210            isInitDataValid: !1,
6211            slides: null,
6212            lastNumTouches: 0,
6213            isDragging: !1,
6214            storedEventID: "touchSlider",
6215            videoStartX: 0,
6216            isDragVideo: !1,
6217            videoObject: null
6218        };
6219    this.isTapEventOccured = function(t) {
6220        var i = g.getArrTouches(t).length;
6221        if (0 != i || 0 != _.lastNumTouches) return _.lastNumTouches = i, !1;
6222        _.lastNumTouches = i;
6223        var n = (e(p.getSlidesReference()), Math.abs(_.lastMouseX - _.startMouseX)),
6224            r = Math.abs(_.lastMouseY - _.startMouseY),
6225            o = jQuery.now() - _.startTime;
6226        return 20 > n && 50 > r && 500 > o
6227    }, this.init = function(e, t) {
6228        p = e, c = jQuery(p), g_objects = e.getObjects(), u = g_objects.g_objSlider, d = g_objects.g_objInner, h = jQuery.extend(h, t), u.bind("mousedown touchstart", a), jQuery("body").bind("mousemove touchmove", s), jQuery(window).add("body").bind("mouseup touchend", l)
6229    }, this.getLastMousePos = function() {
6230        return {
6231            pageX: _.lastMouseX,
6232            pageY: _.lastMouseY
6233        }
6234    }, this.isTouchActive = function() {
6235        return _.touch_active
6236    }
6237}
6238
6239function UGZoomSliderControl() {
6240    function e(e, t) {
6241        _ = e, h = jQuery(_), g_objects = e.getObjects(), g = g_objects.g_objSlider, g_objects.g_objInner, f = jQuery.extend(f, t), g.on("mousewheel", p), g.bind("mousedown touchstart", u), jQuery("body").bind("mousemove touchmove", c), jQuery(window).add("body").bind("mouseup touchend", d), h.bind(_.events.BEFORE_RETURN, function() {
6242            l()
6243        }), h.bind(_.events.ITEM_CHANGED, function() {
6244            v.isZoomedOnce = !1
6245        }), h.bind(_.events.ZOOM_CHANGE, function() {
6246            v.isZoomedOnce = !0
6247        })
6248    }
6249
6250    function t() {
6251        var e = _.getScaleMode();
6252        return "down" != e && (e = "fit"), e
6253    }
6254
6255    function i() {
6256        if (20 > (n = jQuery.now()) - v.storeImageLastTime) return !1;
6257        var e = _.getSlidesReference();
6258        if (v.objSlide = e.objCurrentSlide, v.objImage = e.objCurrentSlide.find("img"), 0 == v.objImage.length) return !1;
6259        v.objImageSize = m.getElementSize(v.objImage), v.objParent = v.objImage.parent(), v.objParentSize = m.getElementSize(v.objParent);
6260        var i = t();
6261        objPadding = _.getObjImagePadding(), v.objFitImageSize = m.getImageInsideParentDataByImage(v.objImage, i, objPadding);
6262        var n = jQuery.now();
6263        return v.storeImageLastTime = n, !0
6264    }
6265
6266    function n(e, i) {
6267        var n = _.getSlidesReference().objCurrentSlide.find("img"),
6268            r = t();
6269        h.trigger(_.events.ZOOM_START);
6270        var o = !0,
6271            a = _.getObjImagePadding();
6272        if ("back" == e) {
6273            var s = m.getImageOriginalSize(n);
6274            m.scaleImageFitParent(n, s.width, s.height, r, a)
6275        } else {
6276            var l = "in" == e;
6277            o = m.zoomImageInsideParent(n, l, f.slider_zoom_step, i, r, f.slider_zoom_max_ratio, a)
6278        }
6279        1 == o && (h.trigger(_.events.ZOOMING), h.trigger(_.events.ZOOM_CHANGE), h.trigger(_.events.ZOOM_END))
6280    }
6281
6282    function r(e, t, i) {
6283        var n = m.getArrTouches(t);
6284        if (!0 === i) {
6285            if (1 != n.length) return !1
6286        } else if (n.length > 1) return !1;
6287        return !!m.isElementBiggerThenParent(e)
6288    }
6289
6290    function o(e) {
6291        var t, i;
6292        v.isPanActive = !0, t = e, i = m.getMousePosition(t), v.startMouseX = i.pageX, v.startMouseY = i.pageY, v.lastMouseX = v.startMouseX, v.lastMouseY = v.startMouseY, v.startImageX = v.objImageSize.left, v.startImageY = v.objImageSize.top, v.panXActive = v.objImageSize.width > v.objParentSize.width, v.panYActive = v.objImageSize.height > v.objParentSize.height
6293    }
6294
6295    function a(e) {
6296        if (0 == v.isZoomActive) return !1;
6297        2 != m.getArrTouches(e).length && (v.isZoomActive = !1, h.trigger(_.events.ZOOM_END))
6298    }
6299
6300    function s(e) {
6301        if (1 == v.isZoomActive) return !0;
6302        var t, i = m.getArrTouches(e);
6303        return 2 != i.length || (t = i, v.isZoomActive = !0, v.startDistance = m.getDistance(t[0].pageX, t[0].pageY, t[1].pageX, t[1].pageY), 0 == v.startDistance && (v.startDistance = 1), v.startMiddlePoint = m.getMiddlePoint(t[0].pageX, t[0].pageY, t[1].pageX, t[1].pageY), v.objImageSize = m.getElementSize(v.objImage), v.startImageX = v.objImageSize.left, v.startImageY = v.objImageSize.top, v.imageOrientPoint = m.getElementLocalPoint(v.startMiddlePoint, v.objImage), 0 == m.isPointInsideElement(v.imageOrientPoint, v.objImageSize) && (v.imageOrientPoint = m.getElementCenterPoint(v.objImage)), void h.trigger(_.events.ZOOM_START))
6304    }
6305
6306    function l() {
6307        if (void 0 == v.objImage || 0 == v.objImage.length) return !0;
6308        if (m.getElementSize(v.objImage).width < v.objFitImageSize.imageWidth) {
6309            v.objImage.css({
6310                position: "absolute",
6311                margin: "none"
6312            });
6313            var e = {
6314                top: v.objFitImageSize.imageTop + "px",
6315                left: v.objFitImageSize.imageLeft + "px",
6316                width: v.objFitImageSize.imageWidth + "px",
6317                height: v.objFitImageSize.imageHeight + "px"
6318            };
6319            v.objImage.animate(e, {
6320                duration: f.slider_zoom_return_pan_duration,
6321                easing: f.slider_zoom_return_pan_easing,
6322                queue: !1
6323            })
6324        } else ! function() {
6325            var e = !1,
6326                t = !1,
6327                i = 0,
6328                n = 0,
6329                r = m.getElementSize(v.objImage),
6330                o = _.getObjImagePadding(),
6331                a = m.getElementCenterPosition(v.objImage, o);
6332            v.panXActive = v.objImageSize.width > v.objParentSize.width, v.panYActive = v.objImageSize.height > v.objParentSize.height, 1 == v.panYActive ? r.top > 0 ? (n = 0, t = !0) : r.bottom < v.objParentSize.height && (n = v.objParentSize.height - r.height, t = !0) : r.top != a.top && (t = !0, n = a.top), 1 == v.panXActive ? r.left > 0 ? (i = 0, e = !0) : r.right < v.objParentSize.width && (i = v.objParentSize.width - r.width, e = !0) : r.left != a.left && (e = !0, i = a.left);
6333            var s = {};
6334            1 == t && (s.top = n + "px"), 1 == e && (s.left = i + "px"), (1 == t || 1 == e) && v.objImage.animate(s, {
6335                duration: f.slider_zoom_return_pan_duration,
6336                easing: f.slider_zoom_return_pan_easing,
6337                queue: !1
6338            })
6339        }()
6340    }
6341
6342    function u(e) {
6343        return 0 == _.isCurrentSlideType("image") || (i(), void 0 == v.objImage || 0 == v.objImage.length || (e.preventDefault(), 1 == !(!v.objImage || !v.objImage.is(":animated")) && v.objImage.stop(!0), 1 == v.isZoomActive ? a(e) : s(e), void(1 == v.isZoomActive ? v.isPanActive = !1 : 1 == r(v.objImage, e) && 1 == v.isZoomedOnce && o(e))))
6344    }
6345
6346    function d(e) {
6347        if (0 == _.isCurrentSlideType("image")) return !0;
6348        if (1 == jQuery(e.target).data("ug-button")) return !1;
6349        if (i(), void 0 == v.objImage || 0 == v.objImage.length) return !0;
6350        var t = v.isPanActive,
6351            n = v.isZoomActive;
6352        if (0 == _.isInnerInPlace()) return v.isZoomActive = !1, v.isPanActive = !1, !0;
6353        if (1 == v.isZoomActive ? a(e) : s(e), 1 == v.isZoomActive) v.isPanActive;
6354        else {
6355            var u = r(v.objImage, e, !0);
6356            1 == v.isPanActive ? v.isPanActive = !1 : 1 == u && o(e)
6357        }(t || n) && 0 == v.isZoomActive && 0 == v.isPanActive && l()
6358    }
6359
6360    function c(e) {
6361        return 0 == _.isCurrentSlideType("image") || void(1 == v.isZoomActive ? function(e) {
6362            var t = m.getArrTouches(e),
6363                i = m.getDistance(t[0].pageX, t[0].pageY, t[1].pageX, t[1].pageY) / v.startDistance,
6364                n = m.getMiddlePoint(t[0].pageX, t[0].pageY, t[1].pageX, t[1].pageY),
6365                r = v.objImageSize.width * i,
6366                o = v.objImageSize.height * i,
6367                a = m.getImageOriginalSize(v.objImage),
6368                s = 1;
6369            if (a.width > 0 && (s = r / a.width), s > f.slider_zoom_max_ratio) return !0;
6370            panX = -(v.imageOrientPoint.x * i - v.imageOrientPoint.x), panY = -(v.imageOrientPoint.y * i - v.imageOrientPoint.y);
6371            var l = n.x - v.startMiddlePoint.x,
6372                u = n.y - v.startMiddlePoint.y,
6373                d = v.startImageX + panX + l,
6374                c = v.startImageY + panY + u;
6375            m.setElementSizeAndPosition(v.objImage, d, c, r, o), h.trigger(_.events.ZOOMING), h.trigger(_.events.ZOOM_CHANGE)
6376        }(e) : 1 == v.isPanActive && function(e) {
6377            if (void 0 == v.objImage || 0 == v.objImage.length) return !0;
6378            var t = m.getMousePosition(e),
6379                i = (t.pageX, v.startMouseX, t.pageY, v.startMouseY, t.pageX - v.lastMouseX),
6380                n = t.pageY - v.lastMouseY,
6381                r = 0 > i ? "left" : "right",
6382                o = 0 > n ? "up" : "down";
6383            v.lastMouseX = t.pageX, v.lastMouseY = t.pageY;
6384            var a = m.getElementSize(v.objImage);
6385            0 == v.panYActive ? n = 0 : "down" == o && a.top > 0 ? n /= 3 : "up" == o && a.bottom < v.objParentSize.height && (n /= 3), 0 == v.panXActive || 0 == _.isInnerInPlace() ? i = 0 : "right" == r && a.left > 0 ? i /= 3 : "left" == r && a.right < v.objParentSize.width && (i /= 3);
6386            var s = a.left + i,
6387                l = a.top + n;
6388            m.placeElement(v.objImage, s, l)
6389        }(e))
6390    }
6391
6392    function p(e, t) {
6393        if (0 == f.slider_zoom_mousewheel) return !0;
6394        if (0 == _.isCurrentSlideType("image")) return !0;
6395        e.preventDefault();
6396        var i = t > 0,
6397            r = m.getMousePosition(e);
6398        n(1 == i ? "in" : "out", r)
6399    }
6400    var g, h, _ = new UGSlider,
6401        m = new UGFunctions,
6402        f = {
6403            slider_zoom_step: 1.2,
6404            slider_zoom_max_ratio: 6,
6405            slider_zoom_return_pan_duration: 400,
6406            slider_zoom_return_pan_easing: "easeOutCubic"
6407        },
6408        v = {
6409            isPanActive: !1,
6410            startMouseX: 0,
6411            startMouseY: 0,
6412            lastMouseX: 0,
6413            lastMouseY: 0,
6414            startImageX: 0,
6415            startImageY: 0,
6416            panXActive: !1,
6417            panYActive: !1,
6418            objImage: null,
6419            objImageSize: null,
6420            objParent: null,
6421            objParentSize: null,
6422            objSlide: null,
6423            storeImageLastTime: 0,
6424            isZoomActive: !1,
6425            startDistance: 0,
6426            startMiddlePoint: null,
6427            imageOrientPoint: null,
6428            objFitImageSize: null,
6429            isZoomedOnce: !1
6430        };
6431    this.________EXTERNAL_____________ = function() {}, this.isPanEnabled = function(e, t) {
6432        if (i(), void 0 == v.objImage || 0 == v.objImage.length) return !1;
6433        if (0 == v.isZoomedOnce) return !1;
6434        if (0 == r(v.objImage, e)) return !1;
6435        if (0 == _.isInnerInPlace()) return !1;
6436        if ("left" == t) {
6437            if (v.objImageSize.right <= v.objParentSize.width) return !1
6438        } else if (v.objImageSize.left >= 0) return !1;
6439        return !0
6440    }, this.init = function(t, i) {
6441        e(t, i)
6442    }, this.zoomIn = function() {
6443        n("in")
6444    }, this.zoomOut = function() {
6445        n("out")
6446    }, this.zoomBack = function() {
6447        n("back")
6448    }
6449}
6450
6451function UGWistiaAPI() {
6452    function e() {
6453        return "undefined" != typeof Wistia
6454    }
6455
6456    function t(e, t, i, s, l) {
6457        n = null, a = !1;
6458        var u = e + "_video",
6459            d = "<div id='" + u + "' class='wistia_embed' style='width:" 
6459+ i + ";height:" + s + ";' data-video-width='" + i + "' data-video-height='" + s + "'>&nbsp;</div>";
6460        jQuery("#" + e).html(d), n = Wistia.embed(t, {
6461            version: "v1",
6462            videoWidth: i,
6463            videoHeight: s,
6464            container: u,
6465            autoPlay: l
6466        }), a = !0, n.bind("play", function() {
6467            o.trigger(r.events.START_PLAYING)
6468        }), n.bind("pause", function() {
6469            o.trigger(r.events.STOP_PLAYING)
6470        }), n.bind("end", function() {
6471            o.trigger(r.events.STOP_PLAYING)
6472        })
6473    }
6474    this.isAPILoaded = !1;
6475    var i, n, r = this,
6476        o = jQuery(this),
6477        a = !1;
6478    this.events = {
6479        START_PLAYING: "start_playing",
6480        STOP_PLAYING: "stop_playing"
6481    }, this.loadAPI = function() {
6482        return 1 == g_ugWistiaAPI.isAPILoaded || (e() ? (g_ugWistiaAPI.isAPILoaded = !0, !0) : (g_ugFunctions.loadJs("fast.wistia.com/assets/external/E-v1.js", !0), void(g_ugWistiaAPI.isAPILoaded = !0)))
6483    }, this.doCommand = function(e) {
6484        if (null == n) return !1;
6485        if (0 == a) return !1;
6486        switch (e) {
6487            case "play":
6488                n.play();
6489                break;
6490            case "pause":
6491                n.pause()
6492        }
6493    }, this.pause = function() {
6494        r.doCommand("pause")
6495    }, this.play = function() {
6496        r.doCommand("play")
6497    }, this.putVideo = function(n, r, o, a, s) {
6498        return e() ? (t(n, r, o, a, s), !0) : (this.loadAPI(), void(i = setInterval(function() {
6499            e() && (t(n, r, o, a, s), clearInterval(i))
6500        }, 500)))
6501    }, this.isPlayerReady = function() {
6502        return !(!a || !n)
6503    }
6504}
6505
6506function UGSoundCloudAPI() {
6507    function e() {
6508        return "undefined" != typeof SC
6509    }
6510
6511    function t(e, t, i, s, l) {
6512        n = null, g_isPlayerReady = !1;
6513        var u = e + "_iframe",
6514            d = location.protocol + "//w.soundcloud.com/player/?url=http://api.soundcloud.com/tracks/" + t;
6515        d += "&amp;buying=false&amp;liking=false&amp;download=false&amp;sharing=false&amp;show_artwork=true&show_comments=false&amp;show_playcount=true&amp;show_user=false&amp;hide_related=true&amp;visual=true&amp;start_track=0&amp;callback=true";
6516        var c = "<iframe id='" + u + "' src=" + (d += !0 === l ? "&amp;auto_play=true" : "&amp;auto_play=false") + " width='" + i + "' height='" + s + "' frameborder='0' scrolling='no' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>";
6517        jQuery("#" + e).html(c), (n = SC.Widget(u)).bind(SC.Widget.Events.READY, function() {
6518            n && (g_isPlayerReady = !0, n.bind(SC.Widget.Events.PLAY, function() {
6519                a.trigger(o.events.START_PLAYING)
6520            }), n.bind(SC.Widget.Events.PAUSE, function() {
6521                a.trigger(o.events.STOP_PLAYING)
6522            }), n.bind(SC.Widget.Events.FINISH, function() {
6523                a.trigger(o.events.STOP_PLAYING)
6524            }))
6525        }), r = e
6526    }
6527    this.isAPILoaded = !1;
6528    var i, n, r, o = this,
6529        a = jQuery(this);
6530    this.events = {
6531        START_PLAYING: "start_playing",
6532        STOP_PLAYING: "stop_playing"
6533    }, this.loadAPI = function() {
6534        return 1 == g_ugSoundCloudAPI.isAPILoaded || (e() ? (g_ugSoundCloudAPI.isAPILoaded = !0, !0) : (g_ugFunctions.loadJs("w.soundcloud.com/player/api.js", !0), void(g_ugSoundCloudAPI.isAPILoaded = !0)))
6535    }, this.putSound = function(n, r, o, a, s) {
6536        return e() ? (t(n, r, o, a, s), !0) : (this.loadAPI(), void(i = setInterval(function() {
6537            e() && (t(n, r, o, a, s), clearInterval(i))
6538        }, 500)))
6539    }, this.doCommand = function(e) {
6540        if (null == n) return !1;
6541        if (0 == g_isPlayerReady) return !1;
6542        switch (e) {
6543            case "play":
6544                n.play();
6545                break;
6546            case "pause":
6547                n.pause()
6548        }
6549    }, this.pause = function() {
6550        o.doCommand("pause")
6551    }, this.play = function() {
6552        o.doCommand("play")
6553    }, this.destroy = function() {
6554        g_isPlayerReady = !1, n = null, r && (jQuery("#" + r).html(""), r = null)
6555    }
6556}
6557
6558function UGHtml5MediaAPI() {
6559    function e() {
6560        return "undefined" != typeof mejs
6561    }
6562
6563    function t(e, t, i, a, s) {
6564        n = null, g_isPlayerReady = !1;
6565        var l = location.protocol + "//cdnjs.cloudflare.com/ajax/libs/mediaelement/2.13.2/js/flashmediaelement-cdn.swf",
6566            u = location.protocol + "//cdnjs.cloudflare.com/ajax/libs/mediaelement/2.13.2/js/silverlightmediaelement.xap",
6567            d = e + "_video",
6568            c = "";
6569        s && !0 === s && (c = "autoplay='autoplay'");
6570        var p = "";
6571        t.posterImage && (p = "poster='" + t.posterImage + "'");
6572        var g = "<video id='" + d + "' width='" + i + "' height='" + a + "'  controls='controls' preload='none' " + c + " " + p + ">";
6573        "" != t.mp4 && (g += "<source type='video/mp4' src='" + t.mp4 + "' />"), "" != t.webm && (g += "<source type='video/webm' src='" + t.webm + "' />"), "" != t.ogv && (g += "<source type='video/ogg' src='" + t.ogv + "' />"), g += "<object width='" + i + "' height='" + a + "' type='application/x-shockwave-flash' data='" + l + "'>", g += "<param name='movie' value='" + l + "' />", g += "<param name='flashvars' value='controls=true&file=" + t.mp4 + "' />", g += "</object>", g += "</video>", jQuery("#" + e).html(g), new MediaElement(d, {
6574            enablePluginDebug: !1,
6575            flashName: l,
6576            silverlightName: u,
6577            success: function(e) {
6578                g_isPlayerReady = !0, n = e, 0 == s && n.pause(), g_ugFunctions.addEvent(n, "play", function() {
6579                    o.trigger(r.events.START_PLAYING)
6580                }), g_ugFunctions.addEvent(n, "pause", function() {
6581                    o.trigger(r.events.STOP_PLAYING)
6582                }), g_ugFunctions.addEvent(n, "ended", function() {
6583                    o.trigger(r.events.STOP_PLAYING)
6584                })
6585            },
6586            error: function(e) {
6587                trace(e)
6588            }
6589        })
6590    }
6591    this.isAPILoaded = !1;
6592    var i, n, r = this,
6593        o = jQuery(this);
6594    this.events = {
6595        START_PLAYING: "start_playing",
6596        STOP_PLAYING: "stop_playing"
6597    }, this.loadAPI = function() {
6598        return 1 == g_ugHtml5MediaAPI.isAPILoaded || (e() ? (g_ugHtml5MediaAPI.isAPILoaded = !0, !0) : (g_ugFunctions.loadJs("cdnjs.cloudflare.com/ajax/libs/mediaelement/2.13.2/js/mediaelement.js", !0), g_ugFunctions.loadCss("cdnjs.cloudflare.com/ajax/libs/mediaelement/2.13.2/css/mediaelementplayer.min.css", !0), void(g_ugHtml5MediaAPI.isAPILoaded = !0)))
6599    }, this.putVideo = function(n, r, o, a, s) {
6600        return e() ? (t(n, r, o, a, s), !0) : (this.loadAPI(), void(i = setInterval(function() {
6601            e() && (t(n, r, o, a, s), clearInterval(i))
6602        }, 500)))
6603    }, this.doCommand = function(e) {
6604        if (null == n) return !1;
6605        if (0 == g_isPlayerReady) return !1;
6606        switch (e) {
6607            case "play":
6608                n.play();
6609                break;
6610            case "pause":
6611                n.pause()
6612        }
6613    }, this.pause = function() {
6614        r.doCommand("pause")
6615    }, this.play = function() {
6616        r.doCommand("play")
6617    }
6618}
6619
6620function UGVimeoAPI() {
6621    function e() {
6622        return "undefined" != typeof Froogaloop
6623    }
6624
6625    function t(e, t, i, u, d) {
6626        a = null, s = !1;
6627        var c = location.protocol + "//player.vimeo.com/video/" + t + "?api=1";
6628        !0 === d && (c += "&amp;byline=0&amp;autoplay=1&amp;title=0&amp;portrait=0");
6629        var p = "<iframe src=" + c + " width='" + i + "' height='" + u + "' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>";
6630        jQuery("#" + e).html(p);
6631        var g = jQuery("#" + e + " iframe")[0];
6632        (a = Froogaloop(g)).addEvent("ready", function() {
6633            a && (s = !0, a && (a.addEvent("cuechange", function() {
6634                1 == l && r.play()
6635            }), a.addEvent("play", function() {
6636                o.trigger(r.events.START_PLAYING)
6637            }), a.addEvent("pause", function() {
6638                o.trigger(r.events.STOP_PLAYING)
6639            }), a.addEvent("finish", function() {
6640                o.trigger(r.events.STOP_PLAYING)
6641            })))
6642        }), n = e
6643    }
6644    this.isAPILoaded = !1;
6645    var i, n, r = this,
6646        o = jQuery(this),
6647        a = null,
6648        s = !1,
6649        l = !1;
6650    this.events = {
6651        START_PLAYING: "start_playing",
6652        STOP_PLAYING: "stop_playing"
6653    }, this.loadAPI = function() {
6654        return 1 == g_ugVimeoAPI.isAPILoaded || (e() ? (g_ugVimeoAPI.isAPILoaded = !0, !0) : (g_ugFunctions.loadJs("f.vimeocdn.com/js/froogaloop2.min.js", !0), void(g_ugVimeoAPI.isAPILoaded = !0)))
6655    }, this.doCommand = function(e) {
6656        return null != a && (0 != s && void a.api(e))
6657    }, this.pause = function() {
6658        r.doCommand("pause")
6659    }, this.play = function() {
6660        r.doCommand("play")
6661    }, this.destroy = function() {
6662        a && (a.api("unload"), a = null, s = !1), n && jQuery("#" + n).html("")
6663    }, this.putVideo = function(n, r, o, a, s) {
6664        return e() ? (t(n, r, o, a, s), !0) : (this.loadAPI(), void(i = setInterval(function() {
6665            e() && (t(n, r, o, a, s), clearInterval(i))
6666        }, 500)))
6667    }, this.isPlayerReady = function() {
6668        return !(!s || !a)
6669    }, this.changeVideo = function(e, t) {
6670        return 0 != r.isPlayerReady() && (l = t, void a.api("loadVideo", e))
6671    }, this.getVideoImages = function(e, t, i) {
6672        var n = location.protocol + "//vimeo.com/api/v2/video/" + e + ".json";
6673        jQuery.get(n, {}, function(e) {
6674            var n = {};
6675            n.preview = e[0].thumbnail_large, n.thumb = e[0].thumbnail_medium, i(t, n)
6676        })
6677    }
6678}
6679
6680function UGYoutubeAPI() {
6681    function e(e, t, r, o, l) {
6682        a && s && a.destroy();
6683        var u = {
6684            controls: 2,
6685            showinfo: d.video_youtube_showinfo,
6686            rel: 0
6687        };
6688        !0 === l && (u.autoplay = 1), s = !1, a = new YT.Player(e, {
6689            height: o,
6690            width: r,
6691            videoId: t,
6692            playerVars: u,
6693            events: {
6694                onReady: i,
6695                onStateChange: n
6696            }
6697        }), e
6698    }
6699
6700    function t() {
6701        return "undefined" != typeof YT && void 0 !== YT.Player
6702    }
6703
6704    function i() {
6705        s = !0
6706    }
6707
6708    function n() {
6709        if ("function" != typeof a.getPlayerState) return trace("Youtube API error: can't get player state"), !1;
6710        var e = a.getPlayerState();
6711        switch (e) {
6712            case YT.PlayerState.PLAYING:
6713                l.trigger(o.events.START_PLAYING);
6714                break;
6715            default:
6716                u == YT.PlayerState.PLAYING && l.trigger(o.events.STOP_PLAYING)
6717        }
6718        u = e
6719    }
6720    this.isAPILoaded = !1;
6721    var r, o = this,
6722        a = null,
6723        s = !1,
6724        l = jQuery(this),
6725        u = -1,
6726        d = {
6727            video_youtube_showinfo: !0
6728        };
6729    this.events = {
6730        START_PLAYING: "start_playing",
6731        STOP_PLAYING: "stop_playing"
6732    }, this.setOptions = function(e) {
6733        d = jQuery.extend(d, e)
6734    }, this.putVideo = function(i, n, o, a, s) {
6735        return t() ? (e(i, n, o, a, s), !0) : (this.loadAPI(), void(r = setInterval(function() {
6736            t() && (e(i, n, o, a, s), clearInterval(r))
6737        }, 500)))
6738    }, this.loadAPI = function() {
6739        return 1 == g_ugYoutubeAPI.isAPILoaded || ("undefined" != typeof YT ? (g_ugYoutubeAPI.isAPILoaded = !0, !0) : (g_ugFunctions.loadJs("www.youtube.com/player_api", !0), void(g_ugYoutubeAPI.isAPILoaded = !0)))
6740    }, this.doCommand = function(e, t) {
6741        if (!a) return !0;
6742        if (0 == s) return !1;
6743        switch (e) {
6744            case "play":
6745                if ("function" != typeof a.playVideo) return !1;
6746                a.playVideo();
6747                break;
6748            case "pause":
6749                if ("function" != typeof a.pauseVideo) return !1;
6750                a.pauseVideo();
6751                break;
6752            case "seek":
6753                if ("function" != typeof a.seekTo) return !1;
6754                a.seekTo(t);
6755                break;
6756            case "stopToBeginning":
6757                var i = a.getPlayerState();
6758                switch (a.pauseVideo(), i) {
6759                    case YT.PlayerState.PLAYING:
6760                    case YT.PlayerState.ENDED:
6761                    case YT.PlayerState.PAUSED:
6762                        a.seekTo(0)
6763                }
6764        }
6765    }, this.play = function() {
6766        o.doCommand("play")
6767    }, this.pause = function() {
6768        o.doCommand("pause")
6769    }, this.destroy = function() {
6770        a && (s = !1, a.destroy())
6771    }, this.stopToBeginning = function() {
6772        o.doCommand("stopToBeginning")
6773    }, this.changeVideo = function(e, t) {
6774        return 0 != o.isPlayerReady() && void(t && 1 == t ? a.loadVideoById(e, 0, "default") : a.cueVideoById(e, 0, "default"))
6775    }, this.isPlayerReady = function() {
6776        return !(!s || !a)
6777    }, this.getVideoImages = function(e) {
6778        var t = {};
6779        return t.preview = "https://i.ytimg.com/vi/" + e + "/sddefault.jpg", t.thumb = "https://i.ytimg.com/vi/" + e + "/default.jpg", t
6780    }
6781}
6782
6783function UGVideoPlayer() {
6784    function e() {
6785        p.hide()
6786    }
6787
6788    function t() {
6789        g.trigger(p.events.PLAY_START), u && u.hide()
6790    }
6791
6792    function i() {
6793        g.trigger(p.events.PLAY_STOP), u && u.show()
6794    }
6795
6796    function n(e) {
6797        var t = ["youtube", "vimeo", "html5", "soundcloud", "wistia"];
6798        for (var i in t) {
6799            var n = t[i];
6800            if (n != e) switch (n) {
6801                case "youtube":
6802                    _.pause(), _.destroy(), a.hide();
6803                    break;
6804                case "vimeo":
6805                    m.pause(), m.destroy(), s.hide();
6806                    break;
6807                case "html5":
6808                    f.pause(), l.hide();
6809                    break;
6810                case "soundcloud":
6811                    v.pause(), v.destroy(), d.hide();
6812                    break;
6813                case "wistia":
6814                    b.pause(), c.hide()
6815            }
6816        }
6817    }
6818    var r, o, a, s, l, u, d, c, p = this,
6819        g = jQuery(this),
6820        h = new UGFunctions,
6821        _ = new UGYoutubeAPI,
6822        m = new UGVimeoAPI,
6823        f = new UGHtml5MediaAPI,
6824        v = new UGSoundCloudAPI,
6825        b = new UGWistiaAPI,
6826        y = null,
6827        w = {
6828            video_enable_closebutton: !0
6829        };
6830    this.events = {
6831        SHOW: "video_show",
6832        HIDE: "video_hide",
6833        PLAY_START: "video_play_start",
6834        PLAY_STOP: "video_play_stop"
6835    };
6836    var x = {
6837        standAloneMode: !1,
6838        youtubeInnerID: "",
6839        vimeoPlayerID: "",
6840        html5PlayerID: "",
6841        wistiaPlayerID: "",
6842        soundCloudPlayerID: ""
6843    };
6844    this.init = function(e, t, i) {
6845        if (!(r = i)) throw new Error("missing gallery ID for video player, it's a must!");
6846        w = jQuery.extend(w, e), _.setOptions(w), t && 1 == t && (x.standAloneMode = !0)
6847    }, this.setHtml = function(e) {
6848        x.youtubeInnerID = r + "_youtube_inner", x.vimeoPlayerID = r + "_videoplayer_vimeo", x.html5PlayerID = r + "_videoplayer_html5", x.wistiaPlayerID = r + "_videoplayer_wistia", x.soundCloudPlayerID = r + "_videoplayer_soundcloud";
6849        var t = "<div class='ug-videoplayer' style='display:none'>";
6850        t += "<div class='ug-videoplayer-wrapper ug-videoplayer-youtube' style='display:none'><div id='" + x.youtubeInnerID + "'></div></div>", t += "<div id='" + x.vimeoPlayerID + "' class='ug-videoplayer-wrapper ug-videoplayer-vimeo' style='display:none'></div>", t += "<div id='" + x.html5PlayerID + "' class='ug-videoplayer-wrapper ug-videoplayer-html5'></div>", t += "<div id='" + x.soundCloudPlayerID + "' class='ug-videoplayer-wrapper ug-videoplayer-soundcloud'></div>", t += "<div id='" + x.wistiaPlayerID + "' class='ug-videoplayer-wrapper ug-videoplayer-wistia'></div>", 0 == x.standAloneMode && 1 == w.video_enable_closebutton && (t += "<div class='ug-videoplayer-button-close'></div>"), t += "</div>", e.append(t), o = e.children(".ug-videoplayer"), a = o.children(".ug-videoplayer-youtube"), s = o.children(".ug-videoplayer-vimeo"), l = o.children(".ug-videoplayer-h
6850tml5"), d = o.children(".ug-videoplayer-soundcloud"), c = o.children(".ug-videoplayer-wistia"), 0 == x.standAloneMode && 1 == w.video_enable_closebutton && (u = o.children(".ug-videoplayer-button-close"))
6851    }, this.destroy = function() {
6852        u && (u.off("click"), u.off("touchend")), jQuery(_).off(_.events.START_PLAYING), jQuery(_).off(_.events.STOP_PLAYING), jQuery(m).off(m.events.START_PLAYING), jQuery(m).off(m.events.STOP_PLAYING), jQuery(f).off(f.events.START_PLAYING), jQuery(f).off(f.events.STOP_PLAYING), jQuery(v).off(v.events.START_PLAYING, t), jQuery(v).off(v.events.STOP_PLAYING, i), jQuery(b).off(b.events.START_PLAYING, t), jQuery(b).off(b.events.STOP_PLAYING, i), y = null
6853    }, this.initEvents = function() {
6854        u && (h.setButtonMobileReady(u), h.setButtonOnClick(u, e)), jQuery(_).on(_.events.START_PLAYING, t), jQuery(_).on(_.events.STOP_PLAYING, i), jQuery(m).on(m.events.START_PLAYING, t), jQuery(m).on(m.events.STOP_PLAYING, i), jQuery(f).on(f.events.START_PLAYING, t), jQuery(f).on(f.events.STOP_PLAYING, i), jQuery(v).on(v.events.START_PLAYING, t), jQuery(v).on(v.events.STOP_PLAYING, i), jQuery(b).on(b.events.START_PLAYING, t), jQuery(b).on(b.events.STOP_PLAYING, i)
6855    }, this.setSize = function(e, t) {
6856        h.setElementSize(o, e, t), u && h.placeElement(u, "right", "top")
6857    }, this.setPosition = function(e, t) {
6858        h.placeElement(o, e, t)
6859    }, this.getObject = function() {
6860        return o
6861    }, this.show = function() {
6862        return 1 == p.isVisible() || (o.show(), o.fadeTo(0, 1), u && u.show(), void g.trigger(p.events.SHOW))
6863    }, this.hide = function() {
6864        return 0 == p.isVisible() || (n(), y = null, o.hide(), void g.trigger(p.events.HIDE))
6865    }, this.getActiveAPI = function() {
6866        switch (y) {
6867            case "youtube":
6868                return _;
6869            case "vimeo":
6870                return m;
6871            case "wistia":
6872                return b;
6873            case "soundcloud":
6874                return v;
6875            case "html5":
6876                return f;
6877            default:
6878                return null
6879        }
6880    }, this.pause = function() {
6881        var e = p.getActiveAPI();
6882        return null != e && void("function" == typeof e.pause && e.pause())
6883    }, this.isVisible = function() {
6884        return o.is(":visible")
6885    }, this.playYoutube = function(e, t) {
6886        if (void 0 === t) t = !0;
6887        n("youtube"), a.show(), 0 == a.children("#" + x.youtubeInnerID).length && a.append("<div id='" + x.youtubeInnerID + "'></div>"), 1 == _.isPlayerReady() && 1 == x.standAloneMode ? _.changeVideo(e, t) : _.putVideo(x.youtubeInnerID, e, "100%", "100%", t), y = "youtube"
6888    }, this.playVimeo = function(e, t) {
6889        if (void 0 === t) t = !0;
6890        n("vimeo"), s.show(), m.isPlayerReady() && 1 == x.standAloneMode ? m.changeVideo(e, t) : m.putVideo(x.vimeoPlayerID, e, "100%", "100%", t), y = "vimeo"
6891    }, this.playHtml5Video = function(e, t, i, r, o) {
6892        if (void 0 === o) o = !0;
6893        n("html5"), l.show();
6894        var a = {
6895            ogv: e,
6896            webm: t,
6897            mp4: i,
6898            posterImage: r
6899        };
6900        f.putVideo(x.html5PlayerID, a, "100%", "100%", o), y = "html5"
6901    }, this.playSoundCloud = function(e, t) {
6902        if (void 0 === t) t = !0;
6903        n("soundcloud"), d.show(), v.putSound(x.soundCloudPlayerID, e, "100%", "100%", t), y = "soundcloud"
6904    }, this.playWistia = function(e, t) {
6905        if (void 0 === t) t = !0;
6906        n("wistia"), c.show(), b.putVideo(x.wistiaPlayerID, e, "100%", "100%", t), y = "wistia"
6907    }
6908}
6909
6910function ugCheckForMinJQueryVersion() {
6911    if (0 == g_ugFunctions.checkMinJqueryVersion("1.8.0")) throw new Error("The gallery can run from jquery 1.8 You have jQuery " + jQuery.fn.jquery + " Please update your jQuery library.")
6912}
6913
6914function ugCheckForErrors(e, t) {
6915    try {
6916        "jquery" == t ? (function() {
6917            if ("undefined" == typeof jQuery) throw new Error("jQuery library not included")
6918        }(), ugCheckForMinJQueryVersion()) : (ugCheckForMinJQueryVersion(), function() {
6919            if ("function" == typeof jQuery.fn.unitegallery) return !0;
6920            var e = "You have some jquery.js library include that c
6920omes after the gallery files js include.";
6921            throw e += "<br> This include eliminates the gallery libraries, and make it not work.", "cms" == t ? (e += "<br><br> To fix it you can:<br>&nbsp;&nbsp;&nbsp; 1. In the Gallery Settings -> Troubleshooting set option:  <strong><b>Put JS Includes To Body</b></strong> option to true.", e += "<br>&nbsp;&nbsp;&nbsp; 2. Find the double jquery.js include and remove it.") : e += "<br><br> Please find and remove this jquery.js include and the gallery will work. <br> * There should be only one jquery.js include before all other js includes in the page.", new Error(e)
6922        }())
6923    } catch (r) {
6924        var i = r.message;
6925        if (i = "<div style='font-size:16px;color:#BC0C06;max-width:900px;border:1px solid red;padding:10px;'>" + (i = "Unite Gallery Error: " + i) + "</div>", "jquery" == t) {
6926            var n = document.getElementById(e);
6927            n.innerHTML = i, n.style.display = "block"
6928        } else jQuery(e).show().html(i);
6929        return !1
6930    }
6931    return !0
6932}
6933
6934function UniteGalleryMain() {
6935    function __________INIT_GALLERY_______() {}
6936
6937    function getThemeFunction(e) {
6938        var t = e;
6939        return -1 == t.indexOf("UGTheme_") && (t = "UGTheme_" + t), t
6940    }
6941
6942    function initTheme(objCustomOptions, callback) {
6943        if (objCustomOptions.hasOwnProperty("gallery_theme")) g_options.gallery_theme = objCustomOptions.gallery_theme;
6944        else {
6945            var defaultTheme = g_options.gallery_theme;
6946            0 == g_ugFunctions.isThemeRegistered(defaultTheme) && (g_options.gallery_theme = g_ugFunctions.getFirstRegisteredTheme())
6947        }
6948        var themeFunction = getThemeFunction(g_options.gallery_theme);
6949        try {
6950            g_options.gallery_theme = eval(themeFunction)
6951        } catch (e) {
6952            jQuery.getScript(fullAjaxBase + "media/com_unitegallery/assets/unitegallery-plugin/themes/" + g_options.gallery_theme + "/ug-theme-" + g_options.gallery_theme + ".js", function() {
6953                g_options.gallery_theme = eval(themeFunction), g_objTheme = new g_options.gallery_theme, g_objTheme.init(t, objCustomOptions), callback()
6954            })
6955        }
6956        "function" == typeof g_options.gallery_theme && (g_options.gallery_theme = eval(themeFunction), g_objTheme = new g_options.gallery_theme, g_objTheme.init(t, objCustomOptions), callback())
6957    }
6958
6959    function resetOptions() {
6960        g_options = jQuery.extend({}, g_temp.originalOptions), g_selectedItemIndex = -1, g_selectedItem = null, g_objSlider = void 0, g_objThumbs = void 0, g_objSlider = void 0
6961    }
6962
6963    function checkForStartupErrors() {
6964        try {
6965            ugCheckForMinJQueryVersion()
6966        } catch (e) {
6967            throwErrorShowMessage(e.message)
6968        }
6969        "object" == typeof g_objWrapper.outerWidth() && throwErrorShowMessage("You have some buggy script. most chances jquery-ui.js that destroy jquery outerWidth, outerHeight functions. The gallery can't run. Please update jquery-ui.js to latest version."), setTimeout(function() {
6970            ugCheckForErrors(g_galleryID, "cms")
6971        }, 5e3)
6972    }
6973
6974    function runGallery(e, i, n, r) {
6975        var o = "object" == typeof i;
6976        if (o && (g_temp.objCustomOptions = i), 1 == g_temp.isRunFirstTime) {
6977            if (g_galleryID = e, 0 == (g_objWrapper = jQuery(g_galleryID)).length) return trace("div with id: " + g_galleryID + " not found"), !1;
6978            checkForStartupErrors(), g_temp.originalOptions = jQuery.extend({}, g_options), o && (g_options = jQuery.extend(g_options, i)), 1 == g_options.gallery_enable_cache && g_options.gallery_initial_catid && cacheItems(g_options.gallery_initial_catid), fillItemsArray(g_objWrapper.children()), loadAPIs(), g_objWrapper.find("img").fadeTo(0, 0).hide(), g_objWrapper.show(), clearInitData()
6979        } else if (t.destroy(), resetOptions(), g_options = jQuery.extend(g_options, g_temp.objCustomOptions), n) {
6980            if (r && 1 == g_options.gallery_enable_cache && cacheItems(r, n), "noitems" == n) return showErrorMessage("No items in this category", ""), !1;
6981            g_objWrapper.html(n), fillItemsArray(g_objWrapper.children()), loadAPIs(), g_objWrapper.children().fadeTo(0, 0).hide(), g_objWrapper.show(), clearInitData()
6982        }
6983        1 == g_temp.isRunFirstTime && 1 == g_options.gallery_enable_tabs && (g_objTabs = new UGTabs).init(t, g_options), o && modifyInitParams(g_temp.objCustomOptions), validateParams(), 1 == g_options.gallery_shuffle && t.shuffleItems(), initTheme(g_temp.objCustomOptions, function() {
6984            setGalleryHtml(), setHtmlObjectsProperties();
6985            var e = g_objWrapper.width();
6986            g_objWrapper.parent(), 0 == e ? g_functions.waitForWidth(g_objWrapper, runGalleryActually) : runGalleryActually()
6987        })
6988    }
6989
6990    function runGalleryActually() {
6991        t.setSizeClass(), 0 == g_temp.isFreestyleMode && 1 == g_options.gallery_preserve_ratio && setHeightByOriginalRatio(), g_objTheme.run(), g_objTabs && g_objTabs.run(), preloadBigImages(), initEvents(), g_numItems > 0 && t.selectItem(0), 1 == g_options.gallery_autoplay && t.startPlayMode(), g_temp.isRunFirstTime = !1
6992    }
6993
6994    function showErrorMessage(e, t) {
6995        if (void 0 === t) t = "<b>Unite Gallery Error: </b>";
6996        var i = "<div class='ug-error-message-wrapper'><div class='ug-error-message'>" + (e = t + e) + "</div></div>";
6997        g_objWrapper.children().remove(), g_objWrapper.html(i), g_objWrapper.show()
6998    }
6999
7000    function throwErrorShowMessage(e) {
7001        throw showErrorMessage(e), new Error(e)
7002    }
7003
7004    function modifyInitParams() {
7005        g_options.gallery_images_preload_type || (g_options.gallery_images_preload_type = "minimal"), (void 0 == g_options.gallery_min_height || g_options.gallery_height < g_options.gallery_min_height) && (g_options.gallery_min_height = 0), (void 0 == g_options.gallery_min_width || g_options.gallery_width < g_options.gallery_min_width) && (g_options.gallery_min_width = 0)
7006    }
7007
7008    function validateParams() {
7009        if (!g_options.gallery_theme) throw new Error("The gallery can't run without theme");
7010        if (g_options.gallery_height < g_options.gallery_min_height) throw new Error("The <b>gallery_height</b> option must be bigger then <b>gallery_min_height option</b>");
7011        if (g_options.gallery_width < g_options.gallery_min_width) throw new Error("The <b>gallery_width</b> option must be bigger then <b>gallery_min_width option</b>")
7012    }
7013
7014    function setGalleryHtml() {
7015        g_objWrapper.addClass("ug-gallery-wrapper"), g_objWrapper.append("<div class='ug-overlay-disabled' style='display:none'></div>"), t.setSizeClass()
7016    }
7017
7018    function clearInitData() {
7019        g_objWrapper.children().remove()
7020    }
7021
7022    function storeLastSize() {
7023        var e = t.getSize();
7024        g_temp.lastWidth = e.width, g_temp.lastHeight = e.height
7025    }
7026
7027    function setHeightByOriginalRatio() {
7028        var e = t.getSize();
7029        if (e.width / e.height != e.orig_ratio) {
7030            var i = e.width / e.orig_ratio;
7031            (i = Math.round(i)) < g_options.gallery_min_height && (i = g_options.gallery_min_height), g_objWrapper.height(i)
7032        }
7033    }
7034
7035    function setHtmlObjectsProperties() {
7036        var e = {
7037            "max-width": g_functions.getCssSizeParam(g_options.gallery_width),
7038            "min-width": g_functions.getCssSizeParam(g_options.gallery_min_width)
7039        };
7040        0 == g_temp.isFreestyleMode ? e.height = g_options.gallery_height + "px" : e.overflow = "visible", g_options.gallery_background_color && (e["background-color"] = g_options.gallery_background_color), g_objWrapper.css(e)
7041    }
7042
7043    function fillItemsArray(e) {
7044        g_arrItems = [];
7045        for (var t = 0, i = 0; i < e.length; i++) {
7046            var n = jQuery(e[i]),
7047                r = "";
7048            if ("a" == (o = n.prop("tagName").toLowerCase())) {
7049                r = n.attr("href");
7050                var o = (n = n.children()).prop("tagName").toLowerCase()
7051            }
7052            var a = n.data("type");
7053            void 0 == a && (a = "image");
7054            var s = {};
7055            if (s.type = a, "img" == o) s.urlThumb = n.attr("src"), s.title = n.attr("alt"), s.objThumbImage = n;
7056            else {
7057                if ("image" == a) throw new Error("The item should not be image type");
7058                s.urlThumb = n.data("thumb"), s.title = n.data("title"), s.objThumbImage = null
7059            }
7060            s.link = r, s.description = n.attr("title"), s.description || (s.description = n.data("description")), s.description || (s.description = ""), s.isLoaded = !1, s.isThumbImageLoaded = !1, s.objPreloadImage = null, s.urlImage = n.data("image"), s.isBigImageLoadStarted = !1, s.isBigImageLoaded = !1, s.isBigImageLoadError = !1, s.imageWidth = 0, s.imageHeight = 0, s.thumbWidth = 0, s.thumbHe
7060ight = 0, s.thumbRatioByWidth = 0, s.thumbRatioByHeight = 0, s.addHtml = null;
7061            var l = void 0 == s.urlImage || "" == s.urlImage,
7062                u = void 0 == s.urlThumb || "" == s.urlThumb;
7063            switch (s.type) {
7064                case "youtube":
7065                    if (s.videoid = n.data("videoid"), l || u) {
7066                        var d = g_ugYoutubeAPI.getVideoImages(s.videoid);
7067                        l && (s.urlImage = d.preview), u && (s.urlThumb = d.thumb, "img" == o && n.attr("src", s.urlThumb))
7068                    }
7069                    g_temp.isYoutubePresent = !0;
7070                    break;
7071                case "vimeo":
7072                    s.videoid = n.data("videoid"), g_temp.isVimeoPresent = !0;
7073                    break;
7074                case "html5video":
7075                    s.videoogv = n.data("videoogv"), s.videowebm = n.data("videowebm"), s.videomp4 = n.data("videomp4"), g_temp.isHtml5VideoPresent = !0;
7076                    break;
7077                case "soundcloud":
7078                    s.trackid = n.data("trackid"), g_temp.isSoundCloudPresent = !0;
7079                    break;
7080                case "wistia":
7081                    s.videoid = n.data("videoid"), g_temp.isWistiaPresent = !0;
7082                    break;
7083                case "custom":
7084                    var c = n.children("img");
7085                    c.length && (c = jQuery(c[0]), s.urlThumb = c.attr("src"), s.title = c.attr("alt"), s.objThumbImage = c);
7086                    var p = n.children().not("img:first-child");
7087                    p.length && (s.addHtml = p.clone())
7088            }
7089            s.objThumbImage && (s.objThumbImage.removeAttr("data-description", ""), s.objThumbImage.removeAttr("data-image", ""), s.objThumbImage.removeAttr("title", "")), s.index = t, g_arrItems.push(s), t++
7090        }
7091        g_numItems = g_arrItems.length
7092    }
7093
7094    function loadAPIs() {
7095        g_temp.isYoutubePresent && g_ugYoutubeAPI.loadAPI(), g_temp.isVimeoPresent && g_ugVimeoAPI.loadAPI(), g_temp.isHtml5VideoPresent && g_ugHtml5MediaAPI.loadAPI(), g_temp.isSoundCloudPresent && g_ugSoundCloudAPI.loadAPI(), g_temp.isWistiaPresent && g_ugWistiaAPI.loadAPI()
7096    }
7097
7098    function preloadBigImages() {
7099        if ("visible" != g_options.gallery_images_preload_type || g_objThumbs || (g_options.gallery_images_preload_type = "minimal"), 1 == g_temp.isAllItemsPreloaded) return !0;
7100        switch (g_options.gallery_images_preload_type) {
7101            default:
7102                case "minimal":
7103                break;
7104            case "all":
7105                    jQuery(g_arrItems).each(function() {
7106                    preloadItemImage(this)
7107                });
7108                break;
7109            case "visible":
7110                    jQuery(g_arrItems).each(function() {
7111                    1 == g_objThumbs.isItemThumbVisible(this) && preloadItemImage(this)
7112                })
7113        }
7114    }
7115
7116    function checkPreloadItemImage(e) {
7117        if (1 == e.isBigImageLoadStarted || 1 == e.isBigImageLoaded || 1 == e.isBigImageLoadError) return !1;
7118        switch (g_options.gallery_images_preload_type) {
7119            default:
7120                case "minimal":
7121                break;
7122            case "all":
7123                    preloadItemImage(e);
7124                break;
7125            case "visible":
7126                    1 == g_objThumbs.isItemThumbVisible(e) && preloadItemImage(e)
7127        }
7128    }
7129
7130    function preloadItemImage(e) {
7131        if (1 == e.isBigImageLoadStarted || 1 == e.isBigImageLoaded || 1 == e.isBigImageLoadError) return !0;
7132        var i = e.urlImage;
7133        return "" == i || void 0 == i ? (e.isBigImageLoadError = !0, !1) : (e.isBigImageLoadStarted = !0, e.objPreloadImage = jQuery("<img/>").attr("src", i), e.objPreloadImage.data("itemIndex", e.index), e.objPreloadImage.on("load", t.onItemBigImageLoaded), e.objPreloadImage.on("error", function() {
7134            var e = jQuery(this).data("itemIndex"),
7135                i = g_arrItems[e];
7136            i.isBigImageLoadError = !0, i.isBigImageLoaded = !1;
7137            var n = jQuery(this).attr("src");
7138            console.log("Can't load image: " + n), g_objGallery.trigger(t.events.ITEM_IMAGE_
7138UPDATED, [e, i.urlImage]), i.objThumbImage.attr("src", i.urlThumb)
7139        }), void checkAllItemsStartedPreloading())
7140    }
7141
7142    function preloadNearBigImages(e) {
7143        if (1 == g_temp.isAllItemsPreloaded) return !1;
7144        if (!e) e = g_selectedItem;
7145        if (!e) return !0;
7146        var t = e.index,
7147            i = t - 1,
7148            n = t + 1;
7149        i > 0 && preloadItemImage(g_arrItems[i]), g_numItems > n && preloadItemImage(g_arrItems[n])
7150    }
7151
7152    function checkAllItemsStartedPreloading() {
7153        if (1 == g_temp.isAllItemsPreloaded) return !1;
7154        for (var e in g_arrItems)
7155            if (0 == g_arrItems[e].isBigImageLoadStarted) return !1;
7156        g_temp.isAllItemsPreloaded = !0
7157    }
7158
7159    function __________END_INIT_GALLERY_______() {}
7160
7161    function __________EVENTS_____________() {}
7162
7163    function onSliderMouseEnter() {
7164        1 == g_options.gallery_pause_on_mouseover && 0 == t.isFullScreen() && 1 == g_temp.isPlayMode && g_objSlider && 0 == g_objSlider.isSlideActionActive() && t.pausePlaying()
7165    }
7166
7167    function onSliderMouseLeave() {
7168        1 == g_options.gallery_pause_on_mouseover && 1 == g_temp.isPlayMode && g_objSlider && 0 == g_objSlider.isSlideActionActive() && (0 == g_objSlider.isCurrentSlideLoadingImage() && t.continuePlaying())
7169    }
7170
7171    function onKeyPress(e) {
7172        var i = e.charCode ? e.charCode : e.keyCode ? e.keyCode : e.which ? e.which : 0;
7173        switch (i) {
7174            case 39:
7175                t.nextItem(), e.preventDefault();
7176                break;
7177            case 37:
7178                t.prevItem(), e.preventDefault()
7179        }
7180        g_objGallery.trigger(t.events.GALLERY_KEYPRESS, i)
7181    }
7182
7183    function onGalleryResized() {
7184        var e;
7185        if (0 == (e = t.getSize()).width) return !0;
7186        t.setSizeClass(), ((e = t.getSize()).width != g_temp.lastWidth || e.height != g_temp.lastHeight) && (1 == g_options.gallery_preserve_ratio && 0 == g_temp.isFreestyleMode && setHeightByOriginalRatio(), storeLastSize(), g_objGallery.trigger(t.events.SIZE_CHANGE))
7187    }
7188
7189    function onThumbsChange() {
7190        "visible" == g_options.gallery_images_preload_type && 0 == g_temp.isAllItemsPreloaded && preloadBigImages()
7191    }
7192
7193    function onFullScreenChange() {
7194        var e = g_functions.isFullScreen(),
7195            i = e ? t.events.ENTER_FULLSCREEN : t.events.EXIT_FULLSCREEN,
7196            n = g_functions.getGlobalData("fullscreenID");
7197        return g_galleryID !== n || (e ? g_objWrapper.addClass("ug-fullscreen") : g_objWrapper.removeClass("ug-fullscreen"), g_objGallery.trigger(i), void onGalleryResized())
7198    }
7199
7200    function onItemImageUpdated(e, i) {
7201        checkPreloadItemImage(t.getItem(i))
7202    }
7203
7204    function onCurrentSlideImageLoadEnd() {
7205        1 == t.isPlayMode() && t.continuePlaying()
7206    }
7207
7208    function initEvents() {
7209        if (g_objWrapper.on("dragstart", function(e) {
7210                e.preventDefault()
7211            }), g_objGallery.on(t.events.ITEM_IMAGE_UPDATED, onItemImageUpdated), g_objThumbs) switch (g_temp.thumbsType) {
7212            case "strip":
7213                jQuery(g_objThumbs).on(g_objThumbs.events.STRIP_MOVE, onThumbsChange);
7214                break;
7215            case "grid":
7216                jQuery(g_objThumbs).on(g_objThumbs.events.PANE_CHANGE, onThumbsChange)
7217        }
7218        if ("advance" == g_options.gallery_mousewheel_role && 0 == g_temp.isFreestyleMode && g_objWrapper.on("mousewheel", t.onGalleryMouseWheel), storeLastSize(), jQuery(window).resize(function() {
7219                g_objWrapper.css("width", "auto"), g_functions.whenContiniousEventOver("gallery_resize", onGalleryResized, g_temp.resizeDelay)
7220            }), g_functions.addFullScreenChangeEvent(onFullScreenChange), g_objSlider) {
7221            if (jQuery(g_objSlider).on(g_objSlider.events.ITEM_CHANGED, function() {
7222                    var e = g_objSlider.getCurrentItemIndex(); - 1 != e && t.selectItem(e)
7223                }), 1 == g_options.gallery_pause_on_mouseover) g_objSlider.getElement().hover(onSliderMouseEnter, onSliderMouseLeave), g_objGallery.on(t.events.ENTER_FULLSCREEN, function() {
7224                onSliderMouseLeave()
7225            });
7226            retriggerEvent(g_objSlider, g_objSlider.events.ACTION_START, t.events.SLIDER_ACTION_START), retriggerEvent(g_objSlider, g_objSlider.events.ACTION_END, t.events.SLIDER_ACTION_END), jQuery(g_objSlider).on(g_objSlider.events.CURRENTSLIDE_LOAD_END, onCurrentSlideImageLoadEnd)
7227        }
7228        1 == g_options.gallery_control_keyboard && jQuery(document).keydown(onKeyPress)
7229    }
7230
7231    function __________GENERAL_______() {}
7232
7233    function cacheItems(e, t) {
7234        if (t) "noitems" != (i = t) && (i = jQuery(t).clone());
7235        else var i = g_objWrapper.children().clone();
7236        g_objCache[e] = i
7237    }
7238
7239    function removeAllSizeClasses(e) {
7240        e || (e = g_objWrapper), e.removeClass("ug-under-480"), e.removeClass("ug-under-780"), e.removeClass("ug-under-960")
7241    }
7242
7243    function retriggerEvent(e, t, i) {
7244        jQuery(e).on(t, function() {
7245            g_objGallery.trigger(i, [this])
7246        })
7247    }
7248
7249    function advanceNextStep() {
7250        var e = jQuery.now(),
7251            i = e - g_temp.playTimeLastStep;
7252        if (g_temp.playTimePassed += i, g_temp.playTimeLastStep = e, g_temp.objProgress) {
7253            var n = g_temp.playTimePassed / g_options.gallery_play_interval;
7254            g_temp.objProgress.setProgress(n)
7255        }
7256        g_temp.playTimePassed >= g_options.gallery_play_interval && (t.nextItem(), g_temp.playTimePassed = 0)
7257    }
7258
7259    function unselectSeletedItem() {
7260        return null == g_selectedItem || (g_objThumbs && g_objThumbs.setThumbUnselected(g_selectedItem.objThumbWrapper), g_selectedItem = null, void(g_selectedItemIndex = -1))
7261    }
7262
7263    function toFakeFullScreen() {
7264        jQuery("body").addClass("ug-body-fullscreen"), g_objWrapper.addClass("ug-fake-fullscreen"), g_temp.isFakeFullscreen = !0, g_objGallery.trigger(t.events.ENTER_FULLSCREEN), g_objGallery.trigger(t.events.SIZE_CHANGE)
7265    }
7266
7267    function exitFakeFullscreen() {
7268        jQuery("body").removeClass("ug-body-fullscreen"), g_objWrapper.removeClass("ug-fake-fullscreen"), g_temp.isFakeFullscreen = !1, g_objGallery.trigger(t.events.EXIT_FULLSCREEN), g_objGallery.trigger(t.events.SIZE_CHANGE)
7269    }
7270    var t = this,
7271        g_galleryID, g_objGallery = jQuery(t),
7272        g_objWrapper, g_objThumbs, g_objSlider, g_functions = new UGFunctions,
7273        g_objTabs, g_arrItems = [],
7274        g_numItems, g_selectedItem = null,
7275        g_selectedItemIndex = -1,
7276        g_objTheme, g_objCache = {};
7277    this.events = {
7278        ITEM_CHANGE: "item_change",
7279        SIZE_CHANGE: "size_change",
7280        ENTER_FULLSCREEN: "enter_fullscreen",
7281        EXIT_FULLSCREEN: "exit_fullscreen",
7282        START_PLAY: "start_play",
7283        STOP_PLAY: "stop_play",
7284        PAUSE_PLAYING: "pause_playing",
7285        CONTINUE_PLAYING: "continue_playing",
7286        SLIDER_ACTION_START: "slider_action_start",
7287        SLIDER_ACTION_END: "slider_action_end",
7288        ITEM_IMAGE_UPDATED: "item_image_updated",
7289        GALLERY_KEYPRESS: "gallery_keypress",
7290        GALLERY_BEFORE_REQUEST_ITEMS: "gallery_before_request_items"
7291    };
7292    var g_options = {
7293            gallery_width: 900,
7294            gallery_height: 500,
7295            gallery_min_width: 150,
7296            gallery_min_height: 100,
7297            gallery_theme: "default",
7298            gallery_skin: "default",
7299            gallery_images_preload_type: "minimal",
7300            gallery_autoplay: !1,
7301            gallery_play_interval: 3e3,
7302            gallery_pause_on_mouseover: !0,
7303            gallery_mousewheel_role: "zoom",
7304            gallery_control_keyboard: !0,
7305            gallery_carousel: !0,
7306            gallery_preserve_ratio: !0,
7307            gallery_background_color: "",
7308            gallery_debug_errors: !1,
7309            gallery_shuffle: !1,
7310            gallery_urlajax: null,
7311            gallery_enable_tabs: !1,
7312            gallery_enable_cache: !0,
7313            gallery_initial_catid: ""
7314        },
7315        g_temp = {
7316            objCustomOptions: {},
7317            isAllItemsPreloaded: !1,
7318            isFreestyleMode: !1,
7319            lastWidth: 0,
7320            lastHeigh: 0,
7321            handleResize: null,
7322            isInited: !1,
7323            isPlayMode: !1,
7324            isPlayModePaused: !1,
7325            playTimePassed: 0,
7326            playTimeLastStep: 0,
7327            playHandle: "",
7328            playStepInterval: 33,
7329            objProgress: null,
7330            isFakeFullscreen: !1,
7331            thumbsType: null,
7332            isYoutubePresent: !1,
7333            isVimeoPresent: !1,
7334            isHtml5VideoPresent: !1,
7335            isSoundCloudPresent: !1,
7336            isWistiaPresent: !1,
7337            resizeDelay: 100,
7338            isRunFirstTime: !0,
7339            originalOptions: {}
7340        };
7341    this.onItemBigImageLoaded = function(e, t) {
7342        if (!t) t = jQuery(this);
7343        var i = t.data("itemIndex"),
7344            n = g_arrItems[i];
7345        n.isBigImageLoaded = !0;
7346        var r = g_functions.getImageOriginalSize(t);
7347        n.imageWidth = r.width, n.imageHeight = r.height
7348    }, this.checkFillImageSize = function(e, t) {
7349        if (!t) {
7350            var i = e.data("itemIndex");
7351            if (void 0 === i) throw new Error("Wrong image given to gallery.checkFillImageSize");
7352            t = g_arrItems[i]
7353        }
7354        var n = g_functions.getImageOriginalSize(e);
7355        t.imageWidth = n.width, t.imageHeight = n.height
7356    }, this.setFreestyleMode = function() {
7357        g_temp.isFreestyleMode = !0
7358    }, this.initThumbsPanel = function(e, i) {
7359        if (!i) i = {};
7360        if (!e) e = "strip";
7361        switch (g_temp.thumbsType = e, e) {
7362            case "strip":
7363                g_objThumbs = new UGThumbsStrip;
7364                break;
7365            case "grid":
7366                g_objThumbs = new UGThumbsGrid;
7367                break;
7368            default:
7369                throw new Error("Wrong thumbs type: " + e)
7370        }
7371        i = jQuery.extend(i, g_temp.objCustomOptions), g_objThumbs.init(t, i)
7372    }, this.initSlider = function(e, i) {
7373        if (!e) e = {};
7374        e = jQuery.extend(e, g_temp.objCustomOptions), (g_objSlider = new UGSlider).init(t, e, i)
7375    }, this.onGalleryMouseWheel = function(e, i) {
7376        e.preventDefault(), i > 0 ? t.prevItem() : t.nextItem()
7377    }, this.destroy = function() {
7378        if (g_objWrapper.off("dragstart"), g_objGallery.off(t.events.ITEM_IMAGE_UPDATED), g_objThumbs) switch (g_temp.thumbsType) {
7379            case "strip":
7380                jQuery(g_objThumbs).off(g_objThumbs.events.STRIP_MOVE);
7381                break;
7382            case "grid":
7383                jQuery(g_objThumbs).off(g_objThumbs.events.PANE_CHANGE)
7384        }
7385        if (g_objWrapper.off("mousewheel"), jQuery(window).off("resize"), g_functions.destroyFullScreenChangeEvent(), g_objSlider) {
7386            jQuery(g_objSlider).off(g_objSlider.events.ITEM_CHANGED);
7387            var e = g_objSlider.getElement();
7388            e.off("mouseenter"), e.off("mouseleave"), g_objGallery.off(t.events.ENTER_FULLSCREEN), jQuery(g_objSlider).off(g_objSlider.events.ACTION_START), jQuery(g_objSlider).off(g_objSlider.events.ACTION_END), jQuery(g_objSlider).off(g_objSlider.events.CURRENTSLIDE_LOAD_END)
7389        }
7390        1 == g_options.gallery_control_keyboard && jQuery(document).off("keydown"), g_objTheme && "function" == typeof g_objTheme.destroy && g_objTheme.destroy(), g_objWrapper.html("")
7391    }, this.getArrItems = function() {
7392        return g_arrItems
7393    }, this.getObjects = function() {
7394        return {
7395            g_galleryID: g_galleryID,
7396            g_objWrapper: g_objWrapper,
7397            g_objThumbs: g_objThumbs,
7398            g_objSlider: g_objSlider,
7399            g_options: g_options,
7400            g_arrItems: g_arrItems,
7401            g_numItems: g_numItems
7402        }
7403    }, this.getObjSlider = function() {
7404        return g_objSlider
7405    }, this.getItem = function(e) {
7406        if (0 > e) throw new Error("item with index: " + e + " not found");
7407        if (e >= g_numItems) throw new Error("item with index: " + e + " not found");
7408        return g_arrItems[e]
7409    }, this.getWidth = function() {
7410        return t.getSize().width
7411    }, this.getHeight = function() {
7412        return t.getSize().height
7413    }
7413, this.getSize = function() {
7414        var e = g_functions.getElementSize(g_objWrapper);
7415        return e.orig_width = g_options.gallery_width, e.orig_height = g_options.gallery_height, e.orig_ratio = e.orig_width / e.orig_height, e
7416    }, this.getGalleryID = function() {
7417        return g_galleryID.replace("#", "")
7418    }, this.getNextItem = function(e, t) {
7419        "object" == typeof e && (e = e.index);
7420        var i = e + 1;
7421        if (!0 !== t && 1 == g_numItems) return null;
7422        if (i >= g_numItems) {
7423            if (1 != g_options.gallery_carousel && !0 !== t) return null;
7424            i = 0
7425        }
7426        return g_arrItems[i]
7427    }, this.getPrevItem = function(e) {
7428        "object" == typeof e && (e = e.index);
7429        var t = e - 1;
7430        if (0 > t) {
7431            if (1 != g_options.gallery_carousel && !0 !== forceCarousel) return null;
7432            t = g_numItems - 1
7433        }
7434        return g_arrItems[t]
7435    }, this.getSelectedItem = function() {
7436        return g_selectedItem
7437    }, this.getNumItems = function() {
7438        return g_numItems
7439    }, this.isLastItem = function() {
7440        return g_selectedItemIndex == g_numItems - 1
7441    }, this.isFirstItem = function() {
7442        return 0 == g_selectedItemIndex
7443    }, this.getOptions = function() {
7444        return g_options
7445    }, this.getElement = function() {
7446        return g_objWrapper
7447    }, this.___________SET_CONTROLS___________ = function() {}, this.setNextButton = function(e) {
7448        e.data("ug-button", !0), g_functions.setButtonOnClick(e, t.nextItem)
7449    }, this.setPrevButton = function(e) {
7450        e.data("ug-button", !0), g_functions.setButtonOnClick(e, t.prevItem)
7451    }, this.setFullScreenToggleButton = function(e) {
7452        e.data("ug-button", !0), g_functions.setButtonOnClick(e, t.toggleFullscreen), g_objGallery.on(t.events.ENTER_FULLSCREEN, function() {
7453            e.addClass("ug-fullscreenmode")
7454        }), g_objGallery.on(t.events.EXIT_FULLSCREEN, function() {
7455            e.removeClass("ug-fullscreenmode")
7456        })
7457    }, this.destroyFullscreenButton = function(e) {
7458        g_functions.destroyButton(e), g_objGallery.off(t.events.ENTER_FULLSCREEN), g_objGallery.off(t.events.EXIT_FULLSCREEN)
7459    }, this.setPlayButton = function(e) {
7460        e.data("ug-button", !0), g_functions.setButtonOnClick(e, t.togglePlayMode), g_objGallery.on(t.events.START_PLAY, function() {
7461            e.addClass("ug-stop-mode")
7462        }), g_objGallery.on(t.events.STOP_PLAY, function() {
7463            e.removeClass("ug-stop-mode")
7464        })
7465    }, this.destroyPlayButton = function(e) {
7466        g_functions.destroyButton(e), g_objGallery.off(t.events.START_PLAY), g_objGallery.off(t.events.STOP_PLAY)
7467    }, this.setProgressIndicator = function(e) {
7468        g_temp.objProgress = e
7469    }, this.setTextContainers = function(e, i) {
7470        g_objGallery.on(t.events.ITEM_CHANGE, function() {
7471            var n = t.getSelectedItem();
7472            e.html(n.title), i.html(n.description)
7473        })
7474    }, this.showDisabledOverlay = function() {
7475        g_objWrapper.children(".ug-overlay-disabled").show()
7476    }, this.hideDisabledOverlay = function() {
7477        g_objWrapper.children(".ug-overlay-disabled").hide()
7478    }, this.___________END_SET_CONTROLS___________ = function() {}, this.___________PLAY_MODE___________ = function() {}, this.startPlayMode = function() {
7479        if (g_temp.isPlayMode = !0, g_temp.isPlayModePaused = !1, g_temp.playTimePassed = 0, g_temp.playTimeLastStep = jQuery.now(), g_temp.playHandle = setInterval(advanceNextStep, g_temp.playStepInterval), g_temp.objProgress) {
7480            var e = g_temp.objProgress.getElement();
7481            g_temp.objProgress.setProgress(0), e.show()
7482        }
7483        g_objGallery.trigger(t.events.START_PLAY), g_objSlider && 1 == g_objSlider.isCurrentSlideLoadingImage() && t.pausePlaying()
7484    }, this.resetPlaying = function() {
7485        return 0 == g_temp.isPlayMode || (g_temp.playTimePassed = 0, void(g_temp.playTimeLastStep = jQuery.now()))
7486    }, this.pausePlaying = function() {
7487        return 1 == g_temp.isPlayModePaused || (g_temp.isPlayModePaused = !0, clearInterval(g_temp.playHandle), void g_objGallery.trigger(t.events.PAUSE_PLAYING))
7488    }, this.continuePlaying = function() {
7489        return 0 == g_temp.isPlayModePaused || (g_temp.isPlayModePaused = !1, g_temp.playTimeLastStep = jQuery.now(), void(g_temp.playHandle = setInterval(advanceNextStep, g_temp.playStepInterval)))
7490    }, this.stopPlayMode = function() {
7491        (g_temp.isPlayMode = !1, clearInterval(g_temp.playHandle), g_temp.playTimePassed = 0, g_temp.objProgress) && g_temp.objProgress.getElement().hide();
7492        g_objGallery.trigger(t.events.STOP_PLAY)
7493    }, this.isPlayMode = function() {
7494        return g_temp.isPlayMode
7495    }, this.togglePlayMode = function() {
7496        0 == t.isPlayMode() ? t.startPlayMode() : t.stopPlayMode()
7497    }, this.___________GENERAL_EXTERNAL___________ = function() {}, this.shuffleItems = function() {
7498        g_arrItems = g_functions.arrayShuffle(g_arrItems);
7499        for (var e in g_arrItems) g_arrItems[e].index = parseInt(e)
7500    }, this.setOptions = function(e) {
7501        g_options = jQuery.extend(g_options, e)
7502    }, this.selectItem = function(e) {
7503        "number" == typeof e && (e = t.getItem(e));
7504        var i = e.index;
7505        if (i == g_selectedItemIndex) return !0;
7506        (unselectSeletedItem(), g_selectedItem = e, g_selectedItemIndex = i, g_objGallery.trigger(t.events.ITEM_CHANGE, e), 1 == g_temp.isPlayMode) && (t.resetPlaying(), 1 == g_objSlider.isCurrentSlideLoadingImage() && t.pausePlaying())
7507    }, this.nextItem = function() {
7508        var e = g_selectedItemIndex + 1;
7509        return 0 == g_numItems || (0 == g_options.gallery_carousel && e >= g_numItems || (e >= g_numItems && (e = 0), void t.selectItem(e)))
7510    }, this.prevItem = function() {
7511        var e = g_selectedItemIndex - 1;
7512        return -1 == g_selectedItemIndex && (e = 0), 0 == g_numItems || (0 == g_options.gallery_carousel && 0 > e || (0 > e && (e = g_numItems - 1), void t.selectItem(e)))
7513    }, this.isFullScreen = function() {
7514        return 1 == g_temp.isFakeFullscreen || 1 == g_functions.isFullScreen()
7515    }, this.isFakeFullscreen = function() {
7516        return g_temp.isFakeFullscreen
7517    }, this.toFullScreen = function() {
7518        g_functions.setGlobalData("fullscreenID", g_galleryID);
7519        var e = g_objWrapper.get(0);
7520        0 == g_functions.toFullscreen(e) && toFakeFullScreen()
7521    }, this.exitFullScreen = function() {
7522        1 == g_temp.isFakeFullscreen ? exitFakeFullscreen() : g_functions.exitFullscreen()
7523    }, this.toggleFullscreen = function() {
7524        0 == t.isFullScreen() ? t.toFullScreen() : t.exitFullScreen()
7525    }, this.resize = function(e, t, i) {
7526        g_objWrapper.css("width", "auto"), g_objWrapper.css("max-width", e + "px"), t && g_objWrapper.height(t), i || !0 === i || onGalleryResized()
7527    }, this.setSizeClass = function(e, i) {
7528        if (!e) e = g_objWrapper;
7529        if (!i) {
7530            var n = t.getSize();
7531            i = n.width
7532        }
7533        var r = "";
7534        return 480 >= i ? r = "ug-under-480" : 780 >= i ? r = "ug-under-780" : 960 > i && (r = "ug-under-960"), 1 == e.hasClass(r) || (removeAllSizeClasses(e), void("" != r && e.addClass(r)))
7535    }, this.isMobileMode = function() {
7536        return !!g_objWrapper.hasClass("ug-under-480")
7537    }, this.changeItems = function(e, t) {
7538        if (!e) e = "noitems";
7539        runGallery(g_galleryID, "nochange", e, t)
7540    }, this.__________AJAX_REQUEST_______ = function() {}, this.ajaxRequest = function(e, t, i, n) {
7541        if (1 == i && "json", !n || "function" != typeof n) throw new Error("ajaxRequest error: success function should be passed");
7542        if ("" == g_options.gallery_urlajax) throw new Error("ajaxRequest error: Ajax url don't passed");
7543        if (void 0 === t) t = {};
7544        var r = {
7545            action: "unitegallery_ajax_action",
7546            client_action: e,
7547            galleryID: g_galleryID,
7548            data: t
7549        };
7550        jQuery.ajax({
7551            type: "post",
7552            url: g_options.gallery_urlajax,
7553            dataType: "json",
7554            data: r,
7555            success: function(e) {
7556                return e ? -1 == e || 0 === e ? (showErrorMessage("ajax error!!!"), !1) : void 0 === e.success ? (showErrorMessage("The 'success' param is a must!"), !1) : 0 == e.success ? (showErrorMessage(e.message), !1) : void n(e) : (showErrorMessage("Empty ajax response!", "Ajax Error"), !1)
7557            },
7558            error: function(e, t) {
7559                console.log("Ajax Error!!! " + t)
7560            }
7561        })
7562    }, this.requestNewItems = function(e, i, n) {
7563        var r = g_options.gallery_enable_cache;
7564        if (n || (n = e), 1 == i && (r = !1), 1 == r && g_objCache.hasOwnProperty(n)) {
7565            var o = g_objCache[n];
7566            t.changeItems(o, n)
7567        } else g_objGallery.trigger(t.events.GALLERY_BEFORE_REQUEST_ITEMS), t.ajaxRequest("front_get_cat_items", {
7568            catid: e
7569        }, !0, function(e) {
7570            var i = e.html;
7571            t.changeItems(i, n)
7572        })
7573    }, this.run = function(e, t) {
7574        if (g_options.gallery_debug_errors, t && t.hasOwnProperty("gallery_debug_errors") && (g_options.gallery_debug_errors = t.gallery_debug_errors), 1 == g_options.gallery_debug_errors) try {
7575            runGallery(e, t)
7576        } catch (e) {
7577            if ("object" == typeof e) {
7578                var i = e.message,
7579                    n = e.lineNumber,
7580                    r = e.fileName;
7581                e.stack, i += " <br><br> in file: " + r, i += " <b> line " + n + "</b>", trace(e)
7582            } else i = e;
7583            showErrorMessage(i = i.replace("Error:", ""))
7584        } else runGallery(e, t)
7585    }
7586}
7587
7588function UGLightbox() {
7589    function e() {
7590        1 == V.isCompact && 1 == X.lightbox_show_textpanel && (X.lightbox_slider_image_padding_bottom = V.initTextPanelHeight), 1 == V.isCompact && "inside" == X.lightbox_arrows_position && (V.isArrowsInside = !0), 1 == V.isArrowsInside && 0 == X.lightbox_arrows_inside_alwayson && (V.isArrowsOnHoverMode = !0)
7591    }
7592
7593    function t(e) {
7594        if (!B) return !0;
7595        var t = {
7596            slider_image_padding_top: e,
7597            slider_video_padding_top: e
7598        };
7599        B.setOptions(t), B.refreshSlideItems()
7600    }
7601
7602    function i() {
7603        if (!F) return !1;
7604        if (!Y) return !1;
7605        var e = F.height();
7606        if (0 == e) return !1;
7607        var i = e,
7608            n = Y.getSize().height;
7609        e != V.topPanelHeight && (i = V.topPanelHeight), n > i && (i = n), e != i && (F.height(i), B && 0 == B.isAnimating() && t(i))
7610    }
7611
7612    function n(e) {
7613        if (0 == V.isOpened) return !1;
7614        if (!Y) return !1;
7615        if (!B) return !1;
7616        var t = U.getElementSize(H),
7617            i = Y.getSize();
7618        if (0 == i.width || i.height > 120) return !1;
7619        if (!e) {
7620            var n = B.getSlideImage();
7621            e = U.getElementSize(n)
7622        }
7623        if (0 == e.height || 0 == e.width) return !1;
7624        if (e.bottom + i.height < t.height) return !1;
7625        var r = B.getOptions(),
7626            o = i.height;
7627        if (o != r.slider_image_padding_bottom) {
7628            var a = {
7629                slider_image_padding_bottom: o
7630            };
7631            if (0 == B.isAnimating()) return B.setOptions(a), B.refreshSlideItems(), !0
7632        }
7633        return !1
7634    }
7635
7636    function r(e) {
7637        var t = (U.getElementSize(H), B.getSlideImage()),
7638            i = U.getElementSize(t);
7639        if (0 == i.width) return !1;
7640        V.textPanelLeft = i.left, V.textPanelTop = i.bottom;
7641        var r = i.width;
7642        if (D) {
7643            var o = U.getElementSize(D);
7644            r -= o.width;
7645            var a = i.right - o.width;
7646            U.placeElement(D, a, V.textPanelTop)
7647        }
7648        Y && (Y.show(), Y.refresh(!0, !0, r), function(e, t) {
7649            if (!e) {
7650                var i = B.getSlideImage();
7651                e = U.getElementSize(i)
7652            }
7653            V.textPanelTop = e.bottom, !0 === t && Y.positionPanel(V.textPanelTop, V.textPanelLeft)
7654        }(i)), 0 == n(i) && (V.positionFrom = "handleCompactTextpanelSizes", Y && (Y.positionPanel(V.textPanelTop, V.textPanelLeft), !0 === e && (e(), v())))
7655    }
7656
7657    function o() {
7658        return 0 == B.isCurrentSlideType("image") || 1 == B.isCurrentImageInPlace()
7659    }
7660
7661    function a(e, t) {
7662        if (0 == V.isArrowsInside) return !1;
7663        if (!R) return !1;
7664        var i = o();
7665        if (R.show(), Q.show(), V.positionFrom = "positionArrowsInside", 1 == V.isArrowsOnHoverMode && 1 == i && 0 == p() && g(!0), 0 == i) var n = U.getElementRelativePos(R, "left", X.lightbox_arrows_offset),
7666            r = U.getElementRelativePos(R, "middle"),
7667            a = U.getElementRelativePos(Q, "right", X.lightbox_arrows_offset),
7668            s = r;
7669        else {
7670            var l = B.getSlideImage(),
7671                u = U.getElementSize(l);
7672            n = (U.getElementSize(B.getElement()), U.getElementRelativePos(R, "left", 0, l) + u.left + X.lightbox_arrows_inside_offset), r = U.getElementRelativePos(R, "middle", 0, l) + u.top, a = U.getElementRelativePos(R, "right", 0, l) + u.left - X.lightbox_arrows_inside_offset, s = r
7673        }
7674        if (!0 === t) {
7675            var d = {
7676                    left: n,
7677                    top: r
7678                },
7679                c = {
7680                    left: a,
7681                    top: s
7682                };
7683            R.stop().animate(d, {
7684                duration: V.fadeDuration
7685            }), Q.stop().animate(c, {
7686                duration: V.fadeDuration
7687            })
7688        } else R.stop(), Q.stop(), U.placeElement(R, n, r), U.placeElement(Q, a, s);
7689        1 == e && h(t)
7690    }
7691
7692    function s(e, t) {
7693        V.positionFrom = null;
7694        var i = o(),
7695            n = U.getElementRelativePos(z, "right", 2, H);
7696        if (0 == i) var r = 2,
7697            a = n;
7698        else {
7699            var s = B.getSlideImage(),
7700                l = U.getElementSize(s),
7701                u = U.getElementSize(B.getElement()),
7702                d = U.getElementSize(z);
7703            u.top == u.height && (u.top = 0);
7704            a = u.left + l.right - d.width / 2 + X.lightbox_compact_closebutton_offsetx;
7705            2 > (r = u.top + l.top - d.height / 2 - X.lightbox_compact_closebutton_offsety) && (r = 2), a > n && (a = n)
7706        }
7707        if (!0 === t) {
7708            var c = {
7709                left: a,
7710                top: r
7711            };
7712            z.stop().animate(c, {
7713                duration: V.fadeDuration
7714            })
7715        } else z.stop(), U.placeElement(z, a, r);
7716        !0 === e && (!0 !== t && z.stop(), z.fadeTo(V.fadeDuration, 1))
7717    }
7718
7719    function l() {
7720        z && z.stop().fadeTo(V.fadeDuration, 0), d(), c(), V.positionFrom = "hideCompactElements", 1 == V.isArrowsInside && g()
7721    }
7722
7723    function u() {
7724        var e, t, n, r = U.getElementSize(H);
7725        F && U.setElementSizeAndPosition(F, 0, 0, r.width, V.topPanelHeight), R && 0 == V.isArrowsInside && (1 == X.lightbox_hide_arrows_onvideoplay && (R.show(), Q.show()), U.placeElement(R, "left", "middle", X.lightbox_arrows_offset), U.placeElement(Q, "right", "middle", X.lightbox_arrows_offset)), 0 == V.isCompact && U.placeElement(z, "right", "top", 2, 2), Y && (V.positionFrom = "positionElements", 0 == V.isCompact ? (e = r, t = {}, (n = X.lightbox_textpanel_width) > e.width - 47 - 40 ? (t.textpanel_padding_left = 47, t.textpanel_padding_right = 40, t.textpanel_title_text_align = "center", t.textpanel_desc_text_align = "center") : (t.textpanel_padding_left = Math.floor((e.width - n) / 2), t.textpanel_padding_right = t.textpanel_padding_left, t.textpanel_title_text_align = "left", t.textpanel_desc_text_align = "left", X.lightbox_textpanel_title_text_align && (t.textpanel_title_text_align = X.lightbox_textpanel_desc_text_align), X.lightbox_textpanel_desc_text_align && (t.textpanel_desc_text_align = X.lightbox_textpanel_desc_text_align)), Y.setOptions(t), Y.refresh(!0, !0), i(), Y.positionPanel()) : (f(), v()));
7726        var o = r.width,
7727            a = r.height;
7728        if (B) {
7729            if (F) {
7730                var s = F.height(),
7731                    l = {
7732                        slider_image_padding_top: s,
7733                        slider_video_padding_top: s
7734                    };
7735                B.setOptions(l)
7736            }
7737            B.setSize(o, a), B.setPosition(0, 0)
7738        }
7739    }
7740
7741    function d() {
7742        Y && Y.getElement().stop().fadeTo(V.fadeDuration, 0)
7743    }
7744
7745    function c() {
7746        D && D.stop().fadeTo(V.fadeDuration, 0)
7747    }
7748
7749    function p() {
7750        if (!V.lastMouseX) return !0;
7751        var e = {
7752            pageX: V.lastMouseX,
7753            pageY: V.lastMouseY
7754        };
7755        return B.isMouseInsideSlideImage(e)
7756    }
7757
7758    function g(e, t) {
7759        return !!R && (1 == V.isArrowsOnHoverMode && !1 === t ? (p(), !0) : void(!0 === e ? (R.stop().fadeTo(0, 0), Q.stop().fadeTo(0, 0)) : (R.stop().fadeTo(V.fadeDuration, 0), Q.stop().fadeTo(V.fadeDuration, 0))))
7760    }
7761
7762    function h(e, t) {
7763        return !!R && (1 == V.isArrowsOnHoverMode && !0 !== t && 1 == o() || (1 == B.isSwiping() || (!0 !== e && (R.stop(), Q.stop()), R.fadeTo(V.fadeDuration, 1), void Q.fadeTo(V.fadeDuration, 1))))
7764    }
7765
7766    function _(e) {
7767        if (!Y) return !1;
7768        if (!e) e = B.getCurrentItem();
7769        Y.setTextPlain(e.title, e.description)
7770    }
7771
7772    function m(e) {
7773        if (!D) return !1;
7774        if (!e) e = B.getCurrentItem();
7775        var t = W.getNumItems(),
7776            i = e.index + 1;
7777        D.html(i + " / " + t)
7778    }
7779
7780    function f() {
7781        return !!Y && void Y.getElement().show().stop().fadeTo(V.fadeDuration, 1)
7782    }
7783
7784    function v() {
7785        D && D.stop().fadeTo(V.fadeDuration, 1)
7786    }
7787
7788    function b() {
7789        return 0 == V.isCompact || void l()
7790    }
7791
7792    function y() {
7793        if (0 == V.isCompact) return !0;
7794        (V.positionFrom = "onZoomChange", s(!1, !0), a(!1, !0), 1 == V.isCompact) && (0 == (B.isCurrentSlideType("image") && 1 == B.isCurrentImageInPlace()) ? (d(), c()) : (V.positionFrom = "onZoomChange", f(), v()))
7795    }
7796
7797    function w() {
7798        if (0 == V.isCompact) return !0;
7799        V.positionFrom = "onSliderAfterReturn", s(!0), a(!0), 0 == n() && r(), f(), v()
7800    }
7801
7802    function x(e, t) {
7803        return t = jQuery(t), 0 == V.isCompact || (0 == B.isSlideCurrent(t) || (V.positionFrom = "onSliderAfterPutImage", s(!0), a(!0), void r()))
7804    }
7805
7806    function E() {
7807        var e = B.getOptions().slider_image_padding_top;
7808        if (F) {
7809            var i = F.height();
7810            i != e && t(i)
7811        }
7812        1 == V.isCompact && (_(), m(), V.positionFrom = "onSliderTransitionEnd", s(!0), a(!0), 0 == B.isSlideActionActive()) && (0 == n() && r(), f(), v())
7813    }
7814
7815    function I(e, t) {
7816        0 == V.isCompact ? (D && m(t), Y && (_(t), Y.positionElements(!1), i(), Y.positionPanel())) : 0 == B.isAnimating() && (Y && _(t), D && m(t))
7817    }
7818
7819    function T(e, t) {
7820        return !("image" == B.getSlideType() || 0 != V.isCompact || !B.isSli
7820deActionActive()) || (1 == B.isPreloading() ? (G.close("slider"), !0) : void(0 == B.isMouseInsideSlideImage(t) && G.close("slider_inside")))
7821    }
7822
7823    function S() {
7824        u()
7825    }
7826
7827    function j() {
7828        R && 1 == X.lightbox_hide_arrows_onvideoplay && (R.hide(), Q.hide())
7829    }
7830
7831    function P() {
7832        R && 1 == X.lightbox_hide_arrows_onvideoplay && (R.show(), Q.show())
7833    }
7834
7835    function C(e, t) {
7836        switch (t) {
7837            case 27:
7838                1 == V.isOpened && G.close("keypress")
7839        }
7840    }
7841
7842    function A() {
7843        1 == V.isArrowsOnHoverMode && h(!1, !0)
7844    }
7845
7846    function k() {
7847        V.positionFrom = "hideCompactElements", 1 == V.isArrowsOnHoverMode && 1 == o() && g(!1, !0)
7848    }
7849
7850    function O(e) {
7851        V.lastMouseX = e.pageX, V.lastMouseY = e.pageY, 1 == (!R || 0 == R.is(":visible") || 1 != R.css("opacity")) && p() && 0 == B.isAnimating() && (V.positionFrom = "onMouseMove", R && 0 == R.is(":animated") && h(!1, !0))
7852    }
7853
7854    function M(e, t, i, n) {
7855        if (0 == V.isOpened) return !0;
7856        switch (X.gallery_mousewheel_role) {
7857            default:
7858                case "zoom":
7859                "image" != B.getSlideType() && e.preventDefault();
7860            break;
7861            case "none":
7862                    e.preventDefault();
7863                break;
7864            case "advance":
7865                    W.onGalleryMouseWheel(e, t, i, n)
7866        }
7867    }
7868    var L, H, N, R, Q, z, D, F, G = this,
7869        W = (jQuery(this), new UniteGalleryMain),
7870        B = new UGSlider,
7871        U = new UGFunctions,
7872        Y = new UGTextPanel,
7873        X = {
7874            lightbox_type: "wide",
7875            lightbox_show_textpanel: !0,
7876            lightbox_textpanel_width: 550,
7877            lightbox_hide_arrows_onvideoplay: !0,
7878            lightbox_arrows_position: "sides",
7879            lightbox_arrows_offset: 10,
7880            lightbox_arrows_inside_offset: 10,
7881            lightbox_arrows_inside_alwayson: !1,
7882            lightbox_overlay_color: null,
7883            lightbox_overlay_opacity: 1,
7884            lightbox_top_panel_opacity: null,
7885            lightbox_show_numbers: !0,
7886            lightbox_numbers_size: null,
7887            lightbox_numbers_color: null,
7888            lightbox_numbers_padding_top: null,
7889            lightbox_numbers_padding_right: null,
7890            lightbox_compact_closebutton_offsetx: 1,
7891            lightbox_compact_closebutton_offsety: 1
7892        };
7893    this.events = {};
7894    var V = {
7895            topPanelHeight: 44,
7896            initTextPanelHeight: 26,
7897            isOpened: !1,
7898            putSlider: !0,
7899            isCompact: !1,
7900            fadeDuration: 300,
7901            positionFrom: null,
7902            textPanelTop: null,
7903            textPanelLeft: null,
7904            isArrowsInside: !1,
7905            isArrowsOnHoverMode: !1,
7906            lastMouseX: null,
7907            lastMouseY: null,
7908            originalOptions: null
7909        },
7910        q = {
7911            lightbox_slider_controls_always_on: !0,
7912            lightbox_slider_enable_bullets: !1,
7913            lightbox_slider_enable_arrows: !1,
7914            lightbox_slider_enable_progress_indicator: !1,
7915            lightbox_slider_enable_play_button: !1,
7916            lightbox_slider_enable_fullscreen_button: !1,
7917            lightbox_slider_enable_zoom_panel: !1,
7918            lightbox_slider_enable_text_panel: !1,
7919            lightbox_slider_scale_mode_media: "down",
7920            lightbox_slider_scale_mode: "down",
7921            lightbox_slider_loader_type: 3,
7922            lightbox_slider_loader_color: "black",
7923            lightbox_slider_transition: "fade",
7924            lightbox_slider_image_padding_top: V.topPanelHeight,
7925            lightbox_slider_image_padding_bottom: 10,
7926            lightbox_slider_video_padding_top: V.topPanelHeight,
7927            lightbox_slider_video_padding_bottom: 0,
7928            lightbox_textpanel_align: "middle",
7929            lightbox_textpanel_padding_top: 5,
7930            lightbox_textpanel_padding_bottom: 5,
7931            slider_video_constantsize: !1,
7932            lightbox_slider_image_border: !1,
7933            lightbox_textpanel_enable_title: !0,
7934            lightbox_textpanel_enable_description: !1,
7935            lightbox_textpanel_enable_bg: !1,
7936            video_enable_closebutton: !1,
7937            lightbox_slider_video_enable_closebutton: !1,
7938            video_youtube_showinfo: !1,
7939            lightbox_slider_enable_links: !1
7940        },
7941        Z = {
7942            lightbox_overlay_opacity: .6,
7943            lightbox_slider_image_border: !0,
7944            lightbox_slider_image_shadow: !0,
7945            lightbox_slider_image_padding_top: 30,
7946            lightbox_slider_image_padding_bottom: 30,
7947            slider_video_constantsize: !0,
7948            lightbox_textpanel_align: "bottom",
7949            lightbox_textpanel_title_text_align: "left",
7950            lightbox_textpanel_desc_text_align: "left",
7951            lightbox_textpanel_padding_left: 10,
7952            lightbox_textpanel_padding_right: 10
7953        };
7954    this.destroy = function() {
7955        if (jQuery(document).unbind("mousemove"), N.off("touchstart"), N.off("touchend"), z.off("click"), L.off(W.events.ITEM_CHANGE), B) {
7956            jQuery(B).off(B.events.TRANSITION_END), jQuery(B).off(B.events.CLICK), jQuery(B).off(B.events.START_DRAG), jQuery(B).off(B.events.TRANSITION_START), jQuery(B).off(B.events.AFTER_DRAG_CHANGE), jQuery(B).off(B.events.AFTER_RETURN);
7957            var e = B.getVideoObject();
7958            jQuery(e).off(e.events.PLAY_START), jQuery(e).off(e.events.PLAY_STOP), jQuery(B).on(B.events.IMAGE_MOUSEENTER, A), jQuery(B).on(B.events.IMAGE_MOUSELEAVE, k), B.destroy()
7959        }
7960        jQuery(window).unbind("resize"), L.off(W.events.GALLERY_KEYPRESS, C), H.off("mousewheel"), H.remove()
7961    }, this.open = function(e) {
7962        var t = W.getItem(e);
7963        (V.isOpened = !0, B && B.setItem(t, "lightbox_open"), Y && Y.setTextPlain(t.title, t.description), N.stop().fadeTo(0, 0), H.show(), H.fadeTo(0, 1), N.stop().fadeTo(V.fadeDuration, X.lightbox_overlay_opacity), u(), 1 == V.isCompact) && (1 == B.isPreloading() ? (z && z.hide(), R && 1 == V.isArrowsInside && (R.hide(), Q.hide()), D && D.hide(), Y && Y.hide()) : 1 == V.isArrowsInside && (R.hide(), Q.hide()));
7964        B && B.startSlideAction()
7965    }, this.close = function() {
7966        V.isOpened = !1, 1 == V.isCompact && l(), B && B.stopSlideAction(), "image" != B.getSlideType() ? H.hide() : H.fadeTo(V.fadeDuration, 0, function() {
7967            H.hide()
7968        })
7969    }, this.init = function(t, i) {
7970        var n, r;
7971        r = i, W = n = t, L = jQuery(n), X = jQuery.extend(X, q), X = jQuery.extend(X, r), V.originalOptions = jQuery.extend({}, X), "compact" == X.lightbox_type && (V.isCompact = !0, X = jQuery.extend(X, Z), X = jQuery.extend(X, r)), e(), 1 == V.putSlider ? (W.initSlider(X, "lightbox"), g_objects = n.getObjects(), B = g_objects.g_objSlider) : B = null, 1 == X.lightbox_show_textpanel ? Y.init(W, X, "lightbox") : Y = null
7972    }, this.putHtml = function() {
7973        var t, i;
7974        W.isMobileMode() && 1 == V.isCompact && (V.isCompact = !1, e(), trace(X = jQuery.extend({}, V.originalOptions)), B.setOptions(X)), t = "", i = "", 1 == V.isCompact && (i = " ug-lightbox-compact"), t += "<div class='ug-gallery-wrapper ug-lightbox" + i + "'>", t += "<div class='ug-lightbox-overlay'></div>", 0 == V.isCompact && (t += "<div class='ug-lightbox-top-panel'>"), t += "<div class='ug-lightbox-top-panel-overlay'></div>", t += "<div class='ug-lightbox-button-close'></div>", X.lightbox_show_numbers && (t += "<div class='ug-lightbox-numbers'></div>"), 0 == V.isCompact && (t += "</div>"), t += "<div class='ug-lightbox-arrow-left'></div>", t += "<div class='ug-lightbox-arrow-right'></div>", t += "</div>", H = jQuery(t), jQuery("body").append(H), B && B.setHtml(H), N = H.children(".ug-lightbox-overlay"), 0 == V.isCompact && (F = H.children(".ug-lightbox-top-panel")), z = H.find(".ug-lightbox-button-close"), X.lightbox_show_numbers && (D = H.find(".ug-lightbox-numbers")), R = H.children(".ug-lightbox-arrow-left"), Q = H.children(".ug-lightbox-arrow-right"), Y && Y.appendHTML(F || H)
7975    }, this.run = function() {
7976        (function() {
7977            if (null !== X.lightbox_overlay_color && N.css("background-color", X.lightbox_overlay_color), null !== X.lightbox_overlay_opacity && N.fadeTo(0, X.lightbox_overlay_opacity), F && null !== X.lightbox_top_panel_opacity && F.children(".ug-lightbox-top-panel-overlay").fadeTo(0, X.lightbox_top_panel_opacity), D) {
7978                var e = {};
7979                null !== X.lightbox_numbers_size && (e["font-size"] = X.lightbox_numbers_size + "px"), X.lightbox_numbers_color && (e.color = X.lightbox_numbers_color), null !== X.lightbox_numbers_padding_right && (e["padding-right"] = X.lightbox_numbers_padding_right + "px"), null !== X.lightbox_numbers_padding_top && (e["padding-top"] = X.lightbox_numbers_padding_top + "px"), D.css(e)
7980            }
7981        })(), B && B.run(),
7982            function() {
7983                if (N.on("touchstart", function(e) {
7984                        e.preventDefault()
7985                    }), N.on("touchend", function() {
7986                        G.close("overlay")
7987                    }), U.addClassOnHover(Q, "ug-arrow-hover"), U.addClassOnHover(R, "ug-arrow-hover"), U.addClassOnHover(z), W.setNextButton(Q), W.setPrevButton(R), z.click(function() {
7988                        G.close("button")
7989                    }), L.on(W.events.ITEM_CHANGE, I), B) {
7990                    jQuery(B).on(B.events.TRANSITION_END, E), jQuery(B).on(B.events.CLICK, T);
7991                    var e = B.getVideoObject();
7992                    jQuery(e).on(e.events.PLAY_START, j), jQuery(e).on(e.events.PLAY_STOP, P), jQuery(B).on(B.events.START_DRAG, b), jQuery(B).on(B.events.TRANSITION_START, b), jQuery(B).on(B.events.AFTER_DRAG_CHANGE, w), jQuery(B).on(B.events.AFTER_RETURN, w), jQuery(B).on(B.events.AFTER_PUT_IMAGE, x), jQuery(B).on(B.events.ZOOM_CHANGE, y), jQuery(B).on(B.events.IMAGE_MOUSEENTER, A), jQuery(B).on(B.events.IMAGE_MOUSELEAVE, k)
7993                }
7994                jQuery(window).resize(function() {
7995                    return 0 == V.isOpened || void U.whenContiniousEventOver("lightbox_resize", S, 100)
7996                }), L.on(W.events.GALLERY_KEYPRESS, C), 1 == V.isArrowsOnHoverMode && jQuery(document).bind("mousemove", O), H.on("mousewheel", M)
7997            }()
7998    }
7999}
8000
8001function UGCarousel() {
8002    function e(e, t) {
8003        if (!t) t = L.initTileHeight / L.initTileWidth * e;
8004        L.tileWidth = e;
8005        var i = {
8006            tile_width: e,
8007            tile_height: t
8008        };
8009        k.setOptions(i), M.tile_width = e, M.tile_height = t, k.resizeAllTiles(e), u(!0)
8010    }
8011
8012    function t() {
8013        if (null === L.carouselMaxWidth) throw new Error("The carousel width not set");
8014        if (L.tileWidth < L.initTileWidth) {
8015            (i = L.carouselMaxWidth - 2 * M.carousel_padding) > L.initTileWidth && (i = L.initTileWidth), e(i);
8016            var t = A.getNumItemsInSpace(L.carouselMaxWidth, i, M.carousel_space_between_tiles)
8017        } else {
8018            var i;
8019            if (0 >= (t = A.getNumItemsInSpace(L.carouselMaxWidth, L.tileWidth, M.carousel_space_between_tiles))) t = 1, e(i = L.carouselMaxWidth - 2 * M.carousel_padding)
8020        }
8021        var n = A.getSpaceByNumItems(t, L.tileWidth, M.carousel_space_between_tiles);
8022        n += 2 * M.carousel_padding, T.width(n), 1 == L.isFirstTimeRun ? (k.initEvents(), T.bind("mousedown touchstart", f), jQuery("body").bind("mousemove touchmove", v), jQuery(window).add("body").bind("mouseup touchend", b), T.hover(y, w), k.run(), jQuery.each(I, function(e, t) {
8023            t.objThumbWrapper.data("index", e), E.trigger(L.eventSizeChange, [t.objThumbWrapper, !0]), t.objTileOriginal = t.objThumbWrapper.clone(!0, !0)
8024        }), u(!0), 1 == M.carousel_autoplay && j.startAutoplay()) : (1 == M.carousel_autoplay && j.pauseAutoplay(), g(0, !1), 1 == M.carousel_autoplay && j.startAutoplay()), A.placeElement(S, 0, M.carousel_padding), _(), L.isFirstTimeRun = !1
8025    }
8026
8027    function i() {
8028        return A.getElementSize(S).left
8029    }
8030
8031    function n(e) {
8032        return A.getMousePosition(e).pageX
8033    }
8034
8035    function r() {
8036        return S.children(".ug-thumb-wrapper")
8037    }
8038
8039    function o(e) {
8040        return A.getNumItemsInSpace(e, L.tileWidth, M.carousel_space_between_tiles)
8041    }
8042
8043    function a() {
8044        return r().length
8045    }
8046
8047    function s(e) {
8048        d(e);
8049        var t = r();
8050        return jQuery(t[e])
8051    }
8052
8053    function l() {
8054        return o(A.getElementSize(T).width)
8055    }
8056
8057    function u(e) {
8058        if (!e) e = !1;
8059        var t, i = r(),
8060            n = 0,
8061            o = 0;
8062        return jQuery.each(i, function(e, r) {
8063            r = jQuery(r), A.placeElement(r, n, 0);
8064            var a = A.getElementSize(r);
8065            n += a.width + M.carousel_space_between_tiles, o = Math.max(o, a.height), e == i.length - 1 && (t = a.right)
8066        }), S.width(t), o += 2 * M.carousel_padding, !0 === e && (S.height(o), T.height(o)), g(L.numCurrent, !1), t
8067    }
8068
8069    function d(e) {
8070        if (e > r().length - 1) throw new Error("Wrogn tile number: " + e)
8071    }
8072
8073    function c(e, t) {
8074        if ("left" == t) var i = S.children(".ug-thumb-wrapper").first();
8075        else i = S.children(".ug-thumb-wrapper").last();
8076        var n = function(e, t, i) {
8077            var n = e.data("index");
8078            if (void 0 == n) throw new Error("every tile should have index!");
8079            for (var r = [], o = 0; t > o; o++) {
8080                if ("prev" == i) var a = C.getPrevItem(n, !0);
8081                else a = C.getNextItem(n, !0);
8082                if (!a) throw new Error("the item to add is empty");
8083                var s = a.objTileOriginal.clone(!0, !0);
8084                n = a.index, s.addClass("cloned"), r.push(s)
8085            }
8086            return r
8087        }(i, e, "left" == t ? "prev" : "next");
8088        jQuery.each(n, function(e, i) {
8089            "left" == t ? S.prepend(i) : S.append(i), E.trigger(L.eventSizeChange, i), k.loadTileImage(i)
8090        })
8091    }
8092
8093    function p(e, t) {
8094        d(n);
8095        for (var i = r(), n = i.length, o = 0; e > o; o++) "left" == t ? jQuery(i[o]).remove() : jQuery(i[n - 1 - o]).remove()
8096    }
8097
8098    function g(e, t, i) {
8099        if (void 0 === t) {
8100            t = !0;
8101            if (S.is(":animated")) return !0
8102        }
8103        var n = s(e),
8104            r = {
8105                left: -A.getElementSize(n).left + M.carousel_padding + "px"
8106            };
8107        if (!0 === t) {
8108            var o = M.carousel_scroll_duration,
8109                a = M.carousel_scroll_easing;
8110            !0 === i && (o = L.scrollShortDuration, a = L.scrollShortEasing), S.stop(!0).animate(r, {
8111                duration: o,
8112                easing: a,
8113                queue: !1,
8114                complete: function() {
8115                    L.numCurrent = e, _()
8116                }
8117            })
8118        } else L.numCurrent = e, S.css(r)
8119    }
8120
8121    function h() {
8122        var e, t, n, r;
8123        g((e = -i(), t = o(e), n = A.getElementSize(s(t)).left, r = A.getElementSize(s(t + 1)).left, Math.abs(n - e) < Math.abs(r - e) ? t : t + 1), !0, !0)
8124    }
8125
8126    function _() {
8127        var e, t, n, r, s = (r = -i(), L.sideSpace - r),
8128            l = (e = A.getElementSize(T), t = A.getElementSize(S), n = t.width - e.width + t.left, L.sideSpace - n),
8129            d = 0,
8130            g = 0,
8131            h = 0,
8132            _ = 0,
8133            m = a();
8134        if (s >
8134 L.spaceActionSize) d = o(s), c(d, "left"), L.numCurrent += d;
8135        else if (s < -L.spaceActionSize) {
8136            p(h = o(Math.abs(s)), "left"), L.numCurrent -= h
8137        }
8138        if (l > L.spaceActionSize ? c(g = o(l), "right") : l < -L.spaceActionSize && p(_ = o(Math.abs(l)), "right"), _ > m) throw new Error("Can't remove more then num tiles");
8139        var f = !1;
8140        return (d || g || h || _) && (u(), f = !0), f
8141    }
8142
8143    function m() {
8144        "left" == M.carousel_autoplay_direction ? j.scrollRight(1) : j.scrollLeft(1)
8145    }
8146
8147    function f(e) {
8148        return 1 == L.touchActive || (L.touchActive = !0, j.pauseAutoplay(), L.startTime = jQuery.now(), L.startMousePos = n(e), L.startInnerPos = i(), L.lastTime = L.startTime, L.lastMousePos = L.startMousePos, void A.storeEventData(e, L.storedEventID))
8149    }
8150
8151    function v(e) {
8152        if (0 == L.touchActive) return !0;
8153        A.updateStoredEventData(e, L.storedEventID), e.preventDefault();
8154        var t = null;
8155        if (1 == M.carousel_vertical_scroll_ondrag && (t = A.handleScrollTop(L.storedEventID)), "vert" === t) return !0;
8156        L.lastMousePos = n(e);
8157        var i, r = L.lastMousePos - L.startMousePos,
8158            o = L.startInnerPos + r,
8159            a = r > 0 ? "prev" : "next",
8160            s = A.getElementSize(S).width;
8161        o > 0 && "prev" == a && (o /= 3), -s > o && "next" == a && (o = L.startInnerPos + r / 3), i = {
8162            left: o + "px"
8163        }, S.css(i)
8164    }
8165
8166    function b() {
8167        return 0 == L.touchActive || (L.touchActive = !1, h(), void j.unpauseAutoplay())
8168    }
8169
8170    function y() {
8171        return 0 == M.carousel_autoplay_pause_onhover || void(1 == L.isPlayMode && 0 == L.isPaused && j.pauseAutoplay())
8172    }
8173
8174    function w() {
8175        return 0 == M.carousel_autoplay_pause_onhover || void j.unpauseAutoplay()
8176    }
8177
8178    function x() {
8179        var e = L.lastTime - L.startTime,
8180            t = Math.abs(L.lastMousePos - L.startMousePos);
8181        return !(e > 300) && !(t > 30)
8182    }
8183    var E, I, T, S, j = this,
8184        P = jQuery(this),
8185        C = new UniteGalleryMain,
8186        A = new UGFunctions,
8187        k = new UGTileDesign,
8188        O = new UGThumbsGeneral,
8189        M = {
8190            carousel_padding: 8,
8191            carousel_space_between_tiles: 20,
8192            carousel_navigation_numtiles: 3,
8193            carousel_scroll_duration: 500,
8194            carousel_scroll_easing: "easeOutCubic",
8195            carousel_autoplay: !0,
8196            carousel_autoplay_timeout: 3e3,
8197            carousel_autoplay_direction: "right",
8198            carousel_autoplay_pause_onhover: !0,
8199            carousel_vertical_scroll_ondrag: !1
8200        };
8201    this.events = {
8202        START_PLAY: "carousel_start_play",
8203        PAUSE_PLAY: "carousel_pause_play",
8204        STOP_PLAY: "carousel_stop_play"
8205    };
8206    var L = {
8207        eventSizeChange: "thumb_size_change",
8208        isFirstTimeRun: !0,
8209        carouselMaxWidth: null,
8210        tileWidth: 0,
8211        initTileWidth: 0,
8212        initTileHeight: 0,
8213        sideSpace: 1500,
8214        spaceActionSize: 500,
8215        numCurrent: 0,
8216        touchActive: !1,
8217        startInnerPos: 0,
8218        lastTime: 0,
8219        startTime: 0,
8220        startMousePos: 0,
8221        lastMousePos: 0,
8222        scrollShortDuration: 200,
8223        scrollShortEasing: "easeOutQuad",
8224        handle: null,
8225        isPlayMode: !1,
8226        isPaused: !1,
8227        storedEventID: "carousel"
8228    };
8229    this.startAutoplay = function() {
8230        L.isPlayMode = !0, L.isPaused = !1, P.trigger(j.events.START_PLAY), L.handle && clearInterval(L.handle), L.handle = setInterval(m, M.carousel_autoplay_timeout)
8231    }, this.unpauseAutoplay = function() {
8232        return 0 == L.isPlayMode || (0 == L.isPaused || void j.startAutoplay())
8233    }, this.pauseAutoplay = function() {
8234        return 0 == L.isPlayMode || (L.isPaused = !0, L.handle && clearInterval(L.handle), void P.trigger(j.events.PAUSE_PLAY))
8235    }, this.stopAutoplay = function() {
8236        return 0 == L.isPlayMode || (L.isPaused = !1, L.isPlayMode = !1, L.handle && clearInterval(L.handle), void P.trigger(j.events.STOP_PLAY))
8237    }, this.destroy = function() {
8238        L.handle && clearInterval(L.handle), P.off(j.events.START_PLAY), P.off(j.events.STOP_PLAY), T.unbind("mousedown"), T.unbind("touchstart"), jQuery("body").unbind("mousemove"), jQuery("body").unbind("touchmove"), jQuery(window).add("body").unbind("mouseup").unbind("touchend"), T.off("mouseenter").off("mouseleave"), k.destroy()
8239    }, this.init = function(e, t, i) {
8240        var n, r;
8241        i && this.setMaxWidth(i), n = e, r = t, g_objects = n.getObjects(), C = n, jQuery(n), E = g_objects.g_objWrapper, I = g_objects.g_arrItems, M = jQuery.extend(M, r), k.setFixedMode(), k.setApproveClickFunction(x), k.init(n, M), O = k.getObjThumbs(), M = k.getOptions(), L.initTileWidth = M.tile_width, L.initTileHeight = M.tile_height, L.tileWidth = M.tile_width
8242    }, this.setMaxWidth = function(e) {
8243        L.carouselMaxWidth = e
8244    }, this.setHtml = function(e) {
8245        ! function(e) {
8246            e || (e = E);
8247            E.append("<div class='ug-carousel-wrapper'><div class='ug-carousel-inner'></div></div>"), T = E.children(".ug-carousel-wrapper"), S = T.children(".ug-carousel-inner"), k.setHtml(S), O.getThumbs().fadeTo(0, 1)
8248        }(e)
8249    }, this.getElement = function() {
8250        return T
8251    }, this.getObjTileDesign = function() {
8252        return k
8253    }, this.getEstimatedHeight = function() {
8254        return M.tile_height + 2 * M.carousel_padding
8255    }, this.run = function() {
8256        t()
8257    }, this.scrollRight = function(e) {
8258        if (!e || "object" == typeof e) e = M.carousel_navigation_numtiles;
8259        var t = l();
8260        e > t && (e = t);
8261        var i = L.numCurrent - e;
8262        0 >= i && (i = 0), g(i)
8263    }, this.scrollLeft = function(e) {
8264        if (!e || "object" == typeof e) e = M.carousel_navigation_numtiles;
8265        var t = l();
8266        e > t && (e = t);
8267        var i = a(),
8268            n = L.numCurrent + e;
8269        n >= i && (n = i - 1), g(n)
8270    }, this.setScrollLeftButton = function(e) {
8271        A.setButtonMobileReady(e), A.setButtonOnClick(e, j.scrollLeft)
8272    }, this.setScrollRightButton = function(e) {
8273        A.setButtonMobileReady(e), A.setButtonOnClick(e, j.scrollRight)
8274    }, this.setPlayPauseButton = function(e) {
8275        A.setButtonMobileReady(e), 1 == L.isPlayMode && 0 == L.isPaused && e.addClass("ug-pause-icon"), P.on(j.events.START_PLAY, function() {
8276            e.addClass("ug-pause-icon")
8277        }), P.on(j.events.STOP_PLAY, function() {
8278            e.removeClass("ug-pause-icon")
8279        }), A.setButtonOnClick(e, function() {
8280            0 == L.isPlayMode || 1 == L.isPaused ? j.startAutoplay() : j.stopAutoplay()
8281        })
8282    }
8283}
8284
8285function UGTabs() {
8286    function e() {
8287        i.click(t)
8288    }
8289
8290    function t() {
8291        var e = r.tabs_class_selected,
8292            t = jQuery(this);
8293        if (t.hasClass(e)) return !0;
8294        i.not(t).removeClass(e), t.addClass(e);
8295        var o, a = t.data("catid");
8296        return !a || (o = a, void n.requestNewItems(o))
8297    }
8298    var i, n = (jQuery(this), new UniteGalleryMain),
8299        r = (new UGFunctions, {
8300            tabs_container: "#ug_tabs",
8301            tabs_class_selected: "ug-tab-selected"
8302        });
8303    this.events = {}, this.init = function(e, t) {
8304        var o;
8305        o = t, n = e, jQuery(n), r = jQuery.extend(r, o), i = jQuery(r.tabs_container + " .ug-tab")
8306    }, this.run = function() {
8307        e()
8308    }
8309}
8310
8311function UG_API(e) {
8312    function t(e) {
8313        var t = {
8314                index: e.index,
8315                title: e.title,
8316                description: e.description,
8317                urlImage: e.urlImage,
8318                urlThumb: e.urlThumb
8319            },
8320            i = e.objThumbImage.data();
8321        for (var n in i) {
8322            switch (n) {
8323                case "image":
8324                case "description":
8325                    continue
8326            }
8327            t[n] = i[n]
8328        }
8329        return t
8330    }
8331    var i, n = (jQuery(this), new UniteGalleryMain);
8332    n = e, i = jQuery(e), this.on = function(e, r) {
8333        switch (e) {
8334            case "item_change":
8335                i.on(n.events.ITEM_CHANGE, function() {
8336                    var e = t(n.getSelectedItem());
8337                    r(e.index, e)
8338                });
8339                break;
8340            case "resize":
8341                i.on(n.events.SIZE_CHANGE, r);
8342                break;
8343            case "enter_fullscreen":
8344                i.on(n.events.ENTER_FULLSCREEN, r);
8345                break;
8346            case "exit_fullscreen":
8347                i.on(n.events.EXIT_FULLSCREEN, r);
8348                break;
8349            case "play":
8350                i.on(n.events.START_PLAY, r);
8351                break;
8352            case "stop":
8353                i.on(n.events.STOP_PLAY, r);
8354                break;
8355            case "pause":
8356                i.on(n.events.PAUSE_PLAYING, r);
8357                break;
8358            case "continue":
8359                i.on(n.events.CONTINUE_PLAYING, r);
8360                break;
8361            default:
8362                console && console.log("wrong api event: " + e)
8363        }
8364    }, this.play = function() {
8365        n.startPlayMode()
8366    }, this.stop = function() {
8367        n.stopPlayMode()
8368    }, this.togglePlay = function() {
8369        n.togglePlayMode()
8370    }, this.enterFullscreen = function() {
8371        n.toFullScreen()
8372    }, this.exitFullscreen = function() {
8373        n.exitFullScreen()
8374    }, this.toggleFullscreen = function() {
8375        n.toggleFullscreen()
8376    }, this.resetZoom = function() {
8377        var e = n.getObjSlider();
8378        return !!e && void e.zoomBack()
8379    }, this.zoomIn = function() {
8380        var e = n.getObjSlider();
8381        return !!e && void e.zoomIn()
8382    }, this.zoomOut = function() {
8383        var e = n.getObjSlider();
8384        return !!e && void e.zoomOut()
8385    }, this.nextItem = function() {
8386        n.nextItem()
8387    }, this.prevItem = function() {
8388        n.prevItem()
8389    }, this.selectItem = function(e) {
8390        n.selectItem(e)
8391    }, this.resize = function(e, t) {
8392        t ? n.resize(e, t) : n.resize(e)
8393    }, this.getItem = function(e) {
8394        return t(n.getItem(e))
8395    }, this.getNumItems = function() {
8396        return n.getNumItems()
8397    }, this.reloadGallery = function(e) {
8398        if (!e) e = {};
8399        n.run(null, e)
8400    }, this.destroy = function() {
8401        n.destroy()
8402    }
8403}
8404var g_ugFunctions = new UGFunctions;
8405! function(e) {
8406    "function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof exports ? module.exports = e : e(jQuery)
8407}(function(e) {
8408    function t(t) {
8409        var a = t || window.event,
8410            s = l.call(arguments, 1),
8411            u = 0,
8412            d = 0,
8413            c = 0,
8414            p = 0;
8415        if ((t = e.event.fix(a)).type = "mousewheel", "detail" in a && (c = -1 * a.detail), "wheelDelta" in a && (c = a.wheelDelta), "wheelDeltaY" in a && (c = a.wheelDeltaY), "wheelDeltaX" in a && (d = -1 * a.wheelDeltaX), "axis" in a && a.axis === a.HORIZONTAL_AXIS && (d = -1 * c, c = 0), u = 0 === c ? d : c, "deltaY" in a && (u = c = -1 * a.deltaY), "deltaX" in a && (d = a.deltaX, 0 === c && (u = -1 * d)), 0 !== c || 0 !== d) {
8416            if (1 === a.deltaMode) {
8417                var g = e.data(this, "mousewheel-line-height");
8418                u *= g, c *= g, d *= g
8419            } else if (2 === a.deltaMode) {
8420                var h = e.data(this, "mousewheel-page-height");
8421                u *= h, c *= h, d *= h
8422            }
8423            return p = Math.max(Math.abs(c), Math.abs(d)), (!o || o > p) && (o = p, n(a, p) && (o /= 40)), n(a, p) && (u /= 40, d /= 40, c /= 40), u = Math[u >= 1 ? "floor" : "ceil"](u / o), d = Math[d >= 1 ? "floor" : "ceil"](d / o), c = Math[c >= 1 ? "floor" : "ceil"](c / o), t.deltaX = d, t.deltaY = c, t.deltaFactor = o, t.deltaMode = 0, s.unshift(t, u, d, c), r && clearTimeout(r), r = setTimeout(i, 200), (e.event.dispatch || e.event.handle).apply(this, s)
8424        }
8425    }
8426
8427    function i() {
8428        o = null
8429    }
8430
8431    function n(e, t) {
8432        return d.settings.adjustOldDeltas && "mousewheel" === e.type && t % 120 == 0
8433    }
8434    var r, o, a = ["wheel", "mousewheel", "DOMMouseScroll", "MozMousePixelScroll"],
8435        s = "onwheel" in document || document.documentMode >= 9 ? ["wheel"] : ["mousewheel", "DomMouseScroll", "MozMousePixelScroll"],
8436        l = Array.prototype.slice;
8437    if (e.event.fixHooks)
8438        for (var u = a.length; u;) e.event.fixHooks[a[--u]] = e.event.mouseHooks;
8439    var d = e.event.special.mousewheel = {
8440        version: "3.1.9",
8441        setup: function() {
8442            if (this.addEventListener)
8443                for (var i = s.length; i;) this.addEventListener(s[--i], t, !1);
8444            else this.onmousewheel = t;
8445            e.data(this, "mousewheel-line-height", d.getLineHeight(this)), e.data(this, "mousewheel-page-height", d.getPageHeight(this))
8446        },
8447        teardown: function() {
8448            if (this.removeEventListener)
8449                for (var e = s.length; e;) this.removeEventListener(s[--e], t, !1);
8450            else this.onmousewheel = null
8451        },
8452        getLineHeight: function(t) {
8453            return parseInt(e(t)["offsetParent" in e.fn ? "offsetParent" : "parent"]().css("fontSize"), 10)
8454        },
8455        getPageHeight: function(t) {
8456            return e(t).height()
8457        },
8458        settings: {
8459            adjustOldDeltas: !0
8460        }
8461    };
8462    e.fn.extend({
8463        mousewheel: function(e) {
8464            return e ? this.bind("mousewheel", e) : this.trigger("mousewheel")
8465        },
8466        unmousewheel: function(e) {
8467            return this.unbind("mousewheel", e)
8468        }
8469    })
8470}), jQuery.easing.jswing = jQuery.easing.swing, jQuery.extend(jQuery.easing, {
8471        def: "easeOutQuad",
8472        swing: function(e, t, i, n, r) {
8473            return jQuery.easing[jQuery.easing.def](e, t, i, n, r)
8474        },
8475        easeInQuad: function(e, t, i, n, r) {
8476            return n * (t /= r) * t + i
8477        },
8478        easeOutQuad: function(e, t, i, n, r) {
8479            return -n * (t /= r) * (t - 2) + i
8480        },
8481        easeInOutQuad: function(e, t, i, n, r) {
8482            return (t /= r / 2) < 1 ? n / 2 * t * t + i : -n / 2 * (--t * (t - 2) - 1) + i
8483        },
8484        easeInCubic: function(e, t, i, n, r) {
8485            return n * (t /= r) * t * t + i
8486        },
8487        easeOutCubic: function(e, t, i, n, r) {
8488            return n * ((t = t / r - 1) * t * t + 1) + i
8489        },
8490        easeInOutCubic: function(e, t, i, n, r) {
8491            return (t /= r / 2) < 1 ? n / 2 * t * t * t + i : n / 2 * ((t -= 2) * t * t + 2) + i
8492        },
8493        easeInQuart: function(e, t, i, n, r) {
8494            return n * (t /= r) * t * t * t + i
8495        },
8496        easeOutQuart: function(e, t, i, n, r) {
8497            return -n * ((t = t / r - 1) * t * t * t - 1) + i
8498        },
8499        easeInOutQuart: function(e, t, i, n, r) {
8500            return (t /= r / 2) < 1 ? n / 2 * t * t * t * t + i : -n / 2 * ((t -= 2) * t * t * t - 2) + i
8501        },
8502        easeInQuint: function(e, t, i, n, r) {
8503            return n * (t /= r) * t * t * t * t + i
8504        },
8505        easeOutQuint: function(e, t, i, n, r) {
8506            return n * ((t = t / r - 1) * t * t * t * t + 1) + i
8507        },
8508        easeInOutQuint: function(e, t, i, n, r) {
8509            return (t /= r / 2) < 1 ? n / 2 * t * t * t * t * t + i : n / 2 * ((t -= 2) * t * t * t * t + 2) + i
8510        },
8511        easeInSine: function(e, t, i, n, r) {
8512            return -n * Math.cos(t / r * (Math.PI / 2)) + n + i
8513        },
8514        easeOutSine: function(e, t, i, n, r) {
8515            return n * Math.sin(t / r * (Math.PI / 2)) + i
8516        },
8517        easeInOutSine: function(e, t, i, n, r) {
8518            return -n / 2 * (Math.cos(Math.PI * t / r) - 1) + i
8519        },
8520        easeInExpo: function(e, t, i, n, r) {
8521            return 0 == t ? i : n * Math.pow(2, 10 * (t / r - 1)) + i
8522        },
8523        easeOutExpo: function(e, t, i, n, r) {
8524            return t == r ? i + n : n * (1 - Math.pow(2, -10 * t / r)) + i
8525        },
8526        easeInOutExpo: function(e, t, i, n, r) {
8527            return 0 == t ? i : t == r ? i + n : (t /= r / 2) < 1 ? n / 2 * Math.pow(2, 10 * (t - 1)) + i : n / 2 * (2 - Math.pow(2, -10 * --t)) + i
8528        },
8529        easeInCirc: function(e, t, i, n, r) {
8530            return -n * (Math.sqrt(1 - (t /= r) * t) - 1) + i
8531        },
8532        easeOutCirc: function(e, t, i, n, r) {
8533            return n * Math.sqrt(1 - (t = t / r - 1) * t) + i
8534        },
8535        easeInOutCirc: function(e, t, i, n, r) {
8536            return (t /= r / 2) < 1 ? -n / 2 * (Math.sqrt(1 - t * t) - 1) + i : n / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + i
8537        },
8538        easeInElastic: function(e, t, i, n, r) {
8539            var o = 1.70158,
8540                a = 0,
8541                s = n;
8542            if (0 == t) return i;
8543            if (1 == (t /= r)) return i + n;
8544            if (a || (a = .3 * r), s < Math.abs(n)) {
8545                s = n;
8546                o = a / 4
8547            } else o = a / (2 * Math.PI) * Math.asin(n / s);
8548            return -s * Math.pow(2, 10 * (t -= 1)) * Math.sin(2 * (t * r - o) * Math.PI / a) + i
8549        },
8550        easeOutElastic: function(e, t, i, n, r) {
8551            var o = 1.70158,
8552                a = 0,
8553                s = n;
8554            if (0 == t) return i;
8555            if (1 == (t /= r)) return i + n;
8556            if (a || (a = .3 * r), s < Math.abs(n)) {
8557                s = n;
8558                o = a / 4
8559            } else o = a / (2 * Math.PI) * Math.asin(n / s);
8560            return s * Math.pow(2, -10 * t) * Math.sin(2 * (t * r - o) * Math.PI / a) + n + i
8561        },
8562        easeInOutElastic: function(e, t, i, n, r) {
8563            var o = 1.70158,
8564                a = 0,
8565                s = n;
8566            if (0 == t) return i;
8567            if (2 == (t /= r / 2)) return i + n;
8568            if (a || (a = .3 * r * 1.5), s < Math.abs(n)) {
8569                s = n;
8570                o = a / 4
8571            } else o = a / (2 * Math.PI) * Math.asin(n / s);
8572            return 1 > t ? -.5 * s * Math.pow(2, 10 * (t -= 1)) * Math.sin(2 * (t * r - o) * Math.PI / a) + i : s * Math.pow(2, -10 * (t -= 1)) * Math.sin(2 * (t * r - o) * Math.PI / a) * .5 + n + i
8573        },
8574        easeInBack: function(e, t, i, n, r, o) {
8575            return void 0 == o && (o = 1.70158), n * (t /= r) * t * ((o + 1) * t - o) + i
8576        },
8577        easeOutBack: function(e, t, i, n, r, o) {
8578            return void 0 == o && (o = 1.70158), n * ((t = t / r - 1) * t * ((o + 1) * t + o) + 1) + i
8579        },
8580        easeInOutBack: function(e, t, i, n, r, o) {
8581            return void 0 == o && (o = 1.70158), (t /= r / 2) < 1 ? n / 2 * t * t * ((1 + (o *= 1.525)) * t - o) + i : n / 2 * ((t -= 2) * t * ((1 + (o *= 1.525)) * t + o) + 2) + i
8582        },
8583        easeInBounce: function(e, t, i, n, r) {
8584            return n - jQuery.easing.easeOutBounce(e, r - t, 0, n, r) + i
8585        },
8586        easeOutBounce: function(e, t, i, n, r) {
8587            return (t /= r) < 1 / 2.75 ? 7.5625 * n * t * t + i : 2 / 2.75 > t ? n * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + i : 2.5 / 2.75 > t ? n * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + i : n * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + i
8588        },
8589        easeInOutBounce: function(e, t, i, n, r) {
8590            return r / 2 > t ? .5 * jQuery.easing.easeInBounce(e, 2 * t, 0, n, r) + i : .5 * jQuery.easing.easeOutBounce(e, 2 * t - r, 0, n, r) + .5 * n + i
8591        }
8592    }),
8593    function(e, t) {
8594        function i(e, t, i) {
8595            var n = d[t.type] || {};
8596            return null == e ? i || !t.def ? null : t.def : (e = n.floor ? ~~e : parseFloat(e), isNaN(e) ? t.def : n.mod ? (e + n.mod) % n.mod : 0 > e ? 0 : n.max < e ? n.max : e)
8597        }
8598
8599        function n(t) {
8600            var i = l(),
8601                n = i._rgba = [];
8602            return t = t.toLowerCase(), g(s, function(e, r) {
8603                var o, a = r.re.exec(t),
8604                    s = a && r.parse(a),
8605                    l = r.space || "rgba";
8606                return s ? (o = i[l](s), i[u[l].cache] = o[u[l].cache], n = i._rgba = o._rgba, !1) : void 0
8607            }), n.length ? ("0,0,0,0" === n.join() && e.extend(n, o.transparent), i) : o[t]
8608        }
8609
8610        function r(e, t, i) {
8611            return 1 > 6 * (i = (i + 1) % 1) ? e + (t - e) * i * 6 : 1 > 2 * i ? t : 2 > 3 * i ? e + (t - e) * (2 / 3 - i) * 6 : e
8612        }
8613        if (void 0 === e.cssHooks) return !1;
8614        var o, a = /^([\-+])=\s*(\d+\.?\d*)/,
8615            s = [{
8616                re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
8617                parse: function(e) {
8618                    return [e[1], e[2], e[3], e[4]]
8619                }
8620            }, {
8621                re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
8622                parse: function(e) {
8623                    return [2.55 * e[1], 2.55 * e[2], 2.55 * e[3], e[4]]
8624                }
8625            }, {
8626                re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
8627                parse: function(e) {
8628                    return [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)]
8629                }
8630            }, {
8631                re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
8632                parse: function(e) {
8633                    return [parseInt(e[1] + e[1], 16), parseInt(e[2] + e[2], 16), parseInt(e[3] + e[3], 16)]
8634                }
8635            }, {
8636                re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
8637                space: "hsla",
8638                parse: function(e) {
8639                    return [e[1], e[2] / 100, e[3] / 100, e[4]]
8640                }
8641            }],
8642            l = e.Color = function(t, i, n, r) {
8643                return new e.Color.fn.parse(t, i, n, r)
8644            },
8645            u = {
8646                rgba: {
8647                    props: {
8648                        red: {
8649                            idx: 0,
8650                            type: "byte"
8651                        },
8652                        green: {
8653                            idx: 1,
8654                            type: "byte"
8655                        },
8656                        blue: {
8657                            idx: 2,
8658                            type: "byte"
8659                        }
8660                    }
8661                },
8662                hsla: {
8663                    props: {
8664                        hue: {
8665                            idx: 0,
8666                            type: "degrees"
8667                        },
8668                        saturation: {
8669                            idx: 1,
8670                            type: "percent"
8671                        },
8672                        lightness: {
8673                            idx: 2,
8674                            type: "percent"
8675                        }
8676                    }
8677                }
8678            },
8679            d = {
8680                byte: {
8681                    floor: !0,
8682                    max: 255
8683                },
8684                percent: {
8685                    max: 1
8686                },
8687                degrees: {
8688                    mod: 360,
8689                    floor: !0
8690                }
8691            },
vendor: 4,646 bytes, lines 8692-8790
8692            c = l.support = {},
8693            p = e("<p>")[0],
8694            g = e.each;
8695        p.style.cssText = "background-color:rgba(1,1,1,.5)", c.rgba = p.style.backgroundColor.indexOf("rgba") > -1, g(u, function(e, t) {
8696            t.cache = "_" + e, t.props.alpha = {
8697                idx: 3,
8698                type: "percent",
8699                def: 1
8700            }
8701        }), l.fn = e.extend(l.prototype, {
8702            parse: function(r, a, s, d) {
8703                if (r === t) return this._rgba = [null, null, null, null], this;
8704                (r.jquery || r.nodeType) && (r = e(r).css(a), a = t);
8705                var c = this,
8706                    p = e.type(r),
8707                    h = this._rgba = [];
8708                return a !== t && (r = [r, a, s, d], p = "array"), "string" === p ? this.parse(n(r) || o._default) : "array" === p ? (g(u.rgba.props, function(e, t) {
8709                    h[t.idx] = i(r[t.idx], t)
8710                }), this) : "object" === p ? (g(u, r instanceof l ? function(e, t) {
8711                    r[t.cache] && (c[t.cache] = r[t.cache].slice())
8712                } : function(t, n) {
8713                    var o = n.cache;
8714                    g(n.props, function(e, t) {
8715                        if (!c[o] && n.to) {
8716                            if ("alpha" === e || null == r[e]) return;
8717                            c[o] = n.to(c._rgba)
8718                        }
8719                        c[o][t.idx] = i(r[e], t, !0)
8720                    }), c[o] && e.inArray(null, c[o].slice(0, 3)) < 0 && (c[o][3] = 1, n.from && (c._rgba = n.from(c[o])))
8721                }), this) : void 0
8722            },
8723            is: function(e) {
8724                var t = l(e),
8725                    i = !0,
8726                    n = this;
8727                return g(u, function(e, r) {
8728                    var o, a = t[r.cache];
8729                    return a && (o = n[r.cache] || r.to && r.to(n._rgba) || [], g(r.props, function(e, t) {
8730                        return null != a[t.idx] ? i = a[t.idx] === o[t.idx] : void 0
8731                    })), i
8732                }), i
8733            },
8734            _space: function() {
8735                var e = [],
8736                    t = this;
8737                return g(u, function(i, n) {
8738                    t[n.cache] && e.push(i)
8739                }), e.pop()
8740            },
8741            transition: function(e, t) {
8742                var n = l(e),
8743                    r = n._space(),
8744                    o = u[r],
8745                    a = 0 === this.alpha() ? l("transparent") : this,
8746                    s = a[o.cache] || o.to(a._rgba),
8747                    c = s.slice();
8748                return n = n[o.cache], g(o.props, function(e, r) {
8749                    var o = r.idx,
8750                        a = s[o],
8751                        l = n[o],
8752                        u = d[r.type] || {};
8753                    null !== l && (null === a ? c[o] = l : (u.mod && (l - a > u.mod / 2 ? a += u.mod : a - l > u.mod / 2 && (a -= u.mod)), c[o] = i((l - a) * t + a, r)))
8754                }), this[r](c)
8755            },
8756            blend: function(t) {
8757                if (1 === this._rgba[3]) return this;
8758                var i = this._rgba.slice(),
8759                    n = i.pop(),
8760                    r = l(t)._rgba;
8761                return l(e.map(i, function(e, t) {
8762                    return (1 - n) * r[t] + n * e
8763                }))
8764            },
8765            toRgbaString: function() {
8766                var t = "rgba(",
8767                    i = e.map(this._rgba, function(e, t) {
8768                        return null == e ? t > 2 ? 1 : 0 : e
8769                    });
8770                return 1 === i[3] && (i.pop(), t = "rgb("), t + i.join() + ")"
8771            },
8772            toHslaString: function() {
8773                var t = "hsla(",
8774                    i = e.map(this.hsla(), function(e, t) {
8775                        return null == e && (e = t > 2 ? 1 : 0), t && 3 > t && (e = Math.round(100 * e) + "%"), e
8776                    });
8777                return 1 === i[3] && (i.pop(), t = "hsl("), t + i.join() + ")"
8778            },
8779            toHexString: function(t) {
8780                var i = this._rgba.slice(),
8781                    n = i.pop();
8782                return t && i.push(~~(255 * n)), "#" + e.map(i, function(e) {
8783                    return 1 === (e = (e || 0).toString(16)).length ? "0" + e : e
8784                }).join("")
8785            },
8786            toString: function() {
8787                return 0 === this._rgba[3] ? "transparent" : this.toRgbaString()
8788            }
8789        }), l.fn.parse.prototype = l.fn, u.hsla.to = function(e) {
8790            if (null == e[0] || null == e[1] || null == e[2]) return [null, null, null, e[3]];
8791            var t, i, n = e[0] / 255,
8792                r = e[1] / 255,
8793                o = e[2] / 255,
8794                a = e[3],
8795                s = Math.max(n, r, o),
8796                l = Math.min(n, r, o),
8797                u = s - l,
8798                d = s + l,
8799                c = .5 * d;
8800            return t = l === s ? 0 : n === s ? 60 * (r - o) / u + 360 : r === s ? 60 * (o - n) / u + 120 : 60 * (n - r) / u + 240, i = 0 === u ? 0 : .5 >= c ? u / d : u / (2 - d), [Math.round(t) % 360, i, c, null == a ? 1 : a]
8801        }, u.hsla.from = function(e) {
8802            if (null == e[0] || null == e[1] || null == e[2]) return [null, null, null, e[3]];
8803            var t = e[0] / 360,
8804                i = e[1],
8805                n = e[2],
8806                o = e[3],
8807                a = .5 >= n ? n * (1 + i) : n + i - n * i,
8808                s = 2 * n - a;
8809            return [Math.round(255 * r(s, a, t + 1 / 3)), Math.round(255 * r(s, a, t)), Math.round(255 * r(s, a, t - 1 / 3)), o]
8810        }, g(u, function(n, r) {
8811            var o = r.props,
8812                s = r.cache,
8813                u = r.to,
8814                d = r.from;
8815            l.fn[n] = function(n) {
8816                if (u && !this[s] && (this[s] = u(this._rgba)), n === t) return this[s].slice();
8817                var r, a = e.type(n),
8818                    c = "array" === a || "object" === a ? n : arguments,
8819                    p = this[s].slice();
8820                return g(o, function(e, t) {
8821                    var n = c["object" === a ? e : t.idx];
8822                    null == n && (n = p[t.idx]), p[t.idx] = i(n, t)
8823                }), d ? ((r = l(d(p)))[s] = p, r) : l(p)
8824            }, g(o, function(t, i) {
8825                l.fn[t] || (l.fn[t] = function(r) {
8826                    var o, s = e.type(r),
8827                        l = "alpha" === t ? this._hsla ? "hsla" : "rgba" : n,
8828                        u = this[l](),
8829                        d = u[i.idx];
8830                    return "undefined" === s ? d : ("function" === s && (r = r.call(this, d), s = e.type(r)), null == r && i.empty ? this : ("string" === s && ((o = a.exec(r)) && (r = d + parseFloat(o[2]) * ("+" === o[1] ? 1 : -1))), u[i.idx] = r, this[l](u)))
8831                })
8832            })
8833        }), l.hook = function(t) {
8834            var i = t.split(" ");
8835            g(i, function(t, i) {
8836                e.cssHooks[i] = {
8837                    set: function(t, r) {
8838                        var o, a, s = "";
8839                        if ("transparent" !== r && ("string" !== e.type(r) || (o = n(r)))) {
8840                            if (r = l(o || r), !c.rgba && 1 !== r._rgba[3]) {
8841                                for (a = "backgroundColor" === i ? t.parentNode : t;
8842                                    ("" === s || "transparent" === s) && a && a.style;) try {
8843                                    s = e.css(a, "backgroundColor"), a = a.parentNode
8844                                } catch (e) {}
8845                                r = r.blend(s && "transparent" !== s ? s : "_default")
8846                            }
8847                            r = r.toRgbaString()
8848                        }
8849                        try {
8850                            t.style[i] = r
8851                        } catch (e) {}
8852                    }
8853                }, e.fx.step[i] = function(t) {
8854                    t.colorInit || (t.start = l(t.elem, i), t.end = l(t.end), t.colorInit = !0), e.cssHooks[i].set(t.elem, t.start.transition(t.end, t.pos))
8855                }
8856            })
8857        }, l.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"), e.cssHooks.borderColor = {
8858            expand: function(e) {
8859                var t = {};
8860                return g(["Top", "Right", "Bottom", "Left"], function(i, n) {
8861                    t["border" + n + "Color"] = e
8862                }), t
8863            }
8864        }, o = e.Color.names = {
8865            aqua: "#00ffff",
8866            black: "#000000",
8867            blue: "#0000ff",
8868            fuchsia: "#ff00ff",
8869            gray: "#808080",
8870            green: "#008000",
8871            lime: "#00ff00",
8872            maroon: "#800000",
8873            navy: "#000080",
8874            olive: "#808000",
8875            purple: "#800080",
8876            red: "#ff0000",
8877            silver: "#c0c0c0",
8878            teal: "#008080",
8879            white: "#ffffff",
8880            yellow: "#ffff00",
8881            transparent: [null, null, null, 0],
8882            _default: "#ffffff"
8883        }
8884    }(jQuery),
8885    function(e) {
8886        e.mlp = {
8887            x: 0,
8888            y: 0
8889        }, e(function t() {
8890            var i = this === document ? e(this) : e(this).contents();
8891            i.mousemove(function(t) {
8892                e.mlp = {
8893                    x: t.pageX,
8894                    y: t.pageY
8895                }
8896            }), i.find("iframe").load(t)
8897        }), e.fn.ismouseover = function() {
8898            var t = !1;
8899            return this.eq(0).each(function() {
8900                var i = e(this).is("iframe") ? e(this).contents().find("body") : e(this),
8901                    n = i.offset();
8902                t = n.left <= e.mlp.x && n.left + i.outerWidth() > e.mlp.x && n.top <= e.mlp.y && n.top + i.outerHeight() > e.mlp.y
8903            }), t
8904        }
8905    }(jQuery);
8906var g_ugYoutubeAPI = new UGYoutubeAPI,
8907    g_ugVimeoAPI = new UGVimeoAPI,
8908    g_ugHtml5MediaAPI = new UGHtml5MediaAPI,
8909    g_ugSoundCloudAPI = new UGSoundCloudAPI,
8910    g_ugWistiaAPI = new UGWistiaAPI;
8911
8912function isset() {
8913    var e = arguments,
8914        t = e.length,
8915        i = 0;
8916    if (0 === t) throw new Error("Empty isset");
8917    for (; i !== t;) {
8918        if (void 0 === e[i] || null === e[i]) return !1;
8919        i++
8920    }
8921    return !0
8922}
8923
8924function refreshCaptcha(e, t) {
8925    t || (t = "index.php?option=com_rsform&task=captcha&componentId=" + e), document.getElementById("captcha" + e).src = t + "&" + Math.random(), document.getElementById("captchaTxt" + e).value = "", document.getElementById("captchaTxt" + e).focus()
8926}
8927
8928function number_format(e, t, i, n) {
8929    var r = e,
8930        o = t;
8931    r = isFinite(+r) ? +r : 0, o = isFinite(+o) ? Math.abs(o) : 0;
8932    var a, s, l = void 0 === n ? "," : n,
8933        u = void 0 === i ? "." : i,
8934        d = o > 0 ? r.toFixed(o) : Math.round(r).toFixed(o),
8935        c = Math.abs(r).toFixed(o);
8936    return c >= 1e3 ? (s = (a = c.split(/\D/))[0].length % 3 || 3, a[0] = d.slice(0, s + (0 > r)) + a[0].slice(s).replace(/(\d{3})/g, l + "$1"), d = a.join(u)) : d = d.replace(".", u), d
8937}
8938
8939function buildXmlHttp() {
8940    var e;
8941    try {
8942        e = new XMLHttpRequest
8943    } catch (t) {
8944        try {
8945            e = new ActiveXObject("Msxml2.XMLHTTP")
8946        } catch (t) {
8947            try {
8948                e = new ActiveXObject("Microsoft.XMLHTTP")
8949            } catch (e) {
8950                return alert("Your browser does not support AJAX!"), !1
8951            }
8952        }
8953    }
8954    return e
8955}
8956
8957function ajaxValidation(e, t) {
8958    try {
8959        e.elements.length
8960    } catch (t) {
8961        e = this
8962    }
8963    var i, n = buildXmlHttp();
8964    i = "undefined" != typeof rsfp_ajax_url ? rsfp_ajax_url : "index.php?option=com_rsform&task=ajaxValidate";
8965    var r = new Array,
8966        o = new Array,
8967        a = !1,
8968        s = 0;
8969    for (c = 0; c < e.elements.length; c++)
8970        if (e.elements[c].name && 0 != e.elements[c].name.length && !("checkbox" == e.elements[c].type && 0 == e.elements[c].checked || "radio" == e.elements[c].type && 0 == e.elements[c].checked))
8971            if ("submit" == e.elements[c].type && (o.push(e.elements[c]), e.elements[c].disabled = !0), "select-multiple" != e.elements[c].type) "form[formId]" == e.elements[c].name && (s = e.elements[c].value), r.push(e.elements[c].name + "=" + encodeURIComponent(e.elements[c].value));
8972            else
8973                for (var l = 0; l < e.elements[c].options.length; l++) e.elements[c].options[l].selected && r.push(e.elements[c].name + "=" + encodeURIComponent(e.elements[c].options[l].value));
8974            "function" == typeof ajaxExtraValidationScript[s] && ajaxExtraValidationScript[s]("beforeSend", s, {
8975        url: i,
8976        params: r
8977    }), t && r.push("page=" + t), r = r.join("&"), n.open("POST", i, !1), n.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), n.send(r);
8978    a = !0;
8979    if (-1 != n.responseText.indexOf("\n")) {
8980        for (var u = n.responseText.split("\n"), d = u[0].split(","), c = 0; c < d.length; c++) !isNaN(parseInt(d[c])) && document.getElementById("component" + d[c]) && (document.getElementById("component" + d[c]).className = "formNoError");
8981        for (d = u[1].split(","), c = 0; c < d.length; c++) !isNaN(parseInt(d[c])) && document.getElementById("component" + d[c]) && (document.getElementById("component" + d[c]).className = "formError", a = !1);
8982        4 == u.length && (t = parseInt(u[2]) - 1, totalPages = parseInt(u[3]), rsfp_changePage(s, t, totalPages, !1)), "function" == typeof ajaxExtraValidationScript[s] && ajaxExtraValidationScript[s]("afterSend", s, {
8983            url: i,
8984            params: r,
8985            response: u
8986        })
8987    }
8988    for (c = 0; c < o.length; c++) o[c].disabled = !1;
8989    if (0 == a && document.getElementById("rsform_error_" + s)) try {
8990        document.getElementById("rsform_error_" + s).style.display = "block"
8991    } catch (e) {}
8992    if (1 == a) try {
8993        document.getElementById("rsform_error_" + s).style.display = "none"
8994    } catch (e) {}
8995    return a
8996}
8997
8998function rsfp_addEvent(e, t, i) {
8999    return e.addEventListener ? (e.addEventListener(t, i, !1), !0) : !!e.attachEvent && e.attachEvent("on" + t, i)
9000}
9001
9002function rsfp_getForm(e) {
9003    if (void 0 === RSFormPro.Forms[e])
9004        for (var t = document.getElementsByName("form[formId]"), i = 0; i < t.length; i++)
9005            if (parseInt(t[i].value) == parseInt(e)) {
9006                var n = t[i].parentNode;
9007                if ("FORM" == n.tagName || "FORM" == n.nodeName) return RSFormPro.Forms[e] = n, n;
9008                for (; n.parentNode;)
9009                    if (n = n.parentNode, "FORM" == n.tagName || "FORM" == n.nodeName) return RSFormPro.Forms[e] = n, n
9010            }
9011    return RSFormPro.Forms[e]
9012}
9013
9014function rsfp_setCalculationsEvents(e, t) {
9015    var n = window["rsfp_Calculations" + e],
9016        r = t || RSFormProPrices,
9017        o = navigator.userAgent.match(/MSIE 8\.0/),
9018        a = "click";
9019    for (field in r)
9020        for (field = field.replace(e + "_", ""), objects = rsfp_getFieldsByName(e, field), i = 0; i < objects.length; i++) tagName = objects[i].tagName || objects[i].nodeName, ("INPUT" == tagName || "SELECT" == tagName) && (a = "INPUT" == tagName && o && objects[i].type && "checkbox" == objects[i].type.toLowerCase() ? "click" : "change", rsfp_addEvent(objects[i], a, function() {
9021            "function" == typeof n && n()
9022        }))
9023}
9024
9025function rsfp_getValue(e, t) {
9026    if (form = rsfp_getForm(e), values = [], "undefined" != typeof form)
9027        for (var i = 0; i < form.elements.length; i++) {
9028            var n = form.elements[i];
9029            switch (n.tagName || n.nodeName) {
9030                case "INPUT":
9031                    if (n.type) switch (n.type.toUpperCase()) {
9032                        case "TEXT":
9033                        case "HIDDEN":
9034                            if (!n.name || n.name != "form[" + t + "]") continue;
9035                            return n.value;
9036                        case "RADIO":
9037                            if (!n.name || n.name != "form[" + t + "]") continue;
9038                            1 == n.checked && values.push(n.value);
9039                            break;
9040                        case "CHECKBOX":
9041                            if (!n.name || n.name != "form[" + t + "][]") continue;
9042                            1 == n.checked && values.push(n.value)
9043                    }
9044                    break;
9045                case "SELECT":
9046                    if (!n.name || n.name != "form[" + t + "][]") continue;
9047                    if (n.options)
9048                        for (var r = 0; r < n.options.length; r++) n.options[r].selected && values.push(n.options[r].value)
9049            }
9050        }
9051    return values
9052}
9053
9054function rsfp_toNumber(e, t, i, n) {
9055    if (parseInt(n) > 0 && e.lastIndexOf(t) > -1) {
9056        var r = e.lastIndexOf(t);
9057        e = e.substring(0, r) + "DECIMALS" + e.substring(r + 1)
9058    }
9059    return e.indexOf(i) > -1 && (e = e.split(i).join("")), e = e.split("DECIMALS").join("."), parseFloat(e)
9060}
9061
9062function rsfp_verifyChecked(e, t, i) {
9063    if (isChecked = !1, form = rsfp_getForm(e), "undefined" != typeof form) e: for (var n = 0; n < form.elements.length; n++) {
9064        var r = form.elements[n];
9065        switch (r.tagName || r.nodeName) {
9066            case "INPUT":
9067                if (r.type) switch (r.type.toUpperCase()) {
9068                    case "RADIO":
9069                        if (!r.name || r.name != "form[" + t + "]") continue;
9070                        if (1 == r.checked && r.value == i) {
9071                            isChecked = !0;
9072                            break e
9073                        }
9074                        break;
9075                    case "CHECKBOX":
9076                        if (!r.name || r.name != "form[" + t + "][]") continue;
9077                        if (1 == r.checked && r.value == i) {
9078                            isChecked = !0;
9079                            break e
9080                        }
9081                }
9082                break;
9083            case "SELECT":
9084                if (!r.name || r.name != "form[" + t + "][]") continue;
9085                if (r.options)
9086                    for (var o = 0; o < r.options.length; o++)
9087                        if (r.options[o].selected && r.options[o].value == i) {
9088                            isChecked = !0;
9089                            break e
9090                        }
9091        }
9092    }
9093    return isChecked
9094}
9095
9096function rsfp_addCondition(e, t, i) {
9097    if (form = rsfp_getForm(e), "undefined" != typeof form)
9098        for (var n = 0; n < form.elements.length; n++) {
9099            var r = form.elements[n],
9100                o = r.tagName || r.nodeName;
9101            !r.name || r.name != "form[" + t + "]" && r.name != "form[" + t + "][]" || rsfp_addEvent(r, "SELECT" == o ? "change" : "click", function() {
9102                i()
9103            })
9104        }
9105}
9106
9107function rsfp_getBlock(e, t) {
9108    form = rsfp_getForm(e);
9109    var n = !1;
9110    if ("undefined" != typeof form && (blocks = getElementsByClassName("rsform-block")))
9111        for (i = 0; i < blocks.length; i++) {
9112            var r = blocks[i].className.split(" ");
9113            for (c = 0; c < r.length; c++)
9114                if (r[c] == "rsform-block-" + t) {
9115                    if (blocks[i].parentNode) {
9116                        if (current_block = blocks[i], current_block == form) return [blocks[i]];
9117                        for (; current_block.parentNode;)
9118                            if (current_block = current_block.parentNode, current_block == form) return [blocks[i]]
9119                    }
9120                    n = [blocks[i]]
9121                }
9122        }
9123    return n
9124}
9125
9126function rsfp_getFieldsByName(e, t) {
9127    form = rsfp_getForm(e);
9128    var i = [];
9129    if ("undefined" != typeof form)
9130        for (var n = 0; n < form.elements.length; n++) {
9131            var r = form.elements[n];
9132            if (pushed = !1, !r.name || r.name != "form[" + t + "]" && r.name != "form[" + t + "][]" && r.name != "form[" + t + "][d]" && r.name != "form[" + t + "][m]" && r.name != "form[" + t + "][y]" || (i.push(r), pushed = !0), pushed) {
9133                if (r.id && r.id.indexOf("txtcal") > -1) {
9134                    var o = r.id.replace("txtcal", "");
9135                    i.push(document.getElementById("btn" + o))
9136                }
9137                for (var a = form.getElementsByTagName("label"), s = 0; s < a.length; s++) a[s].htmlFor && a[s].htmlFor == r.id && i.push(a[s])
9138            }
9139        }
9140    return i
9141}
9142
9143function rsfp_setDisplay(e, t) {
9144    for (i = 0; i < e.length; i++) e[i].style.display = t
9145}
9146
9147function rsfp_checkValidDate(e) {
9148    for (var t = new Date, i = 1; 31 >= i; i++) {
9149        var n = parseInt(document.getElementById(e + "y").value),
9150            r = parseInt(document.getElementById(e + "m").value) - 1,
9151            o = i - 1;
9152        "" == document.getElementById(e + "d").options[0].value && o++, document.getElementById(e + "d").options[o].disabled = !1, isNaN(n) |
9152| isNaN(r) || ("function" == typeof t.__msh_oldSetFullYear ? t.__msh_oldSetFullYear(n, r, i) : t.setFullYear(n, r, i), (t.getDate() != i || t.getMonth() != r) && (document.getElementById(e + "d").options[o].disabled = !0))
9153    }
9154    if (1 == document.getElementById(e + "d").options[document.getElementById(e + "d").selectedIndex].disabled)
9155        for (i = 31; i >= 28; i--) {
9156            o = i - 1;
9157            if ("" == document.getElementById(e + "d").options[0].value && o++, 0 == document.getElementById(e + "d").options[o].disabled) {
9158                document.getElementById(e + "d").value = i;
9159                break
9160            }
9161        }
9162}
9163
9164function rsfp_geolocation(e, t, i, n, r, o, a) {
9165    var s = document.getElementById("rsform_geolocation" + t),
9166        l = document.getElementById(i).clientWidth;
9167    document.getElementById("rsform_geolocation" + t).style.width = l + "px", document.getElementById("rsform_geolocation" + t).style.display = "none", document.getElementById("rsform_geolocation" + t).innerHTML = "", "" != e && o.geocode({
9168        address: e
9169    }, function(e, o) {
9170        if ("OK" == o) {
9171            for (var l = 0; l < e.length; l++) {
9172                var u = e[l],
9173                    d = document.createElement("li"),
9174                    c = document.createElement("a");
9175                c.setAttribute("href", "javascript:void(0)"), c.innerHTML = u.formatted_address, rsfp_addEvent(c, "click", function() {
9176                    var e = a ? u.formatted_address : u.geometry.location.lat().toFixed(5) + "," + u.geometry.location.lng().toFixed(5),
9177                        o = i,
9178                        s = new google.maps.LatLng(u.geometry.location.lat().toFixed(5), u.geometry.location.lng().toFixed(5));
9179                    return function() {
9180                        document.getElementById(o).value = e, r.setPosition(s), n.setCenter(s), document.getElementById("rsform_geolocation" + t).style.display = "none"
9181                    }
9182                }()), d.appendChild(c), s.appendChild(d)
9183            }
9184            document.getElementById("rsform_geolocation" + t).style.display = ""
9185        }
9186    })
9187}
9188
9189function rsfp_runAllConditions(e) {
9190    var t = window["rsfp_runAllConditions" + e];
9191    "function" == typeof t && t()
9192}
9193
9194function rsfp_changePage(e, t, i, n) {
9195    if (n && !ajaxValidation(rsfp_getForm(e), t)) return !1;
9196    for (var r = 0; i >= r; r++) {
9197        var o;
9198        (o = document.getElementById("rsform_" + e + "_page_" + r)) && rsfp_hidePage(o)
9199    }
9200    if (o = document.getElementById("rsform_" + e + "_page_" + t)) {
9201        rsfp_showPage(o);
9202        try {
9203            var a = window["rsfp_showProgress_" + e];
9204            "function" == typeof a && a(t)
9205        } catch (e) {}
9206    }
9207}
9208
9209function rsfp_hidePage(e) {
9210    RSFormProUtils.addClass(e, "formHidden")
9211}
9212
9213function rsfp_showPage(e) {
9214    RSFormProUtils.removeClass(e, "formHidden")
9215}
9216jQuery.fn.unitegallery = function(e) {
9217        var t = "#" + jQuery(this).attr("id");
9218        if (!e) e = {};
9219        var i = new UniteGalleryMain;
9220        return i.run(t, e), new UG_API(i)
9221    },
9222    function(e) {
9223        var t = function() {};
9224        e.extend(t.prototype, {
9225            name: "GoogleMapsPro",
9226            options: {
9227                lat: 53.553407,
9228                lng: 9.992196,
9229                marker: !0,
9230                popup: !1,
9231                text: "",
9232                zoom: 13,
9233                mapCtrl: 2,
9234                zoomWhl: !0,
9235                mapType: 0,
9236                typeCtrl: !0,
9237                overviewCtrl: !0,
9238                directions: !0,
9239                directionsDestUpdate: !1,
9240                directionsTravelMode: 0,
9241                locale: "en",
9242                mainIcon: "red-dot",
9243                otherIcon: "blue-dot",
9244                http: "http",
9245                iconUrl: "://maps.google.com/mapfiles/ms/micons/",
9246                msgFromAddress: "From address: ",
9247                msgGetDirections: "Get directions",
9248                msgEmpty: "Please fill in your address.",
9249                msgNotFound: "Sorry, address not found!",
9250                msgAddressNotFound: ", not found!",
9251                msgAvoidTolls: "Avoid tolls",
9252                msgAvoidHighways: "Avoid highways"
9253            },
9254            initialize: function(t, i) {
9255                this.options = e.extend({}, this.options, i), this.container = t, this.setupMap(), this.options.directions && this.setupDirections()
9256            },
9257            setupMap: function() {
9258                this.map = new google.maps.Map(this.container.get(0), {
9259                    mapTypeId: google.maps.MapTypeId.ROADMAP
9260                }), this.map.setOptions({
9261                    navigationControl: 1 == this.options.mapCtrl || 2 == this.options.mapCtrl
9262                }), this.map.setOptions({
9263                    navigationControlOptions: {
9264                        style: 1 == this.options.mapCtrl ? google.maps.NavigationControlStyle.SMALL : google.maps.NavigationControlStyle.DEFAULT
9265                    }
9266                }), this.map.setOptions({
9267                    scrollwheel: !!this.options.zoomWhl
9268                }), 1 == this.options.mapType && this.map.setOptions({
9269                    mapTypeId: google.maps.MapTypeId.SATELLITE
9270                }), 2 == this.options.mapType && this.map.setOptions({
9271                    mapTypeId: google.maps.MapTypeId.HYBRID
9272                }), 3 == this.options.mapType && this.map.setOptions({
9273                    mapTypeId: google.maps.MapTypeId.TERRAIN
9274                }), this.map.setOptions({
9275                    mapTypeControl: !!this.options.typeCtrl
9276                }), this.infowindow = new google.maps.InfoWindow, this.options.marker ? this.addMarkerLatLng(this.options.lat, this.options.lng, this.options.text, !0) : this.centerMap(this.options.lat, this.options.lng)
9277            },
9278            createMarker: function(e, t, i) {
9279                var n = this,
9280                    r = this.map,
9281                    o = this.infowindow,
9282                    a = new google.maps.MarkerImage(this.options.http + this.options.iconUrl + i + ".png", new google.maps.Size(32, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 32)),
9283                    s = (i = i.match("pushpin") ? this.options.http + this.options.iconUrl + "pushpin_shadow.png" : this.options.http + this.options.iconUrl + "msmarker.shadow.png", i = new google.maps.MarkerImage(i, new google.maps.Size(56, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 32)), new google.maps.Marker({
9284                        position: e,
9285                        icon: a,
9286                        shadow: i,
9287                        map: this.map
9288                    }));
9289                return (t || this.options.directionsDestUpdate) && google.maps.event.addListener(s, "click", function() {
9290                    t && (o.setContent(t), o.open(r, s)), n.options.directionsDestUpdate && (n.options.lat = s.getPosition().lat(), n.options.lng = s.getPosition().lng())
9291                }), s
9292            },
9293            centerMap: function(e, t) {
9294                this.map.setCenter(new google.maps.LatLng(e, t)), this.map.setZoom(this.options.zoom)
9295            },
9296            addMarkerLatLng: function(e, t, i, n) {
9297                var r = this.options.otherIcon;
9298                n && (r = this.options.mainIcon), e = new google.maps.LatLng(e, t), r = this.createMarker(e, i, r), n && (this.map.setCenter(e), this.map.setZoom(this.options.zoom)), n && i && this.options.popup && (this.infowindow.setContent(i), this.infowindow.open(this.map, r))
9299            },
9300            setupDirections: function() {
9301                var t = this;
9302                this.directionsService = new google.maps.DirectionsService, this.directionsDisplay = new google.maps.DirectionsRenderer, this.directionsDisplay.setMap(this.map), this.directionsDisplay.setPanel(e("<div>").addClass("directions").css("position", "relative").insertAfter(this.container).get(0));
9303                var i = e("<p>
9303").append('<label for="from-address">' + this.options.msgFromAddress + "</label>").append('<input type="text" name="address" style="margin:0 5px;" />').append('<button type="submit">' + this.options.msgGetDirections + "</button>"),
9304                    n = "";
9305                2 == this.options.tolls && (n = 'checked="checked"');
9306                var r = e('<span class="avoid-tolls">').append('<label for="avoid-tolls">' + this.options.msgAvoidTolls + "</label>").append('<input id="avoid-tolls" type="checkbox" name="tolls" ' + n + ' style="margin:0 5px;" />');
9307                (1 == this.options.tolls || 2 == this.options.tolls) && i.append(r);
9308                var o = "";
9309                2 == this.options.highways && (o = 'checked="checked"');
9310                var a = e('<span class="avoid-highways">').append('<label for="avoid-highways">' + this.options.msgAvoidHighways + "</label>").append('<input id="avoid-highways" type="checkbox" name="highways" ' + o + ' style="margin:0 5px;" />');
9311                (1 == this.options.highways || 2 == this.options.highways) && i.append(a), e('<form method="get" action="#"></form>').append(i).insertAfter(this.container).bind("submit", function(i) {
9312                    i.preventDefault(), i.stopPropagation(), t.setDirections(e(this))
9313                })
9314            },
9315            setDirections: function(e) {
9316                var t, i = this;
9317                t = !!e.find('input[name="tolls"]').is(":checked");
9318                var n;
9319                n = !!e.find('input[name="highways"]').is(":checked"), this.container.parent().find("div.alert").remove(), "" === (e = e.find('input[name="address"]').val()) ? this.showAlert(this.options.msgEmpty) : this.directionsService.route({
9320                    origin: e,
9321                    destination: new google.maps.LatLng(this.options.lat, this.options.lng),
9322                    avoidTolls: t,
9323                    avoidHighways: n,
9324                    unitSystem: this.options.unitSystem,
9325                    travelMode: google.maps.DirectionsTravelMode.DRIVING,
9326                    region: this.options.locale
9327                }, function(e, t) {
9328                    t == google.maps.DirectionsStatus.OK ? i.directionsDisplay.setDirections(e) : i.showAlert(i.options.msgNotFound)
9329                })
9330            },
9331            showAlert: function(t) {
9332                e("<div>").addClass("alert").append(e("<strong>").text(t)).insertAfter(this.container)
9333            }
9334        }), e.fn[t.prototype.name] = function() {
9335            var i = arguments,
9336                n = i[0] ? i[0] : null;
9337            return this.each(function() {
9338                var r = e(this);
9339                if (t.prototype[n] && r.data(t.prototype.name) && "initialize" != n) r.data(t.prototype.name)[n].apply(r.data(t.prototype.name), Array.prototype.slice.call(i, 1));
9340                else if (!n || e.isPlainObject(n)) {
9341                    var o = new t;
9342                    t.prototype.initialize && o.initialize.apply(o, e.merge([r], i)), r.data(t.prototype.name, o)
9343                } else e.error("Method " + n + " does not exist on jQuery." + t.name)
9344            })
9345        }
9346    }(jQuery),
9347    function(e) {
9348        var t = function() {};
9349        e.extend(t.prototype, {
9350            name: "GoogleMapsProSelector",
9351            initialize: function(t, i) {
9352                this.options = e.extend({
9353                    zldialog: null,
9354                    returnpath: null,
9355                    decimal_coordinates: null,
9356                    zoom_level: 13,
9357                    default_center: "41.38696607915501,2.1699338571472326",
9358                    txtSearch: "Search",
9359                    txtSave: "Save",
9360                    txtRestart: "Restart",
9361                    mapType: 0
9362                }, i);
9363                var n = this;
9364                n.options.zldialog.loaded(), t.append('<div id="map_canvas" />');
9365                var r = n.options.default_center;
9366                n.options.returnpath.val() && (r = n.options.returnpath.val()), r = r.split(","), 0 == n.options.mapType ? MapType = google.maps.MapTypeId.ROADMAP : 1 == n.options.mapType ? MapType = google.maps.MapTypeId.SATELLITE : 2 == n.options.mapType ? MapType = google.maps.MapTypeId.HYBRID : 3 == n.options.mapType && (MapType = google.maps.MapTypeId.TERRAIN), n.options.defaultoptions = {
9367                    zoom: n.options.zoom_level,
9368                    center: new google.maps.LatLng(r[0], r[1]),
9369                    mapTypeId: MapType,
9370                    disableDefaultUI: !0,
9371                    zoomControl: !0
9372                }, n.options.returnpath.val() && (n.options.defaultoptions.zoom = 16), n.options.map = new google.maps.Map(t.find("#map_canvas").get(0), n.options.defaultoptions), n.options.coordinates = new google.maps.LatLng, n.options.geocoder = new google.maps.Geocoder, n.options.marker = new google.maps.Marker({
9373                    draggable: !0,
9374                    visible: !1
9375                }), google.maps.event.addListener(n.options.marker, "dragend", function() {
9376                    n.setMarker(n.options.marker.getPosition())
9377                }), google.maps.event.addListener(n.options.map, "click", function(e) {
9378                    n.setMarker(e.latLng)
9379                }), n.initControls(t), n.options.decimal_coordinates() && /^([-]?(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+)),\s?([-]?(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+))$/.test(n.options.decimal_coordinates()) ? (decimal_coordinates = n.options.decimal_coordinates().split(","), n.setMarker(new google.maps.LatLng(decimal_coordinates[0], decimal_coordinates[1]))) : n.options.returnpath.val() && n.findLocation(n.options.returnpath.val())
9380            },
9381            initControls: function(t) {
9382                var i = this,
9383                    n = e('<div class="controls" />').append(e('<form name="select"><input type="text" class="address" /><input type="submit" value="' + i.options.txtSearch + '" /></form>').submit(function() {
9384                        return i.findLocation(n.find("input.address").val()), !1
9385                    }), e("<button>" + i.options.txtRestart + "</button>").click(function() {
9386                        i.reset()
9387                    }), e("<button>" + i.options.txtSave + "</button>").click(function() {
9388                        i.save()
9389                    }));
9390                t.append(e('<div class="controls-wrapper" />').append(n))
9391            },
9392            reset: function() {
9393                this.options.returnpath.val() ? this.findLocation(this.options.returnpath.val()) : (this.options.marker.visible && (this.options.marker.setMap(null), this.options.marker.visible = !1), this.options.map.setOptions(this.options.defaultoptions))
9394            },
9395            setMarker: function(e) {
9396                this.options.coordinates = e, this.options.map.setZoom(16), this.options.map.setCenter(this.options.coordinates), this.options.marker.setPosition(this.options.coordinates), this.options.marker.setMap(this.options.map), this.options.marker.visible = !0
9397            },
9398            findLocation: function(e) {
9399                var t = this;
9400                t.options.geocoder.geocode({
9401                    address: e
9402                }, function(e, i) {
9403                    i == google.maps.GeocoderStatus.OK ? t.setMarker(e[0].geometry.location) : (alert(i == google.maps.GeocoderStatus.ZERO_RESULTS ? t.options.msgEmpty : "Geocode was not successful for the following reason: " + i), t.reset())
9404                })
9405            },
9406            save: function() {
9407                this.options.marker.visible && this.options.returnpath.val(this.options.coordinates.lat() + "," + this.options.coordinates.lng()), this.options.returnpath.change(), this.options.zldialog.close()
9408            }
9409        }), e.fn[t.prototype.name] = function() {
9410            var i = arguments,
9411                n = i[0] ? i[0] : null;
9412            return this.each(function() {
9413                var r = e(this);
9414                if (t.prototype[n] && r.data(t.prototype.name) && "initialize" != n) r.data(t.prototype.name)[n].apply(r.data(t.prototype.name), Array.prototype.slice.call(i, 1));
9415                else if (!n || e.isPlainObject(n)) {
9416                    var o = new t;
9417                    t.prototype.initialize && o.initialize.apply(o, e.merge([r], i)), r.data(t.prototype.name, o)
9418                } else e.error("Method " + n + " does not exist on jQuery." + t.name)
9419            })
9420        }
9421    }(jQuery),
9422    function(e) {
9423        var t = function() {};
9424        e.extend(t.prototype, {
9425            name: "GoogleMapsProPreview",
9426            initialize: function(t, i) {
9427                this.options = e.extend({
9428                    language: "en",
9429                    mapType: "roadmap",
9430                    http: "http"
9431                }, i);
9432                var n = this;
9433                0 == n.options.mapType ? MapType = "roadmap" : 1 == n.options.mapType ? MapType = "satellite" : 2 == n.options.mapType ? MapType = "hybrid" : 3 == n.options.mapType && (MapType = "terrain"), e("<span>").addClass("input-cancel").insertAfter(t).click(function() {
9434                    t.val(""), t.change()
9435                }), t.change(function() {
9436                    var e = t.attr("data-decimal-coordinates");
9437                    e ? t.siblings(".map-preview").show().find("img").attr("src", n.options.http + "://maps.google.com/maps/api/staticmap?zoom=14&size=411x160&maptype=" + MapType + "&sensor=false&markers=" + e + "&language=" + n.options.language) : t.siblings(".map-preview").hide().find("img").attr("src", "")
9438                })
9439            }
9440        }), e.fn[t.prototype.name] = function() {
9441            var i = arguments,
9442                n = i[0] ? i[0] : null;
9443            return this.each(function() {
9444                var r = e(this);
9445                if (t.prototype[n] && r.data(t.prototype.name) && "initialize" != n) r.data(t.prototype.name)[n].apply(r.data(t.prototype.name), Array.prototype.slice.call(i, 1));
9446                else if (!n || e.isPlainObject(n)) {
9447                    var o = new t;
9448                    t.prototype.initialize && o.initialize.apply(o, e.merge([r], i)), r.data(t.prototype.name, o)
9449                } else e.error("Method " + n + " does not exist on jQuery." + t.name)
9450            })
9451        }
9452    }(jQuery);
9453var RSFormProCalendars = {},
9454    RSFormProPrices = {};
9455if ("object" != typeof RSFormPro) var RSFormPro = {};
9456var RSFormProUtils = {
9457    hasClass: function(e, t) {
9458        return new RegExp("(\\s|^)" + t + "(\\s|$)").test(e.className)
9459    },
9460    addClass: function(e, t) {
9461        RSFormProUtils.hasClass(e, t) || (e.className += (e.className ? " " : "") + t)
9462    },
9463    removeClass: function(e, t) {
9464        RSFormProUtils.hasClass(e, t) && (e.className = e.className.replace(new RegExp("(\\s|^)" + t + "(\\s|$)"), " ").replace(/^\s+|\s+$/g, ""))
9465    }
9466};
9467RSFormPro.Forms = {};
9468var ajaxExtraValidationScript = {},
9469    getElementsByClassName = function(e, t, i) {
9470        return (getElementsByClassName = document.getElementsByClassName ? function(e, t, i) {
9471            for (var n, r = (i = i || document).getElementsByClassName(e), o = t ? new RegExp("\\b" + t + "\\b", "i") : null, a = [], s = 0, l = r.length; l > s; s += 1) n = r[s], (!o || o.test(n.nodeName)) && a.push(n);
9472            return a
9473        } : document.evaluate ? function(e, t, i) {
9474            t = t || "*", i = i || document;
9475            for (var n, r, o = e.split(" "), a = "", s = "http://www.w3.org/1999/xhtml", l = document.documentElement.namespaceURI === s ? s : null, u = [], d = 0, c = o.length; c > d; d += 1) a += "[contains(concat(' ', @class, ' '), ' " + o[d] + " ')]";
9476            try {
9477                n = document.evaluate(".//" + t + a, i, l, 0, null)
9478            } catch (e) {
9479                n = document.evaluate(".//" + t + a, i, null, 0, null)
9480            }
9481            for (; r = n.iterateNext();) u.push(r);
9482            return u
9483        } : function(e, t, i) {
9484            t = t || "*", i = i || document;
9485            for (var n, r, o = e.split(" "), a = [], s = "*" === t && i.all ? i.all : i.getElementsByTagName(t), l = [], u = 0, d = o.length; d > u; u += 1) a.push(new RegExp("(^|\\s)" + o[u] + "(\\s|$)"));
9486            for (var c = 0, p = s.length; p > c; c += 1) {
9487                n = s[c], r = !1;
9488                for (var g = 0, h = a.length; h > g && (r = a[g].test(n.className)); g += 1);
9489                r && l.push(n)
9490            }
9491            return l
9492        })(e, t, i)
9493    };
9494! function(e) {
9495    var t = function() {};
9496    e.extend(t.prototype, {
9497        name: "Comment",
9498        options: {
9499            cookiePrefix: "zoo-comment_",
9500            cookieLifetime: 15552e3,
9501            msgCancel: "Cancel"
9502        },
9503        initialize: function(t, i) {
9504            this.options = e.extend({}, this.options, i);
9505            var n = this,
9506                r = t.find("#respond"),
9507                o = t.find("#edit");
9508            r.find("a.facebook-connect").bind("click", function() {
9509                n.setLoginCookie("facebook")
9510            }), r.find("a.facebook-logout").bind("click", function() {
9511                n.setLoginCookie("")
9512            }), r.find("a.twitter-connect").bind("click", function() {
9513                n.setLoginCookie("twitter")
9514            }), r.find("a.twitter-logout").bind("click", function() {
9515                n.setLoginCookie("")
9516            }), r.find("input:text").placeholder(), o.find(".comment-cancelEdit").bind("click", function(t) {
9517                t.preventDefault(), o.hide(), o.appendTo(e("#comments")), o.find("input[name=comment_id]").val(0), o.find("textarea[name=content]").val("")
9518            }), t.find(".comment").each(function() {
9519                var t = e(this);
9520                t.find(".reply").bind("click", function(i) {
9521                    i.preventDefault(), o.hide(), r.find(".comment-cancelReply").remove(), e("<a>" + n.options.msgCancel + "</a>").addClass("comment-cancelReply").attr("href", "#respond").bind("click", function(t) {
9522                        t.preventDefault(), r.find(".comment-cancelReply").remove(), r.appendTo(e("#comments")), r.find("input[name=parent_id]").val(0)
9523                    }).appendTo(r.find(".actions")), r.appendTo(t), r.find("input[name=parent_id]").val(e(this).closest(".comment").attr("id").replace(/comment-/i, ""))
9524                }), t.find(".edit").bind("click", function(i) {
9525                    i.preventDefault(), r.find(".comment-cancelReply").remove(), r.appendTo(e("#comments")), r.find("input[name=parent_id]").val(0), o.appendTo(t), o.find("input[name=comment_id]").val(e(this).closest(".comment").attr("id").replace(/comment-/i, "")), o.find("textarea[name=content]").val(e(this).closest(".comment").find(".content").html()), o.show()
9526                })
9527            })
9528        },
9529        setLoginCookie: function(t) {
9530            e.cookie(this.options.cookiePrefix + "login", t, {
9531                expires: this.options.cookieLifetime / 86400,
9532                path: "/"
9533            })
9534        }
9535    }), e.fn[t.prototype.name] = function() {
9536        var i = arguments,
9537            n = i[0] ? i[0] : null;
9538        return this.each(function() {
9539            var r = e(this);
9540            if (t.prototype[n] && r.data(t.prototype.name) && "initialize" != n) r.data(t.prototype.name)[n].apply(r.data(t.prototype.name), Array.prototype.slice.call(i, 1));
9541            else if (!n || e.isPlainObject(n)) {
9542                var o = new t;
9543                t.prototype.initialize && o.initialize.apply(o, e.merge([r], i)), r.data(t.prototype.name, o)
9544            } else e.error("Method " + n + " does not exist on jQuery." + t.name)
9545        })
9546    }
9547}(jQuery),
9548function(e) {
9549    var t = function() {};
9550    e.extend(t.prototype, {
9551        name: "BrowseComments",
9552        options: {
9553            url: "index.php?option=com_zoo&controller=comment",
9554            id: "edit-comment-editor"
9555        },
9556        initialize: function(t, i) {
9557            this.options = e.extend({}, this.options, i);
9558            var n = this;
9559            this.form = t, t.delegate("tr.comment-row .actions-links .edit, tr.comment-row .actions-links .reply", "click", function(t) {
9560                t.preventDefault();
9561                var i = e(this).attr("class");
9562                n.modifyEvent(e(this).closest("tr.comment-row"), i)
9563            }), t.delegate("tr.comment-row .actions-links span", "click", function(t) {
9564                switch (t.preventDefault(), e(this).attr("class")) {
9565                    case "no-spam":
9566                        var i = "approve";
9567                        break;
9568                    case "delete":
9569                        i = "remove";
9570                        break;
9571                    default:
9572                        i = e(this).attr("class")
9573                }
9574                n.stateEvent(e(this).closest("tr.comment-row"), i)
9575            })
9576        },
9577        modifyEvent: function(t, i) {
9578            var n = this;
9579            e.ajax({
9580                url: this.options.url,
9581                data: {
9582                    task: i,
9583                    format: "raw",
9584                    cid: t.find('input[name^="cid["]').val()
9585                },
9586                success: function(r) {
9587                    n.removeEditor(), n.insertEditor(t, r), "edit" == i && t.hide(), n.form.unbind("save").unbind("cancel").bind("save", function(r, o) {
9588                        n.removeEditor(), "edit" == i ? t.replaceWith(o) : e(o).insertAfter(t), n.stripe()
9589                    }).bind("cancel", function() {
9590                        n.removeEditor()
9591                    })
9592                }
9593            })
9594        },
9595        stateEvent: function(t, i) {
9596            e('<input type="hidden" name="cid">').val(t.find('input[name^="cid["]').val()).appendTo(this.form), this.form.find("input[name=task]").val(i), this.form.submit()
9597        },
9598        insertEditor: function(t, i) {
9599            var n = this,
9600                r = t.after(i).next();
9601            r.find(".actions .save").bind("click", function(t) {
9602                t.preventDefault();
9603                var i = {};
9604                e.each(n.form.serializeArray(), function(e, t) {
9605                    i[t.name] = t.value
9606                }), e.ajax({
9607                    type: "POST",
9608                    url: n.options.url,
9609                    data: e.extend(i, {
9610                        task: "save",
9611                        format: "raw"
9612                    }),
9613                    success: function(e) {
9614                        n.form.triggerHandler("save", e)
9615                    }
9616                })
9617            }), r.find(".actions .cancel").bind("click", function(e) {
9618                e.preventDefault(), n.form.triggerHandler("cancel")
9619            }), r.find(".content textarea").focus()
9620        },
9621        removeEditor: function() {
9622            e("#" + this.options.id, this.form).prev("tr").show(), e("#" + this.options.id, this.form).remove()
9623        },
9624        stripe: function() {
9625            e("table.stripe tbody tr").removeClass("odd even").each(function() {
9626                e(this).addClass(e(this).is("tr:odd") ? "odd" : "even")
9627            })
9628        }
9629    }), e.fn[t.prototype.name] = function() {
9630        var i = arguments,
9631            n = i[0] ? i[0] : null;
9632        return this.each(function() {
9633            var r = e(this);
9634            if (t.prototype[n] && r.data(t.prototype.name) && "initialize" != n) r.data(t.prototype.name)[n].apply(r.data(t.prototype.name), Array.prototype.slice.call(i, 1));
9635            else if (!n || e.isPlainObject(n)) {
9636                var o = new t;
9637                t.prototype.initialize && o.initialize.apply(o, e.merge([r], i)), r.data(t.prototype.name, o)
9638            } else e.error("Method " + n + " does not exist on jQuery." + t.name)
9639        })
9640    }
9641}(jQuery), jQuery(function(e) {
9642        function t() {
9643            var t = e(this);
9644            t.val() === t.attr("placeholder") && t.hasClass("placeholder") && (t.data("placeholder-password") ? t.hide().next().show().focus() : t.val("").removeClass("placeholder"))
9645        }
9646
9647        function i(i) {
9648            var n, r, o, a, s = e(this);
9649            if ("" === s.val() || s.val() === s.attr("placeholder")) {
9650                if (s.is(":password")) {
9651                    if (!s.data("placeholder-textinput")) {
9652                        try {
9653                            n = s.clone().attr({
9654                                type: "text"
9655                            })
9656                        } catch (t) {
9657                            n = e("<input>").attr(e.extend((r = s[0], o = {}, a = /^jQuery\d+$/, e.each(r.attributes, function(e, t) {
9658                                t.specified && !a.test(t.name) && (o[t.name] = t.value)
9659                            }), o), {
9660                                type: "text"
9661                            }))
9662                        }
9663                        n.removeAttr("name").data("placeholder-password", !0).bind("focus.placeholder", t), s.data("placeholder-textinput", n).before(n)
9664                    }
9665                    s = s.hide().prev().show()
9666                }
9667                s.addClass("placeholder").val(s.attr("placeholder"))
9668            } else s.removeClass("placeholder")
9669        }
9670        var n = "placeholder" in document.createElement("input"),
9671            r = "placeholder" in document.createElement("textarea");
9672        e.fn.placeholder = n && r ? function() {
9673            return this
9674        } : function() {
9675            return this.filter((n ? "textarea" : ":input") + "[placeholder]").bind("focus.placeholder", t).bind("blur.placeholder", i).trigger("blur.placeholder").end()
9676        }, e(function() {
9677            e("form").bind("submit.placeholder", function() {
9678                var n = e(".placeholder", this).each(t);
9679                setTimeout(function() {
9680                    n.each(i)
9681                }, 10)
9682            })
9683        }), e(window).bind("unload.placeholder", function() {
9684            e(".placeholder").val("")
9685        })
9686    }),
9687    function() {
9688        if (!window.hasCookieConsent) {
9689            window.hasCookieConsent = !0;
9690            var e = "cookieconsent_dismissed";
9691            if (!(document.cookie.indexOf(e) > -1)) {
9692                "function" != typeof String.prototype.trim && (String.prototype.trim = function() {
9693                    return this.replace(/^\s+|\s+$/g, "")
9694                });
9695                var t, i = {
9696                        isArray: function(e) {
9697                            return "[object Array]" == Object.prototype.toString.call(e)
9698                        },
9699                        isObject: function(e) {
9700                            return "[object Object]" == Object.prototype.toString.call(e)
9701                        },
9702                        each: function(e, t, n, r) {
9703                            if (i.isObject(e) && !r)
9704                                for (var o in e) e.hasOwnProperty(o) && t.call(n, e[o
9704], o, e);
9705                            else
9706                                for (var a = 0, s = e.length; s > a; a++) t.call(n, e[a], a, e)
9707                        },
9708                        merge: function(e, t) {
9709                            e && i.each(t, function(t, n) {
9710                                i.isObject(t) && i.isObject(e[n]) ? i.merge(e[n], t) : e[n] = t
9711                            })
9712                        },
9713                        bind: function(e, t) {
9714                            return function() {
9715                                return e.apply(t, arguments)
9716                            }
9717                        },
9718                        queryObject: function(e, t) {
9719                            var i, n = 0,
9720                                r = e;
9721                            for (t = t.split(".");
9722                                (i = t[n++]) && r.hasOwnProperty(i) && (r = r[i]);)
9723                                if (n === t.length) return r;
9724                            return null
9725                        },
9726                        setCookie: function(e, t, i, n, r) {
9727                            i = i || 365;
9728                            var o = new Date;
9729                            o.setDate(o.getDate() + i);
9730                            var a = [e + "=" + t, "expires=" + o.toUTCString(), "path=" + r || "/"];
9731                            n && a.push("domain=" + n), document.cookie = a.join(";")
9732                        },
9733                        addEventListener: function(e, t, i) {
9734                            e.addEventListener ? e.addEventListener(t, i) : e.attachEvent("on" + t, i)
9735                        }
9736                    },
9737                    n = (a = function(e, t, n) {
9738                        return i.isArray(t) ? i.each(t, function(t) {
9739                            a(e, t, n)
9740                        }) : void(e.addEventListener ? e.addEventListener(t, n) : e.attachEvent("on" + t, n))
9741                    }, s = function(e, t, n) {
9742                        var r = e.parentNode.querySelectorAll("[" + t + "]");
9743                        i.each(r, function(e) {
9744                            var i = e.getAttribute(t);
9745                            n(e, i)
9746                        }, window, !0)
9747                    }, {
9748                        build: function(e, t) {
9749                            var n;
9750                            i.isArray(e) && (e = e.join("")), n = t, e = e.replace(/\{\{(.*?)\}\}/g, function(e, t) {
9751                                for (var r, o, a = t.split("||"); o = a.shift();) {
9752                                    if ('"' === (o = o.trim())[0]) return o.slice(1, o.length - 1);
9753                                    if (r = i.queryObject(n, o)) return r
9754                                }
9755                                return ""
9756                            });
9757                            var r, o, l, u, d = (r = e, (o = document.createElement("div")).innerHTML = r, o.children[0]);
9758                            return u = t, s(d, "data-cc-event", function(e, t) {
9759                                var n = t.split(":"),
9760                                    r = i.queryObject(u, n[1]);
9761                                a(e, n[0], i.bind(r, u))
9762                            }), l = t, s(d, "data-cc-if", function(e, t) {
9763                                i.queryObject(l, t) || e.parentNode.removeChild(e)
9764                            }), d
9765                        }
9766                    }),
9767                    r = {
9768                        options: {
9769                            message: "This website uses cookies to ensure you get the best experience on our website. ",
9770                            dismiss: "Got it!",
9771                            learnMore: "More info",
9772                            link: null,
9773                            target: "_blank",
9774                            container: null,
9775                            theme: "light-floating",
9776                            domain: null,
9777                            path: "/",
9778                            expiryDays: 365,
9779                            markup: ['<div class="cc_banner-wrapper {{containerClasses}}">', '<div class="cc_banner cc_container cc_container--open">', '<a href="#null" data-cc-event="click:dismiss" target="_blank" class="cc_btn cc_btn_accept_all">{{options.dismiss}}</a>', '<p class="cc_message">{{options.message}} <a data-cc-if="options.link" target="{{ options.target }}" class="cc_more_info" href="{{options.link || "#null"}}">{{options.learnMore}}</a></p>', '<a class="cc_logo" target="_blank" href="http://silktide.com/cookieconsent">Cookie Consent plugin for the EU cookie law</a>', "</div>", "</div>"]
9780                        },
9781                        init: function() {
9782                            var e = window.cookieconsent_options;
9783                            e && this.setOptions(e), this.setContainer(), this.options.theme ? this.loadTheme(this.render) : this.render()
9784                        },
9785                        setOptionsOnTheFly: function(e) {
9786                            this.setOptions(e), this.render()
9787                        },
9788                        setOptions: function(e) {
9789                            i.merge(this.options, e)
9790                        },
9791                        setContainer: function() {
9792                            this.options.container ? this.container = document.querySelector(this.options.container) : this.container = document.body, this.containerClasses = "", navigator.appVersion.indexOf("MSIE 8") > -1 && (this.containerClasses += " cc_ie8")
9793                        },
9794                        loadTheme: function(e) {
9795                            var t = this.options.theme; - 1 === t.indexOf(".css") && (t = "//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/1.0.9/" + t + ".css");
9796                            var n = document.createElement("link");
9797                            n.rel = "stylesheet", n.type = "text/css", n.href = t;
9798                            var r = !1;
9799                            n.onload = i.bind(function() {
9800                                !r && e && (e.call(this), r = !0)
9801                            }, this), document.getElementsByTagName("head")[0].appendChild(n)
9802                        },
9803                        render: function() {
9804                            this.element && this.element.parentNode && (this.element.parentNode.removeChild(this.element), delete this.element), this.element = n.build(this.options.markup, this), this.container.firstChild ? this.container.insertBefore(this.element, this.container.firstChild) : this.container.appendChild(this.element)
9805                        },
9806                        dismiss: function(e) {
9807                            e.preventDefault && e.preventDefault(), e.returnValue = !1, this.setDismissedCookie(), this.container.removeChild(this.element)
9808                        },
9809                        setDismissedCookie: function() {
9810                            i.setCookie(e, "yes", this.options.expiryDays, this.options.domain, this.options.path)
9811                        }
9812                    },
9813                    o = !1;
9814                (t = function() {
9815                    o || "complete" != document.readyState || (r.init(), o = !0, window.update_cookieconsent_options = i.bind(r.setOptionsOnTheFly, r))
9816                })(), i.addEventListener(document, "readystatechange", t)
9817            }
9818        }
9819        var a, s
9820    }(),
9821    function(e) {
9822        var t = function(t) {
9823            this.origHtmlMargin = parseFloat(e("html").css("margin-top")), this.options = e.extend({}, e.smartbanner.defaults, t);
9824            var i = navigator.standalone;
9825            if (this.options.force ? this.type = this.options.force : null != navigator.userAgent.match(/iPad|iPhone|iPod/i) ? (null != navigator.userAgent.match(/Safari/i) && (null != navigator.userAgent.match(/CriOS/i) || window.Number(navigator.userAgent.
9825substr(navigator.userAgent.indexOf("OS ") + 3, 3).replace("_", ".")) < 6) && (this.type = "ios"), null != navigator.userAgent.match(/Safari/i) && (this.type = "ios")) : null != navigator.userAgent.match(/Android/i) ? this.type = "android" : null != navigator.userAgent.match(/Windows NT 6.2/i) && (this.type = "windows"), this.type && !i && !this.getCookie("sb-closed") && !this.getCookie("sb-installed")) {
9826                this.scale = "auto" == this.options.scale ? e(window).width() / window.screen.width : this.options.scale, this.scale < 1 && (this.scale = 1);
9827                var n = e("android" == this.type ? 'meta[name="google-play-app"]' : "ios" == this.type ? 'meta[name="apple-itunes-app"]' : 'meta[name="msApplication-ID"]');
9828                0 != n.length && ("windows" == this.type ? (this.pfn = e('meta[name="msApplication-PackageFamilyName"]').attr("content"), this.appId = n.attr("content")[1]) : this.appId = /app-id=([^\s,]+)/.exec(n.attr("content"))[1], this.title = this.options.title ? this.options.title : e("title").text().replace(/\s*[|\-·].*$/, ""), this.author = this.options.author ? this.options.author : e('meta[name="author"]').length ? e('meta[name="author"]').attr("content") : window.location.hostname, this.create(), this.show(), this.listen())
9829            }
9830        };
9831        t.prototype = {
9832            constructor: t,
9833            create: function() {
9834                var t, i = this.options.url ? this.options.url : ("windows" == this.type ? "ms-windows-store:PDP?PFN=" + this.pfn : "android" == this.type ? "market://details?id=" : "https://itunes.apple.com/" + this.options.appStoreLanguage + "/app/id") + this.appId,
9835                    n = this.options.price ? this.options.price + " - " + ("android" == this.type ? this.options.inGooglePlay : "ios" == this.type ? this.options.inAppStore : this.options.inWindowsStore) : "",
9836                    r = null === this.options.iconGloss ? "ios" == this.type : this.options.iconGloss;
9837                e("body").append('<div id="smartbanner" class="' + this.type + '"><div class="sb-container"><a href="#" class="sb-close">&times;</a><span class="sb-icon"></span><div class="sb-info"><strong>' + this.title + "</strong><span>" + this.author + "</span><span>" + n + '</span></div><a href="' + i + '" class="sb-button"><span>' + this.options.button + "</span></a></div></div>"), this.options.icon ? t = this.options.icon : e('link[rel="apple-touch-icon-precomposed"]').length > 0 ? (t = e('link[rel="apple-touch-icon-precomposed"]').attr("href"), null === this.options.iconGloss && (r = !1)) : e('link[rel="apple-touch-icon"]').length > 0 ? t = e('link[rel="apple-touch-icon"]').attr("href") : e('meta[name="msApplication-TileImage"]').length > 0 ? t = e('meta[name="msApplication-TileImage"]').attr("content") : e('meta[name="msapplication-TileImage"]').length > 0 && (t = e('meta[name="msapplication-TileImage"]').attr("content")), t ? (e("#smartbanner .sb-icon").css("background-image", "url(" + t + ")"), r && e("#smartbanner .sb-icon").addClass("gloss")) : e("#smartbanner").addClass("no-icon"), this.bannerHeight = e("#smartbanner").outerHeight() + 2, this.scale > 1 && (e("#smartbanner").css("top", parseFloat(e("#smartbanner").css("top")) * this.scale).css("height", parseFloat(e("#smartbanner").css("height")) * this.scale), e("#smartbanner .sb-container").css("-webkit-transform", "scale(" + this.scale + ")").css("-msie-transform", "scale(" + this.scale + ")").css("-moz-transform", "scale(" + this.scale + ")").css("width", e(window).width() / this.scale))
9838            },
9839            listen: function() {
9840                e("#smartbanner .sb-close").on("click", e.proxy(this.close, this)), e("#smartbanner .sb-button").on("click", e.proxy(this.install, this))
9841            },
9842            show: function(t) {
9843                e("#smartbanner").stop().animate({
9844                    top: 0
9845                }, this.options.speedIn).addClass("shown"), e("html").animate({
9846                    marginTop: this.origHtmlMargin + this.bannerHeight * this.scale
9847                }, this.options.speedIn, "swing", t)
9848            },
9849            hide: function(t) {
9850                e("#smartbanner").stop().animate({
9851                    top: -1 * this.bannerHeight * this.scale
9852                }, this.options.speedOut).removeClass("shown"), e("html").animate({
9853                    marginTop: this.origHtmlMargin
9854                }, this.options.speedOut, "swing", t)
9855            },
9856            close: function(e) {
9857                e.preventDefault(), this.hide(), this.setCookie("sb-closed", "true", this.options.days
9857Hidden)
9858            },
9859            install: function(e) {
9860                this.hide(), this.setCookie("sb-installed", "true", this.options.daysReminder)
9861            },
9862            setCookie: function(e, t, i) {
9863                var n = new Date;
9864                n.setDate(n.getDate() + i), t = escape(t) + (null == i ? "" : "; expires=" + n.toUTCString()), document.cookie = e + "=" + t + "; path=/;"
9865            },
9866            getCookie: function(e) {
9867                var t, i, n, r = document.cookie.split(";");
9868                for (t = 0; t < r.length; t++)
9869                    if (i = r[t].substr(0, r[t].indexOf("=")), n = r[t].substr(r[t].indexOf("=") + 1), (i = i.replace(/^\s+|\s+$/g, "")) == e) return unescape(n);
9870                return null
9871            },
9872            switchType: function() {
9873                var t = this;
9874                this.hide(function() {
9875                    t.type = "android" == t.type ? "ios" : "android";
9876                    var i = e("android" == t.type ? 'meta[name="google-play-app"]' : 'meta[name="apple-itunes-app"]').attr("content");
9877                    t.appId = /app-id=([^\s,]+)/.exec(i)[1], e("#smartbanner").detach(), t.create(), t.show()
9878                })
9879            }
9880        }, e.smartbanner = function(i) {
9881            var n = e(window),
9882                r = n.data("typeahead"),
9883                o = "object" == typeof i && i;
9884            r || n.data("typeahead", r = new t(o)), "string" == typeof i && r[i]()
9885        }, e.smartbanner.defaults = {
9886            title: smtitle,
9887            author: smauthor,
9888            price: "FREE",
9889            appStoreLanguage: "us",
9890            inAppStore: "On the App Store",
9891            inGooglePlay: "In Google Play",
9892            inWindowsStore: "In the Windows Store",
9893            icon: smicon,
9894            iconGloss: null,
9895            button: "VIEW",
9896            url: null,
9897            scale: "auto",
9898            speedIn: 300,
9899            speedOut: 400,
9900            daysHidden: 15,
9901            daysReminder: 60,
9902            force: null
9903        }, e.smartbanner.Constructor = t
9904    }(window.jQuery);
9905var isPopup = 1;
9906
9907function ppop() {
9908    var e = document.getElementById("player-on").style,
9909        t = document.getElementById("player-oc-j").style,
9910        i = document.getElementById("player-oc-p").style;
9911    if (1 == isPopup) {
9912        "-90px" != e.bottom && toggle_visibility();
9913        var n = window.open(window.fullAjaxBase + "player", "Player", "width=1151,height=440"),
9914            r = setInterval(function() {
9915                n.closed ? (i.opacity = 1, t.opacity = 1, clearInterval(r), isPopup = 1, toggle_visibility(), jQuery("#content-hs").append('<iframe id="iframediv" width="100%" height="80" border="0" style="border: 0; box-shadow: 0px;" src="' + window.fullAjaxBase + 'player/"></iframe>')) : (isPopup = 0, i.opacity = .8, t.opacity = .8, jQuery("#iframediv").remove())
9916            }, 500)
9917    }
9918}
9919
9920function toggle_visibility() {
9921    if (1 == isPopup) {
9922        var e = document.getElementById("player-on").style;
9923        "-90px" != e.bottom ? (e.bottom = "-90px", jQuery("#player-oc-j").addClass("max-icon")) : (e.bottom = "0px", jQuery("#player-oc-j").removeClass("max-icon"))
9924    }
9925}
9926
9927function downloadJSAtOnload() {
9928    "yes" == rplayer && jQuery(document.body).append('<div id="player-on" class="player-onair" ><img id="player-oc-j" class="player-oc" /><img id="player-oc-p" class="player-pu" /><div id="content-hs"><div id="iframediv"><iframe width="100%" height="80" name="playerframe" id="playerframe" border="0" style="border: 0; box-shadow: 0px;" src="' + window.fullAjaxBase + 'player"></iframe></div></div></div>'), jQuery(".player-pu").on("click", function() {
9929        ppop()
9930    }), jQuery(".player-oc").on("click", function() {
9931        toggle_visibility()
9932    }), "yes" == smenable && jQuery.smartbanner()
9933}
9934
9935function autoApplyActiveOnProgramFilter() {
9936    var e = jQuery(".program-filter ul li");
9937    e.length && e.each(function() {
9938        jQuery(this).find("a").eq(0).attr("href") == window.location.pathname && (jQuery(this).closest("ul").find("li").removeAttr("id"), jQuery(this).attr("id", "day-active"))
9939    })
9940}
9941
9942function handleHoverOverMenuItem() {
9943    jQuery("#tm-navbar ul.uk-navbar-nav li.uk-parent").on({
9944        mouseenter: function() {
9945            window.innerWidth > window.collapseMenuUnder && jQuery(this).addClass("uk-open").attr("aria-expanded", "true")
9946        },
9947        mouseleave: function() {
9948            window.innerWidth > window.collapseMenuUnder && jQuery(this).removeClass("uk-open").attr("aria-expanded", "false")
9949        }
9950    })
9951}
9952
9953function handleMobileMenu() {
9954    jQuery("ul.uk-navbar-nav li a, .icons-header a, #rowsocial a, .mod-languages a").on("click", function() {
9955        jQuery(this).parent().hasClass("uk-parent") || (jQuery(this).closest("#tm-navbar").removeClass("active"), jQuery("#mobile-menu-burger").removeClass("active"), jQuery("body").css("position", "relative"))
9956    }), jQuery("form.uk-search").on("submit", function() {
9957        jQuery("#mobile-menu-burger").removeClass("active"), jQuery("body").css("position", "relative"), jQuery("#tm-navbar").removeClass("active"), jQuery(".uk-search-field").blur()
9958    }), autoExpandMenu()
9959}
9960
9961function autoExpandMenu() {
9962    window.innerWidth <= window.collapseMenuUnder && (jQuery("ul.uk-navbar-nav > li.uk-parent ul.uk-nav > li.uk-parent").removeClass("uk-parent", "uk-open"), jQuery("ul.uk-navbar-nav > li.uk-parent ul.uk-nav > li.current").addClass("uk-active").removeClass("current"), jQuery("ul.uk-navbar-nav > li.uk-parent.uk-open:not('.uk-active')").removeClass("uk-open").attr("aria-expanded", "false"), jQuery("ul.uk-navbar-nav > li.uk-parent ul.uk-nav > li.uk-active").closest("li.uk-parent").addClass("uk-open").attr("aria-expanded", "true"))
9963}
9964
9965function autoApplyMobileClass() {
9966    window.innerWidth <= collapseMenuUnder ? jQuery("#tm-navbar").addClass("mobile-view").removeClass("desktop-view") : jQuery("#tm-navbar").removeClass("mobile-view").addClass("desktop-view")
9967}
9968
9969function handleInit() {
9970    window.top.isMobileDevice && jQuery(".onair-catrss").hide(), init_mod_charts(), init_mod_calendarevents(), init_mod_produceronair(), init_mod_toprated(), jQuery("body").css({
9971        position: "relative",
9972        top: "auto",
9973        "z-index": 1
9974    }), jQuery(".program-filter li").each(function() {
9975        var e = jQuery(this);
9976        setTimeout(function() {
9977            e.css("pointer-events", "auto")
9978        }, 500)
9979    }), jQuery(".mod-languages > .btn-group > button.dropdown-toggle").toggle(function() {
9980        jQuery(this).parent().find(".dropdown-menu").show()
9981    }, function() {
9982        jQuery(this).parent().find(".dropdown-menu").hide()
9983    }), jQuery(".mod-languages a").on("click", function(e) {
9984        return window.location = jQuery(this).attr("href"), e.preventDefault(), !1
9985    }), window.innerWidth <= window.collapseMenuUnder ? handleMobileMenu() : handleHoverOverMenuItem(), jQuery("a.uk-navbar-brand, .icons-header a").on("click", function() {
9986        jQuery(".uk-navbar-nav.uk-hidden-small li, .uk-navbar-nav li.uk-parent ul.uk-nav li").removeClass("uk-active")
9987    }), jQuery(".uk-search-field").on({
9988        focus: function() {
9989            window.innerWidth <= 1024 ? jQuery("#flax-search .icons-header").stop(!0, !0).animate({
9990                opacity: 0
9991            }, 300) : jQuery(".icons-header").stop(!0, !0).animate({
9992                opacity: 0
9993            }, 300), jQuery(".mod-languages").stop(!0, !0).animate({
9994                opacity: 0
9995            }, 300), jQuery(".uk-search").addClass("focused"), window.innerWidth <= collapseMenuUnder && jQuery("#search-40").append(jQuery('<input type="button" class="search-button-mob" onclick="window.closeSearchField();"/>'))
9996        },
9997        blur: function() {
9998            window.innerWidth <= 1024 ? jQuery("#flax-search .icons-header").stop(!0, !0).animate({
9999                opacity: 1
10000            }, 300) : jQuery(".icons-header").stop(!0, !0).animate({
10001                opacity: 1
10002            }, 300), jQuery(".mod-languages").stop(!0, !0).animate({
10003                opacity: 1
10004            }, 300), jQuery(".uk-search").removeClass("focused"), jQuery(".search-button-mob").remove()
10005        }
10006    })
10007}
10008if (window.playerIsPlaying = 1, jQuery(document).on("click", "#ratepop, .closepop", function() {
10009        jQuery("#ratepop").remove(), jQuery(".jvotecheck", frames.playerframe.document).removeClass("disabled")
10010    }), window.addEventListener ? window.addEventListener("load", downloadJSAtOnload, !1) : window.attachEvent ? window.attachEvent("onload", downloadJSAtOnload) : window.onload = downloadJSAtOnload, window.closeSearchField = function() {
10011        jQuery(".icons-header").stop(!0, !0).animate({
10012            opacity: 1
10013        }, 300), jQuery(".uk-search").removeClass("focused"), jQuery(this).remove()
10014    }, jQuery(document).ready(function() {
10015        window.collapseMenuUnder = 1024, window.top.isMobileDevice = !1, (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
10015sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0, 4))) && (window.top.isMobileDevice = !0), handleInit(), jQuery("#mobile-menu-burger").on("click", function() {
10016            if (jQuery(this).hasClass("active")) {
10017                var e = jQuery("body").css("top");
10018                e = e.replace("px", "").replace("-", ""), jQuery("body").css({
10019                    position: "relative",
10020                    top: "auto",
10021                    "z-index": 1
10022                }), jQuery("body").scrollTop(e)
10023            } else jQuery("body").css({
10024                position: "fixed",
10025                top: "-" + jQuery("body").scrollTop() + "px",
10026                left: 0,
10027                "z-index": 1,
10028                "max-width": "100%"
10029            });
10030            jQuery("#tm-navbar.mobile-view").toggleClass("active"), jQuery(this).toggleClass("active")
10031        }), jQuery(window).on("resize", function() {
10032            autoApplyMobileClass(), autoExpandMenu()
10033        }), jQuery(".uk-navbar-nav.uk-hidden-small li, .uk-navbar-nav li.uk-parent ul.uk-nav li").each(function() {
10034            jQuery(this).find("a").eq(0).on("click", function() {
10035                jQuery(".uk-navbar-nav.uk-hidden-small li, .uk-navbar-nav li.uk-parent ul.uk-nav li").removeClass("uk-active"), jQuery(this).parent().addClass("uk-active"), jQuery(this).parent().hasClass("uk-parent") && jQuery(this).parent().closest("li.deeper.uk-parent").addClass("uk-active"), jQuery(this).closest("ul").hasClass("uk-nav") && jQuery(this).closest("li.uk-parent").addClass("uk-active"), autoExpandMenu()
10036            })
10037        }), jQuery("ul.uk-navbar-nav > li.uk-parent > a").on("click", function(e) {
10038            if (window.innerWidth <= window.collapseMenuUnder) return jQuery(this).parent().toggleClass("uk-open"), e.preventDefault(), !1
10039        }), autoApplyMobileClass()
10040    }), "yes" == enablewebpush) {
10041    var OneSignal = OneSignal || [];
10042    OneSignal.push(["init", window.OneSignalOptions])
10043}
10044
10045function init_mod_calendarevents() {
10046    if (document.mod_calendarevents) {
10047        var e = document.mod_calendarevents;
10048        jQuery("#eventslist").hide(), jQuery("#datetime").datepicker({
10049            beforeShowDay: function(t) {
10050                var i = [!0, "", null];
10051                return jQuery.grep(e, function(e) {
10052                    return new Date(e.Date).valueOf() === t.valueOf()
10053                }).length && (i = [!0, "highlight", null]), i
10054            },
10055            onSelect: function(t) {
10056                for (var i, n = new Date(t), r = 0, o = []; r < e.length;) i = new Date(e[r].Date), n.valueOf() === i.valueOf() && o.push(e[r]), r++;
10057                o.length > 0 && (jQuery("#eventslist").show(200), jQuery.each(o, function(e, t) {
10058                    jQuery("#eventslist-items").append('<div class="item"><span data-link="' + window.fullAjaxBase + window.lang_sef + "/" + t.Link + '">' + t.Title + "</span></div>")
10059                }))
10060            }
10061        }), jQuery("#closebtn").click(function() {
10062            jQuery("#eventslist").hide(200), jQuery("#eventslist-items").html("")
10063        });
10064        var t = jQuery("#datetime").width(),
10065            i = jQuery("#datetime").height();
10066        jQuery("#eventslist").width(t).height(i), jQuery(".item span").live("click", function() {
10067            jQuery("#customhref").attr("href", jQuery(this).attr("data-link")).trigger("click")
10068        })
10069    }
10070}
10071
10072function init_mod_charts() {
10073    document.mod_charts_enabled && (jQuery(".ratepopstar-charts").on("click", function() {
10074        var e = jQuery(this).attr("data-url");
10075        jQuery("body").append('<div id="ratepop"><div class="ratepopcenter"><div class="closepop"><img src="' + window.fullAjaxBase + 'player/assets/img/close.png"></div><iframe width="260" height="400" src="' + e + '"></iframe></div></div>')
10076    }), jQuery(document).on("click", "#ratepop, .closepop", function() {
10077        jQuery("#ratepop").remove()
10078    }))
10079}
10080
10081function init_mod_produceronair() {
10082    if (document.mod_produceronair_options) {
10083        var e = document.mod_produceronair_options.jtrans;
10084        clearInterval(window.mod_produceronair_interval), window.mod_produceronair_interval = setInterval(function() {
10085            var t = document.mod_produceronair_options.data,
10086                i = new Date,
10087                n = new Array(7);
10088            n[0] = "sunday", n[1] = "monday", n[2] = "tuesday", n[3] = "wednesday", n[4] = "thursday", n[5] = "friday", n[6] = "saturday";
10089            var r = n[i.getDay()];
10090            0 === Object.keys(t).length ? jQuery("#rowproduce_onair").html("") : jQuery("#rowproduce_onair > div").length > 0 ? (jQuery(".producer-link").attr("href", fullAjaxBase + t.menu_alias + "/" + r + "/" 
10090+ t.alias), jQuery(".producer-time").text(t.starttime + " - " + t.endtime), jQuery(".producer-title").text(t.title), jQuery(".producer-image").attr("src", fullAjaxBase + "cache3ds/com_allcustom/images/" + t.imagename), jQuery(".producer-shortdescription").text(t.shortdescription)) : jQuery("#rowproduce_onair").append("<div class='uk-panel uk-panel-space'><h3>" + e + "</h3><div class='media media-left'><a class='producer-link' href='" + fullAjaxBase + t.menu_alias + "/" + r + "/" + t.alias + "'><img src='" + fullAjaxBase + "cache3ds/com_allcustom/images/" + t.imagename + "' /></a></div><a class='producer-link' href='" + fullAjaxBase + t.menu_alias + "/" + r + "/" + t.alias + "'><div class='producer-title'>" + t.title + "</div></a><div class='producer-time'>" + t.starttime + " - " + t.endtime + "</div><div class='producer-shortdescription'>" + t.shortdescription + "</div></div>")
10091        }, document.mod_produceronair_options.time)
10092    }
10093}
10094
10095function init_mod_toprated() {
10096    document.mod_toprated_enabled && (jQuery(".byRate").css({
10097        "border-bottom": "1px solid"
10098    }), jQuery(".byAvg").click(function() {
10099        jQuery(".byAvg").css({
10100            "border-bottom": "1px solid"
10101        }), jQuery(".byRate").css({
10102            "border-bottom": "0px"
10103        }), jQuery(".taba").fadeIn("slow", function() {}), jQuery(".tabb").hide()
10104    }), jQuery(".byRate").click(function() {
10105        jQuery(".byRate").css({
10106            "border-bottom": "1px solid"
10107        }), jQuery(".byAvg").css({
10108            "border-bottom": "0px"
10109        }), jQuery(".taba").hide(), jQuery(".tabb").fadeIn("slow", function() {})
10110    }), jQuery(".ratepopstar").on("click", function() {
10111        var e = jQuery(this).attr("data-url");
10112        jQuery("body").append('<div id="ratepop"><div class="ratepopcenter"><div class="closepop"><img src="player/assets/img/close.png"></div><iframe width="260" height="400" src="' + e + '"></iframe></div></div>')
10113    }), jQuery(document).on("click", "#ratepop, .closepop", function() {
10114        jQuery("#ratepop").remove()
10115    }))
10116}
10117jQuery(document).ready(function() {
10118    if (jQuery(".inputbox.advancedSelect").click(function() {
10119            var e = location.pathname,
10120                t = this.value,
10121                i = window.fullAjaxBase.replace(location.origin, ""),
10122                n = e.replace(i, ""),
10123                r = t.replace(i, ""),
10124                o = n.substring(n.indexOf("/") + 1),
10125                a = r.split("/")[0];
10126            location.replace(window.fullAjaxBase + a + "/" + o)
10127        }), "active" == window.activeFullAjax) {
10128        var e = "flax-component";
10129        FLAX.Filter.add({
10130            url: "/",
10131            id: e
10132        }), FLAX.Filter.add({
10133            query: ["task=weblink", "task=profile", "task=user.login", "task=user.logout", "task=article.edit"],
10134            type: "nowrap"
10135        }), FLAX.Filter.add(), FLAX.Filter.on("beforewrap", function(e) {
10136            var t = e.el.getAttribute("id");
10137            if ("login-form" == t || "form-login" == t || e.el.href && (/.+\.(jpg|jpeg|gif|png|mp3|mp4|ogg|ogv|webm|pdf|txt|odf|ods)$/i.test(e.el.href) || -1 != e.el.href.indexOf("#"))) return !1
10138        }), FLAX.Default.sprt_url = "!", FLAX.linkEqual["!ax!" + e + "!"] = "ajx", FLAX.linkEqual["[~q~]"] = "?", FLAX.directLink();
10139        var t = document.createElement("script");
10140
10141        function i(e, t) {
10142            ga("set", {
10143                page: e,
10144                title: t
10145            })
10146        }
10147        t.src = "//www.google-analytics.com/ga.js", document.getElementsByTagName("head")[0].appendChild(t), window.gaid && (r = window.gaid, jQuery.getScript("//www.google-analytics.com/analytics.js"), window.ga = window.ga || function() {
10148            (ga.q = ga.q || []).push(arguments)
10149        }, ga.l = +new Date, ga("create", r, "auto"),  i(window.location.href, document.title), ga("send", "pageview")), jQuery("#ac").click(), FLAX.Html.onall("response", function(e) {
10150            if (e.xhr.getResponseHeader) {
10151                var t = e.xhr.getResponseHeader("Ax-Location"),
10152                    i = e.xhr.getResponseHeader("Ax-Action");
10153                t && e.url != t && (e.options.url = e.url = t), t && "reload" == i && (location = t)
10154            }
10155        }), FLAX.Html.onall("response", function() {
10156            jQuery("html, body").animate({
10157                scrollTop: 0
10158            }, 300)
10159        });
10160        FLAX.Html.onall("load", function(e) {
10161            _gaq.push(["_trackPageview", e.url]), autoApplyActiveOnProgramFilter(), handleInit();
10162            jQuery(".logotop").attr("src");
10163            jQuery("#flax-bottom-c .uk-grid div:first-child .uk-panel .uk-margin").prepend("")
10164        });
10165        var n = jQuery("<div/>", {
10166            id: "fullAjaxGif",
10167            style: 'height: 100%;width:100%;position:fixed;left: 0%;top: 0%;z-index: 99999 !important;background: #000;opacity: 0.5;background-image: url("' + window.fullAjaxBase + '/media/plg_system_addfullajax/images/ajax-loader.gif");background-repeat: no-repeat;margin:0 auto;background-position: 50% 50%;'
10168        });
10169        FLAX.Effect.add({
10170            id: e,
10171            start: function(t, i) {
10172                if (window.fullAjaxStarted) {
10173                    var r = jQuery("#" + e);
10174                    jQuery("#ac").click(), jQuery("#fullAjaxGif").length || n.insertBefore(r), r.stop().animate({
10175                        opacity: 1
10176                    }, 10, i)
10177                } else window.fullAjaxStarted = 1;
10178                "undefined" != typeof sliderInterval && (clearInterval(sliderInterval), sliderInterval = null)
10179            },
10180            end: function(t) {
10181                var n = jQuery("#fullAjaxGif");
10182                n.length && n.remove(), jQuery("#" + e).stop().animate({
10183                    opacity: 1
10184                }, 10), i(window.location.href, document.title)
10185            }
10186        }), FLAX.Model2Blocks[e] = {
10187            "flax-bottom-c": "flax-bottom-c",
10188            "flax-sidebar-b": "flax-sidebar-b",
10189            "flax-sidebar-a": "flax-sidebar-a",
10190            "flax-onair-sidecheck": "flax-onair-sidecheck",
10191            "flax-top-a": "flax-top-a",
10192            "flax-message": "flax-message",
10193            "flax-component": "flax-component",
10194            "flax-main-top": "flax-main-top",
10195            "flax-main-bottom": "flax-main-bottom",
10196            "flax-content-top": "flax-content-top",
10197            "flax-content-bottom": "flax-content-bottom",
10198            "flax-menu": "flax-menu",
10199            "flax-search": "flax-search",
10200            "flax-header-top": "flax-header-top"
10201        }, document[(_el = document.addEventListener) ? "addEventListener" : "attachEvent"](_el ? "DOMContentLoaded" : "onreadystatechange", function() {
10202            (_el || "complete" == document.readyState) && (window.jq183 || jQuery)(".noscript").removeClass("noscript")
10203        }), jQuery(window).load(function() {
10204            setTimeout(function() {
10205                window.fullAjaxStarted = 1
10206            }, 500)
10207        })
10208    }
10209    var r;
10210    var $cookiecontent = params.getAttribute("data-disclaimer-content");
10211	var $cookiedetails = params.getAttribute("data-disclaimer-details");
10212	var $cookieaccept  = params.getAttribute("data-disclaimer-accept");
10213    window.cookieconsent_options = {
10214        message: $cookiecontent,
10215        dismiss: $cookieaccept,
10216        learnMore: $cookiedetails,
10217        link: "http://www.aboutcookies.org/",
10218        theme: "dark-top"
10219    }, jQuery(".tm-totop-scroller").click(function() {
10220        return jQuery("html, body").animate({
10221            scrollTop: 0
10222        }, "slow"), !1
10223    })
10224}), jQuery(window).load(function() {
10225    jQuery(window).on("popstate", function(e) {
10226        window.location.reload()
10227    })
10228});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.