1/*! 2 * Shadowbox.js, version 3.0.3 3 * http://shadowbox-js.com/ 4 * 5 * Copyright 2007-2010, Michael J. I. Jackson 6 * 2010-03-10 00:00:00 +0000 7 */ 8(function(window, undefined) { 9var S = { 10 version: "3.0.3" 11}; 12var ua = navigator.userAgent.toLowerCase(); 13if (ua.indexOf("windows") > -1 || ua.indexOf("win32") > -1) { 14 S.isWindows = true 15} else { 16 if (ua.indexOf("macintosh") > -1 || ua.indexOf("mac os x") > -1) { 17 S.isMac = true 18 } else { 19 if (ua.indexOf("linux") > -1) { 20 S.isLinux = true 21 } 22 } 23} 24S.isIE = ua.indexOf("msie") > -1; 25S.isIE6 = ua.indexOf("msie 6") > -1; 26S.isIE7 = ua.indexOf("msie 7") > -1; 27S.isGecko = ua.indexOf("gecko") > -1 && ua.indexOf("safari") == -1; 28S.isWebKit = ua.indexOf("applewebkit/") > -1; 29var inlineId = /#(.+)$/, 30 galleryName = /^(light|shadow)box\[(.*?)\]/i, 31 inlineParam = /\s*([a-z_]*?)\s*=\s*(.+)\s*/, 32 fileExtension = /[0-9a-z]+$/i, 33 scriptPath = /(.+\/)shadowbox\.js/i; 34var open = false, 35 initialized = false, 36 lastOptions = {}, 37 slideDelay = 0, 38 slideStart, slideTimer; 39S.current = -1; 40S.dimensions = null; 41S.ease = function (a) { 42 return 1 + Math.pow(a - 1, 3) 43}; 44S.errorInfo = { 45 fla: { 46 name: "Flash", 47 url: "http://www.adobe.com/products/flashplayer/" 48 }, 49 qt: { 50 name: "QuickTime", 51 url: "http://www.apple.com/quicktime/download/" 52 }, 53 wmp: { 54 name: "Windows Media Player", 55 url: "http://www.microsoft.com/windows/windowsmedia/" 56 }, 57 f4m: { 58 name: "Flip4Mac", 59 url: "http://www.flip4mac.com/wmv_download.htm" 60 } 61}; 62S.gallery = []; 63S.onReady = noop; 64S.path = null; 65S.player = null; 66S.playerId = "sb-player"; 67S.options = { 68 animate: true, 69 animateFade: true, 70 autoplayMovies: true, 71 continuous: false, 72 enableKeys: true, 73 flashParams: { 74 bgcolor: "#000000", 75 allowfullscreen: true 76 }, 77 flashVars: {}, 78 flashVersion: "9.0.115", 79 handleOversize: "resize", 80 handleUnsupported: "link", 81 onChange: noop, 82 onClose: noop, 83 onFinish: noop, 84 onOpen: noop, 85 showMovieControls: true, 86 skipSetup: false, 87 slideshowDelay: 0, 88 viewportPadding: 20 89}; 90S.getCurrent = function () { 91 return S.current > -1 ? S.gallery[S.current] : null 92}; 93S.hasNext = function () { 94 return S.gallery.length > 1 && (S.current != S.gallery.length - 1 || S.options.continuous) 95}; 96S.isOpen = function () { 97 return open 98}; 99S.isPaused = function () { 100 return slideTimer == "pause" 101}; 102S.applyOptions = function (a) { 103 lastOptions = apply({}, S.options); 104 apply(S.options, a) 105}; 106S.revertOptions = function () { 107 apply(S.options, lastOptions) 108}; 109S.init = function (c, f) { 110 if (initialized) { 111 return 112 } 113 initialized = true; 114 if (S.skin.options) { 115 apply(S.options, S.skin.options) 116 } 117 if (c) { 118 apply(S.options, c) 119 } 120 if (!S.path) { 121 var e, b = document.getElementsByTagName("script"); 122 for (var d = 0, a = b.length; d < a; ++d) { 123 e = scriptPath.exec(b[d].src); 124 if (e) { 125 S.path = e[1]; 126 break 127 } 128 } 129 } 130 if (f) { 131 S.onReady = f 132 } 133 bindLoad() 134}; 135S.open = function (b) { 136 if (open) { 137 return 138 } 139 var a = S.makeGallery(b); 140 S.gallery = a[0]; 141 S.current = a[1]; 142 b = S.getCurrent(); 143 if (b == null) { 144 return 145 } 146 S.applyOptions(b.options || {}); 147 filterGallery(); 148 if (S.gallery.length) { 149 b = S.getCurrent(); 150 if (S.options.onOpen(b) === false) { 151 return 152 } 153 open = true; 154 S.skin.onOpen(b, load) 155 } 156}; 157S.close = function () { 158 if (!open) { 159 return 160 } 161 open = false; 162 if (S.player) { 163 S.player.remove(); 164 S.player = null 165 } 166 if (typeof slideTimer == "number") { 167 clearTimeout(slideTimer); 168 slideTimer = null 169 } 170 slideDelay = 0; 171 listenKeys(false); 172 S.options.onClose(S.getCurrent()); 173 S.skin.onClose(); 174 S.revertOptions() 175}; 176S.play = function () { 177 if (!S.hasNext()) { 178 return 179 } 180 if (!slideDelay) { 181 slideDelay = S.options.slideshowDelay * 1000 182 } 183 if (slideDelay) { 184 slideStart = now(); 185 slideTimer = setTimeout(function () { 186 slideDelay = slideStart = 0; 187 S.next() 188 }, slideDelay); 189 if (S.skin.onPlay) { 190 S.skin.onPlay() 191 } 192 } 193}; 194S.pause = function () { 195 if (typeof slideTimer != "number") { 196 return 197 } 198 slideDelay = Math.max(0, slideDelay - (now() - slideStart)); 199 if (slideDelay) { 200 clearTimeout(slideTimer); 201 slideTimer = "pause"; 202 if (S.skin.onPause) { 203 S.skin.onPause() 204 } 205 } 206}; 207S.change = function (a) { 208 if (!(a in S.gallery)) { 209 if (S.options.continuous) { 210 a = (a < 0 ? S.gallery.length + a : 0); 211 if (!(a in S.gallery)) { 212 return 213 } 214 } else { 215 return 216 } 217 } 218 S.current = a; 219 if (typeof slideTimer == "number") { 220 clearTimeout(slideTimer); 221 slideTimer = null; 222 slideDelay = slideStart = 0 223 } 224 S.options.onChange(S.getCurrent()); 225 load(true) 226}; 227S.next = function () { 228 S.change(S.current + 1) 229}; 230S.previous = function () { 231 S.change(S.current - 1) 232}; 233S.setDimensions = function (o, f, m, n, e, a, k, h) { 234 var j = o, 235 d = f; 236 var i = 2 * k + e; 237 if (o + i > m) { 238 o = m - i 239 } 240 var c = 2 * k + a; 241 if (f + c > n) { 242 f = n - c 243 } 244 var b = (j - o) / j, 245 l = (d - f) / d, 246 g = (b > 0 || l > 0); 247 if (h && g) { 248 if (b > l) { 249 f = Math.round((d / j) * o) 250 } else { 251 if (l > b) { 252 o = Math.round((j / d) * f) 253 } 254 } 255 } 256 S.dimensions = { 257 height: o + e, 258 width: f + a, 259 innerHeight: o, 260 innerWidth: f, 261 top: Math.floor((m - (o + i)) / 2 + k), 262 left: Math.floor((n - (f + c)) / 2 + k), 263 oversized: g 264 }; 265 return S.dimensions 266}; 267S.makeGallery = function (e) { 268 var a = [], 269 d = -1; 270 if (typeof e == "string") { 271 e = [e] 272 } 273 if (typeof e.length == "number") { 274 each(e, function (g, h) { 275 if (h.content) { 276 a[g] = h 277 } else { 278 a[g] = { 279 content: h 280 } 281 } 282 }); 283 d = 0 284 } else { 285 if (e.tagName) { 286 var b = S.getCache(e); 287 e = b ? b : S.makeObject(e) 288 } 289 if (e.gallery) { 290 a = []; 291 var f; 292 for (var c in S.cache) { 293 f = S.cache[c]; 294 if (f.gallery && f.gallery == e.gallery) { 295 if (d == -1 && f.content == e.content) { 296 d = a.length 297 } 298 a.push(f) 299 } 300 } 301 if (d == -1) { 302 a.unshift(e); 303 d = 0 304 } 305 } else { 306 a = [e]; 307 d = 0 308 } 309 } 310 each(a, function (g, h) { 311 a[g] = apply({}, h) 312 }); 313 return [a, d] 314}; 315S.makeObject = function (d, c) { 316 var e = { 317 content: d.href, 318 title: d.getAttribute("title") || "", 319 desc: d.getAttribute("desc") || "", 320 link: d 321 }; 322 if (c) { 323 c = apply({}, c); 324 each(["player", "title", "height", "width", "gallery"], function (f, g) { 325 if (typeof c[g] != "undefined") { 326 e[g] = c[g]; 327 delete c[g] 328 } 329 }); 330 e.options = c 331 } else { 332 e.options = {} 333 } 334 if (!e.player) { 335 e.player = S.getPlayer(e.content) 336 } 337 var a = d.getAttribute("rel"); 338 if (a) { 339 var b = a.match(galleryName); 340 if (b) { 341 e.gallery = escape(b[2]) 342 } 343 each(a.split(";"), function (f, g) { 344 b = g.match(inlineParam); 345 if (b) { 346 e[b[1]] = b[2] 347 } 348 }) 349 } 350 return e 351}; 352S.getPlayer = function (c) { 353 if (c.indexOf("#") > -1 && c.indexOf(document.location.href) == 0) { 354 return "inline" 355 } 356 var d = c.indexOf("?"); 357 if (d > -1) { 358 c = c.substring(0, d) 359 } 360 var b, a = c.match(fileExtension); 361 if (a) { 362 b = a[0].toLowerCase() 363 } 364 if (b) { 365 if (S.img && S.img.ext.indexOf(b) > -1) { 366 return "img" 367 } 368 if (S.swf && S.swf.ext.indexOf(b) > -1) { 369 return "swf" 370 } 371 if (S.flv && S.flv.ext.indexOf(b) > -1) { 372 return "flv" 373 } 374 if (S.qt && S.qt.ext.indexOf(b) > -1) { 375 if (S.wmp && S.wmp.ext.indexOf(b) > -1) { 376 return "qtwmp" 377 } else { 378 return "qt" 379 } 380 } 381 if (S.wmp && S.wmp.ext.indexOf(b) > -1) { 382 return "wmp" 383 } 384 } 385 return "iframe" 386}; 387 388function filterGallery() { 389 var d = S.errorInfo, 390 e = S.plugins, 391 g, h, l, c, k, b, j, a; 392 for (var f = 0; f < S.gallery.length; ++f) { 393 g = S.gallery[f]; 394 h = false;
395 l = null; 396 switch (g.player) { 397 case "flv": 398 case "swf": 399 if (!e.fla) { 400 l = "fla" 401 } 402 break; 403 case "qt": 404 if (!e.qt) { 405 l = "qt" 406 } 407 break; 408 case "wmp": 409 if (S.isMac) { 410 if (e.qt && e.f4m) { 411 g.player = "qt" 412 } else { 413 l = "qtf4m" 414 } 415 } else { 416 if (!e.wmp) { 417 l = "wmp" 418 } 419 } 420 break; 421 case "qtwmp": 422 if (e.qt) { 423 g.player = "qt" 424 } else { 425 if (e.wmp) { 426 g.player = "wmp" 427 } else { 428 l = "qtwmp" 429 } 430 } 431 break 432 } 433 if (l) { 434 if (S.options.handleUnsupported == "link") { 435 switch (l) { 436 case "qtf4m": 437 k = "shared"; 438 b = [d.qt.url, d.qt.name, d.f4m.url, d.f4m.name]; 439 break; 440 case "qtwmp": 441 k = "either"; 442 b = [d.qt.url, d.qt.name, d.wmp.url, d.wmp.name]; 443 break; 444 default: 445 k = "single"; 446 b = [d[l].url, d[l].name] 447 } 448 g.player = "html"; 449 g.content = '<div class="sb-message">' + sprintf(S.lang.errors[k], b) + "</div>" 450 } else { 451 h = true 452 } 453 } else { 454 if (g.player == "inline") { 455 c = inlineId.exec(g.content); 456 if (c) { 457 j = get(c[1]); 458 if (j) { 459 g.content = j.innerHTML 460 } else { 461 h = true 462 } 463 } else { 464 h = true 465 } 466 } else { 467 if (g.player == "swf" || g.player == "flv") { 468 a = (g.options && g.options.flashVersion) || S.options.flashVersion; 469 if (S.flash && !S.flash.hasFlashPlayerVersion(a)) { 470 g.width = 310; 471 g.height = 177 472 } 473 } 474 } 475 } 476 if (h) { 477 S.gallery.splice(f, 1); 478 if (f < S.current) { 479 --S.current 480 } else { 481 if (f == S.current) { 482 S.current = f > 0 ? f - 1 : f 483 } 484 }--f 485 } 486 } 487} 488function listenKeys(a) { 489 if (!S.options.enableKeys) { 490 return 491 }(a ? addEvent : removeEvent)(document, "keydown", handleKey) 492} 493function handleKey(c) { 494 if (c.metaKey || c.shiftKey || c.altKey || c.ctrlKey) { 495 return 496 } 497 var b = keyCode(c), 498 a; 499 switch (b) { 500 case 81: 501 case 88: 502 case 27: 503 a = S.close; 504 break; 505 case 37: 506 a = S.previous; 507 break; 508 case 39: 509 a = S.next; 510 break; 511 case 32: 512 a = typeof slideTimer == "number" ? S.pause : S.play; 513 break 514 } 515 if (a) { 516 preventDefault(c); 517 a() 518 } 519} 520function load(i) { 521 listenKeys(false); 522 var h = S.getCurrent(); 523 var e = (h.player == "inline" ? "html" : h.player); 524 if (typeof S[e] != "function") { 525 throw "unknown player " + e 526 } 527 if (i) { 528 S.player.remove(); 529 S.revertOptions(); 530 S.applyOptions(h.options || {}) 531 } 532 S.player = new S[e](h, S.playerId); 533 if (S.gallery.length > 1) { 534 var f = S.gallery[S.current + 1] || S.gallery[0]; 535 if (f.player == "img") { 536 var d = new Image(); 537 d.src = f.content 538 } 539 var g = S.gallery[S.current - 1] || S.gallery[S.gallery.length - 1]; 540 if (g.player == "img") { 541 var c = new Image(); 542 c.src = g.content 543 } 544 } 545 S.skin.onLoad(i, waitReady) 546} 547function waitReady() { 548 if (!open) { 549 return 550 } 551 if (typeof S.player.ready != "undefined") { 552 var a = setInterval(function () { 553 if (open) { 554 if (S.player.ready) { 555 clearInterval(a); 556 a = null; 557 S.skin.onReady(show) 558 } 559 } else { 560 clearInterval(a); 561 a = null 562 } 563 }, 10) 564 } else { 565 S.skin.onReady(show) 566 } 567} 568function show() { 569 if (!open) { 570 return 571 } 572 S.player.append(S.skin.body, S.dimensions); 573 S.skin.onShow(finish) 574} 575function finish() { 576 if (!open) { 577 return 578 } 579 if (S.player.onLoad) { 580 S.player.onLoad() 581 } 582 S.options.onFinish(S.getCurrent()); 583 if (!S.isPaused()) { 584 S.play() 585 } 586 listenKeys(true) 587}; 588 589if(!Array.prototype.indexOf){Array.prototype.indexOf=function(b,c){var a=this.length>>>0;c=c||0;if(c<0){c+=a}for(;c<a;++c){if(c in this&&this[c]===b){return c}}return -1}}function now(){return(new Date).getTime()}function apply(a,c){for(var b in c){a[b]=c[b]}return a}function each(d,e){var b=0,a=d.length;for(var c=d[0];b<a&&e.call(c,b,c)!==false;c=d[++b]){}}function sprintf(b,a){return b.replace(/\{(\w+?)\}/g,function(c,d){return a[d]})}function noop(){}function get(a){return document.getElementById(a)}function remove(a){a.parentNode.removeChild(a)}var supportsOpacity=true,supportsFixed=true;function checkSupport(){var a=document.body,b=document.createElement("div");
589supportsOpacity=typeof b.style.opacity==="string";b.style.position="fixed";b.style.margin=0;b.style.top="20px";a.appendChild(b,a.firstChild);supportsFixed=b.offsetTop==20;a.removeChild(b)}S.getStyle=(function(){var a=/opacity=([^)]*)/,b=document.defaultView&&document.defaultView.getComputedStyle;return function(f,e){var d;if(!supportsOpacity&&e=="opacity"&&f.currentStyle){d=a.test(f.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return d===""?"1":d}if(b){var c=b(f,null);if(c){d=c[e]}if(e=="opacity"&&d==""){d="1"}}else{d=f.currentStyle[e]}return d}})();S.appendHTML=function(c,b){if(c.insertAdjacentHTML){c.insertAdjacentHTML("BeforeEnd",b)}else{if(c.lastChild){var a=c.ownerDocument.createRange();a.setStartAfter(c.lastChild);var d=a.createContextualFragment(b);c.appendChild(d)}else{c.innerHTML=b}}};S.getWindowSize=function(a){if(document.compatMode==="CSS1Compat"){return document.documentElement["client"+a]}return document.body["client"+a]};S.setOpacity=function(c,a){var b=c.style;if(supportsOpacity){b.opacity=(a==1?"":a)}else{b.zoom=1;if(a==1){if(typeof b.filter=="string"&&(/alpha/i).test(b.filter)){b.filter=b.filter.replace(/\s*[\w\.]*alpha\([^\)]*\);?/gi,"")}}else{b.filter=(b.filter||"").replace(/\s*[\w\.]*alpha\([^\)]*\)/gi,"")+" alpha(opacity="+(a*100)+")"}}};S.clearOpacity=function(a){S.setOpacity(a,1)};function getTarget(b){var a=b.target?b.target:b.srcElement;return a.nodeType==3?a.parentNode:a}function getPageXY(b){var a=b.pageX||(b.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),c=b.pageY||(b.clientY+(document.documentElement.scrollTop||document.body.scrollTop));return[a,c]}function preventDefault(a){a.preventDefault()}function keyCode(a){return a.which?a.which:a.keyCode}function addEvent(d,c,b){if(d.addEventListener){d.addEventListener(c,b,false)}else{if(d.nodeType===3||d.nodeType===8){return}if(d.setInterval&&(d!==window&&!d.frameElement)){d=window}if(!b.__guid){b.__guid=addEvent.guid++}if(!d.events){d.events={}}var a=d.events[c];if(!a){a=d.events[c]={};if(d["on"+c]){a[0]=d["on"+c]}}a[b.__guid]=b;d["on"+c]=addEvent.handleEvent}}addEvent.guid=1;addEvent.handleEvent=function(d){var a=true;d=d||addEvent.fixEvent(((this.ownerDocument||this.document||this).parentWindow||window).event);var b=this.events[d.type];for(var c in b){this.__handleEvent=b[c];if(this.__handleEvent(d)===false){a=false}}return a};addEvent.preventDefault=function(){this.returnValue=false};addEvent.stopPropagation=function(){this.cancelBubble=true};addEvent.fixEvent=function(a){a.preventDefault=addEvent.preventDefault;a.stopPropagation=addEvent.stopPropagation;return a};function removeEvent(c,b,a){if(c.removeEventListener){c.removeEventListener(b,a,false)}else{if(c.events&&c.events[b]){delete c.events[b][a.__guid]}}};var loaded=false,DOMContentLoaded;if(document.addEventListener){DOMContentLoaded=function(){document.removeEventListener("DOMContentLoaded",DOMContentLoaded,false);S.load()}}else{if(document.attachEvent){DOMContentLoaded=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",DOMContentLoaded);S.load()}}}}function doScrollCheck(){if(loaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(doScrollCheck,1);return}S.load()}function bindLoad(){if(document.readyState==="complete"){return S.load()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMContentLoaded,false);window.addEventListener("load",S.load,false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",DOMContentLoaded);window.attachEvent("onload",S.load);var a=false;try{a=window.frameElement===null}catch(b){}if(document.documentElement.doScroll&&a){doScrollCheck()}}}}S.load=function(){if(loaded){return}if(!document.body){return setTimeout(S.load,13)}loaded=true;checkSupport();S.onReady();if(!S.options.skipSetup){S.setup()}S.skin.init()};S.plugins={};if(navigator.plugins&&navigator.plugins.length){var names=[];each(navigator.plugins,function(a,b){names.push(b.name)});names=names.join(",");var f4m=names.indexOf("Flip4Mac")>-1;S.plugins={fla:names.indexOf("Shockwave Flash")>-1,qt:names.indexOf("QuickTime")>-1,wmp:!f4m&&names.indexOf("Windows Media")>-1,f4m:f4m}}else{var detectPlugin=function(a){var b;try{b=new ActiveXObject(a)}catch(c){}return !!b};S.plugins={fla:detectPlugin("ShockwaveFlash.ShockwaveFlash"),qt:detectPlugin("QuickTime.QuickTime"),wmp:detectPlugin("wmplayer.ocx"),f4m:false}};var relAttr=/^(light|shadow)box/i,expando="shadowboxCacheKey",cacheKey=1;S.cache={};S.select=function(b){var c=[];if(!b){var a;each(document.getElementsByTagName("a"),function(f,g){a=g.getAttribute("rel");if(a&&relAttr.test(a)){c.push(g)}})}else{var e=b.length;if(e){if(typeof b=="string"){if(S.find){c=S.find(b)}}else{if(e==2&&typeof b[0]=="string"&&b[1].nodeType){if(S.find){c=S.find(b[0],b[1])}}else{for(var d=0;d<e;++d){c[d]=b[d]}}}}else{c.push(b)}}return c};S.setup=function(a,b){each(S.select(a),function(c,d){S.addCache(d,b)})};S.teardown=function(a){each(S.select(a),function(b,c){S.removeCache(c)})};S.addCache=function(c,a){var b=c[expando];if(b==undefined){b=cacheKey++;
589c[expando]=b;addEvent(c,"click",handleClick)}S.cache[b]=S.makeObject(c,a)};S.removeCache=function(a){removeEvent(a,"click",handleClick);delete S.cache[a[expando]];a[expando]=null};S.getCache=function(b){var a=b[expando];return(a in S.cache&&S.cache[a])};S.clearCache=function(){for(var a in S.cache){S.removeCache(S.cache[a].link)}S.cache={}};function handleClick(a){S.open(this);if(S.gallery.length){preventDefault(a)}};/* 590 * SWFObject v2.1 <http://code.google.com/p/swfobject/> 591 * Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis 592 * This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 593 * 594 * Modified for inclusion in Shadowbox.js 595 */ 596S.flash=(function(){var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",win=window,doc=document,nav=navigator,domLoadFnArr=[],regObjArr=[],objIdArr=[],listenersArr=[],script,timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=true}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u); 597/*@cc_on 598 ie = true; 599 @if (@_win32) 600 windows = true; 601 @elif (@_mac) 602 mac = true; 603 @end 604 @*/ 605return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();var onDomLoad=function(){if(!ua.w3cdom){return}addDomLoadEvent(main);if(ua.ie&&ua.win){try{doc.write("<script id=__ie_ondomload defer=true src=//:><\/script>");script=getElementById("__ie_ondomload");if(script){addListener(script,"onreadystatechange",checkReadyState)}}catch(e){}}if(ua.webkit&&typeof doc.readyState!=UNDEF){timer=setInterval(function(){if(/loaded|complete/.test(doc.readyState)){callDomLoadFunctions()}},10)}if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,null)}addLoadEvent(callDomLoadFunctions)}();function checkReadyState(){if(script.readyState=="complete"){script.parentNode.removeChild(script);callDomLoadFunctions()}}function callDomLoadFunctions(){if(isDomLoaded){return}if(ua.ie&&ua.win){var s=createElement("span");try{var t=doc.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t)}catch(e){return}}isDomLoaded=true;if(timer){clearInterval(timer);timer=null}var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]()}}function addDomLoadEvent(fn){if(isDomLoaded){fn()}else{domLoadFnArr[domLoadFnArr.length]=fn}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false)}else{if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false)}else{if(typeof win.attachEvent!=UNDEF){addListener(win,"onload",fn)}else{if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn()}}else{win.onload=fn}}}}}function main(){var rl=regObjArr.length;for(var i=0;i<rl;i++){var id=regObjArr[i].id;if(ua.pv[0]>0){var obj=getElementById(id);if(obj){regObjArr[i].width=obj.getAttribute("width")?obj.getAttribute("width"):"0";regObjArr[i].height=obj.getAttribute("height")?obj.getAttribute("height"):"0";if(hasPlayerVersion(regObjArr[i].swfVersion)){if(ua.webkit&&ua.webkit<312){fixParams(obj)}setVisibility(id,true)}else{if(regObjArr[i].expressInstall&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){showExpressInstall(regObjArr[i])}else{displayAltContent(obj)}}}}else{setVisibility(id,true)}}}function fixParams(obj){var nestedObj=obj.getElementsByTagName(OBJECT)[0];
605if(nestedObj){var e=createElement("embed"),a=nestedObj.attributes;if(a){var al=a.length;for(var i=0;i<al;i++){if(a[i].nodeName=="DATA"){e.setAttribute("src",a[i].nodeValue)}else{e.setAttribute(a[i].nodeName,a[i].nodeValue)}}}var c=nestedObj.childNodes;if(c){var cl=c.length;for(var j=0;j<cl;j++){if(c[j].nodeType==1&&c[j].nodeName=="PARAM"){e.setAttribute(c[j].getAttribute("name"),c[j].getAttribute("value"))}}}obj.parentNode.replaceChild(e,obj)}}function showExpressInstall(regObj){isExpressInstallActive=true;var obj=getElementById(regObj.id);if(obj){if(regObj.altContentId){var ac=getElementById(regObj.altContentId);if(ac){storedAltContent=ac;storedAltContentId=regObj.altContentId}}else{storedAltContent=abstractAltContent(obj)}if(!(/%$/.test(regObj.width))&&parseInt(regObj.width,10)<310){regObj.width="310"}if(!(/%$/.test(regObj.height))&&parseInt(regObj.height,10)<137){regObj.height="137"}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",dt=doc.title,fv="MMredirectURL="+win.location+"&MMplayerType="+pt+"&MMdoctitle="+dt,replaceId=regObj.id;if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceId+="SWFObjectNew";newObj.setAttribute("id",replaceId);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}createSWF({data:regObj.expressInstall,id:EXPRESS_INSTALL_ID,width:regObj.width,height:regObj.height},{flashvars:fv},replaceId)}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj)}}function abstractAltContent(obj){var ac=createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName=="PARAM")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true))}}}}}return ac}
605function createSWF(attObj,parObj,id){var r,el=getElementById(id);if(el){if(typeof attObj.id==UNDEF){attObj.id=id}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){parObj.movie=attObj[i]}else{if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"'}else{if(i.toLowerCase()!="classid"){att+=" "+i+'="'+attObj[i]+'"'}}}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />'}}el.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+att+">"+par+"</object>";objIdArr[objIdArr.length]=attObj.id;r=getElementById(attObj.id)}else{if(ua.webkit&&ua.webkit<312){var e=createElement("embed");e.setAttribute("type",FLASH_MIME_TYPE);for(var k in attObj){if(attObj[k]!=Object.prototype[k]){if(k.toLowerCase()=="data"){e.setAttribute("src",attObj[k])}else{if(k.toLowerCase()=="styleclass"){e.setAttribute("class",attObj[k])}else{if(k.toLowerCase()!="classid"){e.setAttribute(k,attObj[k])}}}}}for(var l in parObj){if(parObj[l]!=Object.prototype[l]){if(l.toLowerCase()!="movie"){e.setAttribute(l,parObj[l])}}}el.parentNode.replaceChild(e,el);r=e}else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m])}else{if(m.toLowerCase()!="classid"){o.setAttribute(m,attObj[m])}}}}for(var n in parObj){if(parObj[n]!=Object.prototype[n]&&n.toLowerCase()!="movie"){createObjParam(o,n,parObj[n])}}el.parentNode.replaceChild(o,el);r=o}}}return r}function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p)}function removeSWF(id){var obj=getElementById(id);if(obj&&(obj.nodeName=="OBJECT"||obj.nodeName=="EMBED")){if(ua.ie&&ua.win){if(obj.readyState==4){removeObjectInIE(id)}else{win.attachEvent("onload",function(){removeObjectInIE(id)})}}else{obj.parentNode.removeChild(obj)}}}function removeObjectInIE(id){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=null}}obj.parentNode.removeChild(obj)}}function getElementById(id){var el=null;try{el=doc.getElementById(id)}catch(e){}return el}function createElement(el){return doc.createElement(el)}function addListener(target,eventType,fn){target.attachEvent(eventType,fn);listenersArr[listenersArr.length]=[target,eventType,fn]}function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10)||0;v[2]=parseInt(v[2],10)||0;return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false}function createCSS(sel,decl){if(ua.ie&&ua.mac){return}var h=doc.getElementsByTagName("head")[0],s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media","screen");if(!(ua.ie&&ua.win)&&typeof doc.createTextNode!=UNDEF){s.appendChild(doc.createTextNode(sel+" {"+decl+"}"))}h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){var ls=doc.styleSheets[doc.styleSheets.length-1];if(typeof ls.addRule==OBJECT){ls.addRule(sel,decl)}}}function setVisibility(id,isVisible){var v=isVisible?"visible":"hidden";if(isDomLoaded&&getElementById(id)){getElementById(id).style.visibility=v}else{createCSS("#"+id,"visibility:"+v)}}function urlEncodeIfNecessary(s){var regex=/[\\\"<>\.;]/;var hasBadChars=regex.exec(s)!=null;return hasBadChars?encodeURIComponent(s):s}var cleanup=function(){if(ua.ie&&ua.win){window.attachEvent("onunload",function(){var ll=listenersArr.length;for(var i=0;i<ll;i++){listenersArr[i][0].detachEvent(listenersArr[i][1],listenersArr[i][2])}var il=objIdArr.length;for(var j=0;j<il;j++){removeSWF(objIdArr[j])}for(var k in ua){ua[k]=null}ua=null;for(var l in swfobject){swfobject[l]=null}swfobject=null})}}();return{registerObject:function(objectIdStr,swfVersionStr,xiSwfUrlStr){if(!ua.w3cdom||!objectIdStr||!swfVersionStr){return}var regObj={};regObj.id=objectIdStr;regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr?xiSwfUrlStr:false;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false)},getObjectById:function(objectIdStr){var r=null;if(ua.w3cdom){var o=getElementById(objectIdStr);if(o){var n=o.getElementsByTagName(OBJECT)[0];if(!n||(n&&typeof o.SetVariable!=UNDEF)){r=o}else{if(typeof n.SetVariable!=UNDEF){r=n}}}}return r},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parOb
605j,attObj){if(!ua.w3cdom||!swfUrlStr||!replaceElemIdStr||!widthStr||!heightStr||!swfVersionStr){return}widthStr+="";heightStr+="";if(hasPlayerVersion(swfVersionStr)){setVisibility(replaceElemIdStr,false);var att={};if(attObj&&typeof attObj===OBJECT){for(var i in attObj){if(attObj[i]!=Object.prototype[i]){att[i]=attObj[i]}}}att.data=swfUrlStr;att.width=widthStr;att.height=heightStr;var par={};if(parObj&&typeof parObj===OBJECT){for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par[j]=parObj[j]}}}if(flashvarsObj&&typeof flashvarsObj===OBJECT){for(var k in flashvarsObj){if(flashvarsObj[k]!=Object.prototype[k]){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+k+"="+flashvarsObj[k]}else{par.flashvars=k+"="+flashvarsObj[k]}}}}addDomLoadEvent(function(){createSWF(att,par,replaceElemIdStr);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true)}})}else{if(xiSwfUrlStr&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){isExpressInstallActive=true;setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){var regObj={};regObj.id=regObj.altContentId=replaceElemIdStr;regObj.width=widthStr;regObj.height=heightStr;regObj.expressInstall=xiSwfUrlStr;showExpressInstall(regObj)})}}},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parOb
605j,replaceElemIdStr){if(ua.w3cdom){return createSWF(attObj,parObj,replaceElemIdStr)}else{return undefined}},removeSWF:function(objElemIdStr){if(ua.w3cdom){removeSWF(objElemIdStr)}},createCSS:function(sel,decl){if(ua.w3cdom){createCSS(sel,decl)}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(param==null){return urlEncodeIfNecessary(q)}if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(isExpressInstallActive&&storedAltContent){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block"}}storedAltContent=null;storedAltContentId=null;isExpressInstallActive=false}}}}}();return swfobject})();S.lang={code:"en",of:"of",loading:"loading",cancel:"Cancel",next:"Next",previous:"Previous",play:"Play",pause:"Pause",close:"Close",errors:{single:'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared:'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either:'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}};S.html=function(a,b){this.obj=a;this.id=b;this.height=a.height?parseInt(a.height,10):300;this.width=a.width?parseInt(a.width,10):500};S.html.prototype={append:function(a,b){var c=document.createElement("div");c.id=this.id;c.className="html";c.innerHTML=this.obj.content;a.appendChild(c)},remove:function(){var a=get(this.id);if(a){remove(a)}}};S.iframe=function(b,c){this.obj=b;this.id=c;var a=get("sb-overlay");this.height=b.height?parseInt(b.height,10):a.offsetHeight;this.width=b.width?parseInt(b.width,10):a.offsetWidth};S.iframe.prototype={append:function(a,c){var b='<iframe id="'+this.id+'" name="'+this.id+'" height="100%" width="100%" frameborder="0" marginwidth="0" marginheight="0" style="visibility:hidden" onload="this.style.visibility=\'visible\'" scrolling="auto"';if(S.isIE){b+=' allowtransparency="true"';if(S.isIE6){b+=" src=\"javascript:false;document.write('');\""}}b+="></iframe>";a.innerHTML=b},remove:function(){var a=get(this.id);if(a){remove(a);if(S.isGecko){delete window.frames[this.id]}}},onLoad:function(){var a=S.isIE?get(this.id).contentWindow:window.frames[this.id];a.location.href=this.obj.content}};var pre,proxyId="sb-drag-proxy",dragData,dragProxy,dragTarget;function resetDrag(){dragData={x:0,y:0,startX:null,startY:null}}function updateProxy(){var a=S.dimensions;apply(dragProxy.style,{height:a.innerHeight+"px",width:a.innerWidth+"px"})}function enableDrag(){resetDrag();var a=["position:absolute","cursor:"+(S.isGecko?"-moz-grab":"move"),"background-color:"+(S.isIE?"#fff;filter:alpha(opacity=0)":"transparent")].join(";");S.appendHTML(S.skin.body,'<div id="'+proxyId+'" style="'+a+'"></div>');dragProxy=get(proxyId);updateProxy();addEvent(dragProxy,"mousedown",startDrag)}function disableDrag(){if(dragProxy){removeEvent(dragProxy,"mousedown",startDrag);remove(dragProxy);dragProxy=null}dragTarget=null}function startDrag(b){preventDefault(b);var a=getPageXY(b);dragData.startX=a[0];dragData.startY=a[1];dragTarget=get(S.player.id);addEvent(document,"mousemove",positionDrag);addEvent(document,"mouseup",endDrag);if(S.isGecko){dragProxy.style.cursor="-moz-grabbing"}}function positionDrag(f){var a=S.player,g=S.dimensions,d=getPageXY(f);var c=d[0]-dragData.startX;dragData.startX+=c;dragData.x=Math.max(Math.min(0,dragData.x+c),g.innerWidth-a.width);var b=d[1]-dragData.startY;dragData.startY+=b;dragData.y=Math.max(Math.min(0,dragData.y+b),g.innerHeight-a.height);apply(dragTarget.style,{left:dragData.x+"px",top:dragData.y+"px"})}function endDrag(){removeEvent(document,"mousemove",positionDrag);removeEvent(document,"mouseup",endDrag);if(S.isGecko){dragProxy.style.cursor="-moz-grab"}}S.img=function(b,c){this.obj=b;this.id=c;this.ready=false;var a=this;pre=new Image();pre.onload=function(){a.height=b.height?parseInt(b.height,10):pre.height;
605a.width=b.width?parseInt(b.width,10):pre.width;a.ready=true;pre.onload=null;pre=null};pre.src=b.content};S.img.ext=["bmp","gif","jpg","jpeg","png"];S.img.prototype={append:function(b,e){var c=document.createElement("img");c.id=this.id;c.src=this.obj.content;c.style.position="absolute";var a,d;if(e.oversized&&S.options.handleOversize=="resize"){a=e.innerHeight;d=e.innerWidth}else{a=this.height;d=this.width}c.setAttribute("height",a);c.setAttribute("width",d);b.appendChild(c)},remove:function(){var a=get(this.id);if(a){remove(a)}disableDrag();if(pre){pre.onload=null;pre=null}},onLoad:function(){var a=S.dimensions;if(a.oversized&&S.options.handleOversize=="drag"){enableDrag()}},onWindowResize:function(){var d=S.dimensions;switch(S.options.handleOversize){case"resize":var a=get(this.id);a.height=d.innerHeight;a.width=d.innerWidth;break;case"drag":if(dragTarget){var c=parseInt(S.getStyle(dragTarget,"top")),b=parseInt(S.getStyle(dragTarget,"left"));if(c+this.height<d.innerHeight){dragTarget.style.top=d.innerHeight-this.height+"px"}if(b+this.width<d.innerWidth){dragTarget.style.left=d.innerWidth-this.width+"px"}updateProxy()}break}}};var qtControllerHeight=16;S.qt=function(a,b){this.obj=a;this.id=b;this.height=a.height?parseInt(a.height,10):300;if(S.options.showMovieControls){this.height+=qtControllerHeight}this.width=a.width?parseInt(a.width,10):300};S.qt.ext=["dv","mov","moov","movie","mp4","avi","mpg","mpeg"];S.qt.prototype={append:function(h,i){var b=S.options,c=String(b.autoplayMovies),j=String(b.showMovieControls);var g="<object",e={id:this.id,name:this.id,height:this.height,width:this.width,kioskmode:"true"};if(S.isIE){e.classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";e.codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"}else{e.type="video/quicktime";e.data=this.obj.content}for(var d in e){g+=" "+d+'="'+e[d]+'"'}g+=">";var f={src:this.obj.content,scale:"aspect",controller:j,autoplay:c};for(var a in f){g+='<param name="'+a+'" value="'+f[a]+'">'}g+="</object>";h.innerHTML=g},remove:function(){try{document[this.id].Stop()}catch(b){}var a=get(this.id);if(a){remove(a)}}};S.swf=function(a,b){this.obj=a;this.id=b;this.height=a.height?parseInt(a.height,10):300;this.width=a.width?parseInt(a.width,10):300};S.swf.ext=["swf"];S.swf.prototype={append:function(g,i){var f=document.createElement("div");f.id=this.id;g.appendChild(f);var j=i.innerHeight,b=i.innerWidth,c=this.obj.content,h=S.options.flashVersion,a=S.path+"expressInstall.swf",d=S.options.flashVars,e=S.options.flashParams;S.flash.embedSWF(c,this.id,b,j,h,a,d,e)},remove:function(){S.flash.expressInstallCallback();S.flash.removeSWF(this.id)},onWindowResize:function(){var b=S.dimensions,a=get(this.id);a.height=b.innerHeight;a.width=b.innerWidth}};var wmpControllerHeight=(S.isIE?70:45);S.wmp=function(a,b){this.obj=a;this.id=b;this.height=a.height?parseInt(a.height,10):300;if(S.options.showMovieControls){this.height+=wmpControllerHeight}this.width=a.width?parseInt(a.width,10):300};S.wmp.ext=["asf","avi","mpg","mpeg","wm","wmv"];S.wmp.prototype={append:function(a,g){var c=S.options,d=c.autoplayMovies?1:0;var b='<object id="'+this.id+'" name="'+this.id+'" height="'+this.height+'" width="'+this.width+'"',f={autostart:c.autoplayMovies?1:0};if(S.isIE){b+=' classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"';f.url=this.obj.content;f.uimode=c.showMovieControls?"full":"none"}else{b+=' type="video/x-ms-wmv"';b+=' data="'+this.obj.content+'"';f.showcontrols=c.showMovieControls?1:0}b+=">";for(var e in f){b+='<param name="'+e+'" value="'+f[e]+'">'}b+="</object>";a.innerHTML=b},remove:function(){if(S.isIE){try{window[this.id].controls.stop();window[this.id].URL="movie"+now()+".wmv";window[this.id]=function(){}}catch(b){}}var a=get(this.id);if(a){setTimeout(function(){remove(a)},10)}}};var overlayOn = false, 606 visibilityCache = [], 607 pngIds = ["sb-nav-close", "sb-nav-next", "sb-nav-play", "sb-nav-pause", "sb-nav-previous"], 608 container, overlay, wrapper, doWindowResize = true; 609 610function animate(c, m, j, h, n) { 611 var a = (m == "opacity"), 612 i = a ? S.setOpacity : function (o, p) { 613 o.style[m] = "" + p + "px" 614 }; 615 if (h == 0 || (!a && !S.options.animate) || (a && !S.options.animateFade)) { 616 i(c, j); 617 if (n) { 618 n() 619 } 620 return 621 } 622 var k = parseFloat(S.getStyle(c, m)) || 0; 623 var l = j - k; 624 if (l == 0) { 625 if (n) { 626 n() 627 } 628 return 629 } 630 h *= 1000; 631 var d = now(), 632 g = S.ease, 633 f = d + h, 634 e; 635 var b = setInterval(function () { 636 e = now(); 637 if (e >= f) { 638 clearInterval(b); 639 b = null; 640 i(c, j); 641 if (n) { 642 n() 643 } 644 } else { 645 i(c, k + g((e - d) / h) * l) 646 } 647 }, 10) 648} 649 650function setSize() { 651 container.style.height = S.getWindowSize("Height") + "px"; 652 container.style.width = S.getWindowSize("Width") + "px" 653} 654 655function setPosition() { 656 container.style.top = document.documentElement.scrollTop + "px"; 657 container.style.left = document.documentElement.scrollLeft + "px" 658} 659 660function toggleTroubleElements(a) { 661 if (a) { 662 each(visibilityCache, function (b, c) { 663 c[0].style.visibility = c[1] || "" 664 }) 665 } else { 666 visibilityCache = []; 667 each(S.options.troubleElements, function (c, b) { 668 each(document.getElementsByTagName(b), function (d, e) { 669 visibilityCache.push([e, e.style.visibility]); 670 e.style.visibility = "hidden" 671 }) 672 }) 673 } 674} 675 676function toggleNav(c, a) { 677 var b = get("sb-nav-" + c); 678 if (b) { 679 b.style.display = a ? "" : "none" 680 } 681} 682 683function toggleLoading(a, f) { 684 var e = get("sb-loading"), 685 c = S.getCurrent().player, 686 d = (c == "img" || c == "html"); 687 if (a) { 688 S.setOpacity(e, 0); 689 e.style.display = "block"; 690 var b = function () { 691 S.clearOpacity(e); 692 if (f) { 693 f() 694 } 695 }; 696 if (d) { 697 animate(e, "opacity", 1, S.options.fadeDuration, b) 698 } else { 699 b() 700 } 701 } else { 702 var b = function () { 703 e.style.display = "none"; 704 S.clearOpacity(e); 705 if (f) { 706 f() 707 } 708 }; 709 if (d) { 710 animate(e, "opacity", 0, S.options.fadeDuration, b) 711 } else { 712 b() 713 } 714 } 715} 716 717function buildBars(m) { 718 var f = S.getCurrent(); 719 get("sb-title-inner").innerHTML = f.title || ""; 720 get("sb-info-desc").innerHTML = f.desc || ""; 721 var n, j, b, o, k; 722 if (S.options.displayNav) { 723 n = true; 724 var l = S.gallery.length; 725 if (l > 1) { 726 if (S.options.continuous) { 727 j = k = true 728 } else { 729 j = (l - 1) > S.current; 730 k = S.current > 0 731 } 732 } 733 if (S.options.slideshowDelay > 0 && S.hasNext()) { 734 o = !S.isPaused(); 735 b = !o 736 } 737 } else { 738 n = j = b = o = k = false 739 } 740 toggleNav("close", n); 741 toggleNav("next", j); 742 toggleNav("play", b); 743 toggleNav("pause", o); 744 toggleNav("previous", k); 745 var a = ""; 746 if (S.options.displayCounter && S.gallery.length > 1) { 747 var l = S.gallery.length; 748 if (S.options.counterType == "skip") { 749 var e = 0, 750 d = l, 751 c = parseInt(S.options.counterLimit) || 0; 752 if (c < l && c > 2) { 753 var g = Math.floor(c / 2); 754 e = S.current - g; 755 if (e < 0) { 756 e += l 757 } 758 d = S.current + (c - g); 759 if (d > l) { 760 d -= l 761 } 762 } 763 while (e != d) { 764 if (e == l) { 765 e = 0 766 } 767 a += '<a onclick="Shadowbox.change(' + e + ');"'; 768 if (e == S.current) { 769 a += ' class="sb-counter-current"' 770 } 771 a += ">" + (++e) + "</a>" 772 } 773 } else { 774 a = [S.current + 1, S.lang.of, l].join(" ") 775 } 776 } 777 get("sb-counter").innerHTML = a; 778 m() 779} 780 781function showBars(d) { 782 var a = get("sb-title-inner"), 783 c = get("sb-info-inner"), 784 b = 0.35; 785 a.style.visibility = c.style.visibility = ""; 786 if (a.innerHTML != "") { 787 animate(a, "marginTop", 0, b) 788 } 789 animate(c, "marginTop", 0, b, d) 790} 791 792function hideBars(c, i) { 793 var g = get("sb-title"), 794 a = get("sb-info"),
795 d = g.offsetHeight, 796 e = a.offsetHeight, 797 f = get("sb-title-inner"), 798 h = get("sb-info-inner"), 799 b = (c ? 0.35 : 0); 800 animate(f, "marginTop", d, b); 801 animate(h, "marginTop", e * -1, b, function () { 802 f.style.visibility = h.style.visibility = "hidden"; 803 i() 804 }) 805} 806 807function adjustHeight(a, d, b, f) { 808 var e = get("sb-wrapper-inner"), 809 c = (b ? S.options.resizeDuration : 0); 810 animate(wrapper, "top", d, c); 811 animate(e, "height", a, c, f) 812} 813 814function adjustWidth(a, d, b, e) { 815 var c = (b ? S.options.resizeDuration : 0); 816 animate(wrapper, "left", d, c); 817 animate(wrapper, "width", a, c, e) 818} 819 820function setDimensions(i, c) { 821 var e = get("sb-body-inner"), 822 i = parseInt(i), 823 c = parseInt(c), 824 b = wrapper.offsetHeight - e.offsetHeight, 825 a = wrapper.offsetWidth - e.offsetWidth, 826 g = overlay.offsetHeight, 827 h = overlay.offsetWidth, 828 f = parseInt(S.options.viewportPadding) || 20, 829 d = (S.player && S.options.handleOversize != "drag"); 830 return S.setDimensions(i, c, g, h, b, a, f, d) 831} 832var K = {}; 833K.markup = '<div id="sb-container"><div id="sb-overlay"></div><div id="sb-wrapper"><div id="sb-title"><div id="sb-title-inner"></div></div><div id="sb-wrapper-inner"><div id="sb-body"><div id="sb-body-inner"></div><div id="sb-loading"><div id="sb-loading-inner"><span>{loading}</span></div></div></div></div><div id="sb-info"><div id="sb-info-inner"><div id="sb-counter"></div><div id="sb-nav"><a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()">{close}</a><a id="sb-nav-next" title="{next}" onclick="Shadowbox.next()">{next} |</a><a id="sb-nav-play" title="{play}" onclick="Shadowbox.play()"></a><a id="sb-nav-pause" title="{pause}" onclick="Shadowbox.pause()"></a><a id="sb-nav-previous" title="{previous}" onclick="Shadowbox.previous()"> {previous} |</a></div><div class="clear"></div><div id="sb-info-desc"></div></div></div></div></div>'; 834K.options = { 835 animSequence: "sync", 836 counterLimit: 10, 837 counterType: "default", 838 displayCounter: true, 839 displayNav: true, 840 fadeDuration: 0.35, 841 initialHeight: 160, 842 initialWidth: 320, 843 modal: false, 844 overlayColor: "#000", 845 overlayOpacity: 0.5, 846 resizeDuration: 0.35, 847 showOverlay: true, 848 troubleElements: ["select", "object", "embed", "canvas"] 849}; 850K.init = function () { 851 S.appendHTML(document.body, sprintf(K.markup, S.lang)); 852 K.body = get("sb-body-inner"); 853 container = get("sb-container"); 854 overlay = get("sb-overlay"); 855 wrapper = get("sb-wrapper"); 856 if (!supportsFixed) { 857 container.style.position = "absolute" 858 } 859 if (!supportsOpacity) { 860 var c, a, b = /url\("(.*\.png)"\)/; 861 each(pngIds, function (e, f) { 862 c = get(f); 863 if (c) { 864 a = S.getStyle(c, "backgroundImage").match(b); 865 if (a) { /*c.style.backgroundImage="none";c.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+a[1]+",sizingMethod=scale);"*/ 866 } 867 } 868 }) 869 } 870 var d; 871 addEvent(window, "resize", function () { 872 if (d) { 873 clearTimeout(d); 874 d = null 875 } 876 if (open) { 877 d = setTimeout(K.onWindowResize, 10) 878 } 879 }) 880}; 881K.onOpen = function (a, c) { 882 doWindowResize = false; 883 container.style.display = "block"; 884 setSize(); 885 var b = setDimensions(S.options.initialHeight, S.options.initialWidth); 886 adjustHeight(b.innerHeight, b.top); 887 adjustWidth(b.width, b.left); 888 if (S.options.showOverlay) { 889 overlay.style.backgroundColor = S.options.overlayColor; 890 S.setOpacity(overlay, 0); 891 if (!S.options.modal) { 892 addEvent(overlay, "click", S.close) 893 } 894 overlayOn = true 895 } 896 if (!supportsFixed) { 897 setPosition(); 898 addEvent(window, "scroll", setPosition) 899 } 900 toggleTroubleElements(); 901 container.style.visibility = "visible"; 902 if (overlayOn) { 903 animate(overlay, "opacity", S.options.overlayOpacity, S.options.fadeDuration, c) 904 } else { 905 c() 906 } 907}; 908K.onLoad = function (b, a) { 909 toggleLoading(true); 910 while (K.body.firstChild) { 911 remove(K.body.firstChild) 912 } 913 hideBars(b, function () { 914 if (!open) { 915 return 916 } 917 if (!b) { 918 wrapper.style.visibility = "visible" 919 } 920 buildBars(a) 921 }) 922}; 923K.onReady = function (d) { 924 if (!open) { 925 return 926 } 927 var b = S.player, 928 c = setDimensions(b.height, b.width); 929 var a = function () { 930 showBars(d) 931 }; 932 switch (S.options.animSequence) { 933 case "hw": 934 adjustHeight(c.innerHeight, c.top, true, function () { 935 adjustWidth(c.width, c.left, true, a) 936 }); 937 break; 938 case "wh": 939 adjustWidth(c.width, c.left, true, function () { 940 adjustHeight(c.innerHeight, c.top, true, a) 941 }); 942 break; 943 default: 944 adjustWidth(c.width, c.left, true); 945 adjustHeight(c.innerHeight, c.top, true, a) 946 } 947}; 948K.onShow = function (a) { 949 toggleLoading(false, a); 950 doWindowResize = true 951}; 952K.onClose = function () { 953 if (!supportsFixed) { 954 removeEvent(window, "scroll", setPosition) 955 } 956 removeEvent(overlay, "click", S.close); 957 wrapper.style.visibility = "hidden"; 958 var a = function () { 959 container.style.visibility = "hidden"; 960 container.style.display = "none"; 961 toggleTroubleElements(true) 962 }; 963 if (overlayOn) { 964 animate(overlay, "opacity", 0, S.options.fadeDuration, a) 965 } else { 966 a() 967 } 968}; 969K.onPlay = function () { 970 toggleNav("play", false); 971 toggleNav("pause", true) 972}; 973K.onPause = function () { 974 toggleNav("pause", false); 975 toggleNav("play", true) 976}; 977K.onWindowResize = function () { 978 if (!doWindowResize) { 979 return 980 } 981 setSize(); 982 var a = S.player, 983 b = setDimensions(a.height, a.width); 984 adjustWidth(b.width, b.left);
985 adjustHeight(b.innerHeight, b.top); 986 if (a.onWindowResize) { 987 a.onWindowResize() 988 } 989}; 990S.skin = K; 991 992// expose 993window['Shadowbox'] = S; 994 995})(window);
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.