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