PageSourceSearch

https://theprojectjunkie.com/templates/tpj_new_blue_3b/script.js

js theprojectjunkie.com collected 2026-10-06 13:14:56 UTC 54,636 bytes, 1,541 lines download raw bytes

1/* Created by Artisteer v4.3.0.60858 */
2/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, strict:true, undef:true, curly:false, browser:true, jquery:false */
3/*global jQuery BackgroundHelper */
4
5// css helper
6browser = function ($) {
7    'use strict';
8    var data = [
9        { str: navigator.userAgent, sub: 'Chrome', ver: 'Chrome', name: 'chrome' },
10        { str: navigator.vendor, sub: 'Apple', ver: 'Version', name: 'safari' },
11        { prop: window.opera, ver: 'Opera', name: 'opera' },
12        { str: navigator.userAgent, sub: 'Firefox', ver: 'Firefox', name: 'firefox' },
13        { str: navigator.userAgent, sub: 'MSIE', ver: 'MSIE', name: 'ie' },
14        { str: navigator.userAgent, sub: 'Trident/7.0', ver: 'rv', name: 'ie' }
15    ];
16    var v = function (s, n) {
17        var i = s.indexOf(data[n].ver);
18        return (i !== -1) ? parseFloat(s.substring(i + data[n].ver.length + 1)) : 0;
19    };
20    var result = { name: 'unknown', version: 0 };
21    var html = $('html');
22    for (var n = 0; n < data.length; n++) {
23        if (!result[data[n].name]) {
24            result[data[n].name] = false;
25        }
26        if ((data[n].str && (data[n].str.indexOf(data[n].sub) !== -1)) || data[n].prop) {
27            result.name = data[n].name;
28            result[result.name] = true;
29            result.version = v(navigator.userAgent, n) || v(navigator.appVersion, n);
30            html.addClass(result.name + ' ' + result.name + parseInt(result.version, 10));
31        }
32    }
33    return result;
34} (jQuery);
35
36jQuery(function ($) {
37    if (typeof responsiveDesign === "undefined") {
38        $("html").addClass("desktop");
39    }
40});
41
42jQuery(function ($) {
43    'use strict';
44    var i, j, k, l, m;
45    if (!browser.ie || browser.version !== 9) {
46        return;
47    }
48    var splitByTokens = function (str, startToken, endToken, last) {
49        if (!last) {
50            last = false;
51        }
52        var startPos = str.indexOf(startToken);
53        if (startPos !== -1) {
54            startPos += startToken.length;
55            var endPos = last ? str.lastIndexOf(endToken) : str.indexOf(endToken, startPos);
56
57            if (endPos !== -1 && endPos > startPos) {
58                return str.substr(startPos, endPos - startPos);
59            }
60        }
61        return '';
62    };
63
64    var splitWithBrackets = function (str, token, brackets) {
65        /*jshint nonstandard:true */
66        if (!token) {
67            token = ',';
68        }
69        if (!brackets) {
70            brackets = '()';
71        }
72        var bracket = 0;
73        var startPos = 0;
74        var result = [];
75        if (brackets.lenght < 2) {
76            return result;
77        }
78        var pos = 0;
79        while (pos < str.length) {
80            var ch = str[pos];
81            if (ch === brackets[0]) {
82                bracket++;
83            }
84            if (ch === brackets[1]) {
85                bracket--;
86            }
87            if (ch === token && bracket < 1) {
88                result.push(str.substr(startPos, pos - startPos));
89                startPos = pos + token.length;
90            }
91            pos++;
92        }
93        result.push(str.substr(startPos, pos - startPos));
94        return result;
95    };
96
97    var byteToHex = function (d) {
98        var hex = Number(d).toString(16);
99        while (hex.length < 2) {
100            hex = "0" + hex;
101        }
102        return hex;
103    };
104
105    for (i = 0; i < document.styleSheets.length; i++) {
106        var s = document.styleSheets[i];
107        var r = [s];
108        for (j = 0; j < s.imports.length; j++) {
109            r.push(s.imports[j]);
110        }
111        for (j = 0; j < r.length; j++) {
112            s = r[j];
113            var n = [];
114            for (k = 0; k < s.rules.length; k++) {
115                var css = s.rules[k].cssText || s.rules[k].style.cssText;
116                if (!css) {
117                    continue;
118                }
119                var value = splitByTokens(css, '-svg-background:', ';');
120                if (value === '') {
121                    continue;
122                }
123                var values = splitWithBrackets(value);
124                for (l = 0; l < values.length; l++) {
125                    var g = splitByTokens(values[l], 'linear-gradient(', ')', true);
126                    if (g === '') {
127                        continue;
128                    }
129                    var args = splitWithBrackets(g);
130                    if (args.length < 3) {
131                        continue;
132                    }
133                    var maxOffset = 0;
134                    var stops = [];
135                    for (m = 1; m < args.length; m++) {
136                        var stopValues = splitWithBrackets($.trim(args[m]), ' ');
137                        if (stopValues.length < 2) {
138                            continue;
139                        }
140                        var stopColor = $.trim(stopValues[0]);
141                        var stopOpacity = 1;
142                        if (stopColor == 'transparent') {
143                            stopColor = '#000000';
144                            stopOpacity = 0;
145                        }
146                        var colorRgba = splitByTokens(stopColor, 'rgba(', ')', true);
147                        var stopOffset = $.trim(stopValues[1]);
148                        if (colorRgba !== "") {
149                            var rgba = colorRgba.split(',');
150                            if (rgba.length < 4) {
151                                continue;
152                            }
153                            stopColor = '#' + byteToHex(rgba[0]) + byteToHex(rgba[1]) + byteToHex(rgba[2]);
154                            stopOpacity = rgba[3];
155                        }
156                        var isPx = stopOffset.indexOf('px') !== -1;
157                        if (isPx) {
158                            maxOffset = Math.max(maxOffset, parseInt(stopOffset, 10) || 0);
159                        }
160                        stops.push({ offset: stopOffset, color: stopColor, opacity: stopOpacity, isPx: isPx });
161                    }
162                    var stopsXML = '';
163                    var lastStop = null;
164                    for (m = 0; m < stops.length; m++) {
165                        if (stops[m].isPx) {
166                            stops[m].offset = ((parseInt(stops[m].offset, 10) || 0) / (maxOffset / 100)) + '%';
167                        }
168                        stopsXML += '<stop offset="' + stops[m].offset + '" stop-color="' + stops[m].color + '" stop-opacity="' + stops[m].opacity + '"/>';
169                        if (m === stops.length - 1) {
170                            lastStop = stops[m];
171                        }
172                    }
173                    var isLeft = $.trim(args[0]) === 'left';
174                    var direction = 'x1="0%" y1="0%" ' + (isLeft ? 'x2="100%" y2="0%"' : 'x2="0%" y2="
174100%"');
175                    var gradientLength = '100%';
176                    if (maxOffset > 0) {
177                        gradientLength = maxOffset + 'px';
178                    }
179                    var size = (isLeft ? 'width="' + gradientLength + '" height="100%"' : 'width="100%" height="' + gradientLength + '"');
180                    var last = "";
181                    if (lastStop !== null && maxOffset > 0) {
182                        last = '<rect ' +
183                            (isLeft ?
184                                'x="' + maxOffset + '" y="0"' :
185                                'x="0" y="' + maxOffset + '"') +
186                            ' width="100%" height="100%" style="fill:' + lastStop.color + ';opacity:' + lastStop.opacity + ';"/>';
187
188                    }
189                    var svgGradient = '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none"><linearGradient id="g" gradientUnits="objectBoundingBox" ' + direction + '>' + stopsXML + '</linearGradient><rect x="0" y="0" ' + size + ' fill="url(#g)" />' + last + '</svg>';
190                    values[l] = values[l].replace('linear-gradient(' + g + ')', 'url(data:image/svg+xml,' + escape(svgGradient) + ')');
191                }
192                n.push({ s: s.rules[k].selectorText, v: 'background: ' + values.join(",") });
193            }
194            for (k = 0; k < n.length; k++) {
195                s.addRule(n[k].s, n[k].v);
196            }
197        }
198    }
199});
200
201
202jQuery(function ($) {
203    "use strict";
204    // ie8
205    if (!browser.ie || browser.version > 8) return;
206    $('.art-shapes').each(function () {
207        if ($(this).siblings('.art-slider').length) {
208            $(this).remove();
209        } else {
210            $(this).css('z-index', 1);
211        }
212    });
213
214    // ie7
215    if (!browser.ie || browser.version > 7) return;
216    var textblockTexts = $('.art-textblock div[class$="-text"]');
217    textblockTexts.each(function () {
218        var tbText = $(this);
219        var valign = tbText.css('vertical-align') ? tbText.css('vertical-align') : 'top';
220        if (valign === 'middle') {
221            var wrapper = tbText.wrap('<div/>').parent();
222            tbText.css({
223                'position': 'relative',
224                'top': '-50%',
225                'height': 'auto'
226            });
227            wrapper.css({
228                'position': 'absolute',
229                'top': '50%'
230            });
231        } else if (valign === 'bottom') {
232            tbText.css({
233                'position': 'absolute',
234                'height': 'auto',
235                'bottom': 0
236            });
237        }
238    });
239});
240
241/* Set wmode=transparent for youtube and other video hostings to show it under the menus, lightboxes etc. */
242jQuery(function ($) {
243    "use strict";
244    var video = ["youtube"];
245
246    $("iframe[src]").each(function () {
247        var iframe = $(this),
248            src = iframe.attr("src"),
249            isVideo = false,
250            i;
251
252        for (i = 0; i < video.length; i++) {
253            if (src.toLowerCase().indexOf(video[i].toLowerCase()) !== -1) {
254                isVideo = true;
255                break;
256            }
257        }
258
259        if (!isVideo) {
260            return;
261        }
262
263        if (src.lastIndexOf("?") !== -1) {
264            src += "&amp;wmode=transparent";
265        } else {
266            src += "?wmode=transparent";
267        }
268        iframe.attr("src", src);
269    });
270});
271
272jQuery(function ($) {
273    "use strict";
274    $(window).bind("resize", function () { navigatorResizeHandler($("html").hasClass("responsive")); });
275});
276
277var navigatorResizeHandler = (function ($) {
278    "use strict";
279    return function (responsiveDesign) {
280        if (responsiveDesign) return;
281        $(".art-slider").each(function () {
282            var slider = $(this);
283            var sliderWidth = slider.width();
284            var nav = slider.siblings(".art-slidenavigator");
285            var navWidth = nav.outerWidth();
286            if (nav.length && navWidth < sliderWidth) {
287                // left offset
288                var left = nav.attr("data-left");
289                // (margin = containerWidth - (objectPosition + objectWidth)) < 0
290                var margin = sliderWidth - sliderWidth * parseFloat(left) / 100 - nav.outerWidth(false);
291                if (margin < 0) {
292                    nav.css("margin-left", margin);
293                }
294            }
295        });
296    };
297})(jQuery);
298
299var processElementMultiplyBg = (function ($) {
300    return (function (selector, info) {
301        if (!selector || !info || !info.bgimage || !info.bgposition || !info.images || !info.positions) return;
302        var path = "";
303        var script = $('head script[src*="script.js"]');
304        if (script.length) {
305            path = (script.attr('src') || '');
306            path = path.substr(0, path.lastIndexOf('/') + 1);
307        }
308        var html = '';
309        var el = $(selector);
310        var bgimages = info.images.split(",");
311        var bgpositions = info.positions.split(",");
312        for (var i = bgimages.length - 1; i >= 0; i--) {
313            var bgimage = $.trim(bgimages[i]);
314            if (bgimage === "")
315                continue;
316            var imgIdx = bgimage.lastIndexOf('images/');
317            var className = bgimage.substring(imgIdx + 7, bgimage.length - 6);
318            el.append("<div class=\"ie8fix " + className + "\" style=\"position:absolute;top:0;left:0;width:100%;height:100%;background:" + bgimage.replace(/(images\/[^\/]+)$/, path + '$1') + " " + bgpositions[i] + " no-repeat\"></div>");
319        }
320        el.css('background-image', info.bgimage.replace(/(images\/[^\/]+)$/, path + '$1'));
321        el.css('background-position-x', "50%");
322        el.css('background-position-y', "50%");
323    });
324})(jQuery);
325
326
327var responsiveNavigator = (function ($) {
328    "use strict";
329    return function () {
330        if (typeof headerObjectResizer !== 'undefined' && headerObjectResizer.isPreview) return;
331
332        var sheet = $('.art-sheet');
333        var sheetWidth = sheet.outerWidth();
334
335        $(".art-slider").each(function () {
336            var currentSlider = $(this);
337            var currentSliderWidth = currentSlider.width();
338
339            var sliderNavigator = currentSlider.siblings(".art-slidenavigator");
340            if (sliderNavigator.length) {
341                var off = sheetLeftFunc(sheet, sliderNavigator);
342                var calcWidth = isContentSlider(sliderNavigator) ? currentSliderWidth : sheetWidth;
343
344                var navigatorWidth = sliderNavigator.outerWidth();
345                var offset = parseInt(sliderNavigator.attr('data-offset') || 0, 10);
346
347                // left offset
348                sliderNavigator.css('margin-left', '0px');
349
350                var left = parseFloat(sliderNavigator.attr("data-left"), 10);
351                var newLeft = off + uniToPx(left, navigatorWidth, calcWidth);
352                sliderNavigator.css('left', newLeft + 'px');
353
354
355                // reset top to original value
356                sliderNavigator.css("top", "");
357
358                // top
359                var navigatorHeight = sliderNavigator.outerHeight();
360                var uniy = parseFloat(sliderNavigator.attr('data-top'), 10);
361
362                var sliderHeight = parseInt(currentSlider.css('height'), 10);
363                var newTop = uniToPx(uniy, navigatorHeight, sliderHeight);
364
365                sliderNavigator.css("top", (newTop + offset) + 'px');
366            }
367        });
368    };
369})(jQuery);
370
371jQuery(function ($) {
372    "use strict";
373
374    if (typeof responsiveDesign === "undefined") {
375        $(window).bind("resize", responsiveNavigator);
376    }
377
378    $(window).on("load", function pageInitialize() {
379        $(window).trigger("resize");
380        $(window).off("load", pageInitialize);
381    });
382});
383
384
385/* Icons in Header should have display block.
386 * Otherwise, in case of inline-block there's a space gap in some browsers (Opera 12.16) and icon is cutted.
387 */
388if (browser.opera) {
389    jQuery(function ($) {
390        $(".art-header a[class$='tag-icon']").css("display", "block");
391    });
392}
393
394jQuery(function($) {
395    "use strict";
396     $(window).bind("resize", function () {
397        /*global responsiveDesign */
398        "use strict";
399        if (typeof responsiveDesign !== "undefined" && responsiveDesign.isResponsive)
400            return;
401        var sheetLeft = $(".art-sheet").offset().left;
402        $("header.art-header #art-flash-area").each(function () {
403            var object = $(this);
404            object.css("left", sheetLeft + "px");
405        });
406    });
407});
408
409jQuery(function($) {
410    "use strict";
411    $('nav.art-nav').addClass("desktop-nav");
412});
413
414
415jQuery(function ($) {
416    "use strict";
417    if (!browser.ie || browser.version > 7) {
418        return;
419    }
420    $('ul.art-hmenu>li:not(:first-child)').each(function () { $(this).prepend('<span class="art-hmenu-separator"> </span>'); });
421});
422
423jQuery(function ($) {
424    "use strict";
425    $("ul.art-hmenu a:not([href])").attr('href', '#').click(function (e) { e.preventDefault(); });
426});
427
428
429jQuery(function ($) {
430    "use strict";
431    if (!browser.ie || browser.version > 7) {
432        return;
433    }
434
435    /* Fix width of submenu items.
436    * The width of submenu item calculated incorrectly in IE6-7. IE6 has wider items, IE7 dis
436play items like stairs.
437    */
438    $.each($("ul.art-hmenu ul"), function () {
439        var maxSubitemWidth = 0;
440        var submenu = $(this);
441        var subitem = null;
442        $.each(submenu.children("li").children("a"), function () {
443            subitem = $(this);
444            var subitemWidth = subitem.outerWidth(false);
445            if (maxSubitemWidth < subitemWidth) {
446                maxSubitemWidth = subitemWidth;
447            }
448        });
449        if (subitem !== null) {
450            var subitemBorderLeft = parseInt(subitem.css("border-left-width"), 10) || 0;
451            var subitemBorderRight = parseInt(subitem.css("border-right-width"), 10) || 0;
452            var subitemPaddingLeft = parseInt(subitem.css("padding-left"), 10) || 0;
453            var subitemPaddingRight = parseInt(subitem.css("padding-right"), 10) || 0;
454            maxSubitemWidth -= subitemBorderLeft + subitemBorderRight + subitemPaddingLeft + subitemPaddingRight;
455            submenu.children("li").children("a").css("width", maxSubitemWidth + "px");
456        }
457    });
458});
459
460jQuery(function ($) {
461    "use strict";
462    var setDirection = function() {
463        setHMenuOpenDirection({
464            container: "div.art-sheet",
465            defaultContainer: "#art-main",
466            menuClass: "art-hmenu",
467            leftToRightClass: "art-hmenu-left-to-right",
468            rightToLeftClass: "art-hmenu-right-to-left"
469        });
470    };
471    if (typeof responsiveDesign !== "undefined") {
472        $(window).on('responsive', setDirection);
473    } else {
474        setDirection();
475    }
476});
477
478var setHMenuOpenDirection = (function ($) {
479    "use strict";
480    return (function(menuInfo) {
481        var defaultContainer = $(menuInfo.defaultContainer);
482        defaultContainer = defaultContainer.length > 0 ? defaultContainer = $(defaultContainer[0]) : null;
483
484        $("ul." + menuInfo.menuClass + ">li>ul").each(function () {
485            var submenu = $(this);
486
487            var submenuWidth = submenu.outerWidth(false);
488            var submenuLeft = submenu.offset().left;
489
490            var mainContainer = submenu.parents(menuInfo.container);
491            mainContainer = mainContainer.length > 0 ? mainContainer = $(mainContainer[0]) : null;
492
493            var container = mainContainer || defaultContainer;
494            if (container !== null) {
495                var containerLeft = container.offset().left;
496                var containerWidth = container.outerWidth(false);
497
498                if (submenuLeft + submenuWidth >= containerLeft + containerWidth) {
499                    /* right to left */
500                    submenu.addClass(menuInfo.rightToLeftClass).find("ul").addClass(menuInfo.rightToLeftClass);
501                } else if (submenuLeft <= containerLeft) {
502                    /* left to right */
503                    submenu.addClass(menuInfo.leftToRightClass).find("ul").addClass(menuInfo.leftToRightClass);
504                }
505            }
506        });
507    });
508})(jQuery);
509
510
511jQuery(function ($) {
512    'use strict';
513
514    if (browser.ie && browser.version < 8) {
515        $(window).bind('resize', function() {
516            var c = $('div.art-content');
517            var s = c.parent().children('.art-layout-cell:not(.art-content)');
518            var w = 0;
519            c.hide();
520            s.each(function() { w += $(this).outerWidth(true); });
521            c.w = c.parent().width(); c.css('width', c.w - w + 'px');
522            c.show();
523        });
524    }
525
526    $(window).trigger('resize');
527});
528
529jQuery(function($) {
530    "use strict";
531    if (!$('html').hasClass('ie7')) {
532        return;
533    }
534    $('ul.art-vmenu li:not(:first-child),ul.art-vmenu li li li:first-child,ul.art-vmenu>li>ul').each(function () { $(this).append('<div class="art-vmenu-separator"> </div><div class="art-vmenu-separator-bg"> </div>'); });
535});
536
537
538
539var artButtonSetup = (function ($) {
540    'use strict';
541    return (function (className) {
542        $.each($("a." + className + ", button." + className + ", input." + className), function (i, val) {
543            var b = $(val);
544            if (!b.hasClass('art-button')) {
545                b.addClass('art-button');
546            }
547            if (b.is('input')) {
548                b.val(b.val().replace(/^\s*/, '')).css('zoom', '1');
549            }
550            b.mousedown(function () {
551                var b = $(this);
552                b.addClass("active");
553            });
554            b.mouseup(function () {
555                var b = $(this);
556                if (b.hasClass('active')) {
557                    b.removeClass('active');
558                }
559            });
560            b.mouseleave(function () {
561                var b = $(this);
562                if (b.hasClass('active')) {
563                    b.removeClass('active');
564                }
565            });
566        });
567    });
568})(jQuery);
569jQuery(function () {
570    'use strict';
571    artButtonSetup("art-button");
572});
573
574var Control = (function ($) {
575    'use strict';
576    return (function () {
577        this.init = function(label, type, callback) {
578            var chAttr = label.find('input[type="' +type + '"]').attr('checked');
579            if (chAttr === 'checked') {
580              label.addClass('art-checked');
581            }
582
583            label.mouseleave(function () {
584              $(this).removeClass('hovered').removeClass('active');
585            });
586            label.mouseover(function () {
587              $(this).addClass('hovered').removeClass('active');
588            });
589            label.mousedown(function (event) {
590              if (event.which !== 1) {
591                  return;
592              }
593              $(this).addClass('active').removeClass('hovered');
594            });
595            label.mouseup(function (event) {
596              if (event.which !== 1) {
597                  return;
598              }
599              callback.apply(this);
600              $(this).removeClass('active').addClass('hovered');
601            });
602        };
603    });
604})(jQuery);
605
606
607jQuery(function ($) {
608    'use strict';
609    $('.art-pager').contents().filter(
610        function () {
611            return this.nodeType === this.TEXT_NODE;
612        }
613    ).remove();
614});
615var fixRssIconLineHeight = (function ($) {
616    "use strict";
617    return function (className) {
618        $("." + className).css("line-height", $("." + className).height() + "px");
619    };
620})(jQuery);
621
622jQuery(function ($) {
623    "use strict";
624    var rssIcons = $(".art-rss-tag-icon");
625    if (rssIcons.length){
626        fixRssIconLineHeight("art-rss-tag-icon");
627        if (browser.ie && browser.version < 9) {
628            rssIcons.each(function () {
629                if ($.trim($(this).html()) === "") {
630                    $(this).css("vertical-align", "middle");
631                }
632            });
633        }
634    }
635});
636var ThemeLightbox = (function ($) {
637    'use strict';
638    return (function () {
639        var images = $(".art-lightbox");
640        var current;
641        this.init = function (ctrl) {
642            $(".art-lightbox").mouseup({ _ctrl: ctrl }, function (e) {
643                if ((e.data._ctrl === true && !e.ctrlKey) || (e.which && e.which !== 1)) {
644                    return;
645                }
646
647                images = $(".art-lightbox");
648
649                current = images.index(this);
650
651                var imgContainer = $('.art-lightbox-wrapper');
652                if (imgContainer.length === 0) {
653                    imgContainer = $('<div class="art-lightbox-wrapper">').css('line-height', $(window).height() + "px")
654                    .appendTo($("body"));
655
656                    var closeBtn = $('<div class="close"><div class="cw"> </div><div class="ccw"> </div><div class="close-alt">&#10007;</div></div>')
657                .click(close);
658                    closeBtn.appendTo(imgContainer);
659                    showArrows();
660                }
661
662                move(current);
663            });
664        };
665
666        function move(index) {
667            if (index < 0 || index >= images.length) {
668                return;
669            }
670
671            showError(false);
672
673            current = index;
674
675            $(".art-lightbox-wrapper .art-lightbox-image:not(.active)").remove();
676
677            var active = $(".art-lightbox-wrapper .active");
678            var target = $('<img class="art-lightbox-image" alt="" src="' + getFullImgSrc($(images[current]).attr("src")) + '" />').click(function () {
679                if ($(this).hasClass("active")) {
680                    move(current + 1);
681                }
682            });
683
684            if (active.length > 0) {
685                active.after(target);
686            } else {
687                $(".art-lightbox-wrapper").append(target);
688            }
689
690            showArrows();
691            showLoader(true);
692
693            bindMouse($(".art-lightbox-wrapper").add(target));
694
695            target.load(function () {
696                showLoader(false);
697
698                active.removeClass("active");
699                target.addClass("active");
700            });
701
702            target.error(function () {
703                showLoader(false);
704                active.removeClass("active");
705                target.addClass("active");
706                target.attr("src", $(images[current]).attr("src"));
707            });
708        }
709
710        function showArrows() {
711            if ($(".art-lightbox-wrapper .arrow").length === 0) {
712                $(".art-lightbox-wrapper").append(
713                    $('<div class="arrow left"><div class="arrow-t ccw"> </div><div class="arrow-b cw"> </div><div class="arrow-left-alt">&#8592;</div></div>')
714                        .css("top", $(window).height() / 2 - 40)
715                        .click(function () {
716                            if (!$(this).hasClass("disabled")) {
717                                move(current - 1);
718                            }
719                        })
720                );
721                $(".art-lightbox-wrapper").append(
722                    $('<div class="arrow right"><div class="arrow-t cw"> </div><div class="arrow-b ccw"> </div><div class="arrow-right-alt">&#8594;</div></div>')
723                        .css("top", $(window).height() / 2 - 40)
724                        .click(function () {
725                            if (!$(this).hasClass("disabled")) {
726                                move(current + 1);
727                            }
728                        })
729                );
730            }
731
732            if (current === 0) {
733                $(".art-lightbox-wrapper .arrow.left").addClass("disabled");
734            } else {
735                $(".art-lightbox-wrapper .arrow.left").removeClass("disabled");
736            }
737
738            if (current === images.length - 1) {
739                $(".art-lightbox-wrapper .arrow.right").addClass("disabled");
740            } else {
741                $(".art-lightbox-wrapper .arrow.right").removeClass("disabled");
742            }
743        }
744
745        function showError(enable) {
746            if (enable) {
747                $(".art-lightbox-wrapper").append($('<div class="lightbox-error">The requested content cannot be loaded.<br/>Please try again later.</div>')
748                        .css({ "top": $(window).height() / 2 - 60, "left": $(window).width() / 2 - 170 }));
749            } else {
750                $(".art-lightbox-wrapper .lightbox-error").remove();
751            }
752        }
753
754        function showLoader(enable) {
755            if (!enable) {
756                $(".art-lightbox-wrapper .loading").remove();
757            }
758            else {
759                $('<div class="loading"> </div>').css({ "top": $(window).height() / 2 - 16, "left": $(window).width() / 2 - 16 }).appendTo($(".art-lightbox-wrapper"));
760            }
761        }
762
763        var close = function () {
764            $(".art-lightbox-wrapper").remove();
765        };
766
767        function bindMouse(img) {
768            img.bind('mousewheel DOMMouseScroll', function (e) {
769                var orgEvent = window.event || e.originalEvent;
770                var delta = (orgEvent.wheelDelta ? orgEvent.wheelDelta : orgEvent.detail * -1) > 0 ? 1 : -1;
771                move(current + delta);
772                e.preventDefault();
773            }).mousedown(function (e) {
774                // close on middle button click
775                if (e.which === 2) {
776                    close();
777                }
778                e.preventDefault();
779            });
780        }
781
782        function getFullImgSrc(src) {
783            var fileName = src.substring(0, src.lastIndexOf('.'));
784            var ext = src.substring(src.lastIndexOf('.'));
785            return fileName + "-large" + ext;
786        }
787
788    });
789})(jQuery);
790
791jQuery(function () {
792    'use strict';
793    new ThemeLightbox().init();
794});
795
796(function ($) {
797    'use strict';
798    // transition && transitionEnd && browser prefix
799    $.support.themeTransition = (function () {
800        var thisBody = document.body || document.documentElement,
801            thisStyle = thisBody.style,
802            support = thisStyle.transition !== undefined ||
803                thisStyle.WebkitTransition !== undefined ||
804                thisStyle.MozTransition !== undefined ||
805                thisStyle.MsTransition !== undefined ||
806                thisStyle.OTransition !== undefined;
807        return support && {
808            event: (function () {
809                return "transitionend webkitTransitionEnd otransitionend oTransitionEnd";
810            })(),
811            prefix: (function () {
812                return ({
813                    opera: "-o-",
814                    firefox: "-moz-",
815                    chrome: "-webkit-",
816                    safari: "-webkit-",
817                    ie: ""
818                }[browser.name] || "");
819            })()
820        };
821    })();
822
823    window.BackgroundHelper = function () {
824        var slides = [];
825        var direction = "next";
826        var motion = "horizontal";
827        var width = 0;
828        var height = 0;
829        var multiplier = 1;
830        var originalWidth = 0;
831        var originalHeight = 0;
832        var transitionDuration = "";
833
834        this.init = function (motionType, dir, duration) {
835            direction = dir;
836            motion = motionType;
837            slides = [];
838            width = 0;
839            height = 0;
840            multiplier = 1;
841            originalWidth = 0;
842            originalHeight = 0;
843            transitionDuration = duration;
844        };
845
846        this.processSlide = function (element, modify) {
847            this.updateSize(element, null);
848            var pos = [];
849
850            var bgPosition = element.css("background-position");
851            var positions = bgPosition.split(",");
852            $.each(positions, function (i) {
853                var position = $.trim(this);
854                var point = position.split(" ");
855                var zeroValue = browser.ie && browser.version >= 10 ? 0.1 : 0;
856                if (point.length > 1) {
857                    var x = point[0].indexOf('%') === -1 ? parseFloat(point[0], 10) : zeroValue;
858                    var y = point[1].indexOf('%') === -1 ? parseFloat(point[1], 10) : zeroValue;
859                    pos.push({ x: x, y: y });
860                } else {
861                    pos.push({ x: zeroValue, y: zeroValue });
862                }
863            });
864
865            slides.push({
866                "images": element.css("background-image"),
867                "sizes": element.css("background-size"),
868                "positions": pos
869            });
870
871            if (modify)
872                element.css("background-image", "none");
873        };
874
875        this.updateSize = function (element, initialSize) {
876            width = element.outerWidth(false);
877            height = element.outerHeight();
878            if (initialSize && parseInt(initialSize.width, 10) !== 0) {
879                originalWidth = parseInt(initialSize.width, 10);
880                originalHeight = parseInt(initialSize.height, 10);
881                if (motion === "fade") {
882                    $.each(element.children(), function (i) {
883                        $(this).css("background-position", getCssPositions(slides[i].positions, { x: 0, y: 0 }));
884                    });
885                }
886            }
887        };
888
889        this.setBackground = function (element, items) {
890            var bg = [];
891            var sizes = [];
892            $.each(items, function (i, o) {
893                bg.push(o.images);
894                sizes.push(o.sizes);
895            });
896            element.css({
897                "background-image": bg.join(", "),
898                //"background-size": sizes.join(", "),
899                "background-repeat": "no-repeat"
900            });
901        };
902
903        this.setPosition = function (element, items) {
904            var pos = [];
905            $.each(items, function (i, o) {
906                pos.push(o.positions);
907            });
908            element.css({
909                "background-position": pos.join(", ")
910            });
911        };
912
913        this.current = function (index) {
914            return slides[index] || null;
915        };
916
917        this.next = function (index) {
918            var next;
919            if (direction === "next") {
920                next = (index + 1) % slides.length;
921            } else {
922                next = index - 1;
923                if (next < 0) {
924                    next = slides.length - 1;
925                }
926            }
927            return slides[next];
928        };
929
930        this.items = function (prev, next, move) {
931            var prevItem = { x: 0, y: 0 };
932            var nextItem = { x: 0, y: 0 };
933            var isDirectionNext = direction === "next";
934            var verticalOffset = -(originalHeight - height) / 2;
935            var horizontalOffset = -(originalWidth - width) / 2;
936            if (motion === "horizontal") {
937                prevItem.y = nextItem.y = -(originalHeight - height) / 2;
938                prevItem.x = horizontalOffset;
939                nextItem.x = (isDirectionNext ? originalWidth : -originalWidth) + horizontalOffset;
940                if (move) {
941                    prevItem.x += isDirectionNext ? -originalWidth : originalWidth;
942                    nextItem.x += isDirectionNext ? -originalWidth : originalWidth;
943                }
944            } else if (motion === "vertical") {
945                prevItem.x = nextItem.x = horizontalOffset;
946                prevItem.y = verticalOffset;
947                nextItem.y = (isDirectionNext ? originalHeight : -originalHeight) + verticalOffset;
948                if (move) {
949                    prevItem.y += isDirectionNext ? -originalHeight : originalHeight;
950                    nextItem.y += isDirectionNext ? -originalHeight : originalHeight;
951                }
952            }
953            var result = [];
954            if (!!prev) {
955                result.push({ images: prev.images, positions: getCssPositions(prev.positions, prevItem), sizes: prev.sizes });
956            }
957            if (!!next) {
958                result.push({ images: next.images, positions: getCssPositions(next.positions, nextItem), sizes: next.sizes });
959            }
960
961            if (direction === "next") {
962                result.reverse();
963            }
964
965            return result;
966        };
967
968        this.transition = function (container, on) {
969            container.css($.support.themeTransition.prefix + "transition", on ? "background-position " + transitionDuration + " ease-in-out" : "");
970        };
971
972        function getCssPositions(positions, offset) {
973            var result = [];
974            if (positions === undefined) {
975                return "";
976            }
977            offset.x = offset.x || 0;
978            offset.y = offset.y || 0;
979            for (var i = 0; i < positions.length; i++) {
980                result.push((positions[i].x * 1 + offset.x) + "px " + (positions[i].y * 1 + offset.y) + "px");
981            }
982            return result.join(", ");
983        }
984    };
985
986
987    var ThemeSlider = function (element, settings) {
988
989        var interval = null;
990        var active = false;
991        var children = element.find(".active").parent().children();
992        var last = false;
993        var running = false;
994
995        this.settings = $.extend({}, {
996            "animation": "horizontal",
997            "direction": "next",
998            "speed": 600,
999            "pause": 2500,
1000            "auto": true,
1001            "repeat": true,
1002            "navigator": null,
1003            "clickevents": true,
1004            "hover": true,
1005            "helper": null
1006        }, settings);
1007
1008        this.move = function (direction, next) {
1009            var activeItem = element.find(".active"),
1010                nextItem = next || activeItem[direction](),
1011                innerDirection = this.settings.direction === "next" ? "forward" : "back",
1012                reset = direction === "next" ? "first" : "last",
1013                moving = interval,
1014                slider = this, tmp;
1015
1016            active = true;
1017
1018            if (moving) { this.stop(true); }
1019
1020            if (!nextItem.length) {
1021                nextItem = element.find(".art-slide-item")[reset]();
1022                if (!this.settings.repeat) { last = true; active = false; return; }
1023            }
1024
1025            if ($.support.themeTransition) {
1026                nextItem.addClass(this.settings.direction);
1027                tmp = nextItem.get(0).offsetHeight;
1028
1029                activeItem.addClass(innerDirection);
1030                nextItem.addClass(innerDirection);
1031
1032                element.trigger("beforeSlide", children.length);
1033
1034                element.one($.support.themeTransition.event, function () {
1035                    nextItem.removeClass(slider.settings.direction)
1036                        .removeClass(innerDirection)
1037                        .addClass("active");
1038                    activeItem.removeClass("active")
1039                        .removeClass(innerDirection);
1040                    active = false;
1041                    setTimeout(function () {
1042                        element.trigger("afterSlide", children.length);
1043                    }, 0);
1044                });
1045            } else {
1046                element.trigger("beforeSlide", children.length);
1047
1048                activeItem.removeClass("active");
1049                nextItem.addClass("active");
1050                active = false;
1051
1052                element.trigger("afterSlide", children.length);
1053            }
1054
1055            this.navigate(nextItem);
1056
1057            if (moving) { this.start(); }
1058        };
1059
1060        this.navigate = function (position) {
1061            var index = children.index(position);
1062            $(this.settings.navigator).children().removeClass("active").eq(index).addClass("active");
1063        };
1064
1065        this.to = function (index) {
1066            var activeItem = element.find(".active"),
1067                children = activeItem.parent().children(),
1068                activeIndex = children.index(activeItem),
1069                slider = this;
1070
1071            if (index > (children.length - 1) || index < 0) {
1072                return;
1073            }
1074
1075            if (active) {
1076                return element.one("afterSlide", function () {
1077                    slider.to(index);
1078                });
1079            }
1080
1081            if (activeIndex === index) {
1082                return;
1083            }
1084
1085            this.move(index > activeIndex ? "next" : "prev", $(children[index]));
1086        };
1087
1088        this.next = function () {
1089            if (!active) {
1090                if (last) { this.stop(); return; }
1091                this.move("next");
1092            }
1093        };
1094
1095        this.prev = function () {
1096            if (!active) {
1097                if (last) { this.stop(); return; }
1098                this.move("prev");
1099            }
1100        };
1101
1102        this.start = function (force) {
1103            if (!!force) {
1104                setTimeout($.proxy(this.next, this), 10);
1105            }
1106            interval = setInterval($.proxy(this.next, this), this.settings.pause);
1107            running = true;
1108        };
1109
1110        this.stop = function (pause) {
1111            clearInterval(interval);
1112            interval = null;
1113            running = !!pause;
1114            active = false;
1115        };
1116
1117        this.active = function () {
1118            return running;
1119        };
1120
1121        this.moving = function () {
1122            return active;
1123        };
1124
1125        this.navigate(children.filter(".active"));
1126
1127        if (this.settings.clickevents) {
1128            $(this.settings.navigator).on("click", "a", { slider: this }, function (event) {
1129                var activeIndex = children.index(children.filter(".active"));
1130                var index = $(this).parent().children().index($(this));
1131                if (activeIndex !== index) {
1132                    event.data.slider.to(index);
1133                }
1134                event.preventDefault();
1135            });
1136        }
1137
1138        if (this.settings.hover) {
1139            var slider = this;
1140            element.add(this.settings.navigator)
1141                   .add(element.siblings(".art-shapes")).hover(function () {
1142                       if (element.is(":visible") && !last) { slider.stop(true); }
1143                   }, function () {
1144                       if (element.is(":visible") && !last) { slider.start(); }
1145                   });
1146        }
1147    };
1148
1149    $.fn.themeSlider = function (arg) {
1150        return this.each(function () {
1151            var element = $(this),
1152                data = element.data("slider"),
1153                options = typeof arg === "object" && arg;
1154
1155            if (!data) {
1156                data = new ThemeSlider(element, options);
1157                element.data("slider", data);
1158            }
1159
1160            if (typeof arg === "string" && data[arg]) {
1161                data[arg]();
1162            } else if (data.settings.auto && element.is(":visible")) {
1163                data.start();
1164            }
1165        });
1166    };
1167
1168})(jQuery);
1169
1170
1171
1172
1173if (typeof window.resizeData === 'undefined') window.resizeData = {};
1174window.resizeData.headerPageWidth = false;
1175if (typeof window.defaultResponsiveData === 'undefined') window.defaultResponsiveData = [false, true, true, true, true, ];
1176
1177resizeData['object0'] = {
1178   responsive: [
1179                  { left: 1, top: 0, visible: true }, 
1180                  { left: 1, top: 0, visible: true }, 
1181                  { left: 1, top: 0, visible: true }, 
1182                  { left: 1, top: 0, visible: true }, 
1183                  { left: 1, top: 0, visible: true }, 
1184               ],
1185   area: {
1186       x: 0,
1187       y: 0
1188   },
1189   width: 1000,
1190   height: 175,
1191   autoWidth: false};
1192
1193// used to apply compicated values in style like '!important!
1194function applyCss(object, param, value) {
1195    var rg = new RegExp(param + '\s*:\s*[^;]+;', "i");
1196    var style = object.attr('style');
1197    var str = param + ': ' + value + ';';
1198    if (rg.test(style)) {
1199        style = style.replace(rg, str);
1200    }
1201    else {
1202        style += '; ' + str;
1203    }
1204
1205    object.attr('style', style);
1206}
1207
1208// convert universal coord to pixels
1209function uniToPx(uni, size, parentSize) {
1210    uni = parseFloat(uni || '0');
1211    if (uni < 0) {
1212        uni = uni * size;
1213    } else if (uni >= 1) {
1214        uni = parentSize - (2 - uni) * size;
1215    } else {
1216        uni = uni * (parentSize - size);
1217    }
1218
1219    return uni;
1220}
1221
1222function isContentSlider(object) {
1223    var isHeader = object.parents('header').length > 0;
1224    if (isHeader) {
1225        return false;
1226    }
1227    var isPageSlider = object.parents('.art-pageslider').length > 0;
1228    if (isPageSlider)
1229        return false;
1230
1231    return true;
1232}
1233
1234function sheetLeftFunc(sheet, object) {
1235    var sheetLeft = sheet.offset().left;
1236
1237    var isHeader = object.parents('header').length > 0;
1238    if (isHeader) {
1239        if (resizeData.headerPageWidth) return sheetLeft;
1240    } else {
1241        var isPageSlider = object.parents('.art-pageslider').length > 0;
1242        if (isPageSlider) {
1243            if (resizeData.pageSliderPageWidth) return sheetLeft;
1244        }
1245    }
1246
1247    return 0;
1248}
1249
1250var headerObjectResizer = {
1251    
1252    postInit: false,
1253
1254    resize: (function ($) {
1255        'use strict';
1256        return function () {
1257            if (!headerObjectResizer.postInit && typeof responsiveDesign !== 'undefined') {
1258                $(window).on('responsiveResize', headerObjectResizer.resize);
1259                headerObjectResizer.postInit = true;
1260            }
1261
1262            var responsiveType = 0;
1263            // if we don't use full custom responsive so we MUST cleanup all styles
1264            var cleanUpStyles = false;
1265            // when use default respo so while in desktop mode always use 0-type, in other case cleanup our styles
1266            if (typeof responsiveDesign !== 'undefined' && 
1267                    defaultResponsiveData[responsiveDesign.responsiveTypeIdx] &&
1268                    responsiveDesign.isResponsive) {
1269                cleanUpStyles = true;
1270            }
1271
1272            if (typeof responsiveDesign !== 'undefined') {
1273                if (responsiveDesign.responsiveType === 'tabletlandscape') {
1274                    responsiveType = 1;
1275                } else if (responsiveDesign.responsiveType === 'tabletportrait') {
1276                    responsiveType = 2;
1277                } else if (responsiveDesign.responsiveType === 'phonelandscape') {
1278                    responsiveType = 3;
1279                } else if (responsiveDesign.responsiveType === 'phoneportrait') {
1280                    responsiveType = 4;
1281                }
1282            }
1283
1284            var sheet = $('.art-sheet');
1285            var sheetWidth = sheet.outerWidth();
1286
1287            var header = $('header');
1288            var height = 0;
1289            var cssPrefix = 'art-';
1290
1291            // move html shapes
1292            var headerQuery = 'header.art-header .art-shapes>*, header.art-header .art-textblock, header.art-header>.art-headline, header.art-header>.art-slogan, header.art-header>.art-positioncontrol, header.art-header>.art-logo';
1293            var pageSliderQuery = '.art-pageslider .art-slide-item>*';
1294            if (headerObjectResizer.isPreview) {
1295                headerQuery = 'header .art-slider';
1296                pageSliderQuery = '.art-pageslider .art-slider, .art-pageslider .art-textblock';
1297            }
1298            $(headerQuery + ', ' + pageSliderQuery).each(function () {
1299                var object = $(this);
1300                height = object.parent().height();
1301
1302                var off = sheetLeftFunc(sheet, object);
1303
1304                var cls = object.attr('class').split(' ');
1305                $.each(cls, function (key, val) {
1306                    val = $.trim(val);
1307                    if (val.length === 0) return;
1308                    if (val.indexOf(cssPrefix) !== 0) return;
1309
1310                    val = val.substring(cssPrefix.length);
1311                    var data = resizeData[val];
1312                    if (typeof data === 'undefined') return;
1313
1314                    if (cleanUpStyles) {
1315                        object.css('display', '');
1316                        object.css('left', '');
1317                        object.css('margin-left', '');
1318                    }
1319
1320                    var respData = data.responsive[responsiveType];
1321                    if (respData.visible) {
1322                        object.css('display', '');
1323                    } else {
1324                        applyCss(object, 'display', 'none !important');
1325                    }
1326
1327                    if (cleanUpStyles || !respData.visible) return false;
1328
1329                    var x = uniToPx(respData.left, data.autoWidth ? object.width() : data.width, sheetWidth);
1330                    x += off;
1331
1332                    var y = uniToPx(respData.top, data.height, height);
1333
1334                    object.css('left', x + 'px');
1335                    object.css('top', y + 'px');
1336                    applyCss(object, 'margin-left', '0px !important');
1337                    return false;
1338                });
1339            });
1340
1341            // move images in slide's background-images
1342            var slides = $('.art-slide-item').add(header);
1343            if (browser.ie && browser.version <= 8) {
1344                slides = slides.add('.art-slide-item .ie8fix');
1345            }
1346            $.each(slides, function (slideIdx, slide) {
1347                slide = $(slide);
1348
1349                if (slide.closest('.art-collage').length > 0 || cleanUpStyles) {
1350                    slide.css('background-position', '');
1351                    return;
1352                }
1353
1354                var slideVisible = slide.is(':visible');
1355                if (!slideVisible && browser.ie) {
1356                    slide.css('display', 'block');
1357                }
1358
1359                var off = sheetLeftFunc(sheet, slide);
1360
1361                if (browser.ie && browser.version <= 8) {
1362                    var s = slide.attr('style');
1363                    if (s) {
1364                        s = s.replace(/background\-position[^;]+/, '');
1365                        slide.attr('style', s);
1366                    }
1367                } else {
1368                    slide.css('background-position', '');
1369                }
1370                slide.css('background-size', '');
1371
1372                var bgImage = slide.css('background-image') ? slide.css('background-image').split(',') : [];
1373                var bgPosition = slide.css('background-position') && (slide.css('background-position').replace(/[0][^\d]+/gi, '')).length > 0 ?
1374                    slide.css('background-position').split(',') :
1375                    [];
1376                if (bgImage.length !== bgPosition.length) {
1377                    slide.css('display', '');
1378                    return;
1379                }
1380
1381                height = slide.height();
1382                if (height === 0) height = slide.parent().height();
1383
1384                $.each(bgImage, function (idx, val) {
1385                    var findImageIdx = val.lastIndexOf('images/');
1386                    var findDotIdx = val.lastIndexOf('.');
1387                    if (findImageIdx === -1 || findDotIdx === -1) return;
1388
1389                    var name = val.substring(findImageIdx + 7, findDotIdx);
1390
1391                    var data = resizeData[name];
1392                    if (typeof data === 'undefined') return;
1393
1394                    var respData = data.responsive[responsiveType];
1395                    // big default coordinates for hiding
1396                    var x = 9999, y = 9999;
1397                    if (respData.visible) {
1398                        x = uniToPx(respData.left, data.width, sheetWidth);
1399                        x += off + data.area.x;
1400
1401                        y = uniToPx(respData.top, data.height, height);
1402                        y += data.area.y;
1403                    }
1404
1405                    bgPosition[idx] = x + 'px ' + y + 'px';
1406                });
1407
1408                slide.css('background-position', bgPosition.join(','));
1409
1410                if (!slideVisible && browser.ie) {
1411                    slide.css('display', '');
1412                }
1413            });
1414
1415        };
1416    })(jQuery),
1417
1418    initialize: function ($) {
1419        if (!browser.ie || browser.version > 8) {
1420            $(window).on('resize', this.resize);
1421        } else {
1422            var resizeTimeout;
1423            var self = this;
1424            $(window).on("resize", function () {
1425                clearTimeout(resizeTimeout);
1426                resizeTimeout = setTimeout(function () { self.resize(); }, 25);
1427            });
1428        }
1429    }
1430};
1431
1432headerObjectResizer.initialize(jQuery);
1433jQuery(function ($) {
1434    "use strict";
1435    if (!browser.ie || browser.version > 8)
1436        return;
1437    processElementMultiplyBg(".art-header", {
1438        "bgimage": "url('images/header.jpg')",
1439        "bgposition": "0 0",
1440        "images": "url('images/object0.png'), ",
1441        "positions": "13px 0px, "
1442    });
1443});
1444if (typeof window.resizeData === 'undefined') window.resizeData = {};
1445
1446window.resizeData.pageSliderPageWidth = false;
1447
1448(function ($) {
1449    'use strict';
1450
1451    /*global jQuery, artButtonSetup, browser */
1452
1453    $(function () {
1454        artButtonSetup("btn-primary");
1455        artButtonSetup("btn");
1456        artButtonSetup("button");
1457        artButtonSetup("readon");
1458        artButtonSetup("readmore");
1459    });
1460
1461    $(function ($) {
1462        var links = $('a.art-rss-tag-icon[href="#"]'),
1463            href = $('head link[type="application/rss+xml"]').attr('href');
1464        if (href) {
1465            links.attr('href', href);
1466        } else {
1467            links.hide();
1468        }
1469    });
1470
1471    $(function ($) {
1472        $('.art-messages').each(function () {
1473            $(this).css('display', $(this).find('dl, .alert').length ? '' : 'none');
1474        });
1475    });
1476
1477    $(function ($) {
1478        $('.art-search-button').each(function (i, val) {
1479            var element = $(val),
1480                background = element.css('background-image');
1481
1482            if (-1 !== background.indexOf('url')) {
1483                element.val('');
1484            }
1485            if (element.hasClass('art-button')) {
1486                element.removeClass('art-button');
1487            }
1488        });
1489    });
1490
1491    $(function ($) {
1492        // ie < 9 slider multiple background joomla fix
1493        if (!browser.ie || browser.version > 8) {
1494            return;
1495        }
1496
1497        var scriptSrc = jQuery('script[src*="script.js"]').last().attr('src'),
1498            pathToContentImages = scriptSrc.substr(0, scriptSrc.lastIndexOf('/') + 1) + 'data/images/',
1499            pathToDesignImages = scriptSrc.substr(0, scriptSrc.lastIndexOf('/') + 1) + 'images/';
1500
1501        $('.art-slider .art-slide-item').each(function () {
1502            var ie8fixDiv = $('.ie8fix', this),
1503                slide = $(this);
1504                isDesign = $(this).parents('header').length > 0 ||
1505                    $(this).parents('.art-pageslider').length > 0;
1506                elements = [];
1507
1508            elements.push(slide);
1509            $.each(ie8fixDiv, function (key, object) {
1510                elements.push(object);
1511            });
1512
1513            $.each(elements, function (idx, object) {
1514                var bg = $(object).css('background-image');
1515                if (bg) {
1516                    bg = bg.replace(/url\(["'](.+)["']\)/g, function (match, path) {
1517                        var imageName = path.substr(path.lastIndexOf('/') + 1);
1518                        return 'url(\'' + (isDesign ? pathToDesignImages : pathToContentImages) + imageName + '\')';
1519                    });
1520                    $(object).css('background-image', bg);
1521                }
1522            });
1523        });
1524    });
1525
1526}(jQuery));
1527
1528if ('undefined' !== typeof(MooTools)) {
1529    window.addEvent('domready', function() {
1530        $$('.hasTip').each(function(el) {
1531            var title = el.get('title');
1532            if (title) {
1533                title = title.replace(/<strong>(.*?)<\/strong><br \/>/, '$1 :: ');
1534                var parts = title.split('::', 2);
1535                el.store('tip:title', parts[0]);
1536                el.store('tip:text', parts[1]);
1537            }
1538        });
1539        var JTooltips = new Tips($$('.hasTip'), {"maxTitleChars": 50,"fixed": false});
1540    });
1541}

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.