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