PageSourceSearch

https://k-vashdoctor.ru/templates/vashdoc/script.js

js k-vashdoctor.ru collected 2026-10-06 05:08:57 UTC 44,952 bytes, 1,244 lines download raw bytes

1/* Created by Artisteer v4.1.0.60046 */
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    ];
15    var v = function (s, n) {
16        var i = s.indexOf(data[n].ver);
17        return (i !== -1) ? parseFloat(s.substring(i + data[n].ver.length + 1)) : 0;
18    };
19    var html = $('html');
20    var result = { name: 'unknown', version: 0 };
21    for (var n = 0; n < data.length; n++) {
22        result[data[n].name] = false;
23        if ((data[n].str && (data[n].str.indexOf(data[n].sub) !== -1)) || data[n].prop) {
24            result.name = data[n].name;
25            result[result.name] = true;
26            result.version = v(navigator.userAgent, n) || v(navigator.appVersion, n);
27            // 'desktop' class is used as responsive design initial value
28            html.addClass(result.name + ' ' + result.name + parseInt(result.version, 10) + ' desktop');
29        }
30    }
31    return result;
32} (jQuery);
33
34jQuery(function ($) {
35    'use strict';
36    var i, j, k, l, m;
37    if (!browser.ie || browser.version !== 9) {
38        return;
39    }
40    var splitByTokens = function (str, startToken, endToken, last) {
41        if (!last) {
42            last = false;
43        }
44        var startPos = str.indexOf(startToken);
45        if (startPos !== -1) {
46            startPos += startToken.length;
47            var endPos = last ? str.lastIndexOf(endToken) : str.indexOf(endToken, startPos);
48
49            if (endPos !== -1 && endPos > startPos) {
50                return str.substr(startPos, endPos - startPos);
51            }
52        }
53        return '';
54    };
55
56    var splitWithBrackets = function (str, token, brackets) {
57        /*jshint nonstandard:true */
58        if (!token) {
59            token = ',';
60        }
61        if (!brackets) {
62            brackets = '()';
63        }
64        var bracket = 0;
65        var startPos = 0;
66        var result = [];
67        if (brackets.lenght < 2) {
68            return result;
69        }
70        var pos = 0;
71        while (pos < str.length) {
72            var ch = str[pos];
73            if (ch === brackets[0]) {
74                bracket++;
75            }
76            if (ch === brackets[1]) {
77                bracket--;
78            }
79            if (ch === token && bracket < 1) {
80                result.push(str.substr(startPos, pos - startPos));
81                startPos = pos + token.length;
82            }
83            pos++;
84        }
85        result.push(str.substr(startPos, pos - startPos));
86        return result;
87    };
88
89    var byteToHex = function (d) {
90        var hex = Number(d).toString(16);
91        while (hex.length < 2) {
92            hex = "0" + hex;
93        }
94        return hex;
95    };
96
97    for (i = 0; i < document.styleSheets.length; i++) {
98        var s = document.styleSheets[i];
99        var r = [s];
100        for (j = 0; j < s.imports.length; j++) {
101            r.push(s.imports[j]);
102        }
103        for (j = 0; j < r.length; j++) {
104            s = r[j];
105            var n = [];
106            for (k = 0; k < s.rules.length; k++) {
107                var css = s.rules[k].cssText || s.rules[k].style.cssText;
108                if (!css) {
109                    continue;
110                }
111                var value = splitByTokens(css, '-svg-background:', ';');
112                if (value === '') {
113                    continue;
114                }
115                var values = splitWithBrackets(value);
116                for (l = 0; l < values.length; l++) {
117                    var g = splitByTokens(values[l], 'linear-gradient(', ')', true);
118                    if (g === '') {
119                        continue;
120                    }
121                    var args = splitWithBrackets(g);
122                    if (args.length < 3) {
123                        continue;
124                    }
125                    var maxOffset = 0;
126                    var stops = [];
127                    for (m = 1; m < args.length; m++) {
128                        var stopValues = splitWithBrackets($.trim(args[m]), ' ');
129                        if (stopValues.length < 2) {
130                            continue;
131                        }
132                        var stopColor = $.trim(stopValues[0]);
133                        var stopOpacity = 1;
134                        if (stopColor == 'transparent') {
135                            stopColor = '#000000';
136                            stopOpacity = 0;
137                        }
138                        var colorRgba = splitByTokens(stopColor, 'rgba(', ')', true);
139                        var stopOffset = $.trim(stopValues[1]);
140                        if (colorRgba !== "") {
141                            var rgba = colorRgba.split(',');
142                            if (rgba.length < 4) {
143                                continue;
144                            }
145                            stopColor = '#' + byteToHex(rgba[0]) + byteToHex(rgba[1]) + byteToHex(rgba[2]);
146                            stopOpacity = rgba[3];
147                        }
148                        var isPx = stopOffset.indexOf('px') !== -1;
149                        if (isPx) {
150                            maxOffset = Math.max(maxOffset, parseInt(stopOffset, 10) || 0);
151                        }
152                        stops.push({ offset: stopOffset, color: stopColor, opacity: stopOpacity, isPx: isPx });
153                    }
154                    var stopsXML = '';
155                    var lastStop = null;
156                    for (m = 0; m < stops.length; m++) {
157                        if (stops[m].isPx) {
158                            stops[m].offset = ((parseInt(stops[m].offset, 10) || 0) / (maxOffset / 100)) + '%';
159                        }
160                        stopsXML += '<stop offset="' + stops[m].offset + '" stop-color="' + stops[m].color + '" stop-opacity="' + stops[m].opacity + '"/>';
161                        if (m === stops.length - 1) {
162                            lastStop = stops[m];
163                        }
164                    }
165                    var isLeft = $.trim(args[0]) === 'left';
166                    var direction = 'x1="0%" y1="0%" ' + (isLeft ? 'x2="100%" y2="0%"' : 'x2="0%" y2="
166100%"');
167                    var gradientLength = '100%';
168                    if (maxOffset > 0) {
169                        gradientLength = maxOffset + 'px';
170                    }
171                    var size = (isLeft ? 'width="' + gradientLength + '" height="100%"' : 'width="100%" height="' + gradientLength + '"');
172                    var last = "";
173                    if (lastStop !== null && maxOffset > 0) {
174                        last = '<rect ' +
175                            (isLeft ?
176                                'x="' + maxOffset + '" y="0"' :
177                                'x="0" y="' + maxOffset + '"') +
178                            ' width="100%" height="100%" style="fill:' + lastStop.color + ';opacity:' + lastStop.opacity + ';"/>';
179
180                    }
181                    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>';
182                    values[l] = values[l].replace('linear-gradient(' + g + ')', 'url(data:image/svg+xml,' + escape(svgGradient) + ')');
183                }
184                n.push({ s: s.rules[k].selectorText, v: 'background: ' + values.join(",") });
185            }
186            for (k = 0; k < n.length; k++) {
187                s.addRule(n[k].s, n[k].v);
188            }
189        }
190    }
191});
192
193jQuery(function ($) {
194    'use strict';
195    // ie < 9 slider multiple background fix
196    if (!browser.ie || browser.version > 8) return;
197    
198    function split(str) {
199        str = str.replace(/"/g, '').replace(/%20/g, '');
200        return  str.split(/\s*,\s*/);
201    }
202
203    $('.slider .slide-item').each(function () {
204        var bgs = split($(this).css('background-image'));
205        // needs to use the last image
206        if (bgs.length > 1) {
207            $(this).css("background-image", bgs[bgs.length - 1]);
208        }
209    });
210});
211
212jQuery(function ($) {
213    "use strict";
214    // ie8
215    if (!browser.ie || browser.version > 8) return;
216    $('.shapes').css('z-index', 1);
217    
218    // ie7
219    if (!browser.ie || browser.version > 7) return;
220    var textblockTexts = $('.textblock > div');
221    textblockTexts.each(function () {
222        var tbText = $(this);
223        var valign = tbText.css('vertical-align') ? tbText.css('vertical-align') : 'top';
224        if (valign === 'middle') {
225            var wrapper = tbText.wrap('<div/>').parent();
226            tbText.css({
227                'position': 'relative',
228                'top': '-50%',
229                'height': 'auto'
230            });
231            wrapper.css({
232                'position': 'absolute',
233                'top': '50%'
234            });
235        } else if (valign === 'bottom') {
236            tbText.css({
237                'position': 'absolute',
238                'height': 'auto',
239                'bottom': 0
240            });
241        }
242    });
243});
244
245/* Set wmode=transparent for youtube and other video hostings to show it under the menus, lightboxes etc. */
246jQuery(function ($) {
247    "use strict";
248    var video = ["youtube"];
249
250    $("iframe[src]").each(function () {
251        var iframe = $(this),
252            src = iframe.attr("src"),
253            isVideo = false,
254            i;
255
256        for (i = 0; i < video.length; i++) {
257            if (src.toLowerCase().indexOf(video[i].toLowerCase()) !== -1) {
258                isVideo = true;
259                break;
260            }
261        }
262
263        if (!isVideo) {
264            return;
265        }
266
267        if (src.lastIndexOf("?") !== -1) {
268            src += "&amp;wmode=transparent";
269        } else {
270            src += "?wmode=transparent";
271        }
272        iframe.attr("src", src);
273    });
274});
275
276jQuery(function ($) {
277    "use strict";
278    $(window).bind("resize", function () { navigatorResizeHandler($("html").hasClass("responsive")); });
279});
280
281var navigatorResizeHandler = (function ($) {
282    "use strict";
283    return function (responsiveDesign) {
284        if (responsiveDesign) return;
285        $(".slider").each(function () {
286            var slider = $(this);
287            var sliderWidth = slider.width();
288            var nav = slider.siblings(".slidenavigator");
289            if (nav.length) {
290                // left offset
291                var left = nav.attr("data-left");
292                // (margin = containerWidth - (objectPosition + objectWidth)) < 0
293                var margin = sliderWidth - sliderWidth * parseFloat(left) / 100 - nav.outerWidth(false);
294                if (margin < 0) {
295                    nav.css("margin-left", margin);
296                }
297            }
298        });
299    };
300})(jQuery);
301jQuery(function($) {
302    "use strict";
303     $(window).bind("resize", function () {
304        /*global responsiveDesign */
305        "use strict";
306        if (typeof responsiveDesign !== "undefined" && responsiveDesign.isResponsive)
307            return;
308        var sheetLeft = $(".sheet").offset().left;
309        $("header.header #flash-area").each(function () {
310            var object = $(this);
311            object.css("left", sheetLeft + "px");
312        });
313    });
314});
315
316jQuery(function($) {
317    "use strict";
318    $('nav.nav').addClass("desktop-nav");
319});
320
321
322jQuery(function ($) {
323    "use strict";
324    if (!browser.ie || browser.version > 7) {
325        return;
326    }
327    $('ul.hmenu>li:not(:first-child)').each(function () { $(this).prepend('<span class="hmenu-separator"> </span>'); });
328});
329
330jQuery(function ($) {
331    "use strict";
332    $("ul.hmenu a:not([href])").attr('href', '#').click(function (e) { e.preventDefault(); });
333});
334
335
336jQuery(function ($) {
337    "use strict";
338    if (!browser.ie || browser.version > 7) {
339        return;
340    }
341
342    /* Fix width of submenu items.
343    * The width of submenu item calculated incorrectly in IE6-7. IE6 has wider items, IE7 display items like stairs.
344    */
345    $.each($("ul.hmenu ul"), function () {
346        var maxSubitemWidth = 0;
347        var submenu = $(this);
348        var subitem = null;
349        $.each(submenu.children("li").children("a"), function () {
350            subitem = $(this);
351            var subitemWidth = subitem.outerWidth(false);
352            if (maxSubitemWidth < subitemWidth) {
353                maxSubitemWidth = subitemWidth;
354            }
355        });
356        if (subitem !== null) {
357            var subitemBorderLeft = parseInt(subitem.css("border-left-width"), 10) || 0;
358            var subitemBorderRight = parseInt(subitem.css("border-right-width"), 10) || 0;
359            var subitemPaddingLeft = parseInt(subitem.css("padding-left"), 10) || 0;
360            var subitemPaddingRight = parseInt(subitem.css("padding-right"), 10) || 0;
361            maxSubitemWidth -= subitemBorderLeft + subitemBorderRight + subitemPaddingLeft + subitemPaddingRight;
362            submenu.children("li").children("a").css("width", maxSubitemWidth + "px");
363        }
364    });
365});
366jQuery(function () {
367    "use strict";
368    setHMenuOpenDirection({
369        container: "div.sheet",
370        defaultContainer: "#main",
371        menuClass: "hmenu",
372        leftToRightClass: "hmenu-left-to-right",
373        rightToLeftClass: "hmenu-right-to-left"
374    });
375});
376
377var setHMenuOpenDirection = (function ($) {
378    "use strict";
379    return (function(menuInfo) {
380        var defaultContainer = $(menuInfo.defaultContainer);
381        defaultContainer = defaultContainer.length > 0 ? defaultContainer = $(defaultContainer[0]) : null;
382
383        $("ul." + menuInfo.menuClass + ">li>ul").each(function () {
384            var submenu = $(this);
385
386            var submenuWidth = submenu.outerWidth(false);
387            var submenuLeft = submenu.offset().left;
388
389            var mainContainer = submenu.parents(menuInfo.container);
390            mainContainer = mainContainer.length > 0 ? mainContainer = $(mainContainer[0]) : null;
391
392            var container = mainContainer || defaultContainer;
393            if (container !== null) {
394                var containerLeft = container.offset().left;
395                var containerWidth = container.outerWidth(false);
396
397                if (submenuLeft + submenuWidth >= containerLeft + containerWidth) {
398                    /* right to left */
399                    submenu.addClass(menuInfo.rightToLeftClass).find("ul").addClass(menuInfo.rightToLeftClass);
400                } else if (submenuLeft <= containerLeft) {
401                    /* left to right */
402                    submenu.addClass(menuInfo.leftToRightClass).find("ul").addClass(menuInfo.leftToRightClass);
403                }
404            }
405        });
406    });
407})(jQuery);
408
409
410var menuExtendedCreate = (function ($) {
411    "use strict";
412    return function () {
413        var sheet = $(".sheet");
414        var sheetLeft = sheet.offset().left;
415        var sheetWidth = sheet.width();
416
417        $(".hmenu>li").each(function(i, v) {
418            var itm = $(this);
419            var subm = itm.children("ul");
420            if (subm.length === 0) {
421                return;
422            }
423
424            // reset
425            itm.removeClass("ext ext-r ext-l");
426            itm.css("width", "").find(".ext-off,.ext-m,.ext-l,.ext-r").remove();
427            subm.children("li").children("a").css("width", "");
428
429            var lw = 0, rw = 0;
430        
431            if (typeof subm.attr("data-ext-l") !== "undefined" && typeof subm.attr("data-ext-r") !== "undefined") {
432                lw = parseInt(subm.attr("data-ext-l"), 10) + 0;
433                rw = parseInt(subm.attr("data-ext-r"), 10) + 0;
434                itm.addClass("ext-r").addClass("ext-l");
435            } else {
436                var ltr = !subm.hasClass("hmenu-right-to-left");
437                itm.addClass(ltr ? "ext-r" : "ext-l");
438            }
439
440            var shadow = 0;
441            if (subm.length > 0) {
442                var lnk = itm.children("a");
443                var lnkWidth = lnk.outerWidth(false);
444                itm.css("width", Math.round(parseFloat(lnkWidth, 10)) + "px");
445                var menubarMargin = 5 * 2; // margin * 2 sides
446                var menubarBorder = 1 * 2; // border 1 side
447                var submWidth = subm.width() + shadow + menubarMargin + menubarBorder;
448                var w = submWidth - lnkWidth;
449                $("<div class=\"ext-m\"></div>").insertBefore(lnk);
450                if (w < 0) {
451                    var submA = subm.children("li").children("a");
452                    var pL = parseInt(submA.css("padding-left").replace("px", ""), 10) || 0;
453                    var pR = parseInt(submA.css("padding-right").replace("px", ""), 10) || 0;
454                    var bL = parseInt(submA.css("border-left").replace("px", ""), 10) || 0;
455                    var bR = parseInt(submA.css("border-right").replace("px", ""), 10) || 0;
456                    subm.children("li").children("a").css("width", (lnkWidth - pL - pR - bL - bR) + "px");
457                    submWidth = subm.width() + shadow + menubarMargin + menubarBorder;
458                    w = submWidth - lnkWidth;
459                }
460                $("<div class=\"ext-l\" style=\"width: " + (lw > 0 ? lw : Math.round(parseFloat(w, 10))) + "px;\"></div>").insertBefore(lnk);
461                $("<div class=\"ext-r\" style=\"width: " + (rw > 0 ? rw : Math.round(parseFloat(w, 10))) + "px;\"></div>").insertBefore(lnk);
462                itm.addClass("ext");
463            }
464        });
465    };
466})(jQuery);
467jQuery(window).load(menuExtendedCreate);
468
469jQuery(function ($) {
470    'use strict';
471    $(window).bind('resize', function () {
472        var bh = $('body').height();
473        var mh = 0;
474        var c = $('div.content');
475        c.removeAttr('style');
476
477        $('#main').children().each(function() {
478            if ($(this).css('position') !== 'absolute') {
479                mh += $(this).outerHeight(true);
480            }
481        });
482        
483        if (mh < bh) {
484            var r = bh - mh;
485            c.css('height', (c.outerHeight(true) + r) + 'px');
486        }
487    });
488
489    if (browser.ie && browser.version < 8) {
490        $(window).bind('resize', function() {
491            var c = $('div.content');
492            var s = c.parent().children('.layout-cell:not(.content)');
493            var w = 0;
494            c.hide();
495            s.each(function() { w += $(this).outerWidth(true); });
496            c.w = c.parent().width(); c.css('width', c.w - w + 'px');
497            c.show();
498        });
499    }
500
501    $(window).trigger('resize');
502});
503
504jQuery(function($) {
505    "use strict";
506    if (!$('html').hasClass('ie7')) {
507        return;
508    }
509    $('ul.vmenu li:not(:first-child),ul.vmenu li li li:first-child,ul.vmenu>li>ul').each(function () { $(this).append('<div class="vmenu-separator"> </div><div class="vmenu-separator-bg"> </div>'); });
510});
511
512
513
514var artButtonSetup = (function ($) {
515    'use strict';
516    return (function (className) {
517        $.each($("a." + className + ", button." + className + ", input." + className), function (i, val) {
518            var b = $(val);
519            if (!b.hasClass('button')) {
520                b.addClass('button');
521            }
522            if (b.is('input')) {
523                b.val(b.val().replace(/^\s*/, '')).css('zoom', '1');
524            }
525            b.mousedown(function () {
526                var b = $(this);
527                b.addClass("active");
528            });
529            b.mouseup(function () {
530                var b = $(this);
531                if (b.hasClass('active')) {
532                    b.removeClass('active');
533                }
534            });
535            b.mouseleave(function () {
536                var b = $(this);
537                if (b.hasClass('active')) {
538                    b.removeClass('active');
539                }
540            });
541        });
542    });
543})(jQuery);
544jQuery(function () {
545    'use strict';
546    artButtonSetup("button");
547});
548
549jQuery(function($) {
550    'use strict';
551    $('input.search-button, form.search input[type="submit"]').attr('value', '');
552});
553
554var Control = (function ($) {
555    'use strict';
556    return (function () {
557        this.init = function(label, type, callback) {
558            var chAttr = label.find('input[type="' +type + '"]').attr('checked');
559            if (chAttr === 'checked') {
560              label.addClass('checked');
561            }
562
563            label.mouseleave(function () {
564              $(this).removeClass('hovered').removeClass('active');
565            });
566            label.mouseover(function () {
567              $(this).addClass('hovered').removeClass('active');
568            });
569            label.mousedown(function (event) {
570              if (event.which !== 1) {
571                  return;
572              }
573              $(this).addClass('active').removeClass('hovered');
574            });
575            label.mouseup(function (event) {
576              if (event.which !== 1) {
577                  return;
578              }
579              callback.apply(this);
580              $(this).removeClass('active').addClass('hovered');
581            });
582        };
583    });
584})(jQuery);
585
586
587jQuery(function ($) {
588    'use strict';
589    $('.pager').contents().filter(
590        function () {
591            return this.nodeType === this.TEXT_NODE;
592        }
593    ).remove();
594});
595var fixRssIconLineHeight = (function ($) {
596    "use strict";
597    return function (className) {
598        $("." + className).css("line-height", $("." + className).height() + "px");
599    };
600})(jQuery);
601
602jQuery(function ($) {
603    "use strict";
604    var rssIcons = $(".rss-tag-icon");
605    if (rssIcons.length){
606        fixRssIconLineHeight("rss-tag-icon");
607        if (browser.ie && browser.version < 9) {
608            rssIcons.each(function () {
609                if ($.trim($(this).html()) === "") {
610                    $(this).css("vertical-align", "middle");
611                }
612            });
613        }
614    }
615});
616var ThemeLightbox = (function ($) {
617    'use strict';
618    return (function () {
619        var images = $(".lightbox");
620        var current;
621        this.init = function (ctrl) {
622            $(".lightbox").mouseup({ _ctrl: ctrl }, function (e) {
623                if ((e.data._ctrl === true && !e.ctrlKey) || (e.which && e.which !== 1)) {
624                    return;
625                }
626
627                images = $(".lightbox");
628
629                current = images.index(this);
630
631                var imgContainer = $('.lightbox-wrapper');
632                if (imgContainer.length === 0) {
633                    imgContainer = $('<div class="lightbox-wrapper">').css('line-height', $(window).height() + "px")
634                    .appendTo($("body"));
635
636                    var closeBtn = $('<div class="close"><div class="cw"> </div><div class="ccw"> </div><div class="close-alt">&#10007;</div></div>')
637                .click(close);
638                    closeBtn.appendTo(imgContainer);
639                    showArrows();
640                }
641
642                move(current);
643            });
644        };
645
646        function move(index) {
647            if (index < 0 || index >= images.length) {
648                return;
649            }
650
651            showError(false);
652
653            current = index;
654
655            $(".lightbox-wrapper .lightbox-image:not(.active)").remove();
656
657            var active = $(".lightbox-wrapper .active");
658            var target = $('<img class="lightbox-image" alt="" src="' + getFullImgSrc($(images[current]).attr("src")) + '" />').click(function () {
659                if ($(this).hasClass("active")) {
660                    move(current + 1);
661                }
662            });
663
664            if (active.length > 0) {
665                active.after(target);
666            } else {
667                $(".lightbox-wrapper").append(target);
668            }
669
670            showArrows();
671            showLoader(true);
672
673            bindMouse($(".lightbox-wrapper").add(target));
674
675            target.load(function () {
676                showLoader(false);
677
678                active.removeClass("active");
679                target.addClass("active");
680            });
681
682            target.error(function () {
683                showLoader(false);
684                active.removeClass("active");
685                target.addClass("active");
686                target.attr("src", $(images[current]).attr("src"));
687            });
688        }
689
690        function showArrows() {
691            if ($(".lightbox-wrapper .arrow").length === 0) {
692                $(".lightbox-wrapper").append(
693                    $('<div class="arrow left"><div class="arrow-t ccw"> </div><div class="arrow-b cw"> </div><div class="arrow-left-alt">&#8592;</div></div>')
694                        .css("top", $(window).height() / 2 - 40)
695                        .click(function () {
696                            if (!$(this).hasClass("disabled")) {
697                                move(current - 1);
698                            }
699                        })
700                );
701                $(".lightbox-wrapper").append(
702                    $('<div class="arrow right"><div class="arrow-t cw"> </div><div class="arrow-b ccw"> </div><div class="arrow-right-alt">&#8594;</div></div>')
703                        .css("top", $(window).height() / 2 - 40)
704                        .click(function () {
705                            if (!$(this).hasClass("disabled")) {
706                                move(current + 1);
707                            }
708                        })
709                );
710            }
711
712            if (current === 0) {
713                $(".lightbox-wrapper .arrow.left").addClass("disabled");
714            } else {
715                $(".lightbox-wrapper .arrow.left").removeClass("disabled");
716            }
717
718            if (current === images.length - 1) {
719                $(".lightbox-wrapper .arrow.right").addClass("disabled");
720            } else {
721                $(".lightbox-wrapper .arrow.right").removeClass("disabled");
722            }
723        }
724
725        function showError(enable) {
726            if (enable) {
727                $(".lightbox-wrapper").append($('<div class="lightbox-error">The requested content cannot be loaded.<br/>Please try again later.</div>')
728                        .css({ "top": $(window).height() / 2 - 60, "left": $(window).width() / 2 - 170 }));
729            } else {
730                $(".lightbox-wrapper .lightbox-error").remove();
731            }
732        }
733
734        function showLoader(enable) {
735            if (!enable) {
736                $(".lightbox-wrapper .loading").remove();
737            }
738            else {
739                $('<div class="loading"> </div>').css({ "top": $(window).height() / 2 - 16, "left": $(window).width() / 2 - 16 }).appendTo($(".lightbox-wrapper"));
740            }
741        }
742
743        var close = function () {
744            $(".lightbox-wrapper").remove();
745        };
746
747        function bindMouse(img) {
748            img.bind('mousewheel DOMMouseScroll', function (e) {
749                var orgEvent = window.event || e.originalEvent;
750                var delta = (orgEvent.wheelDelta ? orgEvent.wheelDelta : orgEvent.detail * -1) > 0 ? 1 : -1;
751                move(current + delta);
752                e.preventDefault();
753            }).mousedown(function (e) {
754                // close on middle button click
755                if (e.which === 2) {
756                    close();
757                }
758                e.preventDefault();
759            });
760        }
761
762        function getFullImgSrc(src) {
763            var fileName = src.substring(0, src.lastIndexOf('.'));
764            var ext = src.substring(src.lastIndexOf('.'));
765            return fileName + "-large" + ext;
766        }
767
768    });
769})(jQuery);
770
771jQuery(function () {
772    'use strict';
773    new ThemeLightbox().init();
774});
775
776(function($) {
777    'use strict';
778    // transition && transitionEnd && browser prefix
779    $.support.transition = (function() {
780        var thisBody = document.body || document.documentElement,
781            thisStyle = thisBody.style,
782            support = thisStyle.transition !== undefined ||
783                thisStyle.WebkitTransition !== undefined ||
784                thisStyle.MozTransition !== undefined ||
785                thisStyle.MsTransition !== undefined ||
786                thisStyle.OTransition !== undefined;
787        return support && {
788            event: (function() {
789                var e = "transitionend";
790                if (browser.opera) {
791                    var version = browser.version;
792                    e = version >= 12 ? (version < 12.50 ? "otransitionend" : "transitionend") : "oTransitionEnd";
793                } else if (browser.chrome || browser.safari) {
794                    e = "webkitTransitionEnd";
795                }
796                return e;
797            })(),
798            prefix: (function() {
799                return ({
800                        opera: "-o-",
801                        firefox: "-moz-",
802                        chrome: "-webkit-",
803                        safari: "-webkit-",
804                        ie: "-ms-"
805                    }[browser.name]);
806            })()
807        };
808    })();
809
810    window.BackgroundHelper = function () {
811        var slides = [];
812        var direction = "next";
813        var motion = "horizontal";
814        var width = 0;
815        var height = 0;
816        var multiplier = 1;
817        var transitionDuration = "";
818
819        this.init = function(motionType, dir, duration) {
820            direction = dir;
821            motion = motionType;
822            slides = [];
823            width = 0;
824            height = 0;
825            multiplier = 1;
826            transitionDuration = duration;
827        };
828
829        this.processSlide = function(element, modify) {
830            this.updateSize(element, null);
831            var pos = [];
832
833            var bgPosition = element.css("background-position");
834            var positions = bgPosition.split(",");
835            $.each(positions, function (i) {
836                var position = $.trim(this);
837                var point = position.split(" ");
838                if (point.length > 1) {
839                    var x = parseInt(point[0], 10);
840                    var y = parseInt(point[1], 10);
841                    pos.push({ x: x, y: y });
842                }
843            });
844
845            slides.push({
846                "images": element.css("background-image"),
847                "sizes": element.css("background-size"),
848                "positions": pos
849            });
850            
851            if (modify)
852                element.css("background-image", "none");
853        };
854        
855        this.updateSize = function (element, initialSize) {
856            width = element.outerWidth(false);
857            height = element.outerHeight();
858            if (initialSize && parseInt(initialSize.width, 10) !== 0) {
859                multiplier = width / initialSize.width;
860                if (motion === "fade") {
861                    $.each(element.children(), function (i) {
862                        $(this).css("background-position", getCssPositions(slides[i].positions, { x: 0, y: 0 }));
863                    });
864                }
865            }
866        };
867
868        this.setBackground = function(element, items) {
869            var bg = [];
870            var sizes = [];
871            $.each(items, function (i, o) {
872                bg.push(o.images);
873                sizes.push(o.sizes);
874            });
875            element.css({
876                "background-image": bg.join(", "),
877                "background-size": sizes.join(", "),
878                "background-repeat": "no-repeat"
879            });
880        };
881
882        this.setPosition = function(element, items) {
883            var pos = [];
884            $.each(items, function(i, o) {
885                pos.push(o.positions);
886            });
887            element.css({
888                "background-position": pos.join(", ")
889            });
890        };
891
892        this.current = function(index) {
893            return slides[index] || null;
894        };
895
896        this.next = function(index) {
897            var next;
898            if (direction === "next") {
899                next = (index + 1) % slides.length;
900            } else {
901                next = index - 1;
902                if (next < 0) {
903                    next = slides.length - 1;
904                }
905            }
906            return slides[next];
907        };
908
909        this.items = function(prev, next, move) {
910            var prevItem = { x: 0, y: 0 };
911            var nextItem = { x: 0, y: 0 };
912            var isDirectionNext = direction === "next";
913            if (motion === "horizontal") {
914                nextItem.x = isDirectionNext ? width : -width;
915                nextItem.y = 0;
916                if (move) {
917                    prevItem.x += isDirectionNext ? -width : width;
918                    nextItem.x += isDirectionNext ? -width : width;
919                }
920            } else if (motion === "vertical") {
921                nextItem.x = 0;
922                nextItem.y = isDirectionNext ? height : -height;
923                if (move) {
924                    prevItem.y += isDirectionNext ? -height : height;
925                    nextItem.y += isDirectionNext ? -height : height;
926                }
927            }
928            var result = [ ];
929            if (!!prev) {
930                result.push({ images: prev.images, positions: getCssPositions(prev.positions, prevItem), sizes: prev.sizes });
931            }
932            if (!!next) {
933                result.push({ images: next.images, positions: getCssPositions(next.positions, nextItem), sizes: next.sizes });
934            }
935            
936            if (direction === "next") {
937                result.reverse();
938            }
939
940            return result;
941        };
942
943        this.transition = function(container, on) {
944            container.css($.support.transition.prefix + "transition", on ? transitionDuration + " ease-in-out background-position" : "");
945        };
946        
947        function getCssPositions(positions, offset) {
948            var result = [];
949            if (positions === undefined) {
950                return "";
951            }
952            offset.x = offset.x || 0;
953            offset.y = offset.y || 0;
954            for (var i = 0; i < positions.length; i++) {
955                result.push((positions[i].x * multiplier + offset.x) + "px " + (positions[i].y * multiplier + offset.y) + "px");
956            }
957            return result.join(", ");
958        }
959    };
960
961
962    var Slider = function (element, settings) {
963
964        var interval = null;
965        var active = false;
966        var children = element.find(".active").parent().children();
967        var last = false;
968        var running = false;
969
970        this.settings = $.extend({ }, {
971            "animation": "horizontal",
972            "direction": "next",
973            "speed": 600,
974            "pause": 2500,
975            "auto": true,
976            "repeat": true,
977            "navigator": null,
978            "clickevents": true,
979            "hover": true,
980            "helper": null
981        }, settings);
982
983        this.move = function (direction, next) {
984            var activeItem = element.find(".active"),
985                nextItem = next || activeItem[direction](),
986                innerDirection = this.settings.direction === "next" ? "forward" : "back",
987                reset = direction === "next" ? "first" : "last",
988                moving = interval,
989                slider = this, tmp;
990
991            active = true;
992
993            if (moving) { this.stop(true); }
994
995            if (!nextItem.length) {
996                nextItem = element.find(".slide-item")[reset]();
997                if (!this.settings.repeat) { last = true; active = false; return; }
998            }
999
1000            if ($.support.transition) {
1001                nextItem.addClass(this.settings.direction);
1002                tmp = nextItem.get(0).offsetHeight;
1003                
1004                activeItem.addClass(innerDirection);
1005                nextItem.addClass(innerDirection);
1006                
1007                element.trigger("beforeSlide", children.length);
1008                
1009                element.one($.support.transition.event, function () {
1010                    nextItem.removeClass(slider.settings.direction)
1011                        .removeClass(innerDirection)
1012                        .addClass("active");
1013                    activeItem.removeClass("active")
1014                        .removeClass(innerDirection);
1015                    active = false;
1016                    setTimeout(function () {
1017                        element.trigger("afterSlide", children.length);
1018                    }, 0);
1019                });
1020            } else {
1021                element.trigger("beforeSlide", children.length);
1022                
1023                activeItem.removeClass("active");
1024                nextItem.addClass("active");
1025                active = false;
1026                
1027                element.trigger("afterSlide", children.length);
1028            }
1029
1030            this.navigate(nextItem);
1031
1032            if (moving) { this.start(); }
1033        };
1034
1035        this.navigate = function (position) {
1036            var index = children.index(position);
1037            $(this.settings.navigator).children().removeClass("active").eq(index).addClass("active");
1038        };
1039
1040        this.to = function (index) {
1041            var activeItem = element.find(".active"),
1042                children = activeItem.parent().children(),
1043                activeIndex = children.index(activeItem),
1044                slider = this;
1045
1046            if (index > (children.length - 1) || index < 0) {
1047                return;
1048            }
1049
1050            if (active) {
1051                return element.one("afterSlide", function () {
1052                    slider.to(index);
1053                });
1054            }
1055            
1056            if (activeIndex === index) {
1057                return;
1058            }
1059
1060            this.move(index > activeIndex ? "next" : "prev", $(children[index]));
1061        };
1062
1063        this.next = function () {
1064            if (!active) {
1065                if (last) { this.stop(); return;  }
1066                this.move("next");
1067            }
1068        };
1069
1070        this.prev = function () {
1071            if (!active) {
1072                if (last) { this.stop(); return; }
1073                this.move("prev");
1074            }
1075        };
1076
1077        this.start = function (force) {
1078            if (!!force) {
1079                setTimeout($.proxy(this.next, this), 10);
1080            }
1081            interval = setInterval($.proxy(this.next, this), this.settings.pause);
1082            running = true;
1083        };
1084
1085        this.stop = function (pause) {
1086            clearInterval(interval);
1087            interval = null;
1088            running = !!pause;
1089            active = false;
1090        };
1091
1092        this.active = function () {
1093            return running;
1094        };
1095
1096        this.moving = function () {
1097            return active;
1098        };
1099        
1100        this.navigate(children.filter(".active"));
1101
1102        if (this.settings.clickevents) {
1103            $(this.settings.navigator).on("click", "a", { slider: this }, function (event) {
1104                var activeIndex = children.index(children.filter(".active"));
1105                var index = $(this).parent().children().index($(this));
1106                if (activeIndex !== index) {
1107                    event.data.slider.to(index);
1108                }
1109                event.preventDefault();
1110            });
1111        }
1112        
1113        if (this.settings.hover) {
1114            var slider = this;
1115            element.add(this.settings.navigator)
1116                   .add(element.siblings(".shapes")).hover(function () {
1117                if (element.is(":visible") && !last) { slider.stop(true); }
1118            }, function () {
1119                if (element.is(":visible") && !last) { slider.start(); }
1120            });
1121        }
1122    };
1123
1124    $.fn.slider = function (arg) {
1125        return this.each(function () {
1126            var element = $(this),
1127                data = element.data("slider"),
1128                options = typeof arg === "object" && arg;
1129
1130            if (!data) {
1131                data = new Slider(element, options);
1132                element.data("slider", data);
1133            }
1134            
1135            if (typeof arg === "string" && data[arg]) {
1136                data[arg]();
1137            } else if (data.settings.auto && element.is(":visible")) {
1138                data.start();
1139            }
1140        });
1141    };
1142
1143})(jQuery);
1144
1145
1146
1147
1148jQuery(function ($) {
1149    "use strict";
1150    if (!browser.ie || browser.version > 8)
1151        return;
1152    var path = "";
1153    var scripts = $("script[src*='script.js']");
1154    if (scripts.length > 0) {
1155        var src = scripts.last().attr('src');
1156        path = src.substr(0, src.indexOf("script.js"));
1157    }
1158    processHeaderMultipleBg(path);
1159});
1160
1161var processHeaderMultipleBg = (function ($) {
1162    "use strict";
1163    return (function (path) {
1164        var header = $(".header");
1165        var bgimages = "".split(",");
1166        var bgpositions = "".split(",");
1167        for (var i = bgimages.length - 1; i >= 0; i--) {
1168            var bgimage = $.trim(bgimages[i]);
1169            if (bgimage === "")
1170                continue;
1171            if (path !== "") {
1172                bgimage = bgimage.replace(/(url\(['"]?)/i, "$1" + path);
1173            }
1174            header.append("<div style=\"position:absolute;top:0;left:0;width:100%;height:100%;background:" + bgimage + " " + bgpositions[i] + " no-repeat\">");
1175        }
1176        header.css('background-image', "url('images/header.png')".replace(/(url\(['"]?)/i, "$1" + path));
1177        header.css('background-position', "0 0");
1178    });
1179})(jQuery);
1180
1181(function ($) {
1182    'use strict';
1183
1184    /*global jQuery, artButtonSetup */
1185
1186    $(function () {
1187        artButtonSetup("btn-primary");
1188        artButtonSetup("button");
1189        artButtonSetup("readon");
1190        artButtonSetup("readmore");
1191    });
1192
1193    $(function ($) {
1194        var links = $('a.rss-tag-icon[href="#"], a.rss-tag-icon[href=""]'),
1195            href = $('head link[type="application/rss+xml"]').attr('href');
1196        if (href) {
1197            links.attr('href', href);
1198        } else {
1199            links.hide();
1200        }
1201    });
1202
1203    $(function ($) {
1204        $('.messages').each(function () {
1205            $(this).css('display', $(this).find('dl, .alert').length ? '' : 'none');
1206        });
1207    });
1208
1209    $(function ($) {
1210        $('.search-button').each(function (i, val) {
1211            var element = $(val),
1212                background = element.css('background-image');
1213
1214            if (-1 !== background.indexOf('url')) {
1215                element.val('');
1216            }
1217            if (element.hasClass('button')) {
1218                element.removeClass('button');
1219            }
1220        });
1221    });
1222
1223    $(function ($) {
1224        // ie < 9 slider multiple background joomla fix
1225        if (!browser.ie || browser.version > 8) {
1226            return;
1227        }
1228
1229        var scriptSrc = jQuery('script[src*="script.js"]').last().attr('src'),
1230            pathToImages = scriptSrc.substr(0, scriptSrc.lastIndexOf('/') + 1) + 'data/images/';
1231
1232        $('.slider .slide-item').each(function () {
1233            var bg = $(this).css('background-image');
1234            if (bg) {
1235                bg = bg.replace(/url\(["'](.+)["']\)/, function (match, path) {
1236                    var imageName = path.substr(path.lastIndexOf('/') + 1);
1237                    return 'url(\'' + pathToImages + imageName + '\')';
1238                });
1239                $(this).css('background-image', bg);
1240            }
1241        });
1242    });
1243
1244}(jQuery));

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.