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