1 2/** 3 * Name: Highslide JS 4 * Version: 4.1.12 (2011-03-28) 5 * Config: default 6 * Author: Torstein Hønsi 7 * Support: www.highslide.com/support 8 * License: www.highslide.com/#license 9 */ 10if (!hs) { var hs = { 11// Language strings 12lang : { 13 cssDirection: 'ltr', 14 loadingText : 'Loading...', 15 loadingTitle : 'Click to cancel', 16 focusTitle : 'Click to bring to front', 17 fullExpandTitle : 'Expand to actual size (f)', 18 creditsText : 'Intercup (c)', 19 creditsTitle : 'Na úvodnà stranu Intercupu', 20 restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.' 21}, 22// See http://highslide.com/ref for examples of settings 23captionEval : 'this.a.title', 24graphicsDir : 'https://www.intercup.cz/highslide/graphics/', 25expandCursor : 'zoomin.cur', // null disables 26restoreCursor : 'zoomout.cur', // null disables 27expandDuration : 250, // milliseconds 28restoreDuration : 250, 29marginLeft : 15, 30marginRight : 15, 31marginTop : 15, 32marginBottom : 15, 33zIndexCounter : 1001, // adjust to other absolutely positioned elements 34loadingOpacity : 0.75, 35allowMultipleInstances: true, 36numberOfImagesToPreload : 5, 37outlineWhileAnimating : 2, // 0 = never, 1 = always, 2 = HTML only 38outlineStartOffset : 3, // ends at 10 39padToMinWidth : false, // pad the popup width to make room for wide caption 40fullExpandPosition : 'bottom right', 41fullExpandOpacity : 1, 42showCredits : true, // you can set this to false if you want 43creditsHref : 'https://www.intercup.cz/', 44creditsTarget : '_self', 45enableKeyListener : true, 46openerTagNames : ['a'], // Add more to allow slideshow indexing 47 48dragByHeading: true, 49minWidth: 200, 50minHeight: 200, 51allowSizeReduction: true, // allow the image to reduce to fit client size. If false, this overrides minWidth and minHeight 52outlineType : 'drop-shadow', // set null to disable outlines 53// END OF YOUR SETTINGS 54 55 56// declare internal properties 57preloadTheseImages : [], 58continuePreloading: true, 59expanders : [], 60overrides : [ 61 'allowSizeReduction', 62 'useBox', 63 'outlineType', 64 'outlineWhileAnimating', 65 'captionId', 66 'captionText', 67 'captionEval', 68 'captionOverlay', 69 'headingId', 70 'headingText', 71 'headingEval', 72 'headingOverlay', 73 'creditsPosition', 74 'dragByHeading', 75 76 'width', 77 'height', 78 79 'wrapperClassName', 80 'minWidth', 81 'minHeight', 82 'maxWidth', 83 'maxHeight', 84 'pageOrigin', 85 'slideshowGroup', 86 'easing', 87 'easingClose', 88 'fadeInOut', 89 'src' 90], 91overlays : [], 92idCounter : 0, 93oPos : { 94 x: ['leftpanel', 'left', 'center', 'right', 'rightpanel'], 95 y: ['above', 'top', 'middle', 'bottom', 'below'] 96}, 97mouse: {}, 98headingOverlay: {}, 99captionOverlay: {}, 100timers : [], 101 102pendingOutlines : {}, 103clones : {}, 104onReady: [], 105uaVersion: /Trident\/4\.0/.test(navigator.userAgent) ? 8 : 106 parseFloat((navigator.userAgent.toLowerCase().match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1]), 107ie : (document.all && !window.opera), 108//ie : navigator && /MSIE [678]/.test(navigator.userAgent), // ie9 compliant? 109safari : /Safari/.test(navigator.userAgent), 110geckoMac : /Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent), 111 112$ : function (id) { 113 if (id) return document.getElementById(id); 114}, 115 116push : function (arr, val) { 117 arr[arr.length] = val; 118}, 119 120createElement : function (tag, attribs, styles, parent, nopad) { 121 var el = document.createElement(tag); 122 if (attribs) hs.extend(el, attribs); 123 if (nopad) hs.setStyles(el, {padding: 0, border: 'none', margin: 0}); 124 if (styles) hs.setStyles(el, styles); 125 if (parent) parent.appendChild(el); 126 return el; 127}, 128 129extend : function (el, attribs) { 130 for (var x in attribs) el[x] = attribs[x]; 131 return el; 132}, 133 134setStyles : function (el, styles) { 135 for (var x in styles) { 136 if (hs.ieLt9 && x == 'opacity') { 137 if (styles[x] > 0.99) el.style.removeAttribute('filter'); 138 else el.style.filter = 'alpha(opacity='+ (styles[x] * 100) +')'; 139 } 140 else el.style[x] = styles[x]; 141 } 142}, 143animate: function(el, prop, opt) { 144 var start, 145 end, 146 unit; 147 if (typeof opt != 'object' || opt === null) { 148 var args = arguments; 149 opt = { 150 duration: args[2], 151 easing: args[3], 152 complete: args[4] 153 }; 154 } 155 if (typeof opt.duration != 'number') opt.duration = 250; 156 opt.easing = Math[opt.easing] || Math.easeInQuad; 157 opt.curAnim = hs.extend({}
157, prop); 158 for (var name in prop) { 159 var e = new hs.fx(el, opt , name ); 160 161 start = parseFloat(hs.css(el, name)) || 0; 162 end = parseFloat(prop[name]); 163 unit = name != 'opacity' ? 'px' : ''; 164 165 e.custom( start, end, unit ); 166 } 167}, 168css: function(el, prop) { 169 if (el.style[prop]) { 170 return el.style[prop]; 171 } else if (document.defaultView) { 172 return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop); 173 174 } else { 175 if (prop == 'opacity') prop = 'filter'; 176 var val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b){ return b.toUpperCase(); })]; 177 if (prop == 'filter') 178 val = val.replace(/alpha\(opacity=([0-9]+)\)/, 179 function (a, b) { return b / 100 }); 180 return val === '' ? 1 : val; 181 } 182}, 183 184getPageSize : function () { 185 var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat' 186 ? d.documentElement : d.body; 187 188 var width = hs.ieLt9 ? iebody.clientWidth : 189 (d.documentElement.clientWidth || self.innerWidth), 190 height = hs.ieLt9 ? iebody.clientHeight : self.innerHeight; 191 192 hs.page = { 193 width: width, 194 height: height, 195 scrollLeft: hs.ieLt9 ? iebody.scrollLeft : pageXOffset, 196 scrollTop: hs.ieLt9 ? iebody.scrollTop : pageYOffset 197 }; 198 return hs.page; 199}, 200 201getPosition : function(el) { 202 var p = { x: el.offsetLeft, y: el.offsetTop }; 203 while (el.offsetParent) { 204 el = el.offsetParent; 205 p.x += el.offsetLeft; 206 p.y += el.offsetTop; 207 if (el != document.body && el != document.documentElement) { 208 p.x -= el.scrollLeft; 209 p.y -= el.scrollTop; 210 } 211 } 212 return p; 213}, 214 215expand : function(a, params, custom, type) { 216 if (!a) a = hs.createElement('a', null, { display: 'none' }, hs.container); 217 if (typeof a.getParams == 'function') return params; 218 try { 219 new hs.Expander(a, params, custom); 220 return false; 221 } catch (e) { return true; } 222}, 223 224 225focusTopmost : function() { 226 var topZ = 0, 227 topmostKey = -1, 228 expanders = hs.expanders, 229 exp, 230 zIndex; 231 for (var i = 0; i < expanders.length; i++) { 232 exp = expanders[i]; 233 if (exp) { 234 zIndex = exp.wrapper.style.zIndex; 235 if (zIndex && zIndex > topZ) { 236 topZ = zIndex; 237 topmostKey = i; 238 } 239 } 240 } 241 if (topmostKey == -1) hs.focusKey = -1; 242 else expanders[topmostKey].focus(); 243}, 244 245getParam : function (a, param) { 246 a.getParams = a.onclick; 247 var p = a.getParams ? a.getParams() : null; 248 a.getParams = null; 249 250 return (p && typeof p[param] != 'undefined') ? p[param] : 251 (typeof hs[param] != 'undefined' ? hs[param] : null); 252}, 253 254getSrc : function (a) { 255 var src = hs.getParam(a, 'src'); 256 if (src) return src; 257 return a.href; 258}, 259 260getNode : function (id) { 261 var node = hs.$(id), clone = hs.clones[id], a = {}; 262 if (!node && !clone) return null; 263 if (!clone) { 264 clone = node.cloneNode(true); 265 clone.id = ''; 266 hs.clones[id] = clone; 267 return node; 268 } else { 269 return clone.cloneNode(true); 270 } 271}, 272 273discardElement : function(d) { 274 if (d) hs.garbageBin.appendChild(d); 275 hs.garbageBin.innerHTML = ''; 276}, 277transit : function (adj, exp) { 278 var last = exp || hs.getExpander(); 279 exp = last; 280 if (hs.upcoming) return false; 281 else hs.last = last; 282 hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler); 283 try { 284 hs.upcoming = adj; 285 adj.onclick(); 286 } catch (e){ 287 hs.last = hs.upcoming = null; 288 } 289 try { 290 exp.close(); 291 } catch (e) {} 292 return false; 293}, 294 295previousOrNext : function (el, op) { 296 var exp = hs.getExpander(el); 297 if (exp) return hs.transit(exp.getAdjacentAnchor(op), exp); 298 else return false; 299}, 300 301previous : function (el) { 302 return hs.previousOrNext(el, -1); 303}, 304 305next : function (el) { 306 return hs.previousOrNext(el, 1); 307}, 308 309keyHandler : function(e) { 310 if (!e) e = window.event; 311 if (!e.target) e.target = e.srcElement; // ie 312 if (typeof e.target.form != 'undefined') return true; // form element has focus 313 var exp = hs.getExpander(); 314 315 var op = null; 316 switch (e.keyCode) { 317 case 70: // f 318 if (exp) exp.doFullExpand(); 319 return true; 320 case 32: // Space 321 case 34: // Page Down 322 case 39: // Arrow right 323 case 40: // Arrow down 324 op = 1; 325 break; 326 case 8: // Backspace 327 case 33: // Page Up 328 case 37: // Arrow left 329 case 38: // Arrow up 330 op = -1; 331 break; 332 case 27: // Escape 333 case 13: // Enter 334 op = 0; 335 } 336 if (op !== null) { 337 hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler); 338 if (!hs.enableKeyListener) return true; 339 340 if (e.preventDefault) e.preventDefault(); 341 else e.returnValue = false; 342 if (exp) { 343 if (op == 0) { 344 exp.close(); 345 } else { 346 hs.previousOrNext(exp.key, op); 347 } 348 return false; 349 } 350 } 351 return true; 352}, 353 354 355registerOverlay : function (overlay) { 356 hs.push(hs.overlays, hs.extend(overlay, { hsId: 'hsId'+ hs.idCounter++ } )); 357}, 358 359 360getWrapperKey : function (element, expOnly) { 361 var el, re = /^highslide-wrapper-([0-9]+)$/; 362 // 1. look in open expanders 363 el = element; 364 while (el.parentNode) { 365 if (el.id && re.test(el.id)) return el.id.replace(re, "$1"); 366 el = el.parentNode; 367 } 368 // 2. look in thumbnail 369 if (!expOnly) { 370 el = element; 371 while (el.parentNode) { 372 if (el.tagName && hs.isHsAnchor(el)) { 373 for (var key = 0; key < hs.expanders.length; key++) { 374 var exp = hs.expanders[key]; 375 if (exp && exp.a == el) return key; 376 } 377 } 378 el = el.parentNode; 379 } 380 } 381 return null; 382}, 383 384getExpander : function (el, expOnly) { 385 if (typeof el == 'undefined') return hs.expanders[hs.focusKey] || null; 386 if (typeof el == 'number') return hs.expanders[el] || null; 387 if (typeof el == 'string') el = hs.$(el); 388 return hs.expanders[hs.getWrapperKey(el, expOnly)] || null; 389}, 390 391isHsAnchor : function (a) { 392 return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/hs.(htmlE|e)xpand/)); 393}, 394 395reOrder : function () { 396 for (var i = 0; i < hs.expanders.length; i++)
397 if (hs.expanders[i] && hs.expanders[i].isExpanded) hs.focusTopmost(); 398}, 399 400mouseClickHandler : function(e) 401{ 402 if (!e) e = window.event; 403 if (e.button > 1) return true; 404 if (!e.target) e.target = e.srcElement; 405 406 var el = e.target; 407 while (el.parentNode 408 && !(/highslide-(image|move|html|resize)/.test(el.className))) 409 { 410 el = el.parentNode; 411 } 412 var exp = hs.getExpander(el); 413 if (exp && (exp.isClosing || !exp.isExpanded)) return true; 414 415 if (exp && e.type == 'mousedown') { 416 if (e.target.form) return true; 417 var match = el.className.match(/highslide-(image|move|resize)/); 418 if (match) { 419 hs.dragArgs = { 420 exp: exp , 421 type: match[1], 422 left: exp.x.pos, 423 width: exp.x.size, 424 top: exp.y.pos, 425 height: exp.y.size, 426 clickX: e.clientX, 427 clickY: e.clientY 428 }; 429 430 431 hs.addEventListener(document, 'mousemove', hs.dragHandler); 432 if (e.preventDefault) e.preventDefault(); // FF 433 434 if (/highslide-(image|html)-blur/.test(exp.content.className)) { 435 exp.focus(); 436 hs.hasFocused = true; 437 } 438 return false; 439 } 440 } else if (e.type == 'mouseup') { 441 442 hs.removeEventListener(document, 'mousemove', hs.dragHandler); 443 444 if (hs.dragArgs) { 445 if (hs.styleRestoreCursor && hs.dragArgs.type == 'image') 446 hs.dragArgs.exp.content.style.cursor = hs.styleRestoreCursor; 447 var hasDragged = hs.dragArgs.hasDragged; 448 449 if (!hasDragged &&!hs.hasFocused && !/(move|resize)/.test(hs.dragArgs.type)) { 450 exp.close(); 451 } 452 else if (hasDragged || (!hasDragged && hs.hasHtmlExpanders)) { 453 hs.dragArgs.exp.doShowHide('hidden'); 454 } 455 hs.hasFocused = false; 456 hs.dragArgs = null; 457 458 } else if (/highslide-image-blur/.test(el.className)) { 459 el.style.cursor = hs.styleRestoreCursor; 460 } 461 } 462 return false; 463}, 464 465dragHandler : function(e) 466{ 467 if (!hs.dragArgs) return true; 468 if (!e) e = window.event; 469 var a = hs.dragArgs, exp = a.exp; 470 471 a.dX = e.clientX - a.clickX; 472 a.dY = e.clientY - a.clickY; 473 474 var distance = Math.sqrt(Math.pow(a.dX, 2) + Math.pow(a.dY, 2)); 475 if (!a.hasDragged) a.hasDragged = (a.type != 'image' && distance > 0) 476 || (distance > (hs.dragSensitivity || 5)); 477 478 if (a.hasDragged && e.clientX > 5 && e.clientY > 5) { 479 480 if (a.type == 'resize') exp.resize(a); 481 else { 482 exp.moveTo(a.left + a.dX, a.top + a.dY); 483 if (a.type == 'image') exp.content.style.cursor = 'move'; 484 } 485 } 486 return false; 487}, 488 489wrapperMouseHandler : function (e) { 490 try { 491 if (!e) e = window.event; 492 var over = /mouseover/i.test(e.type); 493 if (!e.target) e.target = e.srcElement; // ie 494 if (!e.relatedTarget) e.relatedTarget = 495 over ? e.fromElement : e.toElement; // ie 496 var exp = hs.getExpander(e.target); 497 if (!exp.isExpanded) return; 498 if (!exp || !e.relatedTarget || hs.getExpander(e.relatedTarget, true) == exp 499 || hs.dragArgs) return; 500 for (var i = 0; i < exp.overlays.length; i++) (function() { 501 var o = hs.$('hsId'+ exp.overlays[i]); 502 if (o && o.hideOnMouseOut) { 503 if (over) hs.setStyles(o, { visibility: 'visible', display: '' }); 504 hs.animate(o, { opacity: over ? o.opacity : 0 }, o.dur); 505 } 506 })(); 507 } catch (e) {} 508}, 509addEventListener : function (el, event, func) { 510 if (el == document && event == 'ready') { 511 hs.push(hs.onReady, func); 512 } 513 try { 514 el.addEventListener(event, func, false); 515 } catch (e) { 516 try { 517 el.detachEvent('on'+ event, func); 518 el.attachEvent('on'+ event, func); 519 } catch (e) { 520 el['on'+ event] = func; 521 } 522 } 523}, 524 525removeEventListener : function (el, event, func) { 526 try { 527 el.removeEventListener(event, func, false); 528 } catch (e) { 529 try { 530 el.detachEvent('on'+ event, func); 531 } catch (e) { 532 el['on'+ event] = null; 533 } 534 } 535}, 536 537preloadFullImage : function (i) { 538 if (hs.continuePreloading && hs.preloadTheseImages[i] && hs.preloadTheseImages[i] != 'undefined') { 539 var img = document.createElement('img'); 540 img.onload = function() { 541 img = null; 542 hs.preloadFullImage(i + 1); 543 }; 544 img.src = hs.preloadTheseImages[i]; 545 } 546}, 547preloadImages : function (number) { 548 if (number && typeof number != 'object') hs.numberOfImagesToPreload = number; 549 550 var arr = hs.getAnchors();
551 for (var i = 0; i < arr.images.length && i < hs.numberOfImagesToPreload; i++) { 552 hs.push(hs.preloadTheseImages, hs.getSrc(arr.images[i])); 553 } 554 555 // preload outlines 556 if (hs.outlineType) new hs.Outline(hs.outlineType, function () { hs.preloadFullImage(0)} ); 557 else 558 559 hs.preloadFullImage(0); 560 561 // preload cursor 562 if (hs.restoreCursor) var cur = hs.createElement('img', { src: hs.graphicsDir + hs.restoreCursor }); 563}, 564 565 566init : function () { 567 if (!hs.container) { 568 569 hs.ieLt7 = hs.ie && hs.uaVersion < 7; 570 hs.ieLt9 = hs.ie && hs.uaVersion < 9; 571 572 hs.getPageSize(); 573 for (var x in hs.langDefaults) { 574 if (typeof hs[x] != 'undefined') hs.lang[x] = hs[x]; 575 else if (typeof hs.lang[x] == 'undefined' && typeof hs.langDefaults[x] != 'undefined') 576 hs.lang[x] = hs.langDefaults[x]; 577 } 578 579 hs.container = hs.createElement('div', { 580 className: 'highslide-container' 581 }, { 582 position: 'absolute', 583 left: 0, 584 top: 0, 585 width: '100%', 586 zIndex: hs.zIndexCounter, 587 direction: 'ltr' 588 }, 589 document.body, 590 true 591 ); 592 hs.loading = hs.createElement('a', { 593 className: 'highslide-loading', 594 title: hs.lang.loadingTitle, 595 innerHTML: hs.lang.loadingText, 596 href: 'javascript:;' 597 }, { 598 position: 'absolute', 599 top: '-9999px', 600 opacity: hs.loadingOpacity, 601 zIndex: 1 602 }, hs.container 603 ); 604 hs.garbageBin = hs.createElement('div', null, { display: 'none' }, hs.container); 605 606 // http://www.robertpenner.com/easing/ 607 Math.linearTween = function (t, b, c, d) { 608 return c*t/d + b; 609 }; 610 Math.easeInQuad = function (t, b, c, d) { 611 return c*(t/=d)*t + b; 612 }; 613 614 hs.hideSelects = hs.ieLt7; 615 hs.hideIframes = ((window.opera && hs.uaVersion < 9) || navigator.vendor == 'KDE' 616 || (hs.ieLt7 && hs.uaVersion < 5.5)); 617 } 618}, 619ready : function() { 620 if (hs.isReady) return; 621 hs.isReady = true; 622 for (var i = 0; i < hs.onReady.length; i++) hs.onReady[i](); 623}, 624 625updateAnchors : function() { 626 var el, els, all = [], images = [],groups = {}, re; 627 628 for (var i = 0; i < hs.openerTagNames.length; i++) { 629 els = document.getElementsByTagName(hs.openerTagNames[i]); 630 for (var j = 0; j < els.length; j++) { 631 el = els[j]; 632 re = hs.isHsAnchor(el); 633 if (re) { 634 hs.push(all, el); 635 if (re[0] == 'hs.expand') hs.push(images, el); 636 var g = hs.getParam(el, 'slideshowGroup') || 'none'; 637 if (!groups[g]) groups[g] = []; 638 hs.push(groups[g], el); 639 } 640 } 641 } 642 hs.anchors = { all: all, groups: groups, images: images }; 643 return hs.anchors; 644 645}, 646 647getAnchors : function() { 648 return hs.anchors || hs.updateAnchors(); 649}, 650 651 652close : function(el) { 653 var exp = hs.getExpander(el); 654 if (exp) exp.close(); 655 return false; 656} 657}; // end hs object 658hs.fx = function( elem, options, prop ){ 659 this.options = options; 660 this.elem = elem; 661 this.prop = prop; 662 663 if (!options.orig) options.orig = {}; 664}; 665hs.fx.prototype = { 666 update: function(){ 667 (hs.fx.step[this.prop] || hs.fx.step._default)(this); 668 669 if (this.options.step) 670 this.options.step.call(this.elem, this.now, this); 671 672 }, 673 custom: function(from, to, unit){ 674 this.startTime = (new Date()).getTime(); 675 this.start = from; 676 this.end = to; 677 this.unit = unit;// || this.unit || "px"; 678 this.now = this.start; 679 this.pos = this.state = 0; 680 681 var self = this; 682 function t(gotoEnd){ 683 return self.step(gotoEnd); 684 } 685 686 t.elem = this.elem; 687 688 if ( t() && hs.timers.push(t) == 1 ) { 689 hs.timerId = setInterval(function(){ 690 var timers = hs.timers; 691 692 for ( var i = 0; i < timers.length; i++ ) 693 if ( !timers[i]() ) 694 timers.splice(i--, 1); 695 696 if ( !timers.length ) { 697 clearInterval(hs.timerId); 698 } 699 }, 13); 700 } 701 }, 702 step: function(gotoEnd){ 703 var t = (new Date()).getTime(); 704 if ( gotoEnd || t >= this.options.duration + this.startTime ) { 705 this.now = this.end; 706 this.pos = this.state = 1; 707 this.update(); 708 709 this.options.curAnim[ this.prop ] = true; 710 711 var done = true; 712 for ( var i in this.options.curAnim ) 713 if ( this.options.curAnim[i] !== true ) 714 done = false; 715 716 if ( done ) { 717 if (this.options.complete) this.options.complete.call(this.elem); 718 } 719 return false; 720 } else { 721 var n = t - this.startTime; 722 this.state = n / this.options.duration; 723 this.pos = this.options.easing(n, 0, 1, this.options.duration);
724 this.now = this.start + ((this.end - this.start) * this.pos); 725 this.update(); 726 } 727 return true; 728 } 729 730}; 731 732hs.extend( hs.fx, { 733 step: { 734 735 opacity: function(fx){ 736 hs.setStyles(fx.elem, { opacity: fx.now }); 737 }, 738 739 _default: function(fx){ 740 try { 741 if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) 742 fx.elem.style[ fx.prop ] = fx.now + fx.unit; 743 else 744 fx.elem[ fx.prop ] = fx.now; 745 } catch (e) {} 746 } 747 } 748}); 749 750hs.Outline = function (outlineType, onLoad) { 751 this.onLoad = onLoad; 752 this.outlineType = outlineType; 753 var v = hs.uaVersion, tr; 754 755 this.hasAlphaImageLoader = hs.ie && hs.uaVersion < 7; 756 if (!outlineType) { 757 if (onLoad) onLoad(); 758 return; 759 } 760 761 hs.init(); 762 this.table = hs.createElement( 763 'table', { 764 cellSpacing: 0 765 }, { 766 visibility: 'hidden', 767 position: 'absolute', 768 borderCollapse: 'collapse', 769 width: 0 770 }, 771 hs.container, 772 true 773 ); 774 var tbody = hs.createElement('tbody', null, null, this.table, 1); 775 776 this.td = []; 777 for (var i = 0; i <= 8; i++) { 778 if (i % 3 == 0) tr = hs.createElement('tr', null, { height: 'auto' }, tbody, true); 779 this.td[i] = hs.createElement('td', null, null, tr, true); 780 var style = i != 4 ? { lineHeight: 0, fontSize: 0} : { position : 'relative' }; 781 hs.setStyles(this.td[i], style); 782 }
783 this.td[4].className = outlineType +' highslide-outline'; 784 785 this.preloadGraphic(); 786}; 787 788hs.Outline.prototype = { 789preloadGraphic : function () { 790 var src = hs.graphicsDir + (hs.outlinesDir || "outlines/")+ this.outlineType +".png"; 791 792 var appendTo = hs.safari && hs.uaVersion < 525 ? hs.container : null; 793 this.graphic = hs.createElement('img', null, { position: 'absolute', 794 top: '-9999px' }, appendTo, true); // for onload trigger 795 796 var pThis = this; 797 this.graphic.onload = function() { pThis.onGraphicLoad(); }; 798 799 this.graphic.src = src; 800}, 801 802onGraphicLoad : function () { 803 var o = this.offset = this.graphic.width / 4, 804 pos = [[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]], 805 dim = { height: (2*o) +'px', width: (2*o) +'px' }; 806 for (var i = 0; i <= 8; i++) { 807 if (pos[i]) { 808 if (this.hasAlphaImageLoader) { 809 var w = (i == 1 || i == 7) ? '100%' : this.graphic.width +'px'; 810 var div = hs.createElement('div', null, { width: '100%', height: '100%', position: 'relative', overflow: 'hidden'}, this.td[i], true); 811 hs.createElement ('div', null, { 812 filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+ this.graphic.src + "')", 813 position: 'absolute', 814 width: w, 815 height: this.graphic.height +'px', 816 left: (pos[i][0]*o)+'px', 817 top: (pos[i][1]*o)+'px' 818 }, 819 div, 820 true); 821 } else { 822 hs.setStyles(this.td[i], { background: 'url('+ this.graphic.src +') '+ (pos[i][0]*o)+'px '+(pos[i][1]*o)+'px'}); 823 } 824 825 if (window.opera && (i == 3 || i ==5)) 826 hs.createElement('div', null, dim, this.td[i], true); 827 828 hs.setStyles (this.td[i], dim); 829 } 830 } 831 this.graphic = null; 832 if (hs.pendingOutlines[this.outlineType]) hs.pendingOutlines[this.outlineType].destroy(); 833 hs.pendingOutlines[this.outlineType] = this; 834 if (this.onLoad) this.onLoad(); 835}, 836 837setPosition : function (pos, offset, vis, dur, easing) { 838 var exp = this.exp, 839 stl = exp.wrapper.style, 840 offset = offset || 0, 841 pos = pos || { 842 x: exp.x.pos + offset, 843 y: exp.y.pos + offset, 844 w: exp.x.get('wsize') - 2 * offset, 845 h: exp.y.get('wsize') - 2 * offset 846 }; 847 if (vis) this.table.style.visibility = (pos.h >= 4 * this.offset) 848 ? 'visible' : 'hidden'; 849 hs.setStyles(this.table, { 850 left: (pos.x - this.offset) +'px', 851 top: (pos.y - this.offset) +'px', 852 width: (pos.w + 2 * this.offset) +'px' 853 }); 854 855 pos.w -= 2 * this.offset; 856 pos.h -= 2 * this.offset; 857 hs.setStyles (this.td[4], { 858 width: pos.w >= 0 ? pos.w +'px' : 0, 859 height: pos.h >= 0 ? pos.h +'px' : 0 860 }); 861 if (this.hasAlphaImageLoader) this.td[3].style.height 862 = this.td[5].style.height = this.td[4].style.height; 863 864}, 865 866destroy : function(hide) { 867 if (hide) this.table.style.visibility = 'hidden'; 868 else hs.discardElement(this.table); 869} 870}; 871 872hs.Dimension = function(exp, dim) { 873 this.exp = exp; 874 this.dim = dim; 875 this.ucwh = dim == 'x' ? 'Width' : 'Height'; 876 this.wh = this.ucwh.toLowerCase(); 877 this.uclt = dim == 'x' ? 'Left' : 'Top'; 878 this.lt = this.uclt.toLowerCase(); 879 this.ucrb = dim == 'x' ? 'Right' : 'Bottom'; 880 this.rb = this.ucrb.toLowerCase(); 881 this.p1 = this.p2 = 0; 882}; 883hs.Dimension.prototype = { 884get : function(key) { 885 switch (key) { 886 case 'loadingPos': 887 return this.tpos + this.tb + (this.t - hs.loading['offset'+ this.ucwh]) / 2; 888 case 'wsize': 889 return this.size + 2 * this.cb + this.p1 + this.p2; 890 case 'fitsize': 891 return this.clientSize - this.marginMin - this.marginMax; 892 case 'maxsize': 893 return this.get('fitsize') - 2 * this.cb - this.p1 - this.p2 ; 894 case 'opos': 895 return this.pos - (this.exp.outline ? this.exp.outline.offset : 0); 896 case 'osize': 897 return this.get('wsize') + (this.exp.outline ? 2*this.exp.outline.offset : 0); 898 case 'imgPad': 899 return this.imgSize ? Math.round((this.size - this.imgSize) / 2) : 0; 900 901 } 902}, 903calcBorders: function() { 904 // correct for borders 905 this.cb = (this.exp.content['offset'+ this.ucwh] - this.t) / 2; 906 907 this.marginMax = hs['margin'+ this.ucrb]; 908}, 909calcThumb: function() { 910 this.t = this.exp.el[this.wh] ? parseInt(this.exp.el[this.wh]) : 911 this.exp.el['offset'+ this.ucwh]; 912 this.tpos = this.exp.tpos[this.dim]; 913 this.tb = (this.exp.el['offset'+ this.ucwh] - this.t) / 2; 914 if (this.tpos == 0 || this.tpos == -1) { 915 this.tpos = (hs.page[this.wh] / 2) + hs.page['scroll'+ this.uclt]; 916 }; 917}, 918calcExpanded: function() { 919 var exp = this.exp; 920 this.justify = 'auto'; 921 922 923 // size and position 924 this.pos = this.tpos - this.cb + this.tb; 925 926 if (this.maxHeight && this.dim == 'x') 927 exp.maxWidth = Math.min(exp.maxWidth || this.full, exp.maxHeight * this.full / exp.y.full); 928 929 this.size = Math.min(this.full, exp['max'+ this.ucwh] || this.full); 930 this.minSize = exp.allowSizeReduction ? 931 Math.min(exp['min'+ this.ucwh], this.full) :this.full; 932 if (exp.isImage && exp.useBox) { 933 this.size = exp[this.wh]; 934 this.imgSize = this.full; 935 } 936 if (this.dim == 'x' && hs.padToMinWidth) this.minSize = exp.minWidth; 937 this.marginMin = hs['margin'+ this.uclt]; 938 this.scroll = hs.page['scroll'+ this.uclt]; 939 this.clientSize = hs.page[this.wh]; 940}, 941setSize: function(i) { 942 var exp = this.exp; 943 if (exp.isImage && (exp.useBox || hs.padToMinWidth)) { 944 this.imgSize = i; 945 this.size = Math.max(this.size, this.imgSize); 946 exp.content.style[this.lt] = this.get('imgPad')+'px'; 947 } else 948 this.size = i; 949 950 exp.content.style[this.wh] = i +'px'; 951 exp.wrapper.style[this.wh] = this.get('wsize') +'px'; 952 if (exp.outline) exp.outline.setPosition(); 953 if (this.dim == 'x' && exp.overlayBox) exp.sizeOverlayBox(true); 954}, 955setPos: function(i) { 956 this.pos = i; 957 this.exp.wrapper.style[this.lt] = i +'px'; 958 959 if (this.exp.outline) this.exp.outline.setPosition(); 960 961} 962}; 963 964hs.Expander = function(a, params, custom, contentType) { 965 if (document.readyState && hs.ie && !hs.isReady) { 966 hs.addEventListener(document, 'ready', function() { 967 new hs.Expander(a, params, custom, contentType); 968 }); 969 return; 970 } 971 this.a = a; 972 this.custom = custom; 973 this.contentType = contentType || 'image'; 974 this.isImage = !this.isHtml; 975 976 hs.continuePreloading = false; 977 this.overlays = []; 978 hs.init(); 979 var key = this.key = hs.expanders.length; 980 // override inline parameters 981 for (var i = 0; i < hs.overrides.length; i++) { 982 var name = hs.overrides[i];
983 this[name] = params && typeof params[name] != 'undefined' ? 984 params[name] : hs[name]; 985 } 986 if (!this.src) this.src = a.href; 987 988 // get thumb 989 var el = (params && params.thumbnailId) ? hs.$(params.thumbnailId) : a; 990 el = this.thumb = el.getElementsByTagName('img')[0] || el; 991 this.thumbsUserSetId = el.id || a.id; 992 993 // check if already open 994 for (var i = 0; i < hs.expanders.length; i++) { 995 if (hs.expanders[i] && hs.expanders[i].a == a) { 996 hs.expanders[i].focus(); 997 return false; 998 } 999 } 1000 1001 // cancel other 1002 if (!hs.allowSimultaneousLoading) for (var i = 0; i < hs.expanders.length; i++) { 1003 if (hs.expanders[i] && hs.expanders[i].thumb != el && !hs.expanders[i].onLoadStarted) { 1004 hs.expanders[i].cancelLoading(); 1005 } 1006 } 1007 hs.expanders[key] = this; 1008 if (!hs.allowMultipleInstances && !hs.upcoming) { 1009 if (hs.expanders[key-1]) hs.expanders[key-1].close(); 1010 if (typeof hs.focusKey != 'undefined' && hs.expanders[hs.focusKey]) 1011 hs.expanders[hs.focusKey].close(); 1012 } 1013 1014 // initiate metrics 1015 this.el = el; 1016 this.tpos = this.pageOrigin || hs.getPosition(el); 1017 hs.getPageSize(); 1018 var x = this.x = new hs.Dimension(this, 'x'); 1019 x.calcThumb(); 1020 var y = this.y = new hs.Dimension(this, 'y'); 1021 y.calcThumb(); 1022 this.wrapper = hs.createElement( 1023 'div', { 1024 id: 'highslide-wrapper-'+ this.key, 1025 className: 'highslide-wrapper '+ this.wrapperClassName 1026 }, { 1027 visibility: 'hidden', 1028 position: 'absolute', 1029 zIndex: hs.zIndexCounter += 2 1030 }, null, true ); 1031 1032 this.wrapper.onmouseover = this.wrapper.onmouseout = hs.wrapperMouseHandler; 1033 if (this.contentType == 'image' && this.outlineWhileAnimating == 2) 1034 this.outlineWhileAnimating = 0; 1035 1036 // get the outline 1037 if (!this.outlineType) { 1038 this[this.contentType +'Create'](); 1039 1040 } else if (hs.pendingOutlines[this.outlineType]) { 1041 this.connectOutline(); 1042 this[this.contentType +'Create'](); 1043 1044 } else { 1045 this.showLoading(); 1046 var exp = this; 1047 new hs.Outline(this.outlineType, 1048 function () { 1049 exp.connectOutline(); 1050 exp[exp.contentType +'Create'](); 1051 } 1052 ); 1053 } 1054 return true; 1055}; 1056 1057hs.Expander.prototype = { 1058error : function(e) { 1059 if (hs.debug) alert ('Line '+ e.lineNumber +': '+ e.message); 1060 else window.location.href = this.src; 1061}, 1062 1063connectOutline : function() { 1064 var outline = this.outline = hs.pendingOutlines[this.outlineType]; 1065 outline.exp = this; 1066 outline.table.style.zIndex = this.wrapper.style.zIndex - 1; 1067 hs.pendingOutlines[this.outlineType] = null; 1068}, 1069 1070showLoading : function() { 1071 if (this.onLoadStarted || this.loading) return; 1072 1073 this.loading = hs.loading; 1074 var exp = this; 1075 this.loading.onclick = function() { 1076 exp.cancelLoading(); 1077 }; 1078 var exp = this, 1079 l = this.x.get('loadingPos') +'px', 1080 t = this.y.get('loadingPos') +'px'; 1081 setTimeout(function () { 1082 if (exp.loading) hs.setStyles(exp.loading, { left: l, top: t, zIndex: hs.zIndexCounter++ })} 1083 , 100); 1084}, 1085 1086imageCreate : function() { 1087 var exp = this; 1088 1089 var img = document.createElement('img'); 1090 this.content = img; 1091 img.onload = function () { 1092 if (hs.expanders[exp.key]) exp.contentLoaded(); 1093 }; 1094 if (hs.blockRightClick) img.oncontextmenu = function() { return false; }; 1095 img.className = 'highslide-image'; 1096 hs.setStyles(img, { 1097 visibility: 'hidden', 1098 display: 'block', 1099 position: 'absolute', 1100 maxWidth: '9999px', 1101 zIndex: 3 1102 }); 1103 img.title = hs.lang.restoreTitle; 1104 if (hs.safari && hs.uaVersion < 525) hs.container.appendChild(img); 1105 if (hs.ie && hs.flushImgSize) img.src = null; 1106 img.src = this.src; 1107 1108 this.showLoading(); 1109}, 1110 1111contentLoaded : function() { 1112 try { 1113 if (!this.content) return; 1114 this.content.onload = null; 1115 if (this.onLoadStarted) return; 1116 else this.onLoadStarted = true; 1117 1118 var x = this.x, y = this.y; 1119 1120 if (this.loading) { 1121 hs.setStyles(this.loading, { top: '-9999px' }); 1122 this.loading = null; 1123 } 1124 x.full = this.content.width; 1125 y.full = this.content.height; 1126 1127 hs.setStyles(this.content, { 1128 width: x.t +'px', 1129 height: y.t +'px' 1130 }); 1131 this.wrapper.appendChild(this.content); 1132 hs.container.appendChild(this.wrapper); 1133 1134 x.calcBorders(); 1135 y.calcBorders(); 1136 1137 hs.setStyles (this.wrapper, { 1138 left: (x.tpos + x.tb - x.cb) +'px', 1139 top: (y.tpos + x.tb - y.cb) +'px' 1140 }); 1141 this.getOverlays(); 1142 1143 var ratio = x.full / y.full; 1144 x.calcExpanded(); 1145 this.justify(x); 1146 1147 y.calcExpanded(); 1148 this.justify(y); 1149 if (this.overlayBox) this.sizeOverlayBox(0, 1); 1150 1151 1152 if (this.allowSizeReduction) { 1153 this.correctRatio(ratio); 1154 if (this.isImage && this.x.full > (this.x.imgSize || this.x.size)) { 1155 this.createFullExpand(); 1156 if (this.overlays.length == 1) this.sizeOverlayBox(); 1157 } 1158 } 1159 this.show(); 1160 1161 } catch (e) { 1162 this.error(e); 1163 } 1164}, 1165 1166justify : function (p, moveOnly) { 1167 var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y'; 1168 1169 var hasMovedMin = false; 1170 1171 var allowReduce = p.exp.allowSizeReduction; 1172 p.pos = Math.round(p.pos - ((p.get('wsize') - p.t) / 2)); 1173 if (p.pos < p.scroll + p.marginMin) { 1174 p.pos = p.scroll + p.marginMin; 1175 hasMovedMin = true; 1176 } 1177 if (!moveOnly && p.size < p.minSize) { 1178 p.size = p.minSize; 1179 allowReduce = false; 1180 } 1181 if (p.pos + p.get('wsize') > p.scroll + p.clientSize - p.marginMax) { 1182 if (!moveOnly && hasMovedMin && allowReduce) { 1183 p.size = Math.min(p.size, p.get(dim == 'y' ? 'fitsize' : 'maxsize'));
1184 } else if (p.get('wsize') < p.get('fitsize')) { 1185 p.pos = p.scroll + p.clientSize - p.marginMax - p.get('wsize'); 1186 } else { // image larger than viewport 1187 p.pos = p.scroll + p.marginMin; 1188 if (!moveOnly && allowReduce) p.size = p.get(dim == 'y' ? 'fitsize' : 'maxsize'); 1189 } 1190 } 1191 1192 if (!moveOnly && p.size < p.minSize) { 1193 p.size = p.minSize; 1194 allowReduce = false; 1195 } 1196 1197 1198 1199 if (p.pos < p.marginMin) { 1200 var tmpMin = p.pos; 1201 p.pos = p.marginMin; 1202 1203 if (allowReduce && !moveOnly) p.size = p.size - (p.pos - tmpMin); 1204 1205 } 1206}, 1207 1208correctRatio : function(ratio) { 1209 var x = this.x, 1210 y = this.y, 1211 changed = false, 1212 xSize = Math.min(x.full, x.size), 1213 ySize = Math.min(y.full, y.size), 1214 useBox = (this.useBox || hs.padToMinWidth); 1215 1216 if (xSize / ySize > ratio) { // width greater 1217 xSize = ySize * ratio; 1218 if (xSize < x.minSize) { // below minWidth 1219 xSize = x.minSize; 1220 ySize = xSize / ratio; 1221 } 1222 changed = true; 1223 1224 } else if (xSize / ySize < ratio) { // height greater 1225 ySize = xSize / ratio; 1226 changed = true; 1227 } 1228 1229 if (hs.padToMinWidth && x.full < x.minSize) { 1230 x.imgSize = x.full; 1231 y.size = y.imgSize = y.full; 1232 } else if (this.useBox) { 1233 x.imgSize = xSize; 1234 y.imgSize = ySize; 1235 } else { 1236 x.size = xSize; 1237 y.size = ySize; 1238 } 1239 changed = this.fitOverlayBox(this.useBox ? null : ratio, changed); 1240 if (useBox && y.size < y.imgSize) { 1241 y.imgSize = y.size; 1242 x.imgSize = y.size * ratio; 1243 } 1244 if (changed || useBox) { 1245 x.pos = x.tpos - x.cb + x.tb; 1246 x.minSize = x.size; 1247 this.justify(x, true); 1248 1249 y.pos = y.tpos - y.cb + y.tb; 1250 y.minSize = y.size; 1251 this.justify(y, true); 1252 if (this.overlayBox) this.sizeOverlayBox(); 1253 } 1254 1255 1256}, 1257fitOverlayBox : function(ratio, changed) { 1258 var x = this.x, y = this.y; 1259 if (this.overlayBox) { 1260 while (y.size > this.minHeight && x.size > this.minWidth 1261 && y.get('wsize') > y.get('fitsize')) { 1262 y.size -= 10; 1263 if (ratio) x.size = y.size * ratio; 1264 this.sizeOverlayBox(0, 1); 1265 changed = true; 1266 } 1267 } 1268 return changed; 1269}, 1270 1271show : function () { 1272 var x = this.x, y = this.y; 1273 this.doShowHide('hidden'); 1274 1275 // Apply size change 1276 this.changeSize( 1277 1, { 1278 wrapper: { 1279 width : x.get('wsize'), 1280 height : y.get('wsize'), 1281 left: x.pos, 1282 top: y.pos 1283 }, 1284 content: { 1285 left: x.p1 + x.get('imgPad'), 1286 top: y.p1 + y.get('imgPad'), 1287 width:x.imgSize ||x.size, 1288 height:y.imgSize ||y.size 1289 } 1290 }, 1291 hs.expandDuration 1292 ); 1293}, 1294 1295changeSize : function(up, to, dur) { 1296 1297 if (this.outline && !this.outlineWhileAnimating) { 1298 if (up) this.outline.setPosition(); 1299 else this.outline.destroy(); 1300 } 1301 1302 1303 if (!up) this.destroyOverlays(); 1304 1305 var exp = this, 1306 x = exp.x, 1307 y = exp.y, 1308 easing = this.easing; 1309 if (!up) easing = this.easingClose || easing; 1310 var after = up ? 1311 function() { 1312 1313 if (exp.outline) exp.outline.table.style.visibility = "visible"; 1314 setTimeout(function() { 1315 exp.afterExpand(); 1316 }, 50); 1317 } : 1318 function() { 1319 exp.afterClose(); 1320 }; 1321 if (up) hs.setStyles( this.wrapper, { 1322 width: x.t +'px', 1323 height: y.t +'px' 1324 }); 1325 if (this.fadeInOut) { 1326 hs.setStyles(this.wrapper, { opacity: up ? 0 : 1 }); 1327 hs.extend(to.wrapper, { opacity: up }); 1328 } 1329 hs.animate( this.wrapper, to.wrapper, { 1330 duration: dur, 1331 easing: easing, 1332 step: function(val, args) { 1333 if (exp.outline && exp.outlineWhileAnimating && args.prop == 'top') { 1334 var fac = up ? args.pos : 1 - args.pos; 1335 var pos = { 1336 w: x.t + (x.get('wsize') - x.t) * fac, 1337 h: y.t + (y.get('wsize') - y.t) * fac, 1338 x: x.tpos + (x.pos - x.tpos) * fac, 1339 y: y.tpos + (y.pos - y.tpos) * fac 1340 }; 1341 exp.outline.setPosition(pos, 0, 1); 1342 } 1343 } 1344 }); 1345 hs.animate( this.content, to.content, dur, easing, after); 1346 if (up) { 1347 this.wrapper.style.visibility = 'visible'; 1348 this.content.style.visibility = 'visible'; 1349 this.a.className += ' highslide-active-anchor'; 1350 } 1351}, 1352 1353 1354 1355 1356afterExpand : function() { 1357 this.isExpanded = true; 1358 this.focus(); 1359 if (hs.upcoming && hs.upcoming == this.a) hs.upcoming = null; 1360 this.prepareNextOutline();
1361 var p = hs.page, mX = hs.mouse.x + p.scrollLeft, mY = hs.mouse.y + p.scrollTop; 1362 this.mouseIsOver = this.x.pos < mX && mX < this.x.pos + this.x.get('wsize') 1363 && this.y.pos < mY && mY < this.y.pos + this.y.get('wsize'); 1364 if (this.overlayBox) this.showOverlays(); 1365 1366}, 1367 1368 1369prepareNextOutline : function() { 1370 var key = this.key; 1371 var outlineType = this.outlineType; 1372 new hs.Outline(outlineType, 1373 function () { try { hs.expanders[key].preloadNext(); } catch (e) {} }); 1374}, 1375 1376 1377preloadNext : function() { 1378 var next = this.getAdjacentAnchor(1); 1379 if (next && next.onclick.toString().match(/hs\.expand/)) 1380 var img = hs.createElement('img', { src: hs.getSrc(next) }); 1381}, 1382 1383 1384getAdjacentAnchor : function(op) { 1385 var current = this.getAnchorIndex(), as = hs.anchors.groups[this.slideshowGroup || 'none']; 1386 return (as && as[current + op]) || null; 1387}, 1388 1389getAnchorIndex : function() { 1390 var arr = hs.getAnchors().groups[this.slideshowGroup || 'none']; 1391 if (arr) for (var i = 0; i < arr.length; i++) { 1392 if (arr[i] == this.a) return i; 1393 } 1394 return null; 1395}, 1396 1397 1398cancelLoading : function() { 1399 hs.discardElement (this.wrapper); 1400 hs.expanders[this.key] = null; 1401 if (this.loading) hs.loading.style.left = '-9999px'; 1402}, 1403 1404writeCredits : function () { 1405 this.credits = hs.createElement('a', { 1406 href: hs.creditsHref, 1407 target: hs.creditsTarget, 1408 className: 'highslide-credits', 1409 innerHTML: hs.lang.creditsText, 1410 title: hs.lang.creditsTitle 1411 }); 1412 this.createOverlay({ 1413 overlayId: this.credits, 1414 position: this.creditsPosition || 'top left' 1415 }); 1416}, 1417 1418getInline : function(types, addOverlay) { 1419 for (var i = 0; i < types.length; i++) { 1420 var type = types[i], s = null; 1421 if (!this[type +'Id'] && this.thumbsUserSetId) 1422 this[type +'Id'] = type +'-for-'+ this.thumbsUserSetId; 1423 if (this[type +'Id']) this[type] = hs.getNode(this[type +'Id']); 1424 if (!this[type] && !this[type +'Text'] && this[type +'Eval']) try { 1425 s = eval(this[type +'Eval']); 1426 } catch (e) {} 1427 if (!this[type] && this[type +'Text']) { 1428 s = this[type +'Text']; 1429 } 1430 if (!this[type] && !s) { 1431 this[type] = hs.getNode(this.a['_'+ type + 'Id']); 1432 if (!this[type]) { 1433 var next = this.a.nextSibling; 1434 while (next && !hs.isHsAnchor(next)) { 1435 if ((new RegExp('highslide-'+ type)).test(next.className || null)) { 1436 if (!next.id) this.a['_'+ type + 'Id'] = next.id = 'hsId'+ hs.idCounter++; 1437 this[type] = hs.getNode(next.id); 1438 break; 1439 } 1440 next = next.nextSibling; 1441 } 1442 } 1443 } 1444 1445 if (!this[type] && s) this[type] = hs.createElement('div', 1446 { className: 'highslide-'+ type, innerHTML: s } ); 1447 1448 if (addOverlay && this[type]) { 1449 var o = { position: (type == 'heading') ? 'above' : 'below' }; 1450 for (var x in this[type+'Overlay']) o[x] = this[type+'Overlay'][x]; 1451 o.overlayId = this[type]; 1452 this.createOverlay(o); 1453 } 1454 } 1455}, 1456 1457 1458// on end move and resize 1459doShowHide : function(visibility) { 1460 if (hs.hideSelects) this.showHideElements('SELECT', visibility); 1461 if (hs.hideIframes) this.showHideElements('IFRAME', visibility); 1462 if (hs.geckoMac) this.showHideElements('*', visibility); 1463}, 1464showHideElements : function (tagName, visibility) { 1465 var els = document.getElementsByTagName(tagName); 1466 var prop = tagName == '*' ? 'overflow' : 'visibility'; 1467 for (var i = 0; i < els.length; i++) { 1468 if (prop == 'visibility' || (document.defaultView.getComputedStyle( 1469 els[i], "").getPropertyValue('overflow') == 'auto' 1470 || els[i].getAttribute('hidden-by') != null)) { 1471 var hiddenBy = els[i].getAttribute('hidden-by'); 1472 if (visibility == 'visible' && hiddenBy) { 1473 hiddenBy = hiddenBy.replace('['+ this.key +']', ''); 1474 els[i].setAttribute('hidden-by', hiddenBy); 1475 if (!hiddenBy) els[i].style[prop] = els[i].origProp; 1476 } else if (visibility == 'hidden') { // hide if behind 1477 var elPos = hs.getPosition(els[i]); 1478 elPos.w = els[i].offsetWidth; 1479 elPos.h = els[i].offsetHeight; 1480 1481 1482 var clearsX = (elPos.x + elPos.w < this.x.get('opos') 1483 || elPos.x > this.x.get('opos') + this.x.get('osize'));
1484 var clearsY = (elPos.y + elPos.h < this.y.get('opos') 1485 || elPos.y > this.y.get('opos') + this.y.get('osize')); 1486 var wrapperKey = hs.getWrapperKey(els[i]); 1487 if (!clearsX && !clearsY && wrapperKey != this.key) { // element falls behind image 1488 if (!hiddenBy) { 1489 els[i].setAttribute('hidden-by', '['+ this.key +']'); 1490 els[i].origProp = els[i].style[prop]; 1491 els[i].style[prop] = 'hidden'; 1492 1493 } else if (hiddenBy.indexOf('['+ this.key +']') == -1) { 1494 els[i].setAttribute('hidden-by', hiddenBy + '['+ this.key +']'); 1495 } 1496 } else if ((hiddenBy == '['+ this.key +']' || hs.focusKey == wrapperKey) 1497 && wrapperKey != this.key) { // on move 1498 els[i].setAttribute('hidden-by', ''); 1499 els[i].style[prop] = els[i].origProp || ''; 1500 } else if (hiddenBy && hiddenBy.indexOf('['+ this.key +']') > -1) { 1501 els[i].setAttribute('hidden-by', hiddenBy.replace('['+ this.key +']', '')); 1502 } 1503 1504 } 1505 } 1506 } 1507}, 1508 1509focus : function() { 1510 this.wrapper.style.zIndex = hs.zIndexCounter += 2; 1511 // blur others 1512 for (var i = 0; i < hs.expanders.length; i++) { 1513 if (hs.expanders[i] && i == hs.focusKey) { 1514 var blurExp = hs.expanders[i]; 1515 blurExp.content.className += ' highslide-'+ blurExp.contentType +'-blur'; 1516 blurExp.content.style.cursor = hs.ieLt7 ? 'hand' : 'pointer'; 1517 blurExp.content.title = hs.lang.focusTitle; 1518 } 1519 } 1520 1521 // focus this 1522 if (this.outline) this.outline.table.style.zIndex 1523 = this.wrapper.style.zIndex - 1; 1524 this.content.className = 'highslide-'+ this.contentType; 1525 this.content.title = hs.lang.restoreTitle; 1526 1527 if (hs.restoreCursor) { 1528 hs.styleRestoreCursor = window.opera ? 'pointer' : 'url('+ hs.graphicsDir + hs.restoreCursor +'), pointer'; 1529 if (hs.ieLt7 && hs.uaVersion < 6) hs.styleRestoreCursor = 'hand'; 1530 this.content.style.cursor = hs.styleRestoreCursor; 1531 } 1532 1533 hs.focusKey = this.key; 1534 hs.addEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler); 1535}, 1536moveTo: function(x, y) { 1537 this.x.setPos(x); 1538 this.y.setPos(y); 1539}, 1540resize : function (e) { 1541 var w, h, r = e.width / e.height; 1542 w = Math.max(e.width + e.dX, Math.min(this.minWidth, this.x.full)); 1543 if (this.isImage && Math.abs(w - this.x.full) < 12) w = this.x.full; 1544 h = w / r; 1545 if (h < Math.min(this.minHeight, this.y.full)) { 1546 h = Math.min(this.minHeight, this.y.full); 1547 if (this.isImage) w = h * r; 1548 } 1549 this.resizeTo(w, h); 1550}, 1551resizeTo: function(w, h) { 1552 this.y.setSize(h); 1553 this.x.setSize(w); 1554 this.wrapper.style.height = this.y.get('wsize') +'px'; 1555}, 1556 1557close : function() { 1558 if (this.isClosing || !this.isExpanded) return; 1559 this.isClosing = true; 1560 1561 hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler); 1562 1563 try { 1564 this.content.style.cursor = 'default'; 1565 this.changeSize( 1566 0, { 1567 wrapper: { 1568 width : this.x.t, 1569 height : this.y.t, 1570 left: this.x.tpos - this.x.cb + this.x.tb, 1571 top: this.y.tpos - this.y.cb + this.y.tb 1572 }, 1573 content: { 1574 left: 0, 1575 top: 0, 1576 width: this.x.t, 1577 height: this.y.t 1578 } 1579 }, hs.restoreDuration 1580 ); 1581 } catch (e) { this.afterClose(); } 1582}, 1583 1584createOverlay : function (o) { 1585 var el = o.overlayId; 1586 if (typeof el == 'string') el = hs.getNode(el); 1587 if (o.html) el = hs.createElement('div', { innerHTML: o.html }); 1588 if (!el || typeof el == 'string') return; 1589 el.style.display = 'block'; 1590 this.genOverlayBox(); 1591 var width = o.width && /^[0-9]+(px|%)$/.test(o.width) ? o.width : 'auto'; 1592 if (/^(left|right)panel$/.test(o.position) && !/^[0-9]+px$/.test(o.width)) width = '200px'; 1593 var overlay = hs.createElement( 1594 'div', { 1595 id: 'hsId'+ hs.idCounter++, 1596 hsId: o.hsId 1597 }, { 1598 position: 'absolute', 1599 visibility: 'hidden', 1600 width: width, 1601 direction: hs.lang.cssDirection || '', 1602 opacity: 0 1603 },this.overlayBox, 1604 true 1605 ); 1606 1607 overlay.appendChild(el); 1608 hs.extend(overlay, { 1609 opacity: 1, 1610 offsetX: 0, 1611 offsetY: 0, 1612 dur: (o.fade === 0 || o.fade === false || (o.fade == 2 && hs.ie)) ? 0 : 250 1613 }); 1614 hs.extend(overlay, o); 1615 1616 1617 if (this.gotOverlays) { 1618 this.positionOverlay(overlay); 1619 if (!overlay.hideOnMouseOut || this.mouseIsOver) 1620 hs.animate(overlay, { opacity: overlay.opacity }, overlay.dur); 1621 } 1622 hs.push(this.overlays, hs.idCounter - 1); 1623}, 1624positionOverlay : function(overlay) { 1625 var p = overlay.position || 'middle center', 1626 offX = overlay.offsetX, 1627 offY = overlay.offsetY; 1628 if (overlay.parentNode != this.overlayBox) this.overlayBox.appendChild(overlay); 1629 if (/left$/.test(p)) overlay.style.left = offX +'px'; 1630 1631 if (/center$/.test(p)) hs.setStyles (overlay, { 1632 left: '50%', 1633 marginLeft: (offX - Math.round(overlay.offsetWidth / 2)) +'px' 1634 }); 1635 1636 if (/right$/.test(p)) overlay.style.right = - offX +'px'; 1637 1638 if (/^leftpanel$/.test(p)) { 1639 hs.setStyles(overlay, { 1640 right: '100%', 1641 marginRight: this.x.cb +'px', 1642 top: - this.y.cb +'px', 1643 bottom: - this.y.cb +'px', 1644 overflow: 'auto' 1645 }); 1646 this.x.p1 = overlay.offsetWidth; 1647 1648 } else if (/^rightpanel$/.test(p)) { 1649 hs.setStyles(overlay, { 1650 left: '100%', 1651 marginLeft: this.x.cb +'px', 1652 top: - this.y.cb +'px', 1653 bottom: - this.y.cb +'px', 1654 overflow: 'auto' 1655 }); 1656 this.x.p2 = overlay.offsetWidth; 1657 } 1658 1659 if (/^top/.test(p)) overlay.style.top = offY +'px'; 1660 if (/^middle/.test(p)) hs.setStyles (overlay, { 1661 top: '50%', 1662 marginTop: (offY - Math.round(overlay.offsetHeight / 2)) +'px' 1663 }); 1664 if (/^bottom/.test(p)) overlay.style.bottom = - offY +'px'; 1665 if (/^above$/.test(p)) { 1666 hs.setStyles(overlay, { 1667 left: (- this.x.p1 - this.x.cb) +'px', 1668 right: (- this.x.p2 - this.x.cb) +'px', 1669 bottom: '100%', 1670 marginBottom: this.y.cb +'px', 1671 width: 'auto' 1672 }); 1673 this.y.p1 = overlay.offsetHeight; 1674 1675 } else if (/^below$/.test(p)) { 1676 hs.setStyles(overlay, { 1677 position: 'relative', 1678 left: (- this.x.p1 - this.x.cb) +'px', 1679 right: (- this.x.p2 - this.x.cb) +'px', 1680 top: '100%', 1681 marginTop: this.y.cb +'px', 1682 width: 'auto' 1683 }); 1684 this.y.p2 = overlay.offsetHeight; 1685 overlay.style.position = 'absolute'; 1686 } 1687}, 1688 1689getOverlays : function() { 1690 this.getInline(['heading', 'caption'], true); 1691 if (this.heading && this.dragByHeading) this.heading.className += ' highsli
1691de-move'; 1692 if (hs.showCredits) this.writeCredits(); 1693 for (var i = 0; i < hs.overlays.length; i++) { 1694 var o = hs.overlays[i], tId = o.thumbnailId, sg = o.slideshowGroup; 1695 if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId) 1696 || (sg && sg === this.slideshowGroup)) { 1697 this.createOverlay(o); 1698 } 1699 } 1700 var os = []; 1701 for (var i = 0; i < this.overlays.length; i++) { 1702 var o = hs.$('hsId'+ this.overlays[i]); 1703 if (/panel$/.test(o.position)) this.positionOverlay(o); 1704 else hs.push(os, o); 1705 } 1706 for (var i = 0; i < os.length; i++) this.positionOverlay(os[i]); 1707 this.gotOverlays = true; 1708}, 1709genOverlayBox : function() { 1710 if (!this.overlayBox) this.overlayBox = hs.createElement ( 1711 'div', { 1712 className: this.wrapperClassName 1713 }, { 1714 position : 'absolute', 1715 width: (this.x.size || (this.useBox ? this.width : null) 1716 || this.x.full) +'px', 1717 height: (this.y.size || this.y.full) +'px', 1718 visibility : 'hidden', 1719 overflow : 'hidden', 1720 zIndex : hs.ie ? 4 : 'auto' 1721 }, 1722 hs.container, 1723 true 1724 ); 1725}, 1726sizeOverlayBox : function(doWrapper, doPanels) { 1727 var overlayBox = this.overlayBox, 1728 x = this.x, 1729 y = this.y; 1730 hs.setStyles( overlayBox, { 1731 width: x.size +'px', 1732 height: y.size +'px' 1733 }); 1734 if (doWrapper || doPanels) { 1735 for (var i = 0; i < this.overlays.length; i++) { 1736 var o = hs.$('hsId'+ this.overlays[i]); 1737 var ie6 = (hs.ieLt7 || document.compatMode == 'BackCompat'); 1738 if (o && /^(above|below)$/.test(o.position)) { 1739 if (ie6) { 1740 o.style.width = (overlayBox.offsetWidth + 2 * x.cb 1741 + x.p1 + x.p2) +'px'; 1742 } 1743 y[o.position == 'above' ? 'p1' : 'p2'] = o.offsetHeight; 1744 } 1745 if (o && ie6 && /^(left|right)panel$/.test(o.position)) { 1746 o.style.height = (overlayBox.offsetHeight + 2* y.cb) +'px'; 1747 } 1748 } 1749 } 1750 if (doWrapper) { 1751 hs.setStyles(this.content, { 1752 top: y.p1 +'px' 1753 }); 1754 hs.setStyles(overlayBox, { 1755 top: (y.p1 + y.cb) +'px' 1756 }); 1757 } 1758}, 1759 1760showOverlays : function() { 1761 var b = this.overlayBox; 1762 b.className = ''; 1763 hs.setStyles(b, { 1764 top: (this.y.p1 + this.y.cb) +'px', 1765 left: (this.x.p1 + this.x.cb) +'px', 1766 overflow : 'visible' 1767 }); 1768 if (hs.safari) b.style.visibility = 'visible'; 1769 this.wrapper.appendChild (b); 1770 for (var i = 0; i < this.overlays.length; i++) { 1771 var o = hs.$('hsId'+ this.overlays[i]); 1772 o.style.zIndex = o.zIndex || 4; 1773 if (!o.hideOnMouseOut || this.mouseIsOver) { 1774 o.style.visibility = 'visible'; 1775 hs.setStyles(o, { visibility: 'visible', display: '' }); 1776 hs.animate(o, { opacity: o.opacity }, o.dur); 1777 } 1778 } 1779}, 1780 1781destroyOverlays : function() { 1782 if (!this.overlays.length) return; 1783 hs.discardElement(this.overlayBox); 1784}, 1785 1786 1787 1788createFullExpand : function () { 1789 this.fullExpandLabel = hs.createElement( 1790 'a', { 1791 href: 'javascript:hs.expanders['+ this.key +'].doFullExpand();', 1792 title: hs.lang.fullExpandTitle, 1793 className: 'highslide-full-expand' 1794 } 1795 ); 1796 1797 this.createOverlay({ 1798 overlayId: this.fullExpandLabel, 1799 position: hs.fullExpandPosition, 1800 hideOnMouseOut: true, 1801 opacity: hs.fullExpandOpacity 1802 }); 1803}, 1804 1805doFullExpand : function () { 1806 try { 1807 if (this.fullExpandLabel) hs.discardElement(this.fullExpandLabel); 1808 1809 this.focus(); 1810 var xSize = this.x.size; 1811 this.resizeTo(this.x.full, this.y.full); 1812 1813 var xpos = this.x.pos - (this.x.size - xSize) / 2; 1814 if (xpos < hs.marginLeft) xpos = hs.marginLeft; 1815 1816 this.moveTo(xpos, this.y.pos); 1817 this.doShowHide('hidden'); 1818 1819 } catch (e) { 1820 this.error(e); 1821 } 1822}, 1823 1824 1825afterClose : function () { 1826 this.a.className = this.a.className.replace('highslide-active-anchor', ''); 1827 1828 this.doShowHide('visible'); 1829 if (this.outline && this.outlineWhileAnimating) this.outline.destroy(); 1830 1831 hs.discardElement(this.wrapper); 1832 1833 hs.expanders[this.key] = null; 1834 hs.reOrder(); 1835} 1836 1837}; 1838hs.langDefaults = hs.lang; 1839// history 1840var HsExpander = hs.Expander; 1841if (hs.ie && window == window.top) { 1842 (function () { 1843 try { 1844 document.documentElement.doScroll('left'); 1845 } catch (e) { 1846 setTimeout(arguments.callee, 50); 1847 return; 1848 } 1849 hs.ready(); 1850 })(); 1851} 1852hs.addEventListener(document, 'DOMContentLoaded', hs.ready); 1853hs.addEventListener(window, 'load', hs.ready); 1854 1855// set handlers 1856hs.addEventListener(document, 'ready', function() {
1857 if (hs.expandCursor) { 1858 var style = hs.createElement('style', { type: 'text/css' }, null, 1859 document.getElementsByTagName('HEAD')[0]); 1860 1861 function addRule(sel, dec) { 1862 if (hs.ie && hs.uaVersion < 9) { 1863 var last = document.styleSheets[document.styleSheets.length - 1]; 1864 if (typeof(last.addRule) == "object") last.addRule(sel, dec); 1865 } else { 1866 style.appendChild(document.createTextNode(sel + " {" + dec + "}")); 1867 } 1868 } 1869 function fix(prop) { 1870 return 'expression( ( ( ignoreMe = document.documentElement.'+ prop + 1871 ' ? document.documentElement.'+ prop +' : document.body.'+ prop +' ) ) + \'px\' );'; 1872 } 1873 if (hs.expandCursor) addRule ('.highslide img', 1874 'cursor: url('+ hs.graphicsDir + hs.expandCursor +'), pointer !important;'); 1875 } 1876}); 1877hs.addEventListener(window, 'resize', function() { 1878 hs.getPageSize(); 1879}); 1880hs.addEventListener(document, 'mousemove', function(e) { 1881 hs.mouse = { x: e.clientX, y: e.clientY }; 1882}); 1883hs.addEventListener(document, 'mousedown', hs.mouseClickHandler); 1884hs.addEventListener(document, 'mouseup', hs.mouseClickHandler); 1885 1886hs.addEventListener(document, 'ready', hs.getAnchors); 1887hs.addEventListener(window, 'load', hs.preloadImages); 1888}
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.