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 $('.art-slider .art-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 $('.art-shapes').css('z-index', 1); 217 218 // ie7 219 if (!browser.ie || browser.version > 7) return; 220 var textblockTexts = $('.art-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 += "&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 $(".art-slider").each(function () { 286 var slider = $(this); 287 var sliderWidth = slider.width(); 288 var nav = slider.siblings(".art-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 = $(".art-sheet").offset().left; 309 $("header.art-header #art-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.art-nav').addClass("desktop-nav"); 319}); 320 321 322jQuery(function ($) { 323 "use strict"; 324 if (!browser.ie || browser.version > 7) { 325 return; 326 } 327 $('ul.art-hmenu>li:not(:first-child)').each(function () { $(this).prepend('<span class="art-hmenu-separator"> </span>'); }); 328}); 329 330jQuery(function ($) { 331 "use strict"; 332 $("ul.art-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.art-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.art-sheet", 370 defaultContainer: "#art-main", 371 menuClass: "art-hmenu", 372 leftToRightClass: "art-hmenu-left-to-right", 373 rightToLeftClass: "art-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 410jQuery(function ($) { 411 'use strict'; 412 413 if (browser.ie && browser.version < 8) { 414 $(window).bind('resize', function() { 415 var c = $('div.art-content'); 416 var s = c.parent().children('.art-layout-cell:not(.art-content)'); 417 var w = 0; 418 c.hide(); 419 s.each(function() { w += $(this).outerWidth(true); }); 420 c.w = c.parent().width(); c.css('width', c.w - w + 'px'); 421 c.show(); 422 }); 423 } 424 425 $(window).trigger('resize'); 426}); 427 428jQuery(function($) { 429 "use strict"; 430 if (!$('html').hasClass('ie7')) { 431 return; 432 } 433 $('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>'); }); 434}); 435 436 437 438var artButtonSetup = (function ($) { 439 'use strict'; 440 return (function (className) { 441 $.each($("a." + className + ", button." + className + ", input." + className), function (i, val) { 442 var b = $(val); 443 if (!b.hasClass('art-button')) { 444 b.addClass('art-button'); 445 } 446 if (b.is('input')) { 447 b.val(b.val().replace(/^\s*/, '')).css('zoom', '1'); 448 } 449 b.mousedown(function () { 450 var b = $(this); 451 b.addClass("active"); 452 }); 453 b.mouseup(function () { 454 var b = $(this); 455 if (b.hasClass('active')) { 456 b.removeClass('active'); 457 } 458 }); 459 b.mouseleave(function () { 460 var b = $(this); 461 if (b.hasClass('active')) { 462 b.removeClass('active'); 463 } 464 }); 465 }); 466 });
467})(jQuery); 468jQuery(function () { 469 'use strict'; 470 artButtonSetup("art-button"); 471}); 472 473var Control = (function ($) { 474 'use strict'; 475 return (function () { 476 this.init = function(label, type, callback) { 477 var chAttr = label.find('input[type="' +type + '"]').attr('checked'); 478 if (chAttr === 'checked') { 479 label.addClass('art-checked'); 480 } 481 482 label.mouseleave(function () { 483 $(this).removeClass('hovered').removeClass('active'); 484 }); 485 label.mouseover(function () { 486 $(this).addClass('hovered').removeClass('active'); 487 }); 488 label.mousedown(function (event) { 489 if (event.which !== 1) { 490 return; 491 } 492 $(this).addClass('active').removeClass('hovered'); 493 }); 494 label.mouseup(function (event) { 495 if (event.which !== 1) { 496 return; 497 } 498 callback.apply(this); 499 $(this).removeClass('active').addClass('hovered'); 500 }); 501 }; 502 }); 503})(jQuery); 504 505 506jQuery(function ($) { 507 'use strict'; 508 $('.art-pager').contents().filter( 509 function () { 510 return this.nodeType === this.TEXT_NODE; 511 } 512 ).remove(); 513}); 514var fixRssIconLineHeight = (function ($) { 515 "use strict"; 516 return function (className) { 517 $("." + className).css("line-height", $("." + className).height() + "px"); 518 }; 519})(jQuery); 520 521jQuery(function ($) { 522 "use strict"; 523 var rssIcons = $(".art-rss-tag-icon"); 524 if (rssIcons.length){ 525 fixRssIconLineHeight("art-rss-tag-icon"); 526 if (browser.ie && browser.version < 9) { 527 rssIcons.each(function () { 528 if ($.trim($(this).html()) === "") { 529 $(this).css("vertical-align", "middle"); 530 } 531 }); 532 } 533 } 534}); 535var ThemeLightbox = (function ($) { 536 'use strict'; 537 return (function () { 538 var images = $(".art-lightbox"); 539 var current; 540 this.init = function (ctrl) { 541 $(".art-lightbox").mouseup({ _ctrl: ctrl }, function (e) { 542 if ((e.data._ctrl === true && !e.ctrlKey) || (e.which && e.which !== 1)) { 543 return; 544 } 545 546 images = $(".art-lightbox"); 547 548 current = images.index(this); 549 550 var imgContainer = $('.art-lightbox-wrapper'); 551 if (imgContainer.length === 0) {
552 imgContainer = $('<div class="art-lightbox-wrapper">').css('line-height', $(window).height() + "px") 553 .appendTo($("body")); 554 555 var closeBtn = $('<div class="close"><div class="cw"> </div><div class="ccw"> </div><div class="close-alt">✗</div></div>') 556 .click(close); 557 closeBtn.appendTo(imgContainer); 558 showArrows(); 559 } 560 561 move(current); 562 }); 563 }; 564 565 function move(index) { 566 if (index < 0 || index >= images.length) { 567 return; 568 } 569 570 showError(false); 571 572 current = index; 573 574 $(".art-lightbox-wrapper .art-lightbox-image:not(.active)").remove(); 575 576 var active = $(".art-lightbox-wrapper .active"); 577 var target = $('<img class="art-lightbox-image" alt="" src="' + getFullImgSrc($(images[current]).attr("src")) + '" />').click(function () { 578 if ($(this).hasClass("active")) { 579 move(current + 1); 580 } 581 }); 582 583 if (active.length > 0) { 584 active.after(target); 585 } else { 586 $(".art-lightbox-wrapper").append(target); 587 } 588 589 showArrows(); 590 showLoader(true); 591 592 bindMouse($(".art-lightbox-wrapper").add(target)); 593 594 target.load(function () { 595 showLoader(false); 596 597 active.removeClass("active"); 598 target.addClass("active"); 599 }); 600 601 target.error(function () { 602 showLoader(false); 603 active.removeClass("active"); 604 target.addClass("active"); 605 target.attr("src", $(images[current]).attr("src")); 606 }); 607 } 608 609 function showArrows() { 610 if ($(".art-lightbox-wrapper .arrow").length === 0) { 611 $(".art-lightbox-wrapper").append( 612 $('<div class="arrow left"><div class="arrow-t ccw"> </div><div class="arrow-b cw"> </div><div class="arrow-left-alt">←</div></div>') 613 .css("top", $(window).height() / 2 - 40) 614 .click(function () { 615 if (!$(this).hasClass("disabled")) { 616 move(current - 1); 617 } 618 }) 619 ); 620 $(".art-lightbox-wrapper").append( 621 $('<div class="arrow right"><div class="arrow-t cw"> </div><div class="arrow-b ccw"> </div><div class="arrow-right-alt">→</div></div>') 622 .css("top", $(window).height() / 2 - 40) 623 .click(function () { 624 if (!$(this).hasClass("disabled")) { 625 move(current + 1); 626 } 627 }) 628 ); 629 } 630 631 if (current === 0) { 632 $(".art-lightbox-wrapper .arrow.left").addClass("disabled"); 633 } else { 634 $(".art-lightbox-wrapper .arrow.left").removeClass("disabled"); 635 } 636 637 if (current === images.length - 1) { 638 $(".art-lightbox-wrapper .arrow.right").addClass("disabled"); 639 } else { 640 $(".art-lightbox-wrapper .arrow.right").removeClass("disabled"); 641 } 642 } 643 644 function showError(enable) { 645 if (enable) { 646 $(".art-lightbox-wrapper").append($('<div class="lightbox-error">The requested content cannot be loaded.<br/>Please try again later.</div>') 647 .css({ "top": $(window).height() / 2 - 60, "left": $(window).width() / 2 - 170 })); 648 } else { 649 $(".art-lightbox-wrapper .lightbox-error").remove(); 650 } 651 } 652 653 function showLoader(enable) { 654 if (!enable) { 655 $(".art-lightbox-wrapper .loading").remove(); 656 } 657 else { 658 $('<div class="loading"> </div>').css({ "top": $(window).height() / 2 - 16, "left": $(window).width() / 2 - 16 }).appendTo($(".art-lightbox-wrapper")); 659 } 660 } 661 662 var close = function () { 663 $(".art-lightbox-wrapper").remove(); 664 }; 665 666 function bindMouse(img) { 667 img.bind('mousewheel DOMMouseScroll', function (e) { 668 var orgEvent = window.event || e.originalEvent; 669 var delta = (orgEvent.wheelDelta ? orgEvent.wheelDelta : orgEvent.detail * -1) > 0 ? 1 : -1; 670 move(current + delta); 671 e.preventDefault(); 672 }).mousedown(function (e) { 673 // close on middle button click 674 if (e.which === 2) { 675 close(); 676 } 677 e.preventDefault(); 678 }); 679 } 680 681 function getFullImgSrc(src) { 682 var fileName = src.substring(0, src.lastIndexOf('.')); 683 var ext = src.substring(src.lastIndexOf('.')); 684 return fileName + "-large" + ext; 685 } 686 687 });
688})(jQuery); 689 690jQuery(function () { 691 'use strict'; 692 new ThemeLightbox().init(); 693}); 694 695(function($) { 696 'use strict'; 697 // transition && transitionEnd && browser prefix 698 $.support.transition = (function() { 699 var thisBody = document.body || document.documentElement, 700 thisStyle = thisBody.style, 701 support = thisStyle.transition !== undefined || 702 thisStyle.WebkitTransition !== undefined || 703 thisStyle.MozTransition !== undefined || 704 thisStyle.MsTransition !== undefined || 705 thisStyle.OTransition !== undefined; 706 return support && { 707 event: (function() { 708 var e = "transitionend"; 709 if (browser.opera) { 710 var version = browser.version; 711 e = version >= 12 ? (version < 12.50 ? "otransitionend" : "transitionend") : "oTransitionEnd"; 712 } else if (browser.chrome || browser.safari) { 713 e = "webkitTransitionEnd"; 714 } 715 return e; 716 })(), 717 prefix: (function() { 718 return ({ 719 opera: "-o-", 720 firefox: "-moz-", 721 chrome: "-webkit-", 722 safari: "-webkit-", 723 ie: "-ms-" 724 }[browser.name]); 725 })() 726 }; 727 })(); 728 729 window.BackgroundHelper = function () { 730 var slides = []; 731 var direction = "next"; 732 var motion = "horizontal"; 733 var width = 0; 734 var height = 0; 735 var multiplier = 1; 736 var transitionDuration = ""; 737 738 this.init = function(motionType, dir, duration) { 739 direction = dir; 740 motion = motionType; 741 slides = []; 742 width = 0; 743 height = 0; 744 multiplier = 1; 745 transitionDuration = duration; 746 }; 747 748 this.processSlide = function(element, modify) { 749 this.updateSize(element, null); 750 var pos = []; 751 752 var bgPosition = element.css("background-position"); 753 var positions = bgPosition.split(","); 754 $.each(positions, function (i) { 755 var position = $.trim(this); 756 var point = position.split(" "); 757 if (point.length > 1) { 758 var x = parseInt(point[0], 10); 759 var y = parseInt(point[1], 10); 760 pos.push({ x: x, y: y }); 761 } 762 }); 763 764 slides.push({ 765 "images": element.css("background-image"), 766 "sizes": element.css("background-size"), 767 "positions": pos 768 }); 769 770 if (modify) 771 element.css("background-image", "none"); 772 }; 773 774 this.updateSize = function (element, initialSize) { 775 width = element.outerWidth(false); 776 height = element.outerHeight(); 777 if (initialSize && parseInt(initialSize.width, 10) !== 0) { 778 multiplier = width / initialSize.width; 779 if (motion === "fade") { 780 $.each(element.children(), function (i) { 781 $(this).css("background-position", getCssPositions(slides[i].positions, { x: 0, y: 0 })); 782 }); 783 } 784 } 785 }; 786 787 this.setBackground = function(element, items) { 788 var bg = []; 789 var sizes = []; 790 $.each(items, function (i, o) { 791 bg.push(o.images); 792 sizes.push(o.sizes); 793 }); 794 element.css({ 795 "background-image": bg.join(", "), 796 "background-size": sizes.join(", "), 797 "background-repeat": "no-repeat" 798 }); 799 }; 800 801 this.setPosition = function(element, items) { 802 var pos = []; 803 $.each(items, function(i, o) { 804 pos.push(o.positions); 805 }); 806 element.css({ 807 "background-position": pos.join(", ") 808 }); 809 }; 810 811 this.current = function(index) { 812 return slides[index] || null; 813 }; 814 815 this.next = function(index) { 816 var next; 817 if (direction === "next") { 818 next = (index + 1) % slides.length; 819 } else { 820 next = index - 1; 821 if (next < 0) { 822 next = slides.length - 1; 823 } 824 } 825 return slides[next]; 826 }; 827 828 this.items = function(prev, next, move) { 829 var prevItem = { x: 0, y: 0 }; 830 var nextItem = { x: 0, y: 0 }; 831 var isDirectionNext = direction === "next"; 832 if (motion === "horizontal") { 833 nextItem.x = isDirectionNext ? width : -width; 834 nextItem.y = 0; 835 if (move) { 836 prevItem.x += isDirectionNext ? -width : width; 837 nextItem.x += isDirectionNext ? -width : width; 838 } 839 } else if (motion === "vertical") { 840 nextItem.x = 0; 841 nextItem.y = isDirectionNext ? height : -height; 842 if (move) { 843 prevItem.y += isDirectionNext ? -height : height; 844 nextItem.y += isDirectionNext ? -height : height; 845 } 846 } 847 var result = [ ]; 848 if (!!prev) { 849 result.push({ images: prev.images, positions: getCssPositions(prev.positions, prevItem), sizes: prev.sizes }); 850 } 851 if (!!next) { 852 result.push({ images: next.images, positions: getCssPositions(next.positions, nextItem), sizes: next.sizes }); 853 } 854 855 if (direction === "next") { 856 result.reverse(); 857 } 858 859 return result; 860 }; 861 862 this.transition = function(container, on) { 863 container.css($.support.transition.prefix + "transition", on ? transitionDuration + " ease-in-out background-position" : ""); 864 }; 865 866 function getCssPositions(positions, offset) { 867 var result = []; 868 if (positions === undefined) { 869 return ""; 870 } 871 offset.x = offset.x || 0; 872 offset.y = offset.y || 0; 873 for (var i = 0; i < positions.length; i++) { 874 result.push((positions[i].x * multiplier + offset.x) + "px " + (positions[i].y * multiplier + offset.y) + "px"); 875 } 876 return result.join(", "); 877 } 878 }; 879 880 881 var Slider = function (element, settings) { 882 883 var interval = null; 884 var active = false; 885 var children = element.find(".active").parent().children();
886 var last = false; 887 var running = false; 888 889 this.settings = $.extend({ }, { 890 "animation": "horizontal", 891 "direction": "next", 892 "speed": 600, 893 "pause": 2500, 894 "auto": true, 895 "repeat": true, 896 "navigator": null, 897 "clickevents": true, 898 "hover": true, 899 "helper": null 900 }, settings); 901 902 this.move = function (direction, next) { 903 var activeItem = element.find(".active"), 904 nextItem = next || activeItem[direction](), 905 innerDirection = this.settings.direction === "next" ? "forward" : "back", 906 reset = direction === "next" ? "first" : "last", 907 moving = interval, 908 slider = this, tmp; 909 910 active = true; 911 912 if (moving) { this.stop(true); } 913 914 if (!nextItem.length) { 915 nextItem = element.find(".art-slide-item")[reset](); 916 if (!this.settings.repeat) { last = true; active = false; return; } 917 } 918 919 if ($.support.transition) { 920 nextItem.addClass(this.settings.direction); 921 tmp = nextItem.get(0).offsetHeight; 922 923 activeItem.addClass(innerDirection); 924 nextItem.addClass(innerDirection); 925
926 element.trigger("beforeSlide", children.length); 927 928 element.one($.support.transition.event, function () { 929 nextItem.removeClass(slider.settings.direction) 930 .removeClass(innerDirection) 931 .addClass("active"); 932 activeItem.removeClass("active") 933 .removeClass(innerDirection); 934 active = false; 935 setTimeout(function () { 936 element.trigger("afterSlide", children.length); 937 }, 0); 938 }); 939 } else { 940 element.trigger("beforeSlide", children.length); 941 942 activeItem.removeClass("active"); 943 nextItem.addClass("active"); 944 active = false; 945 946 element.trigger("afterSlide", children.length); 947 } 948 949 this.navigate(nextItem); 950 951 if (moving) { this.start(); } 952 }; 953 954 this.navigate = function (position) { 955 var index = children.index(position); 956 $(this.settings.navigator).children().removeClass("active").eq(index).addClass("active"); 957 }; 958 959 this.to = function (index) { 960 var activeItem = element.find(".active"), 961 children = activeItem.parent().children(), 962 activeIndex = children.index(activeItem), 963 slider = this; 964 965 if (index > (children.length - 1) || index < 0) { 966 return; 967 } 968 969 if (active) { 970 return element.one("afterSlide", function () { 971 slider.to(index); 972 }); 973 } 974 975 if (activeIndex === index) { 976 return; 977 } 978 979 this.move(index > activeIndex ? "next" : "prev", $(children[index])); 980 }; 981 982 this.next = function () { 983 if (!active) { 984 if (last) { this.stop(); return; } 985 this.move("next"); 986 } 987 }; 988 989 this.prev = function () { 990 if (!active) { 991 if (last) { this.stop(); return; } 992 this.move("prev"); 993 } 994 }; 995 996 this.start = function (force) { 997 if (!!force) { 998 setTimeout($.proxy(this.next, this), 10); 999 } 1000 interval = setInterval($.proxy(this.next, this), this.settings.pause); 1001 running = true; 1002 }; 1003 1004 this.stop = function (pause) { 1005 clearInterval(interval); 1006 interval = null; 1007 running = !!pause; 1008 active = false; 1009 }; 1010 1011 this.active = function () { 1012 return running; 1013 }; 1014 1015 this.moving = function () { 1016 return active; 1017 }; 1018 1019 this.navigate(children.filter(".active")); 1020 1021 if (this.settings.clickevents) { 1022 $(this.settings.navigator).on("click", "a", { slider: this }, function (event) { 1023 var activeIndex = children.index(children.filter(".active")); 1024 var index = $(this).parent().children().index($(this)); 1025 if (activeIndex !== index) { 1026 event.data.slider.to(index); 1027 } 1028 event.preventDefault(); 1029 }); 1030 } 1031 1032 if (this.settings.hover) { 1033 var slider = this; 1034 element.add(this.settings.navigator) 1035 .add(element.siblings(".art-shapes")).hover(function () { 1036 if (element.is(":visible") && !last) { slider.stop(true); } 1037 }, function () { 1038 if (element.is(":visible") && !last) { slider.start(); } 1039 }); 1040 } 1041 }; 1042 1043 $.fn.slider = function (arg) { 1044 return this.each(function () { 1045 var element = $(this), 1046 data = element.data("slider"), 1047 options = typeof arg === "object" && arg; 1048 1049 if (!data) { 1050 data = new Slider(element, options); 1051 element.data("slider", data); 1052 } 1053 1054 if (typeof arg === "string" && data[arg]) { 1055 data[arg](); 1056 } else if (data.settings.auto && element.is(":visible")) { 1057 data.start(); 1058 } 1059 }); 1060 }; 1061 1062})(jQuery); 1063 1064 1065 1066 1067jQuery(function ($) { 1068 "use strict"; 1069 if (!browser.ie || browser.version > 8) 1070 return; 1071 var path = ""; 1072 var scripts = $("script[src*='script.js']"); 1073 if (scripts.length > 0) {
1074 var src = scripts.last().attr('src'); 1075 path = src.substr(0, src.indexOf("script.js")); 1076 } 1077 processHeaderMultipleBg(path); 1078}); 1079 1080var processHeaderMultipleBg = (function ($) { 1081 "use strict"; 1082 return (function (path) { 1083 var header = $(".art-header"); 1084 var bgimages = "url('images/object1730012720.png'),url('images/object294782820.png'), ".split(","); 1085 var bgpositions = "380px 15px,32px 13px, ".split(","); 1086 for (var i = bgimages.length - 1; i >= 0; i--) { 1087 var bgimage = $.trim(bgimages[i]); 1088 if (bgimage === "") 1089 continue; 1090 if (path !== "") { 1091 bgimage = bgimage.replace(/(url\(['"]?)/i, "$1" + path); 1092 } 1093 header.append("<div style=\"position:absolute;top:0;left:0;width:100%;height:100%;background:" + bgimage + " " + bgpositions[i] + " no-repeat\">"); 1094 } 1095 header.css('background-image', "url('images/header.jpg')".replace(/(url\(['"]?)/i, "$1" + path)); 1096 header.css('background-position', "0 0"); 1097 }); 1098})(jQuery); 1099 1100(function ($) { 1101 'use strict'; 1102 1103 /*global jQuery, artButtonSetup */ 1104 1105 $(function () { 1106 artButtonSetup("btn-primary"); 1107 artButtonSetup("button"); 1108 artButtonSetup("readon"); 1109 artButtonSetup("readmore"); 1110 }); 1111 1112 $(function ($) { 1113 var links = $('a.art-rss-tag-icon[href="#"], a.art-rss-tag-icon[href=""]'), 1114 href = $('head link[type="application/rss+xml"]').attr('href'); 1115 if (href) { 1116 links.attr('href', href); 1117 } else { 1118 links.hide(); 1119 } 1120 }); 1121 1122 $(function ($) { 1123 $('.art-messages').each(function () { 1124 $(this).css('display', $(this).find('dl, .alert').length ? '' : 'none'); 1125 }); 1126 }); 1127 1128 $(function ($) { 1129 $('.art-search-button').each(function (i, val) { 1130 var element = $(val), 1131 background = element.css('background-image'); 1132 1133 if (-1 !== background.indexOf('url')) { 1134 element.val(''); 1135 } 1136 if (element.hasClass('art-button')) { 1137 element.removeClass('art-button'); 1138 } 1139 }); 1140 }); 1141 1142 $(function ($) { 1143 // ie < 9 slider multiple background joomla fix 1144 if (!browser.ie || browser.version > 8) { 1145 return; 1146 } 1147 1148 var scriptSrc = jQuery('script[src*="script.js"]').last().attr('src'), 1149 pathToImages = scriptSrc.substr(0, scriptSrc.lastIndexOf('/') + 1) + 'data/images/'; 1150 1151 $('.art-slider .art-slide-item').each(function () { 1152 var bg = $(this).css('background-image'); 1153 if (bg) { 1154 bg = bg.replace(/url\(["'](.+)["']\)/, function (match, path) { 1155 var imageName = path.substr(path.lastIndexOf('/') + 1); 1156 return 'url(\'' + pathToImages + imageName + '\')'; 1157 }); 1158 $(this).css('background-image', bg); 1159 } 1160 }); 1161 }); 1162 1163}(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.