1/** 2 * Name: Highslide JS 3 * Version: 4.1.9 (2010-07-05) 4 * Author: Torstein Hønsi 5 * Support: www.highslide.com/support 6 * License: www.highslide.com/#license 7 */ 8if (!hs) { var hs = { 9// Language strings 10lang : { 11 cssDirection: 'ltr', 12 loadingText : 'Loading...', 13 loadingTitle : 'Click to cancel', 14 focusTitle : 'Click to bring to front', 15 fullExpandTitle : 'Expand to actual size (f)', 16 creditsText : 'Powered by <i>Highslide JS</i>', 17 creditsTitle : 'Go to the Highslide JS homepage', 18 previousText : 'Previous', 19 nextText : 'Next', 20 moveText : 'Move', 21 closeText : 'Close', 22 closeTitle : 'Close (esc)', 23 resizeTitle : 'Resize', 24 playText : 'Play', 25 playTitle : 'Play slideshow (spacebar)', 26 pauseText : 'Pause', 27 pauseTitle : 'Pause slideshow (spacebar)', 28 previousTitle : 'Previous (arrow left)', 29 nextTitle : 'Next (arrow right)', 30 moveTitle : 'Move', 31 fullExpandText : '1:1', 32 number: 'Image %1 of %2', 33 restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.' 34}, 35// See http://highslide.com/ref for examples of settings 36graphicsDir : 'highslide/graphics/', 37expandCursor : 'zoomin.cur', // null disables 38restoreCursor : 'zoomout.cur', // null disables 39expandDuration : 250, // milliseconds 40restoreDuration : 250, 41marginLeft : 15, 42marginRight : 15, 43marginTop : 15, 44marginBottom : 15, 45zIndexCounter : 1001, // adjust to other absolutely positioned elements 46loadingOpacity : 0.75, 47allowMultipleInstances: true, 48numberOfImagesToPreload : 5, 49outlineWhileAnimating : 2, // 0 = never, 1 = always, 2 = HTML only 50outlineStartOffset : 3, // ends at 10 51padToMinWidth : false, // pad the popup width to make room for wide caption 52fullExpandPosition : 'bottom right', 53fullExpandOpacity : 1, 54showCredits : false, // you can set this to false if you want 55creditsHref : 'http://highslide.com/', 56creditsTarget : '_self', 57enableKeyListener : true, 58openerTagNames : ['a'], // Add more to allow slideshow indexing 59transitions : [], 60transitionDuration: 250, 61dimmingOpacity: 0, // Lightbox style dimming background 62dimmingDuration: 50, // 0 for instant dimming 63 64anchor : 'auto', // where the image expands from 65align : 'auto', // position in the client (overrides anchor) 66targetX: null, // the id of a target element 67targetY: null, 68dragByHeading: true, 69minWidth: 200, 70minHeight: 200, 71allowSizeReduction: true, // allow the image to reduce to fit client size. If false, this overrides minWidth and minHeight 72outlineType : 'drop-shadow', // set null to disable outlines 73skin : { 74 controls: 75 '<div class="highslide-controls"><ul>'+ 76 '<li class="highslide-previous">'+ 77 '<a href="#" title="{hs.lang.previousTitle}">'+ 78 '<span>{hs.lang.previousText}</span></a>'+ 79 '</li>'+ 80 '<li class="highslide-play">'+ 81 '<a href="#" title="{hs.lang.playTitle}">'+ 82 '<span>{hs.lang.playText}</span></a>'+ 83 '</li>'+ 84 '<li class="highslide-pause">'+ 85 '<a href="#" title="{hs.lang.pauseTitle}">'+ 86 '<span>{hs.lang.pauseText}</span></a>'+ 87 '</li>'+ 88 '<li class="highslide-next">'+ 89 '<a href="#" title="{hs.lang.nextTitle}">'+ 90 '<span>{hs.lang.nextText}</span></a>'+ 91 '</li>'+ 92 '<li class="highslide-move">'+ 93 '<a href="#" title="{hs.lang.moveTitle}">'+ 94 '<span>{hs.lang.moveText}</span></a>'+ 95 '</li>'+ 96 '<li class="highslide-full-expand">'+ 97 '<a href="#" title="{hs.lang.fullExpandTitle}">'+ 98 '<span>{hs.lang.fullExpandText}</span></a>'+ 99 '</li>'+ 100 '<li class="highslide-close">'+ 101 '<a href="#" title="{hs.lang.closeTitle}" >'+ 102 '<span>{hs.lang.closeText}</span></a>'+ 103 '</li>'+ 104 '</ul></div>' 105}, 106// END OF YOUR SETTINGS 107 108 109// declare internal properties 110preloadTheseImages : [], 111continuePreloading: true, 112expanders : [], 113overrides : [ 114 'allowSizeReduction', 115 'useBox', 116 'anchor', 117 'align', 118 'targetX', 119 'targetY', 120 'outlineType', 121 'outlineWhileAnimating', 122 'captionId', 123 'captionText', 124 'captionEval', 125 'captionOverlay', 126 'headingId', 127 'headingText', 128 'headingEval', 129 'headingOverlay', 130 'creditsPosition', 131 'dragByHeading', 132 'autoplay', 133 'numberPosition', 134 'transitions', 135 'dimmingOpacity', 136 137 'width', 138 'height', 139 140 'wrapperClassName', 141 'minWidth', 142 'minHeight', 143 'maxWidth', 144 'maxHeight', 145 'pageOrigin', 146 'slideshowGroup', 147 'easing', 148 'easingClose', 149 'fadeInOut', 150 'src' 151], 152overlays : [], 153idCounter : 0, 154oPos : { 155 x: ['leftpanel', 'left', 'center', 'right', 'rightpanel'], 156 y: ['above', 'top', 'middle', 'bottom', 'below'] 157}, 158mouse: {}, 159headingOverlay: {}, 160captionOverlay: {}, 161timers : [], 162 163slideshows : [], 164 165pendingOutlines : {}, 166clones : {}, 167onReady: [], 168uaVersion: /Trident\/4\.0/.test(navigator.userAgent) ? 8 : 169 parseFloat((navigator.userAgent.toLowerCase().match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1]), 170ie : (document.all && !window.opera), 171safari : /Safari/.test(navigator.userAgent), 172geckoMac : /Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent), 173 174$ : function (id) { 175 if (id) return document.getElementById(id); 176}, 177 178push : function (arr, val) { 179 arr[arr.length] = val; 180}, 181 182createElement : function (tag, attribs, styles, parent, nopad) { 183 var el = document.createElement(tag); 184 if (attribs) hs.extend(el, attribs); 185 if (nopad) hs.setStyles(el, {padding: 0, border: 'none', margin: 0}); 186 if (styles) hs.setStyles(el, styles); 187 if (parent) parent.appendChild(el); 188 return el; 189}, 190 191extend : function (el, attribs) { 192 for (var x in attribs) el[x] = attribs[x]; 193 return el; 194}, 195 196setStyles : function (el, styles) { 197 for (var x in styles) { 198 if (hs.ie && x == 'opacity') { 199 if (styles[x] > 0.99) el.style.removeAttribute('filter'); 200 else el.style.filter = 'alpha(opacity='+ (styles[x] * 100) +')'; 201 } 202 else el.style[x] = styles[x]; 203 } 204}, 205animate: function(el, prop, opt) { 206 var start, 207 end, 208 unit; 209 if (typeof opt != 'object' || opt === null) { 210 var args = arguments; 211 opt = { 212 duration: args[2], 213 easing: args[3],
214 complete: args[4] 215 }; 216 } 217 if (typeof opt.duration != 'number') opt.duration = 250; 218 opt.easing = Math[opt.easing] || Math.easeInQuad; 219 opt.curAnim = hs.extend({}, prop); 220 for (var name in prop) { 221 var e = new hs.fx(el, opt , name ); 222 223 start = parseFloat(hs.css(el, name)) || 0; 224 end = parseFloat(prop[name]); 225 unit = name != 'opacity' ? 'px' : ''; 226 227 e.custom( start, end, unit ); 228 } 229}, 230css: function(el, prop) { 231 if (el.style[prop]) { 232 return el.style[prop]; 233 } else if (document.defaultView) { 234 return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop); 235 236 } else { 237 if (prop == 'opacity') prop = 'filter'; 238 var val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b){ return b.toUpperCase(); })]; 239 if (prop == 'filter') 240 val = val.replace(/alpha\(opacity=([0-9]+)\)/, 241 function (a, b) { return b / 100 }); 242 return val === '' ? 1 : val; 243 } 244}, 245 246getPageSize : function () { 247 var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat' 248 ? d.documentElement : d.body; 249 250 var width = hs.ie ? iebody.clientWidth : 251 (d.documentElement.clientWidth || self.innerWidth), 252 height = hs.ie ? iebody.clientHeight : self.innerHeight; 253 254 hs.page = { 255 width: width, 256 height: height, 257 scrollLeft: hs.ie ? iebody.scrollLeft : pageXOffset, 258 scrollTop: hs.ie ? iebody.scrollTop : pageYOffset 259 }; 260 return hs.page; 261}, 262 263getPosition : function(el) { 264 var p = { x: el.offsetLeft, y: el.offsetTop }; 265 while (el.offsetParent) { 266 el = el.offsetParent; 267 p.x += el.offsetLeft; 268 p.y += el.offsetTop; 269 if (el != document.body && el != document.documentElement) { 270 p.x -= el.scrollLeft; 271 p.y -= el.scrollTop; 272 } 273 } 274 return p; 275}, 276 277expand : function(a, params, custom, type) { 278 if (!a) a = hs.createElement('a', null, { display: 'none' }, hs.container); 279 if (typeof a.getParams == 'function') return params; 280 try { 281 new hs.Expander(a, params, custom); 282 return false; 283 } catch (e) { return true; } 284}, 285getElementByClass : function (el, tagName, className) { 286 var els = el.getElementsByTagName(tagName); 287 for (var i = 0; i < els.length; i++) { 288 if ((new RegExp(className)).test(els[i].className)) { 289 return els[i]; 290 } 291 } 292 return null; 293}, 294replaceLang : function(s) { 295 s = s.replace(/\s/g, ' '); 296 var re = /{hs\.lang\.([^}]+)\}/g, 297 matches = s.match(re), 298 lang; 299 if (matches) for (var i = 0; i < matches.length; i++) { 300 lang = matches[i].replace(re, "$1"); 301 if (typeof hs.lang[lang] != 'undefined') s = s.replace(matches[i], hs.lang[lang]); 302 } 303 return s; 304}, 305 306 307focusTopmost : function() { 308 var topZ = 0, 309 topmostKey = -1, 310 expanders = hs.expanders, 311 exp, 312 zIndex; 313 for (var i = 0; i < expanders.length; i++) { 314 exp = expanders[i]; 315 if (exp) { 316 zIndex = exp.wrapper.style.zIndex; 317 if (zIndex && zIndex > topZ) { 318 topZ = zIndex; 319 topmostKey = i; 320 } 321 } 322 } 323 if (topmostKey == -1) hs.focusKey = -1; 324 else expanders[topmostKey].focus(); 325}, 326 327getParam : function (a, param) { 328 a.getParams = a.onclick; 329 var p = a.getParams ? a.getParams() : null; 330 a.getParams = null; 331 332 return (p && typeof p[param] != 'undefined') ? p[param] : 333 (typeof hs[param] != 'undefined' ? hs[param] : null); 334}, 335 336getSrc : function (a) { 337 var src = hs.getParam(a, 'src'); 338 if (src) return src; 339 return a.href; 340}, 341 342getNode : function (id) { 343 var node = hs.$(id), clone = hs.clones[id], a = {}; 344 if (!node && !clone) return null; 345 if (!clone) { 346 clone = node.cloneNode(true); 347 clone.id = ''; 348 hs.clones[id] = clone; 349 return node; 350 } else { 351 return clone.cloneNode(true); 352 } 353}, 354 355discardElement : function(d) { 356 if (d) hs.garbageBin.appendChild(d); 357 hs.garbageBin.innerHTML = ''; 358}, 359dim : function(exp) { 360 if (!hs.dimmer) { 361 hs.dimmer = hs.createElement ('div', { 362 className: 'highslide-dimming highslide-viewport-size', 363 owner: '', 364 onclick: function() { 365 366 hs.close(); 367 } 368 }, { 369 visibility: 'visible', 370 opacity: 0 371 }, hs.container, true); 372 } 373 374 hs.dimmer.style.display = ''; 375 376 hs.dimmer.owner += '|'+ exp.key; 377 if (hs.geckoMac && hs.dimmingGeckoFix) 378 hs.setStyles(hs.dimmer, { 379 background: 'url('+ hs.graphicsDir + 'geckodimmer.png)', 380 opacity: 1 381 }); 382 else 383 hs.animate(hs.dimmer, { opacity: exp.dimmingOpacity }, hs.dimmingDuration); 384}, 385undim : function(key) { 386 if (!hs.dimmer) return; 387 if (typeof key != 'undefined') hs.dimmer.owner = hs.dimmer.owner.replace('|'+ key, ''); 388 389 if ( 390 (typeof key != 'undefined' && hs.dimmer.owner != '') 391 || (hs.upcoming && hs.getParam(hs.upcoming, 'dimmingOpacity')) 392 ) return; 393 394 if (hs.geckoMac && hs.dimmingGeckoFix) hs.dimmer.style.display = 'none'; 395 else hs.animate(hs.dimmer, { opacity: 0 }, hs.dimmingDuration, null, function() { 396 hs.dimmer.style.display = 'none'; 397 }); 398}, 399transit : function (adj, exp) { 400 var last = exp || hs.getExpander(); 401 exp = last; 402 if (hs.upcoming) return false;
403 else hs.last = last; 404 hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler); 405 try { 406 hs.upcoming = adj; 407 adj.onclick(); 408 } catch (e){ 409 hs.last = hs.upcoming = null; 410 } 411 try { 412 if (!adj || exp.transitions[1] != 'crossfade') 413 exp.close(); 414 } catch (e) {} 415 return false; 416}, 417 418previousOrNext : function (el, op) { 419 var exp = hs.getExpander(el); 420 if (exp) return hs.transit(exp.getAdjacentAnchor(op), exp); 421 else return false; 422}, 423 424previous : function (el) { 425 return hs.previousOrNext(el, -1); 426}, 427 428next : function (el) { 429 return hs.previousOrNext(el, 1); 430}, 431 432keyHandler : function(e) { 433 if (!e) e = window.event; 434 if (!e.target) e.target = e.srcElement; // ie 435 if (typeof e.target.form != 'undefined') return true; // form element has focus 436 var exp = hs.getExpander(); 437 438 var op = null; 439 switch (e.keyCode) { 440 case 70: // f 441 if (exp) exp.doFullExpand(); 442 return true; 443 case 32: // Space 444 op = 2; 445 break; 446 case 34: // Page Down 447 case 39: // Arrow right 448 case 40: // Arrow down 449 op = 1; 450 break; 451 case 8: // Backspace 452 case 33: // Page Up 453 case 37: // Arrow left 454 case 38: // Arrow up 455 op = -1; 456 break; 457 case 27: // Escape 458 case 13: // Enter 459 op = 0; 460 } 461 if (op !== null) { 462 hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler); 463 if (!hs.enableKeyListener) return true; 464 465 if (e.preventDefault) e.preventDefault(); 466 else e.returnValue = false; 467 if (exp) { 468 if (op == 0) { 469 exp.close(); 470 } else if (op == 2) { 471 if (exp.slideshow) exp.slideshow.hitSpace(); 472 } else { 473 if (exp.slideshow) exp.slideshow.pause(); 474 hs.previousOrNext(exp.key, op); 475 } 476 return false; 477 } 478 } 479 return true; 480}, 481 482 483registerOverlay : function (overlay) { 484 hs.push(hs.overlays, hs.extend(overlay, { hsId: 'hsId'+ hs.idCounter++ } )); 485}, 486 487 488addSlideshow : function (options) { 489 var sg = options.slideshowGroup; 490 if (typeof sg == 'object') { 491 for (var i = 0; i < sg.length; i++) { 492 var o = {}; 493 for (var x in options) o[x] = options[x]; 494 o.slideshowGroup = sg[i]; 495 hs.push(hs.slideshows, o); 496 } 497 } else { 498 hs.push(hs.slideshows, options); 499 } 500}, 501 502getWrapperKey : function (element, expOnly) { 503 var el, re = /^highslide-wrapper-([0-9]+)$/; 504 // 1. look in open expanders 505 el = element; 506 while (el.parentNode) { 507 if (el.hsKey !== undefined) return el.hsKey; 508 if (el.id && re.test(el.id)) return el.id.replace(re, "$1"); 509 el = el.parentNode; 510 } 511 // 2. look in thumbnail 512 if (!expOnly) { 513 el = element; 514 while (el.parentNode) { 515 if (el.tagName && hs.isHsAnchor(el)) { 516 for (var key = 0; key < hs.expanders.length; key++) { 517 var exp = hs.expanders[key]; 518 if (exp && exp.a == el) return key; 519 } 520 } 521 el = el.parentNode; 522 } 523 } 524 return null; 525}, 526 527getExpander : function (el, expOnly) { 528 if (typeof el == 'undefined') return hs.expanders[hs.focusKey] || null; 529 if (typeof el == 'number') return hs.expanders[el] || null; 530 if (typeof el == 'string') el = hs.$(el); 531 return hs.expanders[hs.getWrapperKey(el, expOnly)] || null; 532}, 533 534isHsAnchor : function (a) { 535 return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/hs.(htmlE|e)xpand/)); 536}, 537 538reOrder : function () { 539 for (var i = 0; i < hs.expanders.length; i++) 540 if (hs.expanders[i] && hs.expanders[i].isExpanded) hs.focusTopmost(); 541}, 542 543mouseClickHandler : function(e) 544{ 545 if (!e) e = window.event; 546 if (e.button > 1) return true; 547 if (!e.target) e.target = e.srcElement; 548 549 var el = e.target; 550 while (el.parentNode 551 && !(/highslide-(image|move|html|resize)/.test(el.className))) 552 { 553 el = el.parentNode; 554 } 555 var exp = hs.getExpander(el); 556 if (exp && (exp.isClosing || !exp.isExpanded)) return true; 557 558 if (exp && e.type == 'mousedown') { 559 if (e.target.form) return true; 560 var match = el.className.match(/highslide-(image|move|resize)/); 561 if (match) { 562 hs.dragArgs = { 563 exp: exp , 564 type: match[1], 565 left: exp.x.pos, 566 width: exp.x.size, 567 top: exp.y.pos, 568 height: exp.y.size, 569 clickX: e.clientX, 570 clickY: e.clientY 571 }; 572 573 574 hs.addEventListener(document, 'mousemove', hs.dragHandler); 575 if (e.preventDefault) e.preventDefault(); // FF 576 577 if (/highslide-(image|html)-blur/.test(exp.content.className)) { 578 exp.focus(); 579 hs.hasFocused = true; 580 } 581 return false;
582 } 583 } else if (e.type == 'mouseup') { 584 585 hs.removeEventListener(document, 'mousemove', hs.dragHandler); 586 587 if (hs.dragArgs) { 588 if (hs.styleRestoreCursor && hs.dragArgs.type == 'image') 589 hs.dragArgs.exp.content.style.cursor = hs.styleRestoreCursor; 590 var hasDragged = hs.dragArgs.hasDragged; 591 592 if (!hasDragged &&!hs.hasFocused && !/(move|resize)/.test(hs.dragArgs.type)) { 593 exp.close(); 594 } 595 else if (hasDragged || (!hasDragged && hs.hasHtmlExpanders)) { 596 hs.dragArgs.exp.doShowHide('hidden'); 597 } 598 hs.hasFocused = false; 599 hs.dragArgs = null; 600 601 } else if (/highslide-image-blur/.test(el.className)) { 602 el.style.cursor = hs.styleRestoreCursor; 603 } 604 } 605 return false; 606}, 607 608dragHandler : function(e) 609{ 610 if (!hs.dragArgs) return true; 611 if (!e) e = window.event; 612 var a = hs.dragArgs, exp = a.exp; 613 614 a.dX = e.clientX - a.clickX; 615 a.dY = e.clientY - a.clickY; 616 617 var distance = Math.sqrt(Math.pow(a.dX, 2) + Math.pow(a.dY, 2)); 618 if (!a.hasDragged) a.hasDragged = (a.type != 'image' && distance > 0) 619 || (distance > (hs.dragSensitivity || 5)); 620 621 if (a.hasDragged && e.clientX > 5 && e.clientY > 5) { 622 623 if (a.type == 'resize') exp.resize(a); 624 else { 625 exp.moveTo(a.left + a.dX, a.top + a.dY); 626 if (a.type == 'image') exp.content.style.cursor = 'move'; 627 } 628 } 629 return false; 630}, 631 632wrapperMouseHandler : function (e) { 633 try { 634 if (!e) e = window.event; 635 var over = /mouseover/i.test(e.type); 636 if (!e.target) e.target = e.srcElement; // ie 637 if (hs.ie) e.relatedTarget = 638 over ? e.fromElement : e.toElement; // ie 639 var exp = hs.getExpander(e.target); 640 if (!exp.isExpanded) return; 641 if (!exp || !e.relatedTarget || hs.getExpander(e.relatedTarget, true) == exp 642 || hs.dragArgs) return; 643 for (var i = 0; i < exp.overlays.length; i++) (function() { 644 var o = hs.$('hsId'+ exp.overlays[i]); 645 if (o && o.hideOnMouseOut) { 646 if (over) hs.setStyles(o, { visibility: 'visible', display: '' }); 647 hs.animate(o, { opacity: over ? o.opacity : 0 }, o.dur); 648 } 649 })(); 650 } catch (e) {} 651}, 652addEventListener : function (el, event, func) { 653 if (el == document && event == 'ready') { 654 hs.push(hs.onReady, func); 655 } 656 try { 657 el.addEventListener(event, func, false); 658 } catch (e) { 659 try { 660 el.detachEvent('on'+ event, func); 661 el.attachEvent('on'+ event, func); 662 } catch (e) { 663 el['on'+ event] = func; 664 } 665 } 666}, 667 668removeEventListener : function (el, event, func) { 669 try { 670 el.removeEventListener(event, func, false); 671 } catch (e) { 672 try { 673 el.detachEvent('on'+ event, func); 674 } catch (e) { 675 el['on'+ event] = null; 676 } 677 } 678}, 679 680preloadFullImage : function (i) { 681 if (hs.continuePreloading && hs.preloadTheseImages[i] && hs.preloadTheseImages[i] != 'undefined') { 682 var img = document.createElement('img'); 683 img.onload = function() { 684 img = null; 685 hs.preloadFullImage(i + 1); 686 }; 687 img.src = hs.preloadTheseImages[i]; 688 } 689}, 690preloadImages : function (number) { 691 if (number && typeof number != 'object') hs.numberOfImagesToPreload = number; 692 693 var arr = hs.getAnchors(); 694 for (var i = 0; i < arr.images.length && i < hs.numberOfImagesToPreload; i++) { 695 hs.push(hs.preloadTheseImages, hs.getSrc(arr.images[i])); 696 } 697 698 // preload outlines 699 if (hs.outlineType) new hs.Outline(hs.outlineType, function () { hs.preloadFullImage(0)} ); 700 else 701 702 hs.preloadFullImage(0); 703 704 // preload cursor 705 if (hs.restoreCursor) var cur = hs.createElement('img', { src: hs.graphicsDir + hs.restoreCursor }); 706}, 707 708 709init : function () { 710 if (!hs.container) { 711 712 hs.getPageSize(); 713 hs.ieLt7 = hs.ie && hs.uaVersion < 7; 714 for (var x in hs.langDefaults) { 715 if (typeof hs[x] != 'undefined') hs.lang[x] = hs[x]; 716 else if (typeof hs.lang[x] == 'undefined' && typeof hs.langDefaults[x] != 'undefined') 717 hs.lang[x] = hs.langDefaults[x]; 718 } 719 720 hs.container = hs.createElement('div', { 721 className: 'highslide-container' 722 }, { 723 position: 'absolute', 724 left: 0, 725 top: 0, 726 width: '100%', 727 zIndex: hs.zIndexCounter, 728 direction: 'ltr' 729 }, 730 document.body, 731 true 732 ); 733 hs.loading = hs.createElement('a', { 734 className: 'highslide-loading', 735 title: hs.lang.loadingTitle, 736 innerHTML: hs.lang.loadingText, 737 href: 'javascript:;' 738 }, { 739 position: 'absolute', 740 top: '-9999px', 741 opacity: hs.loadingOpacity, 742 zIndex: 1 743 }, hs.container 744 ); 745 hs.garbageBin = hs.createElement('div', null, { display: 'none' }, hs.container); 746 hs.viewport = hs.createElement('div', {
747 className: 'highslide-viewport highslide-viewport-size' 748 }, { 749 visibility: (hs.safari && hs.uaVersion < 525) ? 'visible' : 'hidden' 750 }, hs.container, 1 751 ); 752 753 // http://www.robertpenner.com/easing/ 754 Math.linearTween = function (t, b, c, d) { 755 return c*t/d + b; 756 }; 757 Math.easeInQuad = function (t, b, c, d) { 758 return c*(t/=d)*t + b; 759 }; 760 Math.easeOutQuad = function (t, b, c, d) { 761 return -c *(t/=d)*(t-2) + b; 762 }; 763 764 hs.hideSelects = hs.ieLt7; 765 hs.hideIframes = ((window.opera && hs.uaVersion < 9) || navigator.vendor == 'KDE' 766 || (hs.ie && hs.uaVersion < 5.5)); 767 } 768}, 769ready : function() { 770 if (hs.isReady) return; 771 hs.isReady = true; 772 for (var i = 0; i < hs.onReady.length; i++) hs.onReady[i](); 773}, 774 775updateAnchors : function() { 776 var el, els, all = [], images = [],groups = {}, re; 777 778 for (var i = 0; i < hs.openerTagNames.length; i++) { 779 els = document.getElementsByTagName(hs.openerTagNames[i]); 780 for (var j = 0; j < els.length; j++) { 781 el = els[j]; 782 re = hs.isHsAnchor(el); 783 if (re) { 784 hs.push(all, el); 785 if (re[0] == 'hs.expand') hs.push(images, el); 786 var g = hs.getParam(el, 'slideshowGroup') || 'none'; 787 if (!groups[g]) groups[g] = []; 788 hs.push(groups[g], el); 789 } 790 } 791 } 792 hs.anchors = { all: all, groups: groups, images: images }; 793 return hs.anchors; 794 795}, 796 797getAnchors : function() { 798 return hs.anchors || hs.updateAnchors(); 799}, 800 801 802close : function(el) { 803 var exp = hs.getExpander(el); 804 if (exp) exp.close(); 805 return false; 806} 807}; // end hs object 808hs.fx = function( elem, options, prop ){ 809 this.options = options; 810 this.elem = elem; 811 this.prop = prop; 812 813 if (!options.orig) options.orig = {}; 814}; 815hs.fx.prototype = { 816 update: function(){ 817 (hs.fx.step[this.prop] || hs.fx.step._default)(this); 818 819 if (this.options.step) 820 this.options.step.call(this.elem, this.now, this); 821 822 }, 823 custom: function(from, to, unit){ 824 this.startTime = (new Date()).getTime(); 825 this.start = from; 826 this.end = to; 827 this.unit = unit;// || this.unit || "px"; 828 this.now = this.start; 829 this.pos = this.state = 0; 830 831 var self = this; 832 function t(gotoEnd){ 833 return self.step(gotoEnd); 834 } 835 836 t.elem = this.elem; 837 838 if ( t() && hs.timers.push(t) == 1 ) { 839 hs.timerId = setInterval(function(){ 840 var timers = hs.timers; 841 842 for ( var i = 0; i < timers.length; i++ ) 843 if ( !timers[i]() ) 844 timers.splice(i--, 1); 845 846 if ( !timers.length ) { 847 clearInterval(hs.timerId); 848 } 849 }, 13); 850 } 851 }, 852 step: function(gotoEnd){ 853 var t = (new Date()).getTime(); 854 if ( gotoEnd || t >= this.options.duration + this.startTime ) { 855 this.now = this.end; 856 this.pos = this.state = 1; 857 this.update(); 858 859 this.options.curAnim[ this.prop ] = true; 860 861 var done = true; 862 for ( var i in this.options.curAnim ) 863 if ( this.options.curAnim[i] !== true ) 864 done = false; 865 866 if ( done ) { 867 if (this.options.complete) this.options.complete.call(this.elem); 868 } 869 return false; 870 } else { 871 var n = t - this.startTime; 872 this.state = n / this.options.duration; 873 this.pos = this.options.easing(n, 0, 1, this.options.duration);
874 this.now = this.start + ((this.end - this.start) * this.pos); 875 this.update(); 876 } 877 return true; 878 } 879 880}; 881 882hs.extend( hs.fx, { 883 step: { 884 885 opacity: function(fx){ 886 hs.setStyles(fx.elem, { opacity: fx.now }); 887 }, 888 889 _default: function(fx){ 890 try { 891 if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) 892 fx.elem.style[ fx.prop ] = fx.now + fx.unit; 893 else 894 fx.elem[ fx.prop ] = fx.now; 895 } catch (e) {} 896 } 897 } 898}); 899 900hs.Outline = function (outlineType, onLoad) { 901 this.onLoad = onLoad; 902 this.outlineType = outlineType; 903 var v = hs.uaVersion, tr; 904 905 this.hasAlphaImageLoader = hs.ie && v >= 5.5 && v < 7; 906 if (!outlineType) { 907 if (onLoad) onLoad(); 908 return; 909 } 910 911 hs.init(); 912 this.table = hs.createElement( 913 'table', { 914 cellSpacing: 0 915 }, { 916 visibility: 'hidden', 917 position: 'absolute', 918 borderCollapse: 'collapse', 919 width: 0 920 }, 921 hs.container, 922 true 923 ); 924 var tbody = hs.createElement('tbody', null, null, this.table, 1); 925 926 this.td = []; 927 for (var i = 0; i <= 8; i++) { 928 if (i % 3 == 0) tr = hs.createElement('tr', null, { height: 'auto' }, tbody, true); 929 this.td[i] = hs.createElement('td', null, null, tr, true); 930 var style = i != 4 ? { lineHeight: 0, fontSize: 0} : { position : 'relative' }; 931 hs.setStyles(this.td[i], style); 932 }
933 this.td[4].className = outlineType +' highslide-outline'; 934 935 this.preloadGraphic(); 936}; 937 938hs.Outline.prototype = { 939preloadGraphic : function () { 940 var src = hs.graphicsDir + (hs.outlinesDir || "outlines/")+ this.outlineType +".png"; 941 942 var appendTo = hs.safari && hs.uaVersion < 525 ? hs.container : null; 943 this.graphic = hs.createElement('img', null, { position: 'absolute', 944 top: '-9999px' }, appendTo, true); // for onload trigger 945 946 var pThis = this; 947 this.graphic.onload = function() { pThis.onGraphicLoad(); }; 948 949 this.graphic.src = src; 950}, 951 952onGraphicLoad : function () { 953 var o = this.offset = this.graphic.width / 4, 954 pos = [[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]], 955 dim = { height: (2*o) +'px', width: (2*o) +'px' }; 956 for (var i = 0; i <= 8; i++) { 957 if (pos[i]) { 958 if (this.hasAlphaImageLoader) { 959 var w = (i == 1 || i == 7) ? '100%' : this.graphic.width +'px'; 960 var div = hs.createElement('div', null, { width: '100%', height: '100%', position: 'relative', overflow: 'hidden'}, this.td[i], true); 961 hs.createElement ('div', null, { 962 filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+ this.graphic.src + "')", 963 position: 'absolute', 964 width: w, 965 height: this.graphic.height +'px', 966 left: (pos[i][0]*o)+'px', 967 top: (pos[i][1]*o)+'px' 968 }, 969 div, 970 true); 971 } else { 972 hs.setStyles(this.td[i], { background: 'url('+ this.graphic.src +') '+ (pos[i][0]*o)+'px '+(pos[i][1]*o)+'px'}); 973 } 974 975 if (window.opera && (i == 3 || i ==5)) 976 hs.createElement('div', null, dim, this.td[i], true); 977 978 hs.setStyles (this.td[i], dim); 979 } 980 } 981 this.graphic = null; 982 if (hs.pendingOutlines[this.outlineType]) hs.pendingOutlines[this.outlineType].destroy(); 983 hs.pendingOutlines[this.outlineType] = this; 984 if (this.onLoad) this.onLoad(); 985}, 986 987setPosition : function (pos, offset, vis, dur, easing) { 988 var exp = this.exp, 989 stl = exp.wrapper.style, 990 offset = offset || 0, 991 pos = pos || { 992 x: exp.x.pos + offset, 993 y: exp.y.pos + offset, 994 w: exp.x.get('wsize') - 2 * offset, 995 h: exp.y.get('wsize') - 2 * offset 996 }; 997 if (vis) this.table.style.visibility = (pos.h >= 4 * this.offset) 998 ? 'visible' : 'hidden'; 999 hs.setStyles(this.table, { 1000 left: (pos.x - this.offset) +'px', 1001 top: (pos.y - this.offset) +'px', 1002 width: (pos.w + 2 * this.offset) +'px' 1003 }); 1004 1005 pos.w -= 2 * this.offset; 1006 pos.h -= 2 * this.offset; 1007 hs.setStyles (this.td[4], { 1008 width: pos.w >= 0 ? pos.w +'px' : 0, 1009 height: pos.h >= 0 ? pos.h +'px' : 0 1010 }); 1011 if (this.hasAlphaImageLoader) this.td[3].style.height 1012 = this.td[5].style.height = this.td[4].style.height; 1013 1014}, 1015 1016destroy : function(hide) { 1017 if (hide) this.table.style.visibility = 'hidden'; 1018 else hs.discardElement(this.table); 1019} 1020}; 1021 1022hs.Dimension = function(exp, dim) { 1023 this.exp = exp; 1024 this.dim = dim; 1025 this.ucwh = dim == 'x' ? 'Width' : 'Height'; 1026 this.wh = this.ucwh.toLowerCase(); 1027 this.uclt = dim == 'x' ? 'Left' : 'Top'; 1028 this.lt = this.uclt.toLowerCase(); 1029 this.ucrb = dim == 'x' ? 'Right' : 'Bottom'; 1030 this.rb = this.ucrb.toLowerCase(); 1031 this.p1 = this.p2 = 0; 1032}; 1033hs.Dimension.prototype = { 1034get : function(key) { 1035 switch (key) { 1036 case 'loadingPos': 1037 return this.tpos + this.tb + (this.t - hs.loading['offset'+ this.ucwh]) / 2; 1038 case 'loadingPosXfade': 1039 return this.pos + this.cb+ this.p1 + (this.size - hs.loading['offset'+ this.ucwh]) / 2; 1040 case 'wsize': 1041 return this.size + 2 * this.cb + this.p1 + this.p2; 1042 case 'fitsize': 1043 return this.clientSize - this.marginMin - this.marginMax; 1044 case 'maxsize': 1045 return this.get('fitsize') - 2 * this.cb - this.p1 - this.p2 ; 1046 case 'opos': 1047 return this.pos - (this.exp.outline ? this.exp.outline.offset : 0); 1048 case 'osize': 1049 return this.get('wsize') + (this.exp.outline ? 2*this.exp.outline.offset : 0); 1050 case 'imgPad': 1051 return this.imgSize ? Math.round((this.size - this.imgSize) / 2) : 0; 1052 1053 } 1054}, 1055calcBorders: function() { 1056 // correct for borders 1057 this.cb = (this.exp.content['offset'+ this.ucwh] - this.t) / 2; 1058 1059 this.marginMax = hs['margin'+ this.ucrb]; 1060}, 1061calcThumb: function() { 1062 this.t = this.exp.el[this.wh] ? parseInt(this.exp.el[this.wh]) : 1063 this.exp.el['offset'+ this.ucwh]; 1064 this.tpos = this.exp.tpos[this.dim]; 1065 this.tb = (this.exp.el['offset'+ this.ucwh] - this.t) / 2; 1066 if (this.tpos == 0 || this.tpos == -1) { 1067 this.tpos = (hs.page[this.wh] / 2) + hs.page['scroll'+ this.uclt]; 1068 }; 1069}, 1070calcExpanded: function() { 1071 var exp = this.exp; 1072 this.justify = 'auto'; 1073 1074 // get alignment 1075 if (exp.align == 'center') this.justify = 'center'; 1076 else if (new RegExp(this.lt).test(exp.anchor)) this.justify = null; 1077 else if (new RegExp(this.rb).test(exp.anchor)) this.justify = 'max'; 1078 1079 1080 // size and position 1081 this.pos = this.tpos - this.cb + this.tb; 1082 1083 if (this.maxHeight && this.dim == 'x') 1084 exp.maxWidth = Math.min(exp.maxWidth || this.full, exp.maxHeight * this.full / exp.y.full); 1085 1086 this.size = Math.min(this.full, exp['max'+ this.ucwh] || this.full); 1087 this.minSize = exp.allowSizeReduction ? 1088 Math.min(exp['min'+ this.ucwh], this.full) :this.full; 1089 if (exp.isImage && exp.useBox) { 1090 this.size = exp[this.wh]; 1091 this.imgSize = this.full; 1092 } 1093 if (this.dim == 'x' && hs.padToMinWidth) this.minSize = exp.minWidth; 1094 this.target = exp['target'+ this.dim.toUpperCase()]; 1095 this.marginMin = hs['margin'+ this.uclt]; 1096 this.scroll = hs.page['scroll'+ this.uclt]; 1097 this.clientSize = hs.page[this.wh]; 1098}, 1099setSize: function(i) { 1100 var exp = this.exp; 1101 if (exp.isImage && (exp.useBox || hs.padToMinWidth)) { 1102 this.imgSize = i; 1103 this.size = Math.max(this.size, this.imgSize); 1104 exp.content.style[this.lt] = this.get('imgPad')+'px'; 1105 } else 1106 this.size = i; 1107 1108 exp.content.style[this.wh] = i +'px'; 1109 exp.wrapper.style[this.wh] = this.get('wsize') +'px'; 1110 if (exp.outline) exp.outline.setPosition(); 1111 if (this.dim == 'x' && exp.overlayBox) exp.sizeOverlayBox(true); 1112 if (this.dim == 'x' && exp.slideshow && exp.isImage) { 1113 if (i == this.full) exp.slideshow.disable('full-expand'); 1114 else exp.slideshow.enable('full-expand'); 1115 } 1116}, 1117setPos: function(i) { 1118 this.pos = i; 1119 this.exp.wrapper.style[this.lt] = i +'px'; 1120 1121 if (this.exp.outline) this.exp.outline.setPosition(); 1122 1123} 1124}; 1125 1126hs.Expander = function(a, params, custom, contentType) { 1127 if (document.readyState && hs.ie && !hs.isReady) { 1128 hs.addEventListener(document, 'ready', function() { 1129 new hs.Expander(a, params, custom, contentType); 1130 }); 1131 return; 1132 } 1133 this.a = a; 1134 this.custom = custom; 1135 this.contentType = contentType || 'image'; 1136 this.isImage = !this.isHtml; 1137 1138 hs.continuePreloading = false;
1139 this.overlays = []; 1140 this.last = hs.last; 1141 hs.last = null; 1142 hs.init(); 1143 var key = this.key = hs.expanders.length; 1144 // override inline parameters 1145 for (var i = 0; i < hs.overrides.length; i++) { 1146 var name = hs.overrides[i]; 1147 this[name] = params && typeof params[name] != 'undefined' ? 1148 params[name] : hs[name]; 1149 } 1150 if (!this.src) this.src = a.href; 1151 1152 // get thumb 1153 var el = (params && params.thumbnailId) ? hs.$(params.thumbnailId) : a; 1154 el = this.thumb = el.getElementsByTagName('img')[0] || el; 1155 this.thumbsUserSetId = el.id || a.id; 1156 1157 // check if already open 1158 for (var i = 0; i < hs.expanders.length; i++) { 1159 if (hs.expanders[i] && hs.expanders[i].a == a 1160 && !(this.last && this.transitions[1] == 'crossfade')) { 1161 hs.expanders[i].focus(); 1162 return false; 1163 } 1164 } 1165 1166 // cancel other 1167 if (!hs.allowSimultaneousLoading) for (var i = 0; i < hs.expanders.length; i++) { 1168 if (hs.expanders[i] && hs.expanders[i].thumb != el && !hs.expanders[i].onLoadStarted) { 1169 hs.expanders[i].cancelLoading(); 1170 } 1171 } 1172 hs.expanders[key] = this; 1173 if (!hs.allowMultipleInstances && !hs.upcoming) { 1174 if (hs.expanders[key-1]) hs.expanders[key-1].close(); 1175 if (typeof hs.focusKey != 'undefined' && hs.expanders[hs.focusKey]) 1176 hs.expanders[hs.focusKey].close(); 1177 } 1178 1179 // initiate metrics 1180 this.el = el; 1181 this.tpos = this.pageOrigin || hs.getPosition(el); 1182 hs.getPageSize(); 1183 var x = this.x = new hs.Dimension(this, 'x'); 1184 x.calcThumb(); 1185 var y = this.y = new hs.Dimension(this, 'y'); 1186 y.calcThumb(); 1187 this.wrapper = hs.createElement( 1188 'div', { 1189 id: 'highslide-wrapper-'+ this.key, 1190 className: 'highslide-wrapper '+ this.wrapperClassName 1191 }, { 1192 visibility: 'hidden', 1193 position: 'absolute', 1194 zIndex: hs.zIndexCounter += 2 1195 }, null, true ); 1196 1197 this.wrapper.onmouseover = this.wrapper.onmouseout = hs.wrapperMouseHandler; 1198 if (this.contentType == 'image' && this.outlineWhileAnimating == 2) 1199 this.outlineWhileAnimating = 0; 1200 1201 // get the outline 1202 if (!this.outlineType 1203 || (this.last && this.isImage && this.transitions[1] == 'crossfade')) { 1204 this[this.contentType +'Create'](); 1205 1206 } else if (hs.pendingOutlines[this.outlineType]) { 1207 this.connectOutline(); 1208 this[this.contentType +'Create'](); 1209 1210 } else { 1211 this.showLoading(); 1212 var exp = this; 1213 new hs.Outline(this.outlineType, 1214 function () { 1215 exp.connectOutline(); 1216 exp[exp.contentType +'Create'](); 1217 } 1218 ); 1219 } 1220 return true; 1221}; 1222 1223hs.Expander.prototype = { 1224error : function(e) { 1225 if (hs.debug) alert ('Line '+ e.lineNumber +': '+ e.message); 1226 else window.location.href = this.src; 1227}, 1228 1229connectOutline : function() { 1230 var outline = this.outline = hs.pendingOutlines[this.outlineType]; 1231 outline.exp = this; 1232 outline.table.style.zIndex = this.wrapper.style.zIndex - 1; 1233 hs.pendingOutlines[this.outlineType] = null; 1234}, 1235 1236showLoading : function() { 1237 if (this.onLoadStarted || this.loading) return; 1238 1239 this.loading = hs.loading; 1240 var exp = this; 1241 this.loading.onclick = function() { 1242 exp.cancelLoading(); 1243 }; 1244 var exp = this, 1245 l = this.x.get('loadingPos') +'px', 1246 t = this.y.get('loadingPos') +'px'; 1247 if (!tgt && this.last && this.transitions[1] == 'crossfade') 1248 var tgt = this.last; 1249 if (tgt) { 1250 l = tgt.x.get('loadingPosXfade') +'px'; 1251 t = tgt.y.get('loadingPosXfade') +'px'; 1252 this.loading.style.zIndex = hs.zIndexCounter++; 1253 } 1254 setTimeout(function () { 1255 if (exp.loading) hs.setStyles(exp.loading, { left: l, top: t, zIndex: hs.zIndexCounter++ })} 1256 , 100); 1257}, 1258 1259imageCreate : function() { 1260 var exp = this; 1261 1262 var img = document.createElement('img'); 1263 this.content = img; 1264 img.onload = function () { 1265 if (hs.expanders[exp.key]) exp.contentLoaded(); 1266 }; 1267 if (hs.blockRightClick) img.oncontextmenu = function() { return false; }; 1268 img.className = 'highslide-image'; 1269 hs.setStyles(img, { 1270 visibility: 'hidden', 1271 display: 'block', 1272 position: 'absolute', 1273 maxWidth: '9999px', 1274 zIndex: 3 1275 }); 1276 img.title = hs.lang.restoreTitle; 1277 if (hs.safari && hs.uaVersion < 525) hs.container.appendChild(img); 1278 if (hs.ie && hs.flushImgSize) img.src = null; 1279 img.src = this.src; 1280 1281 this.showLoading(); 1282}, 1283 1284contentLoaded : function() { 1285 try { 1286 if (!this.content) return; 1287 this.content.onload = null; 1288 if (this.onLoadStarted) return; 1289 else this.onLoadStarted = true; 1290 1291 var x = this.x, y = this.y; 1292 1293 if (this.loading) { 1294 hs.setStyles(this.loading, { top: '-9999px' }); 1295 this.loading = null; 1296 } 1297 x.full = this.content.width; 1298 y.full = this.content.height; 1299 1300 hs.setStyles(this.content, { 1301 width: x.t +'px', 1302 height: y.t +'px' 1303 }); 1304 this.wrapper.appendChild(this.content); 1305 hs.container.appendChild(this.wrapper); 1306 1307 x.calcBorders(); 1308 y.calcBorders(); 1309 1310 hs.setStyles (this.wrapper, { 1311 left: (x.tpos + x.tb - x.cb) +'px', 1312 top: (y.tpos + x.tb - y.cb) +'px' 1313 }); 1314 1315 1316 this.initSlideshow(); 1317 this.getOverlays(); 1318 1319 var ratio = x.full / y.full; 1320 x.calcExpanded(); 1321 this.justify(x); 1322 1323 y.calcExpanded(); 1324 this.justify(y); 1325 if (this.overlayBox) this.sizeOverlayBox(0, 1); 1326 1327 1328 if (this.allowSizeReduction) { 1329 this.correctRatio(ratio); 1330 var ss = this.slideshow; 1331 if (ss && this.last && ss.controls && ss.fixedControls) { 1332 var pos = ss.overlayOptions.position || '', p; 1333 for (var dim in hs.oPos) for (var i = 0; i < 5; i++) { 1334 p = this[dim]; 1335 if (pos.match(hs.oPos[dim][i])) { 1336 p.pos = this.last[dim].pos 1337 + (this.last[dim].p1 - p.p1) 1338 + (this.last[dim].size - p.size) * [0, 0, .5, 1, 1][i]; 1339 if (ss.fixedControls == 'fit') { 1340 if (p.pos + p.size + p.p1 + p.p2 > p.scroll + p.clientSize - p.marginMax) 1341 p.pos = p.scroll + p.clientSize - p.size - p.marginMin - p.marginMax - p.p1 - p.p2; 1342 if (p.pos < p.scroll + p.marginMin) p.pos = p.scroll + p.marginMin; 1343 } 1344 } 1345 } 1346 } 1347 if (this.isImage && this.x.full > (this.x.imgSize || this.x.size)) { 1348 this.createFullExpand(); 1349 if (this.overlays.length == 1) this.sizeOverlayBox(); 1350 } 1351 } 1352 this.show(); 1353 1354 } catch (e) { 1355 this.error(e); 1356 } 1357}, 1358 1359justify : function (p, moveOnly) { 1360 var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y'; 1361 1362 if (tgt && tgt.match(/ /)) { 1363 tgtArr = tgt.split(' '); 1364 tgt = tgtArr[0]; 1365 } 1366 if (tgt && hs.$(tgt)) { 1367 p.pos = hs.getPosition(hs.$(tgt))[dim]; 1368 if (tgtArr && tgtArr[1] && tgtArr[1].match(/^[-]?[0-9]+px$/)) 1369 p.pos += parseInt(tgtArr[1]); 1370 if (p.size < p.minSize) p.size = p.minSize; 1371 1372 } else if (p.justify == 'auto' || p.justify == 'center') { 1373 1374 var hasMovedMin = false;
1375 1376 var allowReduce = p.exp.allowSizeReduction; 1377 if (p.justify == 'center') 1378 p.pos = Math.round(p.scroll + (p.clientSize + p.marginMin - p.marginMax - p.get('wsize')) / 2); 1379 else 1380 p.pos = Math.round(p.pos - ((p.get('wsize') - p.t) / 2)); 1381 if (p.pos < p.scroll + p.marginMin) { 1382 p.pos = p.scroll + p.marginMin; 1383 hasMovedMin = true; 1384 } 1385 if (!moveOnly && p.size < p.minSize) { 1386 p.size = p.minSize; 1387 allowReduce = false; 1388 } 1389 if (p.pos + p.get('wsize') > p.scroll + p.clientSize - p.marginMax) { 1390 if (!moveOnly && hasMovedMin && allowReduce) { 1391 p.size = Math.min(p.size, p.get(dim == 'y' ? 'fitsize' : 'maxsize')); 1392 } else if (p.get('wsize') < p.get('fitsize')) { 1393 p.pos = p.scroll + p.clientSize - p.marginMax - p.get('wsize'); 1394 } else { // image larger than viewport 1395 p.pos = p.scroll + p.marginMin; 1396 if (!moveOnly && allowReduce) p.size = p.get(dim == 'y' ? 'fitsize' : 'maxsize'); 1397 } 1398 } 1399 1400 if (!moveOnly && p.size < p.minSize) { 1401 p.size = p.minSize; 1402 allowReduce = false; 1403 } 1404 1405 1406 } else if (p.justify == 'max') { 1407 p.pos = Math.floor(p.pos - p.size + p.t); 1408 } 1409 1410 1411 if (p.pos < p.marginMin) { 1412 var tmpMin = p.pos; 1413 p.pos = p.marginMin; 1414 1415 if (allowReduce && !moveOnly) p.size = p.size - (p.pos - tmpMin); 1416 1417 } 1418}, 1419 1420correctRatio : function(ratio) { 1421 var x = this.x, 1422 y = this.y, 1423 changed = false, 1424 xSize = Math.min(x.full, x.size), 1425 ySize = Math.min(y.full, y.size), 1426 useBox = (this.useBox || hs.padToMinWidth); 1427 1428 if (xSize / ySize > ratio) { // width greater 1429 xSize = ySize * ratio; 1430 if (xSize < x.minSize) { // below minWidth 1431 xSize = x.minSize; 1432 ySize = xSize / ratio; 1433 } 1434 changed = true; 1435 1436 } else if (xSize / ySize < ratio) { // height greater 1437 ySize = xSize / ratio; 1438 changed = true; 1439 } 1440 1441 if (hs.padToMinWidth && x.full < x.minSize) { 1442 x.imgSize = x.full; 1443 y.size = y.imgSize = y.full; 1444 } else if (this.useBox) { 1445 x.imgSize = xSize; 1446 y.imgSize = ySize; 1447 } else { 1448 x.size = xSize; 1449 y.size = ySize; 1450 } 1451 changed = this.fitOverlayBox(this.useBox ? null : ratio, changed); 1452 if (useBox && y.size < y.imgSize) { 1453 y.imgSize = y.size; 1454 x.imgSize = y.size * ratio; 1455 } 1456 if (changed || useBox) { 1457 x.pos = x.tpos - x.cb + x.tb; 1458 x.minSize = x.size; 1459 this.justify(x, true); 1460 1461 y.pos = y.tpos - y.cb + y.tb; 1462 y.minSize = y.size; 1463 this.justify(y, true); 1464 if (this.overlayBox) this.sizeOverlayBox(); 1465 } 1466 1467 1468}, 1469fitOverlayBox : function(ratio, changed) { 1470 var x = this.x, y = this.y; 1471 if (this.overlayBox) { 1472 while (y.size > this.minHeight && x.size > this.minWidth 1473 && y.get('wsize') > y.get('fitsize')) { 1474 y.size -= 10; 1475 if (ratio) x.size = y.size * ratio; 1476 this.sizeOverlayBox(0, 1); 1477 changed = true; 1478 } 1479 } 1480 return changed; 1481}, 1482 1483show : function () { 1484 var x = this.x, y = this.y; 1485 this.doShowHide('hidden'); 1486 if (this.slideshow && this.slideshow.thumbstrip) this.slideshow.thumbstrip.selectThumb(); 1487 1488 // Apply size change 1489 this.changeSize( 1490 1, { 1491 wrapper: { 1492 width : x.get('wsize'), 1493 height : y.get('wsize'), 1494 left: x.pos, 1495 top: y.pos 1496 }, 1497 content: { 1498 left: x.p1 + x.get('imgPad'), 1499 top: y.p1 + y.get('imgPad'), 1500 width:x.imgSize ||x.size, 1501 height:y.imgSize ||y.size 1502 } 1503 }, 1504 hs.expandDuration 1505 ); 1506}, 1507 1508changeSize : function(up, to, dur) { 1509 // transition 1510 var trans = this.transitions, 1511 other = up ? (this.last ? this.last.a : null) : hs.upcoming, 1512 t = (trans[1] && other 1513 && hs.getParam(other, 'transitions')[1] == trans[1]) ? 1514 trans[1] : trans[0]; 1515 1516 if (this[t] && t != 'expand') { 1517 this[t](up, to); 1518 return; 1519 } 1520 1521 if (this.outline && !this.outlineWhileAnimating) { 1522 if (up) this.outline.setPosition(); 1523 else this.outline.destroy(); 1524 } 1525 1526 1527 if (!up) this.destroyOverlays(); 1528 1529 var exp = this, 1530 x = exp.x, 1531 y = exp.y, 1532 easing = this.easing; 1533 if (!up) easing = this.easingClose || easing; 1534 var after = up ? 1535 function() { 1536 1537 if (exp.outline) exp.outline.table.style.visibility = "visible"; 1538 setTimeout(function() { 1539 exp.afterExpand(); 1540 }, 50); 1541 } : 1542 function() { 1543 exp.afterClose(); 1544 }; 1545 if (up) hs.setStyles( this.wrapper, { 1546 width: x.t +'px', 1547 height: y.t +'px' 1548 }); 1549 if (this.fadeInOut) { 1550 hs.setStyles(this.wrapper, { opacity: up ? 0 : 1 }); 1551 hs.extend(to.wrapper, { opacity: up }); 1552 } 1553 hs.animate( this.wrapper, to.wrapper, { 1554 duration: dur, 1555 easing: easing, 1556 step: function(val, args) { 1557 if (exp.outline && exp.outlineWhileAnimating && args.prop == 'top') { 1558 var fac = up ? args.pos : 1 - args.pos; 1559 var pos = { 1560 w: x.t + (x.get('wsize') - x.t) * fac, 1561 h: y.t + (y.get('wsize') - y.t) * fac, 1562 x: x.tpos + (x.pos - x.tpos) * fac, 1563 y: y.tpos + (y.pos - y.tpos) * fac 1564 }; 1565 exp.outline.setPosition(pos, 0, 1); 1566 } 1567 } 1568 }); 1569 hs.animate( this.content, to.content, dur, easing, after); 1570 if (up) { 1571 this.wrapper.style.visibility = 'visible'; 1572 this.content.style.visibility = 'visible';
1573 this.a.className += ' highslide-active-anchor'; 1574 } 1575}, 1576 1577 1578 1579fade : function(up, to) { 1580 this.outlineWhileAnimating = false; 1581 var exp = this, t = up ? hs.expandDuration : 0; 1582 1583 if (up) { 1584 hs.animate(this.wrapper, to.wrapper, 0); 1585 hs.setStyles(this.wrapper, { opacity: 0, visibility: 'visible' }); 1586 hs.animate(this.content, to.content, 0); 1587 this.content.style.visibility = 'visible'; 1588 1589 hs.animate(this.wrapper, { opacity: 1 }, t, null, 1590 function() { exp.afterExpand(); }); 1591 } 1592 1593 if (this.outline) { 1594 this.outline.table.style.zIndex = this.wrapper.style.zIndex; 1595 var dir = up || -1, 1596 offset = this.outline.offset, 1597 startOff = up ? 3 : offset, 1598 endOff = up? offset : 3; 1599 for (var i = startOff; dir * i <= dir * endOff; i += dir, t += 25) { 1600 (function() { 1601 var o = up ? endOff - i : startOff - i; 1602 setTimeout(function() { 1603 exp.outline.setPosition(0, o, 1); 1604 }, t); 1605 })(); 1606 } 1607 } 1608 1609 1610 if (up) {}//setTimeout(function() { exp.afterExpand(); }, t+50); 1611 else { 1612 setTimeout( function() { 1613 if (exp.outline) exp.outline.destroy(exp.preserveContent); 1614 1615 exp.destroyOverlays(); 1616 1617 hs.animate( exp.wrapper, { opacity: 0 }, hs.restoreDuration, null, function(){ 1618 exp.afterClose(); 1619 }); 1620 }, t); 1621 } 1622}, 1623crossfade : function (up, to, from) { 1624 if (!up) return; 1625 var exp = this, 1626 last = this.last, 1627 x = this.x, 1628 y = this.y, 1629 lastX = last.x, 1630 lastY = last.y, 1631 wrapper = this.wrapper, 1632 content = this.content, 1633 overlayBox = this.overlayBox; 1634 hs.removeEventListener(document, 'mousemove', hs.dragHandler); 1635 1636 hs.setStyles(content, { 1637 width: (x.imgSize || x.size) +'px', 1638 height: (y.imgSize || y.size) +'px' 1639 }); 1640 if (overlayBox) overlayBox.style.overflow = 'visible'; 1641 this.outline = last.outline; 1642 if (this.outline) this.outline.exp = exp; 1643 last.outline = null; 1644 var fadeBox = hs.createElement('div', { 1645 className: 'highslide-'+ this.contentType 1646 }, { 1647 position: 'absolute', 1648 zIndex: 4, 1649 overflow: 'hidden', 1650 display: 'none' 1651 } 1652 ); 1653 var names = { oldImg: last, newImg: this }; 1654 for (var n in names) { 1655 this[n] = names[n].content.cloneNode(1); 1656 hs.setStyles(this[n], { 1657 position: 'absolute', 1658 border: 0, 1659 visibility: 'visible' 1660 }); 1661 fadeBox.appendChild(this[n]); 1662 } 1663 wrapper.appendChild(fadeBox); 1664 if (overlayBox) { 1665 overlayBox.className = ''; 1666 wrapper.appendChild(overlayBox); 1667 } 1668 fadeBox.style.display = ''; 1669 last.content.style.display = 'none'; 1670 1671 1672 if (hs.safari && hs.uaVersion < 525) { 1673 this.wrapper.style.visibility = 'visible'; 1674 } 1675 hs.animate(wrapper, { 1676 width: x.size 1677 }, { 1678 duration: hs.transitionDuration, 1679 step: function(val, args) { 1680 var pos = args.pos, 1681 invPos = 1 - pos; 1682 var prop, 1683 size = {}, 1684 props = ['pos', 'size', 'p1', 'p2']; 1685 for (var n in props) { 1686 prop = props[n]; 1687 size['x'+ prop] = Math.round(invPos * lastX[prop] + pos * x[prop]); 1688 size['y'+ prop] = Math.round(invPos * lastY[prop] + pos * y[prop]); 1689 size.ximgSize = Math.round( 1690 invPos * (lastX.imgSize || lastX.size) + pos * (x.imgSize || x.size)); 1691 size.ximgPad = Math.round(invPos * lastX.get('imgPad') + pos * x.get('imgPad')); 1692 size.yimgSize = Math.round( 1693 invPos * (lastY.imgSize || lastY.size) + pos * (y.imgSize || y.size)); 1694 size.yimgPad = Math.round(invPos * lastY.get('imgPad') + pos * y.get('imgPad')); 1695 } 1696 if (exp.outline) exp.outline.setPosition({ 1697 x: size.xpos, 1698 y: size.ypos, 1699 w: size.xsize + size.xp1 + size.xp2 + 2 * x.cb, 1700 h: size.ysize + size.yp1 + size.yp2 + 2 * y.cb 1701 }); 1702 last.wrapper.style.clip = 'rect(' 1703 + (size.ypos - lastY.pos)+'px, ' 1704 + (size.xsize + size.xp1 + size.xp2 + size.xpos + 2 * lastX.cb - lastX.pos) +'px, ' 1705 + (size.ysize + size.yp1 + size.yp2 + size.ypos + 2 * lastY.cb - lastY.pos) +'px, ' 1706 + (size.xpos - lastX.pos)+'px)'; 1707 1708 hs.setStyles(content, { 1709 top: (size.yp1 + y.get('imgPad')) +'px', 1710 left: (size.xp1 + x.get('imgPad')) +'px', 1711 marginTop: (y.pos - size.ypos) +'px', 1712 marginLeft: (x.pos - size.xpos) +'px' 1713 }); 1714 hs.setStyles(wrapper, { 1715 top: size.ypos +'px', 1716 left: size.xpos +'px', 1717 width: (size.xp1 + size.xp2 + size.xsize + 2 * x.cb)+ 'px',
1718 height: (size.yp1 + size.yp2 + size.ysize + 2 * y.cb) + 'px' 1719 }); 1720 hs.setStyles(fadeBox, { 1721 width: (size.ximgSize || size.xsize) + 'px', 1722 height: (size.yimgSize || size.ysize) +'px', 1723 left: (size.xp1 + size.ximgPad) +'px', 1724 top: (size.yp1 + size.yimgPad) +'px', 1725 visibility: 'visible' 1726 }); 1727 1728 hs.setStyles(exp.oldImg, { 1729 top: (lastY.pos - size.ypos + lastY.p1 - size.yp1 + lastY.get('imgPad') - size.yimgPad)+'px', 1730 left: (lastX.pos - size.xpos + lastX.p1 - size.xp1 + lastX.get('imgPad') - size.ximgPad)+'px' 1731 }); 1732 1733 hs.setStyles(exp.newImg, { 1734 opacity: pos, 1735 top: (y.pos - size.ypos + y.p1 - size.yp1 + y.get('imgPad') - size.yimgPad) +'px', 1736 left: (x.pos - size.xpos + x.p1 - size.xp1 + x.get('imgPad') - size.ximgPad) +'px' 1737 }); 1738 if (overlayBox) hs.setStyles(overlayBox, { 1739 width: size.xsize + 'px', 1740 height: size.ysize +'px', 1741 left: (size.xp1 + x.cb) +'px', 1742 top: (size.yp1 + y.cb) +'px' 1743 }); 1744 }, 1745 complete: function () { 1746 wrapper.style.visibility = content.style.visibility = 'visible'; 1747 content.style.display = 'block'; 1748 hs.discardElement(fadeBox); 1749 exp.afterExpand(); 1750 last.afterClose(); 1751 exp.last = null; 1752 } 1753 1754 }); 1755}, 1756reuseOverlay : function(o, el) { 1757 if (!this.last) return false; 1758 for (var i = 0; i < this.last.overlays.length; i++) { 1759 var oDiv = hs.$('hsId'+ this.last.overlays[i]); 1760 if (oDiv && oDiv.hsId == o.hsId) { 1761 this.genOverlayBox(); 1762 oDiv.reuse = this.key; 1763 hs.push(this.overlays, this.last.overlays[i]); 1764 return true; 1765 } 1766 } 1767 return false; 1768}, 1769 1770 1771afterExpand : function() { 1772 this.isExpanded = true; 1773 this.focus(); 1774 if (this.dimmingOpacity) hs.dim(this); 1775 if (hs.upcoming && hs.upcoming == this.a) hs.upcoming = null; 1776 this.prepareNextOutline(); 1777 var p = hs.page, mX = hs.mouse.x + p.scrollLeft, mY = hs.mouse.y + p.scrollTop; 1778 this.mouseIsOver = this.x.pos < mX && mX < this.x.pos + this.x.get('wsize') 1779 && this.y.pos < mY && mY < this.y.pos + this.y.get('wsize'); 1780 if (this.overlayBox) this.showOverlays(); 1781 1782}, 1783 1784 1785prepareNextOutline : function() { 1786 var key = this.key; 1787 var outlineType = this.outlineType; 1788 new hs.Outline(outlineType, 1789 function () { try { hs.expanders[key].preloadNext(); } catch (e) {} }); 1790}, 1791 1792 1793preloadNext : function() { 1794 var next = this.getAdjacentAnchor(1); 1795 if (next && next.onclick.toString().match(/hs\.expand/)) 1796 var img = hs.createElement('img', { src: hs.getSrc(next) }); 1797}, 1798 1799 1800getAdjacentAnchor : function(op) { 1801 var current = this.getAnchorIndex(), as = hs.anchors.groups[this.slideshowGroup || 'none']; 1802 if (as && !as[current + op] && this.slideshow && this.slideshow.repeat) { 1803 if (op == 1) return as[0]; 1804 else if (op == -1) return as[as.length-1]; 1805 } 1806 return (as && as[current + op]) || null; 1807}, 1808 1809getAnchorIndex : function() { 1810 var arr = hs.getAnchors().groups[this.slideshowGroup || 'none']; 1811 if (arr) for (var i = 0; i < arr.length; i++) { 1812 if (arr[i] == this.a) return i; 1813 } 1814 return null; 1815}, 1816 1817 1818getNumber : function() { 1819 if (this[this.numberPosition]) { 1820 var arr = hs.anchors.groups[this.slideshowGroup || 'none']; 1821 if (arr) { 1822 var s = hs.lang.number.replace('%1', this.getAnchorIndex() + 1).replace('%2', arr.length); 1823 this[this.numberPosition].innerHTML = 1824 '<div class="highslide-number">'+ s +'</div>'+ this[this.numberPosition].innerHTML; 1825 } 1826 } 1827}, 1828initSlideshow : function() { 1829 if (!this.last) { 1830 for (var i = 0; i < hs.slideshows.length; i++) { 1831 var ss = hs.slideshows[i], sg = ss.slideshowGroup; 1832 if (typeof sg == 'undefined' || sg === null || sg === this.slideshowGroup) 1833 this.slideshow = new hs.Slideshow(this.key, ss); 1834 } 1835 } else { 1836 this.slideshow = this.last.slideshow; 1837 } 1838 var ss = this.slideshow; 1839 if (!ss) return; 1840 var key = ss.expKey = this.key; 1841 1842 ss.checkFirstAndLast(); 1843 ss.disable('full-expand'); 1844 if (ss.controls) { 1845 this.createOverlay(hs.extend(ss.overlayOptions || {}, { 1846 overlayId: ss.controls, 1847 hsId: 'controls', 1848 zIndex: 5 1849 })); 1850 } 1851 if (ss.thumbstrip) ss.thumbstrip.add(this); 1852 if (!this.last && this.autoplay) ss.play(true); 1853 if (ss.autoplay) { 1854 ss.autoplay = setTimeout(function() { 1855 hs.next(key); 1856 }, (ss.interval || 500)); 1857 } 1858}, 1859 1860cancelLoading : function() { 1861 hs.discardElement (this.wrapper); 1862 hs.expanders[this.key] = null; 1863 if (hs.upcoming == this.a) hs.upcoming = null; 1864 hs.undim(this.key); 1865 if (this.loading) hs.loading.style.left = '-9999px'; 1866}, 1867 1868writeCredits : function () { 1869 if (this.credits) return; 1870 this.credits = hs.createElement('a', { 1871 href: hs.creditsHref, 1872 target: hs.creditsTarget, 1873 className: 'highslide-credits', 1874 innerHTML: hs.lang.creditsText, 1875 title: hs.lang.creditsTitle 1876 }); 1877 this.createOverlay({ 1878 overlayId: this.credits, 1879 position: this.creditsPosition || 'top left', 1880 hsId: 'credits' 1881 }); 1882}, 1883 1884getInline : function(types, addOverlay) { 1885 for (var i = 0; i < types.length; i++) { 1886 var type = types[i], s = null; 1887 if (!this[type +'Id'] && this.thumbsUserSetId) 1888 this[type +'Id'] = type +'-for-'+ this.thumbsUserSetId; 1889 if (this[type +'Id']) this[type] = hs.getNode(this[type +'Id']); 1890 if (!this[type] && !this[type +'Text'] && this[type +'Eval']) try { 1891 s = eval(this[type +'Eval']); 1892 } catch (e) {} 1893 if (!this[type] && this[type +'Text']) { 1894 s = this[type +'Text']; 1895 } 1896 if (!this[type] && !s) { 1897 this[type] = hs.getNode(this.a['_'+ type + 'Id']); 1898 if (!this[type]) { 1899 var next = this.a.nextSibling; 1900 while (next && !hs.isHsAnchor(next)) {
1901 if ((new RegExp('highslide-'+ type)).test(next.className || null)) { 1902 if (!next.id) this.a['_'+ type + 'Id'] = next.id = 'hsId'+ hs.idCounter++; 1903 this[type] = hs.getNode(next.id); 1904 break; 1905 } 1906 next = next.nextSibling; 1907 } 1908 } 1909 } 1910 if (!this[type] && !s && this.numberPosition == type) s = '\n'; 1911 1912 if (!this[type] && s) this[type] = hs.createElement('div', 1913 { className: 'highslide-'+ type, innerHTML: s } ); 1914 1915 if (addOverlay && this[type]) { 1916 var o = { position: (type == 'heading') ? 'above' : 'below' }; 1917 for (var x in this[type+'Overlay']) o[x] = this[type+'Overlay'][x]; 1918 o.overlayId = this[type]; 1919 this.createOverlay(o); 1920 } 1921 } 1922}, 1923 1924 1925// on end move and resize 1926doShowHide : function(visibility) { 1927 if (hs.hideSelects) this.showHideElements('SELECT', visibility); 1928 if (hs.hideIframes) this.showHideElements('IFRAME', visibility); 1929 if (hs.geckoMac) this.showHideElements('*', visibility); 1930}, 1931showHideElements : function (tagName, visibility) { 1932 var els = document.getElementsByTagName(tagName); 1933 var prop = tagName == '*' ? 'overflow' : 'visibility'; 1934 for (var i = 0; i < els.length; i++) { 1935 if (prop == 'visibility' || (document.defaultView.getComputedStyle( 1936 els[i], "").getPropertyValue('overflow') == 'auto' 1937 || els[i].getAttribute('hidden-by') != null)) { 1938 var hiddenBy = els[i].getAttribute('hidden-by'); 1939 if (visibility == 'visible' && hiddenBy) { 1940 hiddenBy = hiddenBy.replace('['+ this.key +']', ''); 1941 els[i].setAttribute('hidden-by', hiddenBy); 1942 if (!hiddenBy) els[i].style[prop] = els[i].origProp; 1943 } else if (visibility == 'hidden') { // hide if behind 1944 var elPos = hs.getPosition(els[i]); 1945 elPos.w = els[i].offsetWidth; 1946 elPos.h = els[i].offsetHeight; 1947 if (!this.dimmingOpacity) { // hide all if dimming 1948 1949 var clearsX = (elPos.x + elPos.w < this.x.get('opos') 1950 || elPos.x > this.x.get('opos') + this.x.get('osize')); 1951 var clearsY = (elPos.y + elPos.h < this.y.get('opos') 1952 || elPos.y > this.y.get('opos') + this.y.get('osize')); 1953 } 1954 var wrapperKey = hs.getWrapperKey(els[i]); 1955 if (!clearsX && !clearsY && wrapperKey != this.key) { // element falls behind image 1956 if (!hiddenBy) { 1957 els[i].setAttribute('hidden-by', '['+ this.key +']'); 1958 els[i].origProp = els[i].style[prop]; 1959 els[i].style[prop] = 'hidden'; 1960 1961 } else if (hiddenBy.indexOf('['+ this.key +']') == -1) { 1962 els[i].setAttribute('hidden-by', hiddenBy + '['+ this.key +']'); 1963 } 1964 } else if ((hiddenBy == '['+ this.key +']' || hs.focusKey == wrapperKey) 1965 && wrapperKey != this.key) { // on move 1966 els[i].setAttribute('hidden-by', ''); 1967 els[i].style[prop] = els[i].origProp || ''; 1968 } else if (hiddenBy && hiddenBy.indexOf('['+ this.key +']') > -1) { 1969 els[i].setAttribute('hidden-by', hiddenBy.replace('['+ this.key +']', '')); 1970 } 1971 1972 } 1973 } 1974 } 1975}, 1976 1977focus : function() { 1978 this.wrapper.style.zIndex = hs.zIndexCounter += 2; 1979 // blur others 1980 for (var i = 0; i < hs.expanders.length; i++) { 1981 if (hs.expanders[i] && i == hs.focusKey) { 1982 var blurExp = hs.expanders[i]; 1983 blurExp.content.className += ' highslide-'+ blurExp.contentType +'-blur'; 1984 blurExp.content.style.cursor = hs.ie ? 'hand' : 'pointer'; 1985 blurExp.content.title = hs.lang.focusTitle; 1986 } 1987 } 1988 1989 // focus this 1990 if (this.outline) this.outline.table.style.zIndex 1991 = this.wrapper.style.zIndex - 1; 1992 this.content.className = 'highslide-'+ this.contentType; 1993 this.content.title = hs.lang.restoreTitle; 1994 1995 if (hs.restoreCursor) { 1996 hs.styleRestoreCursor = window.opera ? 'pointer' : 'url('+ hs.graphicsDir + hs.restoreCursor +'), pointer'; 1997 if (hs.ie && hs.uaVersion < 6) hs.styleRestoreCursor = 'hand'; 1998 this.content.style.cursor = hs.styleRestoreCursor; 1999 } 2000 2001 hs.focusKey = this.key; 2002 hs.addEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler); 2003}, 2004moveTo: function(x, y) { 2005 this.x.setPos(x); 2006 this.y.setPos(y); 2007}, 2008resize : function (e) { 2009 var w, h, r = e.width / e.height; 2010 w = Math.max(e.width + e.dX, Math.min(this.minWidth, this.x.full)); 2011 if (this.isImage && Math.abs(w - this.x.full) < 12) w = this.x.full; 2012 h = w / r; 2013 if (h < Math.min(this.minHeight, this.y.full)) { 2014 h = Math.min(this.minHeight, this.y.full); 2015 if (this.isImage) w = h * r; 2016 } 2017 this.resizeTo(w, h); 2018}, 2019resizeTo: function(w, h) { 2020 this.y.setSize(h); 2021 this.x.setSize(w); 2022 this.wrapper.style.height = this.y.get('wsize') +'px'; 2023}, 2024 2025close : function() { 2026 if (this.isClosing || !this.isExpanded) return; 2027 if (this.transitions[1] == 'crossfade' && hs.upcoming) { 2028 hs.getExpander(hs.upcoming).cancelLoading(); 2029 hs.upcoming = null; 2030 } 2031 this.isClosing = true; 2032 if (this.slideshow && !hs.upcoming) this.slideshow.pause(); 2033 2034 hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler); 2035 2036 try { 2037 this.content.style.cursor = 'default'; 2038 this.changeSize( 2039 0, { 2040 wrapper: { 2041 width : this.x.t, 2042 height : this.y.t, 2043 left: this.x.tpos - this.x.cb + this.x.tb, 2044 top: this.y.tpos - this.y.cb + this.y.tb 2045 }, 2046 content: { 2047 left: 0, 2048 top: 0, 2049 width: this.x.t, 2050 height: this.y.t 2051 } 2052 }, hs.restoreDuration 2053 ); 2054 } catch (e) { this.afterClose(); } 2055}, 2056 2057createOverlay : function (o) { 2058 var el = o.overlayId, 2059 relToVP = (o.relativeTo == 'viewport' && !/panel$/.test(o.position)); 2060 if (typeof el == 'string') el = hs.getNode(el); 2061 if (o.html) el = hs.createElement('div', { innerHTML: o.html }); 2062 if (!el || typeof el == 'string') return; 2063 el.style.display = 'block'; 2064 o.hsId = o.hsId || o.overlayId; 2065 if (this.transitions[1] == 'crossfade' && this.reuseOverlay(o, el)) return; 2066 this.genOverlayBox(); 2067 var width = o.width && /^[0-9]+(px|%)$/.test(o.width) ? o.width : 'auto'; 2068 if (/^(left|right)panel$/.test(o.position) && !/^[0-9]+px$/.test(o.width)) width = '200px';
2069 var overlay = hs.createElement( 2070 'div', { 2071 id: 'hsId'+ hs.idCounter++, 2072 hsId: o.hsId 2073 }, { 2074 position: 'absolute', 2075 visibility: 'hidden', 2076 width: width, 2077 direction: hs.lang.cssDirection || '', 2078 opacity: 0 2079 }, 2080 relToVP ? hs.viewport :this.overlayBox, 2081 true 2082 ); 2083 if (relToVP) overlay.hsKey = this.key; 2084 2085 overlay.appendChild(el); 2086 hs.extend(overlay, { 2087 opacity: 1, 2088 offsetX: 0, 2089 offsetY: 0, 2090 dur: (o.fade === 0 || o.fade === false || (o.fade == 2 && hs.ie)) ? 0 : 250 2091 }); 2092 hs.extend(overlay, o); 2093 2094 2095 if (this.gotOverlays) { 2096 this.positionOverlay(overlay); 2097 if (!overlay.hideOnMouseOut || this.mouseIsOver) 2098 hs.animate(overlay, { opacity: overlay.opacity }, overlay.dur); 2099 } 2100 hs.push(this.overlays, hs.idCounter - 1); 2101}, 2102positionOverlay : function(overlay) { 2103 var p = overlay.position || 'middle center', 2104 relToVP = (overlay.relativeTo == 'viewport'), 2105 offX = overlay.offsetX, 2106 offY = overlay.offsetY; 2107 if (relToVP) { 2108 hs.viewport.style.display = 'block'; 2109 overlay.hsKey = this.key; 2110 if (overlay.offsetWidth > overlay.parentNode.offsetWidth) 2111 overlay.style.width = '100%'; 2112 } else 2113 if (overlay.parentNode != this.overlayBox) this.overlayBox.appendChild(overlay); 2114 if (/left$/.test(p)) overlay.style.left = offX +'px'; 2115 2116 if (/center$/.test(p)) hs.setStyles (overlay, { 2117 left: '50%', 2118 marginLeft: (offX - Math.round(overlay.offsetWidth / 2)) +'px' 2119 }); 2120 2121 if (/right$/.test(p)) overlay.style.right = - offX +'px'; 2122 2123 if (/^leftpanel$/.test(p)) { 2124 hs.setStyles(overlay, { 2125 right: '100%', 2126 marginRight: this.x.cb +'px', 2127 top: - this.y.cb +'px', 2128 bottom: - this.y.cb +'px', 2129 overflow: 'auto' 2130 }); 2131 this.x.p1 = overlay.offsetWidth; 2132 2133 } else if (/^rightpanel$/.test(p)) { 2134 hs.setStyles(overlay, { 2135 left: '100%', 2136 marginLeft: this.x.cb +'px', 2137 top: - this.y.cb +'px', 2138 bottom: - this.y.cb +'px', 2139 overflow: 'auto' 2140 }); 2141 this.x.p2 = overlay.offsetWidth; 2142 } 2143 var parOff = overlay.parentNode.offsetHeight; 2144 overlay.style.height = 'auto'; 2145 if (relToVP && overlay.offsetHeight > parOff) 2146 overlay.style.height = hs.ieLt7 ? parOff +'px' : '100%'; 2147 2148 if (/^top/.test(p)) overlay.style.top = offY +'px'; 2149 if (/^middle/.test(p)) hs.setStyles (overlay, { 2150 top: '50%', 2151 marginTop: (offY - Math.round(overlay.offsetHeight / 2)) +'px' 2152 }); 2153 if (/^bottom/.test(p)) overlay.style.bottom = - offY +'px'; 2154 if (/^above$/.test(p)) { 2155 hs.setStyles(overlay, { 2156 left: (- this.x.p1 - this.x.cb) +'px', 2157 right: (- this.x.p2 - this.x.cb) +'px', 2158 bottom: '100%', 2159 marginBottom: this.y.cb +'px', 2160 width: 'auto' 2161 }); 2162 this.y.p1 = overlay.offsetHeight; 2163 2164 } else if (/^below$/.test(p)) { 2165 hs.setStyles(overlay, { 2166 position: 'relative', 2167 left: (- this.x.p1 - this.x.cb) +'px', 2168 right: (- this.x.p2 - this.x.cb) +'px', 2169 top: '100%', 2170 marginTop: this.y.cb +'px', 2171 width: 'auto' 2172 }); 2173 this.y.p2 = overlay.offsetHeight; 2174 overlay.style.position = 'absolute'; 2175 } 2176}, 2177 2178getOverlays : function() { 2179 this.getInline(['heading', 'caption'], true); 2180 this.getNumber(); 2181 if (this.heading && this.dragByHeading) this.heading.className += ' highslide-move'; 2182 if (hs.showCredits) this.writeCredits(); 2183 for (var i = 0; i < hs.overlays.length; i++) { 2184 var o = hs.overlays[i], tId = o.thumbnailId, sg = o.slideshowGroup; 2185 if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId) 2186 || (sg && sg === this.slideshowGroup)) { 2187 this.createOverlay(o); 2188 } 2189 } 2190 var os = []; 2191 for (var i = 0; i < this.overlays.length; i++) { 2192 var o = hs.$('hsId'+ this.overlays[i]); 2193 if (/panel$/.test(o.position)) this.positionOverlay(o); 2194 else hs.push(os, o); 2195 } 2196 for (var i = 0; i < os.length; i++) this.positionOverlay(os[i]); 2197 this.gotOverlays = true; 2198}, 2199genOverlayBox : function() { 2200 if (!this.overlayBox) this.overlayBox = hs.createElement ( 2201 'div', { 2202 className: this.wrapperClassName 2203 }, { 2204 position : 'absolute', 2205 width: (this.x.size || (this.useBox ? this.width : null) 2206 || this.x.full) +'px', 2207 height: (this.y.size || this.y.full) +'px', 2208 visibility : 'hidden', 2209 overflow : 'hidden', 2210 zIndex : hs.ie ? 4 : 'auto' 2211 }, 2212 hs.container, 2213 true 2214 ); 2215}, 2216sizeOverlayBox : function(doWrapper, doPanels) { 2217 var overlayBox = this.overlayBox, 2218 x = this.x, 2219 y = this.y; 2220 hs.setStyles( overlayBox, { 2221 width: x.size +'px', 2222 height: y.size +'px' 2223 }); 2224 if (doWrapper || doPanels) { 2225 for (var i = 0; i < this.overlays.length; i++) { 2226 var o = hs.$('hsId'+ this.overlays[i]); 2227 var ie6 = (hs.ieLt7 || document.compatMode == 'BackCompat'); 2228 if (o && /^(above|below)$/.test(o.position)) { 2229 if (ie6) { 2230 o.style.width = (overlayBox.offsetWidth + 2 * x.cb 2231 + x.p1 + x.p2) +'px'; 2232 } 2233 y[o.position == 'above' ? 'p1' : 'p2'] = o.offsetHeight; 2234 } 2235 if (o && ie6 && /^(left|right)panel$/.test(o.position)) { 2236 o.style.height = (overlayBox.offsetHeight + 2* y.cb) +'px'; 2237 } 2238 } 2239 } 2240 if (doWrapper) { 2241 hs.setStyles(this.content, { 2242 top: y.p1 +'px' 2243 }); 2244 hs.setStyles(overlayBox, { 2245 top: (y.p1 + y.cb) +'px' 2246 }); 2247 } 2248}, 2249 2250showOverlays : function() { 2251 var b = this.overlayBox; 2252 b.className = ''; 2253 hs.setStyles(b, { 2254 top: (this.y.p1 + this.y.cb) +'px', 2255 left: (this.x.p1 + this.x.cb) +'px', 2256 overflow : 'visible' 2257 }); 2258 if (hs.safari) b.style.visibility = 'visible'; 2259 this.wrapper.appendChild (b); 2260 for (var i = 0; i < this.overlays.length; i++) { 2261 var o = hs.$('hsId'+ this.overlays[i]); 2262 o.style.zIndex = o.zIndex || 4; 2263 if (!o.hideOnMouseOut || this.mouseIsOver) { 2264 o.style.visibility = 'visible'; 2265 hs.setStyles(o, { visibility: 'visible', display: '' }); 2266 hs.animate(o, { opacity: o.opacity }, o.dur); 2267 } 2268 } 2269}, 2270 2271destroyOverlays : function() { 2272 if (!this.overlays.length) return; 2273 if (this.slideshow) { 2274 var c = this.slideshow.controls; 2275 if (c && hs.getExpander(c) == this) c.parentNode.removeChild(c); 2276 } 2277 for (var i = 0; i < this.overlays.length; i++) { 2278 var o = hs.$('hsId'+ this.overlays[i]); 2279 if (o && o.parentNode == hs.viewport && hs.getExpander(o) == this) hs.discardElement(o); 2280 } 2281 hs.discardElement(this.overlayBox); 2282}, 2283 2284 2285 2286createFullExpand : function () { 2287 if (this.slideshow && this.slideshow.controls) { 2288 this.slideshow.enable('full-expand'); 2289 return; 2290 } 2291 this.fullExpandLabel = hs.createElement( 2292 'a', { 2293 href: 'javascript:hs.expanders['+ this.key +'].doFullExpand();', 2294 title: hs.lang.fullExpandTitle, 2295 className: 'highslide-full-expand' 2296 } 2297 ); 2298 2299 this.createOverlay({ 2300 overlayId: this.fullExpandLabel, 2301 position: hs.fullExpandPosition, 2302 hideOnMouseOut: true, 2303 opacity: hs.fullExpandOpacity 2304 }); 2305}, 2306 2307doFullExpand : function () { 2308 try { 2309 if (this.fullExpandLabel) hs.discardElement(this.fullExpandLabel); 2310 2311 this.focus(); 2312 var xSize = this.x.size; 2313 this.resizeTo(this.x.full, this.y.full); 2314 2315 var xpos = this.x.pos - (this.x.size - xSize) / 2; 2316 if (xpos < hs.marginLeft) xpos = hs.marginLeft; 2317 2318 this.moveTo(xpos, this.y.pos); 2319 this.doShowHide('hidden'); 2320 2321 } catch (e) { 2322 this.error(e); 2323 } 2324}, 2325 2326 2327afterClose : function () {
2328 this.a.className = this.a.className.replace('highslide-active-anchor', ''); 2329 2330 this.doShowHide('visible'); 2331 if (this.outline && this.outlineWhileAnimating) this.outline.destroy(); 2332 2333 hs.discardElement(this.wrapper); 2334 this.destroyOverlays(); 2335 if (!hs.viewport.childNodes.length) hs.viewport.style.display = 'none'; 2336 2337 if (this.dimmingOpacity) hs.undim(this.key); 2338 hs.expanders[this.key] = null; 2339 hs.reOrder(); 2340} 2341 2342}; 2343 2344 2345hs.Slideshow = function (expKey, options) { 2346 if (hs.dynamicallyUpdateAnchors !== false) hs.updateAnchors(); 2347 this.expKey = expKey; 2348 for (var x in options) this[x] = options[x]; 2349 if (this.useControls) this.getControls(); 2350 if (this.thumbstrip) this.thumbstrip = hs.Thumbstrip(this); 2351}; 2352hs.Slideshow.prototype = { 2353getControls: function() { 2354 this.controls = hs.createElement('div', { innerHTML: hs.replaceLang(hs.skin.controls) }, 2355 null, hs.container); 2356 2357 var buttons = ['play', 'pause', 'previous', 'next', 'move', 'full-expand', 'close']; 2358 this.btn = {}; 2359 var pThis = this; 2360 for (var i = 0; i < buttons.length; i++) { 2361 this.btn[buttons[i]] = hs.getElementByClass(this.controls, 'li', 'highslide-'+ buttons[i]); 2362 this.enable(buttons[i]); 2363 } 2364 this.btn.pause.style.display = 'none'; 2365 //this.disable('full-expand'); 2366}, 2367checkFirstAndLast: function() { 2368 if (this.repeat || !this.controls) return; 2369 var exp = hs.expanders[this.expKey], 2370 cur = exp.getAnchorIndex(), 2371 re = /disabled$/; 2372 if (cur == 0) 2373 this.disable('previous'); 2374 else if (re.test(this.btn.previous.getElementsByTagName('a')[0].className)) 2375 this.enable('previous'); 2376 if (cur + 1 == hs.anchors.groups[exp.slideshowGroup || 'none'].length) { 2377 this.disable('next'); 2378 this.disable('play'); 2379 } else if (re.test(this.btn.next.getElementsByTagName('a')[0].className)) { 2380 this.enable('next'); 2381 this.enable('play'); 2382 } 2383}, 2384enable: function(btn) { 2385 if (!this.btn) return; 2386 var sls = this, a = this.btn[btn].getElementsByTagName('a')[0], re = /disabled$/; 2387 a.onclick = function() { 2388 sls[btn](); 2389 return false; 2390 }; 2391 if (re.test(a.className)) a.className = a.className.replace(re, ''); 2392}, 2393disable: function(btn) { 2394 if (!this.btn) return; 2395 var a = this.btn[btn].getElementsByTagName('a')[0]; 2396 a.onclick = function() { return false; }; 2397 if (!/disabled$/.test(a.className)) a.className += ' disabled'; 2398}, 2399hitSpace: function() { 2400 if (this.autoplay) this.pause(); 2401 else this.play(); 2402}, 2403play: function(wait) { 2404 if (this.btn) { 2405 this.btn.play.style.display = 'none'; 2406 this.btn.pause.style.display = ''; 2407 } 2408 2409 this.autoplay = true; 2410 if (!wait) hs.next(this.expKey); 2411}, 2412pause: function() { 2413 if (this.btn) { 2414 this.btn.pause.style.display = 'none'; 2415 this.btn.play.style.display = ''; 2416 } 2417 2418 clearTimeout(this.autoplay); 2419 this.autoplay = null; 2420}, 2421previous: function() { 2422 this.pause(); 2423 hs.previous(this.btn.previous); 2424}, 2425next: function() { 2426 this.pause(); 2427 hs.next(this.btn.next); 2428}, 2429move: function() {}, 2430'full-expand': function() { 2431 hs.getExpander().doFullExpand(); 2432}, 2433close: function() { 2434 hs.close(this.btn.close); 2435} 2436}; 2437hs.Thumbstrip = function(slideshow) { 2438 function add (exp) { 2439 hs.extend(options || {}, { 2440 overlayId: dom, 2441 hsId: 'thumbstrip', 2442 className: 'highslide-thumbstrip-'+ mode +'-overlay ' + (options.className || '') 2443 }); 2444 if (hs.ieLt7) options.fade = 0; 2445 exp.createOverlay(options); 2446 hs.setStyles(dom.parentNode, { overflow: 'hidden' }); 2447 }; 2448 2449 function scroll (delta) { 2450 selectThumb(undefined, Math.round(delta * dom[isX ? 'offsetWidth' : 'offsetHeight'] * 0.7)); 2451 }; 2452 2453 function selectThumb (i, scrollBy) { 2454 if (i === undefined) for (var j = 0; j < group.length; j++) { 2455 if (group[j] == hs.expanders[slideshow.expKey].a) { 2456 i = j; 2457 break; 2458 } 2459 } 2460 if (i === undefined) return; 2461 var as = dom.getElementsByTagName('a'), 2462 active = as[i], 2463 cell = active.parentNode, 2464 left = isX ? 'Left' : 'Top', 2465 right = isX ? 'Right' : 'Bottom', 2466 width = isX ? 'Width' : 'Height', 2467 offsetLeft = 'offset' + left, 2468 offsetWidth = 'offset' + width, 2469 overlayWidth = div.parentNode.parentNode[offsetWidth], 2470 minTblPos = overlayWidth - table[offsetWidth], 2471 curTblPos = parseInt(table.style[isX ? 'left' : 'top']) || 0, 2472 tblPos = curTblPos, 2473 mgnRight = 20; 2474 if (scrollBy !== undefined) { 2475 tblPos = curTblPos - scrollBy; 2476 2477 if (minTblPos > 0) minTblPos = 0; 2478 if (tblPos > 0) tblPos = 0; 2479 if (tblPos < minTblPos) tblPos = minTblPos; 2480 2481 2482 } else { 2483 for (var j = 0; j < as.length; j++) as[j].className = ''; 2484 active.className = 'highslide-active-anchor'; 2485 var activeLeft = i > 0 ? as[i - 1].parentNode[offsetLeft] : cell[offsetLeft], 2486 activeRight = cell[offsetLeft] + cell[offsetWidth] + 2487 (as[i + 1] ? as[i + 1].parentNode[offsetWidth] : 0); 2488 if (activeRight > overlayWidth - curTblPos) tblPos = overlayWidth - activeRight; 2489 else if (activeLeft < -curTblPos) tblPos = -activeLeft; 2490 } 2491 var markerPos = cell[offsetLeft] + (cell[offsetWidth] - marker[offsetWidth]) / 2 + tblPos;
2492 hs.animate(table, isX ? { left: tblPos } : { top: tblPos }, null, 'easeOutQuad'); 2493 hs.animate(marker, isX ? { left: markerPos } : { top: markerPos }, null, 'easeOutQuad'); 2494 scrollUp.style.display = tblPos < 0 ? 'block' : 'none'; 2495 scrollDown.style.display = (tblPos > minTblPos) ? 'block' : 'none'; 2496 2497 }; 2498 2499 2500 // initialize 2501 var group = hs.anchors.groups[hs.expanders[slideshow.expKey].slideshowGroup || 'none'], 2502 options = slideshow.thumbstrip, 2503 mode = options.mode || 'horizontal', 2504 floatMode = (mode == 'float'), 2505 tree = floatMode ? ['div', 'ul', 'li', 'span'] : ['table', 'tbody', 'tr', 'td'], 2506 isX = (mode == 'horizontal'), 2507 dom = hs.createElement('div', { 2508 className: 'highslide-thumbstrip highslide-thumbstrip-'+ mode, 2509 innerHTML: 2510 '<div class="highslide-thumbstrip-inner">'+ 2511 '<'+ tree[0] +'><'+ tree[1] +'></'+ tree[1] +'></'+ tree[0] +'></div>'+ 2512 '<div class="highslide-scroll-up"><div></div></div>'+ 2513 '<div class="highslide-scroll-down"><div></div></div>'+ 2514 '<div class="highslide-marker"><div></div></div>' 2515 }, { 2516 display: 'none' 2517 }, hs.container), 2518 domCh = dom.childNodes, 2519 div = domCh[0], 2520 scrollUp = domCh[1], 2521 scrollDown = domCh[2], 2522 marker = domCh[3], 2523 table = div.firstChild, 2524 tbody = dom.getElementsByTagName(tree[1])[0], 2525 tr; 2526 for (var i = 0; i < group.length; i++) { 2527 if (i == 0 || !isX) tr = hs.createElement(tree[2], null, null, tbody); 2528 (function(){ 2529 var a = group[i], 2530 cell = hs.createElement(tree[3], null, null, tr), 2531 pI = i; 2532 hs.createElement('a', { 2533 href: a.href, 2534 onclick: function() { 2535 hs.getExpander(this).focus(); 2536 return hs.transit(a); 2537 }, 2538 innerHTML: hs.stripItemFormatter ? hs.stripItemFormatter(a) : a.innerHTML 2539 }, null, cell); 2540 })(); 2541 } 2542 if (!floatMode) { 2543 scrollUp.onclick = function () { scroll(-1); }; 2544 scrollDown.onclick = function() { scroll(1); }; 2545 hs.addEventListener(tbody, document.onmousewheel !== undefined ? 2546 'mousewheel' : 'DOMMouseScroll', function(e) { 2547 var delta = 0; 2548 e = e || window.event; 2549 if (e.wheelDelta) { 2550 delta = e.wheelDelta/120; 2551 if (hs.opera) delta = -delta; 2552 } else if (e.detail) { 2553 delta = -e.detail/3; 2554 } 2555 if (delta) scroll(-delta * 0.2); 2556 if (e.preventDefault) e.preventDefault(); 2557 e.returnValue = false; 2558 }); 2559 } 2560 2561 return { 2562 add: add, 2563 selectThumb: selectThumb 2564 } 2565}; 2566hs.langDefaults = hs.lang; 2567// history 2568var HsExpander = hs.Expander; 2569if (hs.ie && window == window.top) { 2570 (function () { 2571 try { 2572 document.documentElement.doScroll('left'); 2573 } catch (e) { 2574 setTimeout(arguments.callee, 50); 2575 return; 2576 } 2577 hs.ready(); 2578 })(); 2579} 2580hs.addEventListener(document, 'DOMContentLoaded', hs.ready); 2581hs.addEventListener(window, 'load', hs.ready); 2582 2583// set handlers 2584hs.addEventListener(document, 'ready', function() {
2585 if (hs.expandCursor || hs.dimmingOpacity) { 2586 var style = hs.createElement('style', { type: 'text/css' }, null, 2587 document.getElementsByTagName('HEAD')[0]); 2588 2589 function addRule(sel, dec) { 2590 if (!hs.ie) { 2591 style.appendChild(document.createTextNode(sel + " {" + dec + "}")); 2592 } else { 2593 var last = document.styleSheets[document.styleSheets.length - 1]; 2594 if (typeof(last.addRule) == "object") last.addRule(sel, dec); 2595 } 2596 } 2597 function fix(prop) { 2598 return 'expression( ( ( ignoreMe = document.documentElement.'+ prop + 2599 ' ? document.documentElement.'+ prop +' : document.body.'+ prop +' ) ) + \'px\' );'; 2600 } 2601 if (hs.expandCursor) addRule ('.highslide img', 2602 'cursor: url('+ hs.graphicsDir + hs.expandCursor +'), pointer !important;'); 2603 addRule ('.highslide-viewport-size', 2604 hs.ie && (hs.uaVersion < 7 || document.compatMode == 'BackCompat') ? 2605 'position: absolute; '+ 2606 'left:'+ fix('scrollLeft') + 2607 'top:'+ fix('scrollTop') + 2608 'width:'+ fix('clientWidth') + 2609 'height:'+ fix('clientHeight') : 2610 'position: fixed; width: 100%; height: 100%; left: 0; top: 0'); 2611 } 2612}); 2613hs.addEventListener(window, 'resize', function() { 2614 hs.getPageSize(); 2615 if (hs.viewport) for (var i = 0; i < hs.viewport.childNodes.length; i++) { 2616 var node = hs.viewport.childNodes[i], 2617 exp = hs.getExpander(node); 2618 exp.positionOverlay(node); 2619 if (node.hsId == 'thumbstrip') exp.slideshow.thumbstrip.selectThumb(); 2620 } 2621}); 2622hs.addEventListener(document, 'mousemove', function(e) { 2623 hs.mouse = { x: e.clientX, y: e.clientY }; 2624}); 2625hs.addEventListener(document, 'mousedown', hs.mouseClickHandler); 2626hs.addEventListener(document, 'mouseup', hs.mouseClickHandler); 2627 2628hs.addEventListener(document, 'ready', hs.getAnchors); 2629hs.addEventListener(window, 'load', hs.preloadImages); 2630}
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.