1/** 2 * SoundManager 2 homepage demo JS 3 * ------------------------------- 4 * MP3 player button, Muxtape/page player, 5 * inline player and 360 player demo bits 6 * combined and minified for optimal performance. 7 * For raw source, see individual demo pages. 8 * -------------------------------- 9 * Source files: 10 * demo/play-mp3-links/script/inlineplayer.js 11 * demo/page-player/script/page-player.js 12 * demo/mp3-player-button/script/mp3-player-button.js 13 * demo/360-player/script/berniecode-animator.js 14 * demo/360-player/script/360player.js 15 * demo/index.js 16 */ 17/* 18 19 Animator.js 1.1.9 20 21 This library is released under the BSD license: 22 23 Copyright (c) 2006, Bernard Sumption. All rights reserved. 24 25 Redistribution and use in source and binary forms, with or without 26 modification, are permitted provided that the following conditions are met: 27 28 Redistributions of source code must retain the above copyright notice, this 29 list of conditions and the following disclaimer. Redistributions in binary 30 form must reproduce the above copyright notice, this list of conditions and 31 the following disclaimer in the documentation and/or other materials 32 provided with the distribution. Neither the name BernieCode nor 33 the names of its contributors may be used to endorse or promote products 34 derived from this software without specific prior written permission. 35 36 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 37 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 38 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 39 ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR 40 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 41 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 42 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 43 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 44 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 45 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 46 DAMAGE. 47 48*/ 49 50function InlinePlayer() 51{ 52 var a = this, 53 c = this, 54 b = soundManager, 55 d = navigator.userAgent.match(/msie/i); 56 this.playableClass = "inline-playable"; 57 this.excludeClass = "inline-exclude"; 58 this.links = []; 59 this.sounds = []; 60 this.soundsByURL = []; 61 this.indexByURL = []; 62 this.lastSound = null; 63 this.soundCount = 0; 64 this.config = 65 { 66 playNext: !1, 67 autoPlay: !1 68 }; 69 this.css = 70 { 71 sDefault: "sm2_link", 72 sLoading: "sm2_loading", 73 sPlaying: "sm2_playing", 74 sPaused: "sm2_paused" 75 }; 76 this.addEventHandler = "undefined" !== typeof window.addEventListener ? 77 function (a, b, c) 78 { 79 return a.addEventListener(b, c, !1) 80 } : function (a, b, c) 81 { 82 a.attachEvent("on" + b, c) 83 }; 84 this.removeEventHandler = "undefined" !== typeof window.removeEventListener ? 85 function (a, b, c) 86 { 87 return a.removeEventListener(b, c, !1) 88 } : function (a, b, c) 89 { 90 return a.detachEvent("on" + b, c) 91 }; 92 this.classContains = function (a, b) 93 { 94 return "undefined" != typeof a.className ? a.className.match(RegExp("(\\s|^)" + b + "(\\s|$)")) : !1 95 }; 96 this.addClass = function (b, c) 97 { 98 if (!b || !c || a.classContains(b, c)) return !1; 99 b.className = (b.className ? b.className + " " : "") + c 100 }; 101 this.removeClass = function (b, c) 102 { 103 if (!b || !c || !a.classContains(b, c)) return !1; 104 b.className = b.className.replace(RegExp("( " + c + ")|(" + c + ")", "g"), "") 105 }; 106 this.getSoundByURL = function (b) 107 { 108 return "undefined" != typeof a.soundsByURL[b] ? a.soundsByURL[b] : null 109 }; 110 this.isChildOfNode = function (a, b) 111 { 112 if (!a || !a.parentNode) return !1; 113 b = b.toLowerCase(); 114 do a = a.parentNode; 115 while (a && a.parentNode && a.nodeName.toLowerCase() != b); 116 return a.nodeName.toLowerCase() == b ? a : null 117 }; 118 this.events = 119 { 120 play: function () 121 { 122 c.removeClass(this._data.oLink, this._data.className); 123 this._data.className = c.css.sPlaying; 124 c.addClass(this._data.oLink, this._data.className) 125 }, 126 stop: function () 127 { 128 c.removeClass(this._data.oLink, this._data.className); 129 this._data.className = "" 130 }, 131 pause: function () 132 { 133 c.removeClass(this._data.oLink, this._data.className); 134 this._data.className = c.css.sPaused; 135 c.addClass(this._data.oLink, this._data.className) 136 }, 137 resume: function () 138 { 139 c.removeClass(this._data.oLink, this._data.className); 140 this._data.className = c.css.sPlaying; 141 c.addClass(this._data.oLink, this._data.className) 142 }, 143 finish: function () 144 { 145 c.removeClass(this._data.oLink, this._data.className); 146 this._data.className = ""; 147 if (c.config.playNext) 148 { 149 var a = c.indexByURL[this._data.oLink.href] + 1; 150 a < c.links.length && c.handleClick( 151 { 152 target: c.links[a] 153 }) 154 } 155 } 156 }; 157 this.stopEvent = function (a) 158 { 159 "undefined" != typeof a && "undefined" != typeof a.preventDefault ? a.preventDefault() : "undefined" != typeof event && "undefined" != typeof event.returnValue && (event.returnValue = !1); 160 return !1 161 }; 162 this.getTheDamnLink = d ? 163 function (a) 164 { 165 return a && a.target ? a.target : window.event.srcElement 166 } : function (a) 167 { 168 return a.target 169 }; 170 this.handleClick = 171 172 function (c) 173 { 174 if ("undefined" != typeof c.button && 1 < c.button) return !0; 175 var d = a.getTheDamnLink(c); 176 if ("a" != d.nodeName.toLowerCase() && (d = a.isChildOfNode(d, "a"), !d)) return !0; 177 d.getAttribute("href"); 178 if (!d.href || !b.canPlayLink(d) && !a.classContains(d, a.playableClass) || a.classContains(d, a.excludeClass)) return !0;
179 var h = d.href, 180 g = a.getSoundByURL(h); 181 g ? (g != a.lastSound && (b._writeDebug("sound different than last sound: " + a.lastSound.id), a.lastSound && a.stopSound(a.lastSound)), g.togglePause()) : (a.lastSound && a.stopSound(a.lastSound), g = b.createSound( 182 { 183 id: "inlineMP3Sound" + a.soundCount++, 184 url: h, 185 onplay: a.events.play, 186 onstop: a.events.stop, 187 onpause: a.events.pause, 188 onresume: a.events.resume, 189 onfinish: a.events.finish, 190 type: d.type || null 191 }), g._data = 192 { 193 oLink: d, 194 className: a.css.sPlaying 195 }, a.soundsByURL[h] = g, a.sounds.push(g), g.play()); 196 a.lastSound = g; 197 "undefined" != typeof c && "undefined" != typeof c.preventDefault ? c.preventDefault() : event.returnValue = !1; 198 return !1 199 }; 200 this.stopSound = function (a) 201 { 202 soundManager.stop(a.id); 203 soundManager.unload(a.id) 204 }; 205 this.init = function () 206 { 207 b._writeDebug("inlinePlayer.init()"); 208 for (var c = document.getElementsByTagName("a"), d = 0, h = 0, g = c.length; h < g; h++) if ((b.canPlayLink(c[h]) || a.classContains(c[h], a.playableClass)) && !a.classContains(c[h], a.excludeClass)) a.addClass(c[h], a.css.sDefault), a.links[d] = c[h], a.indexByURL[c[h].href] = d, d++; 209 0 < d && (a.addEventHandler(document, "click", a.handleClick), a.config.autoPlay && a.handleClick( 210 { 211 target: a.links[0], 212 preventDefault: function () 213 { 214 } 215 })); 216 b._writeDebug("inlinePlayer.init(): Found " + d + " relevant items.") 217 }; 218 this.init() 219} 220var inlinePlayer = null; 221soundManager.setup( 222{ 223 debugMode: !0, 224 preferFlash: !1, 225 useFlashBlock: !0, 226 url: "../../swf/", 227 flashVersion: 9 228}); 229soundManager.onready(function () 230{ 231 inlinePlayer = new InlinePlayer 232}); 233var pagePlayer = null; 234 235function PagePlayer() 236{ 237 var a = this, 238 c = this, 239 b = soundManager, 240 d, f = null, 241 e = null, 242 h = document.getElementsByTagName("head")[0], 243 g = null, 244 k = navigator.userAgent, 245 p = k.match(/(opera|firefox)/i), 246 q = k.match(/ipad|ipod|iphone/i), 247 r; 248 this.config = 249 { 250 usePeakData: !1, 251 useWaveformData: !1, 252 useEQData: !1, 253 fillGraph: !1, 254 allowRightClick: !0, 255 useThrottling: !0, 256 autoStart: !1, 257 playNext: !0, 258 updatePageTitle: !0, 259 emptyTime: "-:--", 260 useFavIcon: !1 261 }; 262 this.css = 263 { 264 sDefault: "sm2_link", 265 sLoading: "sm2_loading", 266 sPlaying: "sm2_playing", 267 sPaused: "sm2_paused" 268 }; 269 this.sounds = []; 270 this.soundsByObject = []; 271 this.lastSound = null; 272 this.soundCount = 0; 273 this.strings = []; 274 this.dragActive = !1; 275 this.dragExec = new Date; 276 this.dragTimer = null; 277 this.pageTitle = document.title; 278 this.lastWPExec = new Date; 279 this.lastWLExec = new Date; 280 this.vuMeterData = []; 281 this.oControls = null; 282 this._mergeObjects = function (a, b) 283 { 284 var c = 285 { 286 }, 287 l, d; 288 for (l in a) a.hasOwnProperty(l) && (c[l] = a[l]); 289 l = "undefined" === typeof b ? { 290 } : b; 291 for (d in l)"undefined" === typeof c[d] && (c[d] = l[d]); 292 return c 293 }; 294 d = function () 295 { 296 function a(b) 297 { 298 b = l.call(b); 299 var n = b.length; 300 c ? (b[1] = "on" + b[1], 3 < n && b.pop()) : 3 === n && b.push(!1); 301 return b 302 } 303 function b(a, n) 304 { 305 var l = a.shift(), 306 s = [d[n]]; 307 if (c) l[s](a[0], a[1]); 308 else l[s].apply(l, a) 309 } 310 var c = window.attachEvent && !window.addEventListener, 311 l = Array.prototype.slice, 312 d = 313 { 314 add: c ? "attachEvent" : "addEventListener", 315 remove: c ? "detachEvent" : "removeEventListener" 316 }; 317 return { 318 add: function () 319 { 320 b(a(arguments), "add") 321 }, 322 remove: function () 323 { 324 b(a(arguments), "remove") 325 } 326 } 327 }(); 328 this.hasClass = function (a, b) 329 { 330 return "undefined" !== typeof a.className ? RegExp("(^|\\s)" + b + "(\\s|$)").test(a.className) : !1 331 }; 332 this.addClass = function (b, c) 333 { 334 if (!b || !c || a.hasClass(b, c)) return !1; 335 b.className = (b.className ? b.className + " " : "") + c 336 }; 337 this.removeClass = function (b, c) 338 { 339 if (!b || !c || !a.hasClass(b, c)) return !1; 340 b.className = b.className.replace(RegExp("( " + c + ")|(" + c + ")", "g"), "") 341 }; 342 this.select = function (b, c) 343 { 344 var m = a.getByClassName(b, "div", c || null); 345 return m ? m[0] : null 346 }; 347 this.getByClassName = document.querySelectorAll ? 348 function (a, b, c) 349 { 350 a = "." + a; 351 b && (b = b.split(" ")); 352 b = 1 < b.length ? b.join(a + ", ") : b[0] + a; 353 return (c ? c : document).querySelectorAll(b) 354 } : function (b, c, m) 355 { 356 var l = m ? m : document; 357 m = []; 358 var d, e = []; 359 c && (c = c.split(" ")); 360 if (c instanceof Array) 361 { 362 for (d = c.length; d--;) if (!e || !e[c[d]]) e[c[d]] = l.getElementsByTagName(c[d]); 363 for (d = c.length; d--;) for (l = e[c[d]].length; l--;) a.hasClass(e[c[d]][l], b) && m.push(e[c[d]][l]) 364 } 365 else 366 { 367 e = l.all || l.getElementsByTagName("*"); 368 d = 0; 369 for (l = e.length; d < l; d++) a.hasClass(e[d], b) && m.push(e[d]) 370 } 371 return m 372 }; 373 this.isChildOfClass = function (b, c) 374 { 375 if (!b || !c) return !1; 376 for (; b.parentNode && !a.hasClass(b, c);) b = b.parentNode; 377 return a.hasClass(b, c) 378 }; 379 this.getParentByNodeName = 380 381 function (a, b) 382 { 383 if (!a || !b) return !1; 384 for (b = b.toLowerCase(); a.parentNode && b !== a.parentNode.nodeName.toLowerCase();) a = a.parentNode; 385 return a.parentNode && b === a.parentNode.nodeName.toLowerCase() ? a.parentNode : null 386 }; 387 this.getOffX = function (a) 388 { 389 var b = 0; 390 if (a.offsetParent) for (; a.offsetParent;) b += a.offsetLeft, a = a.offsetParent; 391 else a.x && (b += a.x); 392 return b 393 }; 394 this.getTime = function (a, b) 395 { 396 var c = Math.floor(a / 1E3), 397 l = Math.floor(c / 60), 398 c = c - 60 * l; 399 return b ? l + ":" + (10 > c ? "0" + c : c) : { 400 min: l, 401 sec: c 402 } 403 };
404 this.getSoundByObject = function (b) 405 { 406 return "undefined" !== typeof a.soundsByObject[b.id] ? a.soundsByObject[b.id] : null 407 }; 408 this.getPreviousItem = function (a) 409 { 410 if (a.previousElementSibling) a = a.previousElementSibling; 411 else for (a = a.previousSibling; a && a.previousSibling && 1 !== a.previousSibling.nodeType;) a = a.previousSibling; 412 return "li" !== a.nodeName.toLowerCase() ? null : a.getElementsByTagName("a")[0] 413 }; 414 this.playPrevious = function (b) 415 { 416 b || (b = a.lastSound); 417 if (!b) return !1; 418 (b = a.getPreviousItem(b._data.oLI)) && c.handleClick( 419 { 420 target: b 421 }); 422 return b 423 }; 424 this.getNextItem = function (a) 425 { 426 if (a.nextElementSibling) a = a.nextElementSibling; 427 else for (a = a.nextSibling; a && a.nextSibling && 1 !== a.nextSibling.nodeType;) a = a.nextSibling; 428 return "li" !== a.nodeName.toLowerCase() ? null : a.getElementsByTagName("a")[0] 429 }; 430 this.playNext = function (b) 431 { 432 b || (b = a.lastSound); 433 if (!b) return !1; 434 (b = a.getNextItem(b._data.oLI)) && c.handleClick( 435 { 436 target: b 437 }); 438 return b 439 }; 440 this.setPageTitle = function (b) 441 { 442 if (!a.config.updatePageTitle) return !1; 443 try 444 { 445 document.title = (b ? b + " - " : "") + a.pageTitle 446 } 447 catch (c) 448 { 449 a.setPageTitle = function () 450 { 451 return !1 452 } 453 } 454 }; 455 this.events = 456 { 457 play: function () 458 { 459 c.removeClass(this._data.oLI, this._data.className); 460 this._data.className = c.css.sPlaying; 461 c.addClass(this._data.oLI, this._data.className); 462 a.setPageTitle(this._data.originalTitle) 463 }, 464 stop: function () 465 { 466 c.removeClass(this._data.oLI, this._data.className); 467 this._data.className = ""; 468 this._data.oPosition.style.width = "0px"; 469 a.setPageTitle(); 470 a.resetPageIcon() 471 }, 472 pause: function () 473 { 474 if (c.dragActive) return !1; 475 c.removeClass(this._data.oLI, this._data.className); 476 this._data.className = c.css.sPaused; 477 c.addClass(this._data.oLI, this._data.className); 478 a.setPageTitle(); 479 a.resetPageIcon() 480 }, 481 resume: function () 482 { 483 if (c.dragActive) return !1; 484 c.removeClass(this._data.oLI, this._data.className); 485 this._data.className = c.css.sPlaying; 486 c.addClass(this._data.oLI, this._data.className) 487 }, 488 finish: function () 489 { 490 c.removeClass(this._data.oLI, this._data.className); 491 this._data.className = ""; 492 this._data.oPosition.style.width = "0px"; 493 a.config.playNext ? c.playNext(this) : (a.setPageTitle(), a.resetPageIcon()) 494 }, 495 whileloading: function () 496 { 497 function b() 498 { 499 this._data.oLoading.style.width = 100 * (this.bytesLoaded / this.bytesTotal) + "%"; 500 !this._data.didRefresh && this._data.metadata && (this._data.didRefresh = !0, this._data.metadata.refresh()) 501 } 502 if (c.config.useThrottling) 503 { 504 var d = new Date; 505 if (d && 50 < d - a.lastWLExec || this.bytesLoaded === this.bytesTotal) b.apply(this), a.lastWLExec = d 506 } 507 else b.apply(this) 508 }, 509 onload: function () 510 { 511 if (this.loaded) this._data.metadata && this._data.metadata.refresh(); 512 else 513 { 514 var a = this._data.oLI.getElementsByTagName("a")[0], 515 c = a.innerHTML; 516 a.innerHTML = c + ' <span style="font-size:0.5em"> | Load failed, d\'oh! ' + (b.sandbox.noRemote ? " Possible cause: Flash sandbox is denying remote URL access." : b.sandbox.noLocal ? "Flash denying local filesystem access" : "404?") + "</span>"; 517 setTimeout(function () 518 { 519 a.innerHTML = c 520 }, 5E3) 521 } 522 }, 523 whileplaying: function () 524 { 525 var d = null; 526 if (c.dragActive || !c.config.useThrottling) 527 { 528 a.updateTime.apply(this); 529 9 <= b.flashVersion && (c.config.usePeakData && this.instanceOptions.usePeakData && a.updatePeaks.apply(this), (c.config.useWaveformData && this.instanceOptions.useWaveformData || c.config.useEQData && this.instanceOptions.useEQData) && a.updateGraph.apply(this)); 530 if (this._data.metadata && (d = new Date) && 500 < d - a.lastWPExec) this._data.metadata.refreshMetadata(this), a.lastWPExec = d; 531 this._data.oPosition.style.width = 100 * (this.position / a.getDurationEstimate(this)) + "%" 532 } 533 else d = new Date, 30 < d - a.lastWPExec && (a.updateTime.apply(this), 9 <= b.flashVersion && (c.config.usePeakData && this.instanceOptions.usePeakData && a.updatePeaks.apply(this), (c.config.useWaveformData && this.instanceOptions.useWaveformData || c.config.useEQData && this.instanceOptions.useEQData) && a.updateGraph.apply(this)), this._data.metadata && this._data.metadata.refreshMetadata(this), this._data.oPosition.style.width = 100 * (this.position / a.getDurationEstimate(this)) + "%", a.lastWPExec = d) 534 } 535 }; 536 this.setPageIcon = function (b) 537 { 538 if (!a.config.useFavIcon || !a.config.usePeakData || !b) return !1; 539 var c = document.getElementById("sm2-favicon"); 540 c && (h.removeChild(c), c = null); 541 c || (c = document.createElement("link"), c.id = "sm2-favicon", c.rel = "shortcut icon", c.type = "image/png", c.href = b, document.getElementsByTagName("head")[0].appendChild(c)) 542 }; 543 this.resetPageIcon = function () 544 { 545 if (!a.config.useFavIcon) return !1; 546 var b = document.getElementById("favicon"); 547 b && (b.href = "/favicon.ico") 548 }; 549 this.updatePeaks = function () 550 { 551 var c = this._data.oPeak.getElementsByTagName("span"); 552 c[0].style.marginTop = 13 - Math.floor(15 * this.peakData.left) + "px"; 553 c[1].style.marginTop = 13 - Math.floor(15 * this.peakData.right) + "px"; 554 8 < b.flashVersion && (a.config.useFavIcon && a.config.usePeakData) && a.setPageIcon(a.vuMeterData[parseInt(16 * this.peakData.left,
55410)][parseInt(16 * this.peakData.right, 10)]) 555 }; 556 this.updateGraph = function () 557 { 558 if (9 > c.config.flashVersion || !c.config.useWaveformData && !c.config.useEQData) return !1; 559 var a = this._data.oGraph.getElementsByTagName("div"), 560 b; 561 if (c.config.useWaveformData) for (b = 255; b--;) a[255 - b].style.marginTop = 9 + Math.ceil(-8 * this.waveformData.left[b]) + "px"; 562 else for (b = 255; b--;) a[255 - b].style.marginTop = 17 + Math.ceil(-9 * this.eqData[b]) + "px" 563 }; 564 this.resetGraph = function () 565 { 566 if (!c.config.useEQData || 9 > c.config.flashVersion) return !1; 567 var a = this._data.oGraph.getElementsByTagName("div"), 568 b = !c.config.useEQData ? "9px" : "17px", 569 m = !c.config.fillGraph ? "1px" : "32px", 570 d; 571 for (d = 255; d--;) a[255 - d].style.marginTop = b, a[255 - d].style.height = m 572 }; 573 this.updateTime = function () 574 { 575 var b = a.strings.timing.replace("%s1", a.getTime(this.position, !0)), 576 b = b.replace("%s2", a.getTime(a.getDurationEstimate(this), !0)); 577 this._data.oTiming.innerHTML = b 578 }; 579 this.getTheDamnTarget = function (a) 580 { 581 return a.target || (window.event ? window.event.srcElement : null) 582 }; 583 this.withinStatusBar = function (b) 584 { 585 return a.isChildOfClass(b, "playlist") && a.isChildOfClass(b, "controls") 586 }; 587 this.handleClick = function (d) 588 { 589 if (2 === d.button) return c.config.allowRightClick || c.stopEvent(d), c.config.allowRightClick; 590 var e = a.getTheDamnTarget(d), 591 m, l, f; 592 if (!e) return !0; 593 a.dragActive && a.stopDrag(); 594 if (a.withinStatusBar(e)) return !1; 595 "a" !== e.nodeName.toLowerCase() && (e = a.getParentByNodeName(e, "a")); 596 if (!e) return !0; 597 e.getAttribute("href"); 598 if (!e.href || !b.canPlayLink(e) && !a.hasClass(e, "playable") || a.hasClass(e, "exclude")) return !0; 599 a.initUL(a.getParentByNodeName(e, "ul")); 600 a.initItem(e); 601 m = e.href; 602 (l = a.getSoundByObject(e)) ? (a.setPageTitle(l._data.originalTitle), l === a.lastSound ? 2 !== l.readyState ? 1 !== l.playState ? l.play() : l.togglePause() : b._writeDebug("Warning: sound failed to load (security restrictions, 404 or bad format)", 2) : (a.lastSound && a.stopSound(a.lastSound), g && l._data.oTimingBox.appendChild(g), l.togglePause())) : (l = b.createSound( 603 { 604 id: e.id, 605 url: decodeURI(m), 606 onplay: a.events.play, 607 onstop: a.events.stop, 608 onpause: a.events.pause, 609 onresume: a.events.resume, 610 onfinish: a.events.finish, 611 type: e.type || null, 612 whileloading: a.events.whileloading, 613 whileplaying: a.events.whileplaying, 614 onmetadata: a.events.metadata, 615 onload: a.events.onload 616 }), m = a.oControls.cloneNode(!0), f = e.parentNode, f.appendChild(m), g && f.appendChild(g), a.soundsByObject[e.id] = l, l._data = 617 { 618 oLink: e, 619 oLI: f, 620 oControls: a.select("controls", f), 621 oStatus: a.select("statusbar", f), 622 oLoading: a.select("loading", f), 623 oPosition: a.select("position", f), 624 oTimingBox: a.select("timing", f), 625 oTiming: a.select("timing", f).getElementsByTagName("div")[0], 626 oPeak: a.select("peak", f), 627 oGraph: a.select("spectrum-box", f), 628 className: a.css.sPlaying, 629 originalTitle: e.innerHTML, 630 metadata: null 631 }, g && l._data.oTimingBox.appendChild(g), l._data.oLI.getElementsByTagName("ul").length && (l._data.metadata = new Metadata(l)), e = a.strings.timing.replace("%s1", a.config.emptyTime), e = e.replace("%s2", a.config.emptyTime), l._data.oTiming.innerHTML = e, a.sounds.push(l), a.lastSound && a.stopSound(a.lastSound), a.resetGraph.apply(l), l.play()); 632 a.lastSound = l; 633 return a.stopEvent(d) 634 }; 635 this.handleMouseDown = function (b) 636 { 637 q && b.touches && (b = b.touches[0]); 638 if (2 === b.button) return c.config.allowRightClick || c.stopEvent(b), c.config.allowRightClick; 639 var e = a.getTheDamnTarget(b); 640 if (!e || !a.withinStatusBar(e)) return !0; 641 a.dragActive = !0; 642 a.lastSound.pause(); 643 a.setPosition(b); 644 q ? d.add(document, "touchmove", a.handleMouseMove) : d.add(document, "mousemove", a.handleMouseMove); 645 a.addClass(a.lastSound._data.oControls, "dragging"); 646 return a.stopEvent(b) 647 }; 648 this.handleMouseMove = function (b) 649 { 650 q && b.touches && (b = b.touches[0]); 651 if (a.dragActive) if (a.config.useThrottling) 652 { 653 var c = new Date; 654 20 < c - a.dragExec ? a.setPosition(b) : (window.clearTimeout(a.dragTimer), a.dragTimer = window.setTimeout(function () 655 { 656 a.setPosition(b) 657 }, 20)); 658 a.dragExec = c 659 } 660 else a.setPosition(b);
661 else a.stopDrag(); 662 b.stopPropagation = !0; 663 return !1 664 }; 665 this.stopDrag = function (b) 666 { 667 if (a.dragActive) return a.removeClass(a.lastSound._data.oControls, "dragging"), q ? d.remove(document, "touchmove", a.handleMouseMove) : d.remove(document, "mousemove", a.handleMouseMove), c.hasClass(a.lastSound._data.oLI, a.css.sPaused) || a.lastSound.resume(), a.dragActive = !1, a.stopEvent(b) 668 }; 669 this.handleStatusClick = function (b) 670 { 671 a.setPosition(b); 672 c.hasClass(a.lastSound._data.oLI, a.css.sPaused) || a.resume(); 673 return a.stopEvent(b) 674 }; 675 this.stopEvent = function (a) 676 { 677 "undefined" !== typeof a && ("undefined" !== typeof a.preventDefault ? a.preventDefault() : (a.stopPropagation = !0, a.returnValue = !1)); 678 return !1 679 }; 680 this.setPosition = function (b) 681 { 682 var c = a.getTheDamnTarget(b), 683 m; 684 if (!c) return !0; 685 for (m = c; !a.hasClass(m, "controls") && m.parentNode;) m = m.parentNode; 686 c = a.lastSound; 687 b = parseInt(b.clientX, 10); 688 b = Math.floor((b - a.getOffX(m) - 4) / m.offsetWidth * a.getDurationEstimate(c)); 689 isNaN(b) || (b = Math.min(b, c.duration)); 690 isNaN(b) || c.setPosition(b) 691 }; 692 this.stopSound = function (a) 693 { 694 b._writeDebug("stopping sound: " + a.id); 695 b.stop(a.id); 696 q || b.unload(a.id) 697 }; 698 this.getDurationEstimate = function (a) 699 { 700 return a.instanceOptions.isMovieStar ? a.duration : !a._data.metadata || !a._data.metadata.data.givenDuration ? a.durationEstimate || 0 : a._data.metadata.data.givenDuration 701 }; 702 this.createVUData = function () 703 { 704 var b = 0, 705 c = 0, 706 m = f.getContext("2d"), 707 d = m.createLinearGradient(0, 16, 0, 0), 708 e; 709 d.addColorStop(0, "rgb(0,192,0)"); 710 d.addColorStop(0.3, "rgb(0,255,0)"); 711 d.addColorStop(0.625, "rgb(255,255,0)"); 712 d.addColorStop(0.85, "rgb(255,0,0)"); 713 e = m.createLinearGradient(0, 16, 0, 0); 714 e.addColorStop(0, "rgba(0,0,0,0.2)"); 715 e.addColorStop(1, "rgba(0,0,0,0.5)"); 716 for (b = 0; 16 > b; b++) a.vuMeterData[b] = []; 717 for (b = 0; 16 > b; b++) for (c = 0; 16 > c; c++) f.setAttribute("width", 16), f.setAttribute("height", 16), m.fillStyle = e, m.fillRect(0, 0, 7, 15), m.fillRect(8, 0, 7, 15), m.fillStyle = d, m.fillRect(0, 15 - b, 7, 16 - (16 - b)), m.fillRect(8, 15 - c, 7, 16 - (16 - c)), m.clearRect(0, 3, 16, 1), m.clearRect(0, 7, 16, 1), m.clearRect(0, 11, 16, 1), a.vuMeterData[b][c] = f.toDataURL("image/png") 718 }; 719 this.testCanvas = function () 720 { 721 var a = document.createElement("canvas"), 722 b = null; 723 if (!a || "undefined" === typeof a.getContext) return null; 724 b = a.getContext("2d"); 725 if (!b || "function" !== typeof a.toDataURL) return null; 726 try 727 { 728 a.toDataURL("image/png") 729 } 730 catch (c) 731 { 732 return null 733 } 734 return a 735 }; 736 this.initItem = function (b) 737 { 738 b.id || (b.id = "pagePlayerMP3Sound" + a.soundCount++); 739 a.addClass(b, a.css.sDefault) 740 }; 741 this.initUL = function (c) 742 { 743 9 <= b.flashVersion && a.addClass(c, a.cssBase) 744 }; 745 this.init = function (h) 746 { 747 function k(b) 748 { 749 d[b](document, "click", a.handleClick); 750 q ? (d[b](document, "touchstart", a.handleMouseDown), d[b](document, "touchend", a.stopDrag)) : (d[b](document, "mousedown", a.handleMouseDown), d[b](document, "mouseup", a.stopDrag)); 751 d[b](window, "unload", r) 752 } 753 h ? (b._writeDebug("pagePlayer.init(): Using custom configuration"), this.config = this._mergeObjects(h, this.config)) : b._writeDebug("pagePlayer.init(): Using default configuration"); 754 var m, l, w, v; 755 this.cssBase = []; 756 b.useFlashBlock = !0; 757 9 <= b.flashVersion ? (b.defaultOptions.usePeakData = this.config.usePeakData, b.defaultOptions.useWaveformData = this.config.useWaveformData, b.defaultOptions.useEQData = this.config.useEQData, this.config.usePeakData && this.cssBase.push("use-peak"), (this.config.useWaveformData || this.config.useEQData) && this.cssBase.push("use-spectrum"), this.cssBase = this.cssBase.join(" "), this.config.useFavIcon && ((f = a.testCanvas()) && p ? a.createVUData() : this.config.useFavIcon = !1)) : (this.config.usePeakData || this.config.useWaveformData || this.config.useEQData) && b._writeDebug("Page player: Note: soundManager.flashVersion = 9 is required for peak/waveform/EQ features."); 758 e = document.createElement("div"); 759 e.innerHTML = ' <div class="controls">\n <div class="statusbar">\n <div class="loading"></div>\n <div class="position"></div>\n </div>\n </div>\n <div class="timing">\n <div id="sm2_timing" class="timing-data">\n <span class="sm2_position">%s1</span> / <span class="sm2_total">%s2</span>\n </div>\n </div>\n <div class="peak">\n <div class="peak-box"><span class="l"></span><span class="r"></span></div>\n </div>\n <div class="spectrum-container">\n <div class="spectrum-box">\n <div class="spectrum"></div>\n </div>\n </div>'; 760 if (9 <= b.flashVersion) 761 { 762 g = a.select("spectrum-container", e); 763 g = e.removeChild(g); 764 m = a.select("spectrum-box", g); 765 l = m.getElementsByTagName("div")[0]; 766 w = document.createDocumentFragment(); 767 v = null; 768 for (h = 256; h--;) v = l.cloneNode(!1), v.style.left = h + "px", w.appendChild(v); 769 m.removeChild(l); 770 m.appendChild(w) 771 } 772 else e.removeChild(a.select("spectrum-container", e)), e.removeChild(a.select("peak", e)); 773 a.oControls = e.cloneNode(!0); 774 h = a.select("timing-data", e); 775 a.strings.timing = h.innerHTML; 776 h.innerHTML = ""; 777 h.id = ""; 778 r = function () 779 { 780 k("remove") 781 }; 782 k("add"); 783 b._writeDebug("pagePlayer.init(): Ready", 1); 784 a.config.autoStart && c.handleClick( 785 { 786 target: c.getByClassName("playlist", "ul")[0].getElementsByTagName("a")[0] 787 }) 788 } 789}
789 790soundManager.useFlashBlock = !0; 791soundManager.onready(function () 792{ 793 pagePlayer = new PagePlayer; 794 pagePlayer.init("undefined" !== typeof PP_CONFIG ? PP_CONFIG : null) 795}); 796 797function BasicMP3Player() 798{ 799 var a = this, 800 c = this, 801 b = soundManager, 802 d = navigator.userAgent.match(/ipad|iphone/i), 803 f = navigator.userAgent.match(/msie/i); 804 this.excludeClass = "button-exclude"; 805 this.links = []; 806 this.sounds = []; 807 this.soundsByURL = 808 { 809 }; 810 this.indexByURL = 811 { 812 }; 813 this.lastSound = null; 814 this.soundCount = 0; 815 this.config = 816 { 817 playNext: !1, 818 autoPlay: !1 819 }; 820 this.css = 821 { 822 sDefault: "sm2_button", 823 sLoading: "sm2_loading", 824 sPlaying: "sm2_playing", 825 sPaused: "sm2_paused" 826 }; 827 this.includeClass = this.css.sDefault; 828 this.addEventHandler = "undefined" !== typeof window.addEventListener ? 829 function (a, b, c) 830 { 831 return a.addEventListener(b, c, !1) 832 } : function (a, b, c) 833 { 834 a.attachEvent("on" + b, c) 835 }; 836 this.removeEventHandler = "undefined" !== typeof window.removeEventListener ? 837 function (a, b, c) 838 { 839 return a.removeEventListener(b, c, !1) 840 } : function (a, b, c) 841 { 842 return a.detachEvent("on" + b, c) 843 }; 844 this.classContains = function (a, b) 845 { 846 return "undefined" !== typeof a.className ? a.className.match(RegExp("(\\s|^)" + b + "(\\s|$)")) : !1 847 }; 848 this.addClass = function (b, c) 849 { 850 if (!b || !c || a.classContains(b, c)) return !1; 851 b.className = (b.className ? b.className + " " : "") + c 852 }; 853 this.removeClass = function (b, c) 854 { 855 if (!b || !c || !a.classContains(b, c)) return !1; 856 b.className = b.className.replace(RegExp("( " + c + ")|(" + c + ")", "g"), "") 857 }; 858 this.getSoundByURL = function (b) 859 { 860 return "undefined" !== typeof a.soundsByURL[b] ? a.soundsByURL[b] : null 861 }; 862 this.isChildOfNode = function (b, a) 863 { 864 if (!b || !b.parentNode) return !1; 865 a = a.toLowerCase(); 866 do b = b.parentNode; 867 while (b && b.parentNode && b.nodeName.toLowerCase() !== a); 868 return b.nodeName.toLowerCase() === a ? b : null 869 }; 870 this.events = 871 { 872 play: function () 873 { 874 c.removeClass(this._data.oLink, this._data.className); 875 this._data.className = c.css.sPlaying; 876 c.addClass(this._data.oLink, this._data.className) 877 }, 878 stop: function () 879 { 880 c.removeClass(this._data.oLink, this._data.className); 881 this._data.className = "" 882 }, 883 pause: function () 884 { 885 c.removeClass(this._data.oLink, this._data.className); 886 this._data.className = c.css.sPaused; 887 c.addClass(this._data.oLink, this._data.className) 888 }, 889 resume: function () 890 { 891 c.removeClass(this._data.oLink, this._data.className); 892 this._data.className = c.css.sPlaying; 893 c.addClass(this._data.oLink, this._data.className) 894 }, 895 finish: function () 896 { 897 c.removeClass(this._data.oLink, this._data.className); 898 this._data.className = ""; 899 if (c.config.playNext) 900 { 901 var b = c.indexByURL[this._data.oLink.href] + 1; 902 b < c.links.length && c.handleClick( 903 { 904 target: c.links[b] 905 }) 906 } 907 } 908 }; 909 this.stopEvent = function (b) 910 { 911 "undefined" !== typeof b && "undefined" !== typeof b.preventDefault ? b.preventDefault() : "undefined" !== typeof window.event && (window.event.returnValue = !1); 912 return !1 913 }; 914 this.getTheDamnLink = f ? 915 function (b) 916 { 917 return b && b.target ? b.target : window.event.srcElement 918 } : function (b) 919 { 920 return b.target 921 }; 922 this.handleClick = function (c) 923 { 924 if ("undefined" !== typeof c.button && 1 < c.button) return !0; 925 var d = a.getTheDamnLink(c), 926 f, k; 927 if ("a" !== d.nodeName.toLowerCase() && (d = a.isChildOfNode(d, "a"), !d)) return !0; 928 d.getAttribute("href"); 929 if (!d.href || (!soundManager.canPlayLink(d) || a.classContains(d, a.excludeClass)) || !a.classContains(d, a.includeClass)) return !0; 930 b._writeDebug("handleClick()"); 931 f = d.href; 932 (k = a.getSoundByURL(f)) ? k === a.lastSound ? k.togglePause() : (k.togglePause(), b._writeDebug("sound different than last sound: " + a.lastSound.id), a.lastSound && a.stopSound(a.lastSound)) : (k = b.createSound( 933 { 934 id: "basicMP3Sound" + a.soundCount++, 935 url: f, 936 onplay: a.events.play, 937 onstop: a.events.stop, 938 onpause: a.events.pause, 939 onresume: a.events.resume, 940 onfinish: a.events.finish, 941 type: d.type || null 942 }), k._data = 943 { 944 oLink: d, 945 className: a.css.sPlaying 946 }, a.soundsByURL[f] = k, a.sounds.push(k), a.lastSound && a.stopSound(a.lastSound),
946k.play()); 947 a.lastSound = k; 948 return a.stopEvent(c) 949 }; 950 this.stopSound = function (b) 951 { 952 soundManager.stop(b.id); 953 d || soundManager.unload(b.id) 954 }; 955 this.init = function () 956 { 957 b._writeDebug("basicMP3Player.init()"); 958 var c, d, f = 0, 959 k = document.getElementsByTagName("a"); 960 c = 0; 961 for (d = k.length; c < d; c++) a.classContains(k[c], a.css.sDefault) && !a.classContains(k[c], a.excludeClass) && (a.links[f] = k[c], a.indexByURL[k[c].href] = f, f++); 962 0 < f && (a.addEventHandler(document, "click", a.handleClick), a.config.autoPlay && a.handleClick( 963 { 964 target: a.links[0], 965 preventDefault: function () 966 { 967 } 968 })); 969 b._writeDebug("basicMP3Player.init(): Found " + f + " relevant items.") 970 }; 971 this.init() 972} 973var basicMP3Player = null; 974soundManager.setup( 975{ 976 preferFlash: !1, 977 onready: function () 978 { 979 basicMP3Player = new BasicMP3Player 980 } 981}); 982 983function Animator(a) 984{ 985 this.setOptions(a); 986 var c = this; 987 this.timerDelegate = function () 988 { 989 c.onTimerEvent() 990 }; 991 this.subjects = []; 992 this.subjectScopes = []; 993 this.state = this.target = 0; 994 this.lastTime = null 995} 996Animator.prototype = 997{ 998 setOptions: function (a) 999 { 1000 this.options = Animator.applyDefaults( 1001 { 1002 interval: 20, 1003 duration: 400, 1004 onComplete: function () 1005 { 1006 }, 1007 onStep: function () 1008 { 1009 }, 1010 transition: Animator.tx.easeInOut 1011 }, a) 1012 }, 1013 seekTo: function (a) 1014 { 1015 this.seekFromTo(this.state, a) 1016 }, 1017 seekFromTo: function (a, c) 1018 { 1019 this.target = Math.max(0, Math.min(1, c)); 1020 this.state = Math.max(0, Math.min(1, a)); 1021 this.lastTime = (new Date).getTime(); 1022 this.intervalId || (this.intervalId = window.setInterval(this.timerDelegate, this.options.interval)) 1023 }, 1024 jumpTo: function (a) 1025 { 1026 this.target = this.state = 1027 Math.max(0, Math.min(1, a)); 1028 this.propagate() 1029 }, 1030 toggle: function () 1031 { 1032 this.seekTo(1 - this.target) 1033 }, 1034 addSubject: function (a, c) 1035 { 1036 this.subjects[this.subjects.length] = a; 1037 this.subjectScopes[this.subjectScopes.length] = c; 1038 return this 1039 }, 1040 clearSubjects: function () 1041 { 1042 this.subjects = []; 1043 this.subjectScopes = [] 1044 }, 1045 propagate: function () 1046 { 1047 for (var a = this.options.transition(this.state), c = 0; c < this.subjects.length; c++) this.subjects[c].setState ? this.subjects[c].setState(a) : this.subjects[c].apply(this.subjectScopes[c], [a]) 1048 }, 1049 onTimerEvent: function () 1050 { 1051 var a = (new Date).getTime(), 1052 c = a - this.lastTime; 1053 this.lastTime = a; 1054 a = c / this.options.duration * (this.state < this.target ? 1 : -1); 1055 Math.abs(a) >= Math.abs(this.state - this.target) ? this.state = this.target : this.state += a; 1056 try 1057 {
1058 this.propagate() 1059 } 1060 finally 1061 { 1062 this.options.onStep.call(this), this.target == this.state && (window.clearInterval(this.intervalId), this.intervalId = null, this.options.onComplete.call(this)) 1063 } 1064 }, 1065 play: function () 1066 { 1067 this.seekFromTo(0, 1) 1068 }, 1069 reverse: function () 1070 { 1071 this.seekFromTo(1, 0) 1072 }, 1073 inspect: function () 1074 { 1075 for (var a = "#<Animator:\n", c = 0; c < this.subjects.length; c++) a += this.subjects[c].inspect(); 1076 return a + ">" 1077 } 1078}; 1079Animator.applyDefaults = function (a, c) 1080{ 1081 c = c || { 1082 }; 1083 var b, d = 1084 { 1085 }; 1086 for (b in a) d[b] = void 0 !== c[b] ? c[b] : a[b]; 1087 return d 1088}; 1089Animator.makeArray = function (a) 1090{ 1091 if (null == a) return []; 1092 if (!a.length) return [a]; 1093 for (var c = [], b = 0; b < a.length; b++) c[b] = a[b]; 1094 return c 1095}; 1096Animator.camelize = function (a) 1097{ 1098 var c = a.split("-"); 1099 if (1 == c.length) return c[0]; 1100 a = 0 == a.indexOf("-") ? c[0].charAt(0).toUpperCase() + c[0].substring(1) : c[0]; 1101 for (var b = 1, d = c.length; b < d; b++) 1102 { 1103 var f = c[b]; 1104 a += f.charAt(0).toUpperCase() + f.substring(1) 1105 } 1106 return a 1107}; 1108Animator.apply = function (a, c, b) 1109{ 1110 return c instanceof Array ? (new Animator(b)).addSubject(new CSSStyleSubject(a, c[0], c[1])) : (new Animator(b)).addSubject(new CSSStyleSubject(a, c)) 1111}; 1112Animator.makeEaseIn = function (a) 1113{ 1114 return function (c) 1115 { 1116 return Math.pow(c, 2 * a) 1117 } 1118}; 1119Animator.makeEaseOut = function (a) 1120{ 1121 return function (c) 1122 { 1123 return 1 - Math.pow(1 - c, 2 * a) 1124 } 1125}; 1126Animator.makeElastic = function (a) 1127{ 1128 return function (c) 1129 { 1130 c = Animator.tx.easeInOut(c); 1131 return (1 - Math.cos(c * Math.PI * a)) * (1 - c) + c 1132 } 1133}; 1134Animator.makeADSR = function (a, c, b, d) 1135{ 1136 null == d && (d = 0.5); 1137 return function (f) 1138 { 1139 return f < a ? f / a : f < c ? 1 - (f - a) / (c - a) * (1 - d) : f < b ? d : d * (1 - (f - b) / (1 - b)) 1140 } 1141}; 1142Animator.makeBounce = function (a) 1143{ 1144 var c = Animator.makeElastic(a); 1145 return function (b) 1146 { 1147 b = c(b); 1148 return 1 >= b ? b : 2 - b 1149 } 1150}; 1151Animator.tx = 1152{ 1153 easeInOut: function (a) 1154 { 1155 return -Math.cos(a * Math.PI) / 2 + 0.5 1156 }, 1157 linear: function (a) 1158 { 1159 return a 1160 }, 1161 easeIn: Animator.makeEaseIn(1.5), 1162 easeOut: Animator.makeEaseOut(1.5), 1163 strongEaseIn: Animator.makeEaseIn(2.5), 1164 strongEaseOut: Animator.makeEaseOut(2.5), 1165 elastic: Animator.makeElastic(1), 1166 veryElastic: Animator.makeElastic(3), 1167 bouncy: Animator.makeBounce(1), 1168 veryBouncy: Animator.makeBounce(3) 1169}; 1170 1171function NumericalStyleSubject(a, c, b, d, f) 1172{ 1173 this.els = Animator.makeArray(a); 1174 this.property = "opacity" == c && window.ActiveXObject ? "filter" : Animator.camelize(c); 1175 this.from = parseFloat(b); 1176 this.to = parseFloat(d); 1177 this.units = null != f ? f : "px" 1178} 1179NumericalStyleSubject.prototype = 1180{ 1181 setState: function (a) 1182 { 1183 a = this.getStyle(a); 1184 for (var c = 0, b = 0; b < this.els.length; b++) 1185 { 1186 try 1187 { 1188 this.els[b].style[this.property] = a 1189 } 1190 catch (d) 1191 { 1192 if ("fontWeight" != this.property) throw d; 1193 } 1194 if (20 < c++) break 1195 } 1196 }, 1197 getStyle: function (a) 1198 { 1199 a = this.from + (this.to - this.from) * a; 1200 return "filter" == this.property ? "alpha(opacity=" + Math.round(100 * a) + ")" : "opacity" == this.property ? a : Math.round(a) + this.units 1201 }, 1202 inspect: function () 1203 { 1204 return "\t" + this.property + "(" + this.from + this.units + " to " + this.to + this.units + ")\n" 1205 } 1206}; 1207 1208function ColorStyleSubject(a, c, b, d) 1209{ 1210 this.els = Animator.makeArray(a); 1211 this.property = Animator.camelize(c); 1212 this.to = this.expandColor(d); 1213 this.from = this.expandColor(b); 1214 this.origFrom = b; 1215 this.origTo = d 1216} 1217ColorStyleSubject.prototype = 1218{ 1219 expandColor: function (a) 1220 { 1221 var c, b; 1222 if (c = ColorStyleSubject.parseColor(a)) return a = parseInt(c.slice(1, 3), 16), b = parseInt(c.slice(3, 5), 16), c = parseInt(c.slice(5, 7), 16), [a, b, c]; 1223 window.DEBUG && alert("Invalid colour: '" + a + "'") 1224 }, 1225 getValueForState: function (a, c) 1226 { 1227 return Math.round(this.from[a] + (this.to[a] - this.from[a]) * c) 1228 }, 1229 setState: function (a) 1230 { 1231 a = "#" + ColorStyleSubject.toColorPart(this.getValueForState(0, a)) + ColorStyleSubject.toColorPart(this.getValueForState(1, a)) + ColorStyleSubject.toColorPart(this.getValueForState(2, a)); 1232 for (var c = 0; c < this.els.length; c++) this.els[c].style[this.property] = a 1233 }, 1234 inspect: function () 1235 { 1236 return "\t" + this.property + "(" + this.origFrom + " to " + this.origTo + ")\n" 1237 } 1238}; 1239ColorStyleSubject.parseColor = function (a) 1240{ 1241 var c = "#", 1242 b; 1243 if (b = ColorStyleSubject.parseColor.rgbRe.exec(a)) 1244 { 1245 for (var d = 1; 3 >= d; d++) a = Math.max(0, Math.min(255, parseInt(b[d]))), c += ColorStyleSubject.toColorPart(a); 1246 return c 1247 } 1248 if (b = ColorStyleSubject.parseColor.hexRe.exec(a)) 1249 { 1250 if (3 == b[1].length) 1251 { 1252 for (d = 0; 3 > d; d++) c += b[1].charAt(d) + b[1].charAt(d); 1253 return c 1254 } 1255 return "#" + b[1] 1256 } 1257 return !1 1258}; 1259ColorStyleSubject.toColorPart = function (a) 1260{ 1261 255 < a && (a = 255); 1262 var c = a.toString(16); 1263 return 16 > a ? "0" + c : c 1264}; 1265ColorStyleSubject.parseColor.rgbRe = /^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i; 1266ColorStyleSubject.parseColor.hexRe = /^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/; 1267 1268function DiscreteStyleSubject(a, c, b, d, f) 1269{ 1270 this.els = Animator.makeArray(a); 1271 this.property = Animator.camelize(c); 1272 this.from = b; 1273 this.to = d; 1274 this.threshold = f || 0.5 1275} 1276DiscreteStyleSubject.prototype = 1277{ 1278 setState: function (a) 1279 { 1280 for (var c = 0; c < this.els.length; c++) this.els[c].style[this.property] = a <= this.threshold ? this.from : this.to 1281 }, 1282 inspect: function () 1283 { 1284 return "\t" + this.property + "(" + this.from + " to " + this.to + " @ " + this.threshold + ")\n" 1285 } 1286}; 1287 1288function CSSStyleSubject(a, c, b) 1289{ 1290 a = Animator.makeArray(a); 1291 this.subjects = []; 1292 if (0 != a.length) 1293 { 1294 var d; 1295 if (b) c = this.parseStyle(c, a[0]), b = this.parseStyle(b, a[0]); 1296 else for (d in b = this.parseStyle(c, a[0]), c = 1297 { 1298 }
1298, b) c[d] = CSSStyleSubject.getStyle(a[0], d); 1299 for (d in c) c[d] == b[d] && (delete c[d], delete b[d]); 1300 var f, e, h, g; 1301 for (d in c) 1302 { 1303 var k = String(c[d]), 1304 p = String(b[d]); 1305 if (null == b[d]) window.DEBUG && alert("No to style provided for '" + d + '"'); 1306 else 1307 { 1308 if (h = ColorStyleSubject.parseColor(k)) g = ColorStyleSubject.parseColor(p), e = ColorStyleSubject; 1309 else if (k.match(CSSStyleSubject.numericalRe) && p.match(CSSStyleSubject.numericalRe)) h = parseFloat(k), g = parseFloat(p), e = NumericalStyleSubject, f = CSSStyleSubject.numericalRe.exec(k), p = CSSStyleSubject.numericalRe.exec(p), f = null != f[1] ? f[1] : null != p[1] ? p[1] : p; 1310 else if (k.match(CSSStyleSubject.discreteRe) && p.match(CSSStyleSubject.discreteRe)) h = k, g = p, e = DiscreteStyleSubject, f = 0; 1311 else 1312 { 1313 window.DEBUG && alert("Unrecognised format for value of " + d + ": '" + c[d] + "'"); 1314 continue 1315 } 1316 this.subjects[this.subjects.length] = new e(a, d, h, g, f) 1317 } 1318 } 1319 } 1320} 1321CSSStyleSubject.prototype = 1322{ 1323 parseStyle: function (a, c) 1324 { 1325 var b = 1326 { 1327 }; 1328 if (-1 != a.indexOf(":")) for (var d = a.split(";"), f = 0; f < d.length; f++) 1329 { 1330 var e = CSSStyleSubject.ruleRe.exec(d[f]); 1331 e && (b[e[1]] = e[2]) 1332 } 1333 else 1334 { 1335 var h; 1336 h = c.className; 1337 c.className = a; 1338 for (f = 0; f < CSSStyleSubject.cssProperties.length; f++) d = CSSStyleSubject.cssProperties[f], e = CSSStyleSubject.getStyle(c, d), null != e && (b[d] = e); 1339 c.className = h 1340 } 1341 return b 1342 }, 1343 setState: function (a) 1344 { 1345 for (var c = 0; c < this.subjects.length; c++) this.subjects[c].setState(a) 1346 }, 1347 inspect: function () 1348 { 1349 for (var a = "", c = 0; c < this.subjects.length; c++) a += this.subjects[c].inspect(); 1350 return a 1351 } 1352}; 1353CSSStyleSubject.getStyle = function (a, c) 1354{ 1355 var b; 1356 if (document.defaultView && document.defaultView.getComputedStyle && (b = document.defaultView.getComputedStyle(a, "").getPropertyValue(c))) return b; 1357 c = Animator.camelize(c); 1358 a.currentStyle && (b = a.currentStyle[c]); 1359 return b || a.style[c] 1360}; 1361CSSStyleSubject.ruleRe = /^\s*([a-zA-Z\-]+)\s*:\s*(\S(.+\S)?)\s*$/; 1362CSSStyleSubject.numericalRe = /^-?\d+(?:\.\d+)?(%|[a-zA-Z]{2})?$/; 1363CSSStyleSubject.discreteRe = /^\w+$/; 1364CSSStyleSubject.cssProperties = "azimuth background background-attachment background-color background-image background-position background-repeat border-collapse border-color border-spacing border-style border-top border-top-color border-right-color border-bottom-color border-left-color border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width border-bottom-width border-left-width border-width bottom clear clip color content cursor direction display elevation empty-cells css-float font font-family font-size font-size-adjust font-stretch font-style font-variant font-weight height left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-top margin-right margin-bottom margin-left max-height max-width min-height min-width orphans outline outline-color outline-style outline-width overflow padding padding-top padding-right padding-bottom padding-left pause position right size table-layout text-align text-decoration text-indent text-shadow text-transform top vertical-align visibility white-space width word-spacing z-index opacity outline-offset overflow-x overflow-y".split(" "); 1365 1366function AnimatorChain(a, c) 1367{ 1368 this.animators = a; 1369 this.setOptions(c); 1370 for (var b = 0; b < this.animators.length; b++) this.listenTo(this.animators[b]); 1371 this.forwards = !1; 1372 this.current = 0 1373} 1374AnimatorChain.prototype = 1375{ 1376 setOptions: function (a) 1377 { 1378 this.options = Animator.applyDefaults( 1379 { 1380 resetOnPlay: !0 1381 }, a) 1382 }, 1383 play: function () 1384 { 1385 this.forwards = !0; 1386 this.current = -1; 1387 if (this.options.resetOnPlay) for (var a = 0; a < this.animators.length; a++) this.animators[a].jumpTo(0); 1388 this.advance() 1389 }, 1390 reverse: function () 1391 { 1392 this.forwards = !1; 1393 this.current = this.animators.length; 1394 if (this.options.resetOnPlay) for (var a = 0; a < this.animators.length; a++) this.animators[a].jumpTo(1); 1395 this.advance() 1396 }, 1397 toggle: function () 1398 { 1399 this.forwards ? this.seekTo(0) : this.seekTo(1) 1400 }, 1401 listenTo: function (a) 1402 { 1403 var c = a.options.onComplete, 1404 b = this; 1405 a.options.onComplete = function () 1406 { 1407 c && c.call(a); 1408 b.advance() 1409 } 1410 }, 1411 advance: function () 1412 { 1413 this.forwards ? null != this.animators[this.current + 1] && (this.current++, this.animators[this.current].play()) : null != this.animators[this.current - 1] && (this.current--, this.animators[this.current].reverse()) 1414 }, 1415 seekTo: function (a) 1416 { 1417 0 >= a ? (this.forwards = !1, this.animators[this.current].seekTo(0)) : (this.forwards = !0, this.animators[this.current].seekTo(1)) 1418 } 1419}; 1420 1421function Accordion(a) 1422{ 1423 this.setOptions(a); 1424 a = this.options.initialSection; 1425 var c; 1426 this.options.rememberance && (c = document.location.hash.substring(1)); 1427 this.rememberanceTexts = []; 1428 this.ans = []; 1429 for (var b = this, d = 0; d < this.options.sections.length; d++) 1430 { 1431 var f = this.options.sections[d], 1432 e = new Animator(this.options.animatorOptions); 1433 e.addSubject(new NumericalStyleSubject(f, this.options.property, this.options.from + this.options.shift * d, this.options.to + this.options.shift * d, this.options.units)); 1434 e.jumpTo(0); 1435 f = this.options.getActivator(f); 1436 f.index = d; 1437 f.onclick = function () 1438 { 1439 b.show(this.index) 1440 }; 1441 this.ans[this.ans.length] = e; 1442 this.rememberanceTexts[d] = f.innerHTML.replace(/\s/g, ""); 1443 this.rememberanceTexts[d] === c && (a = d) 1444 } 1445 this.show(a) 1446} 1447Accordion.prototype = 1448{ 1449 setOptions: function (a) 1450 { 1451 this.options = Object.extend( 1452 { 1453 sections: null, 1454 getActivator: function (a) 1455 { 1456 return document.getElementById(a.getAttribute("activator")) 1457 }, 1458 shift: 0, 1459 initialSection: 0, 1460 rememberance: !0, 1461 animatorOptions: { 1462 } 1463 }, a || { 1464 }) 1465 }, 1466 show: function (a) 1467 { 1468 for (var c = 0; c < this.ans.length; c++) this.ans[c].seekTo(c > a ? 1 : 0); 1469 this.options.rememberance && (document.location.hash = this.rememberanceTexts[a]) 1470 } 1471}; 1472var threeSixtyPlayer, ThreeSixtyPlayer; 1473(function (a) 1474{ 1475 function c() 1476 { 1477 var b = this, 1478 c = this, 1479 f = soundManager, 1480 e = navigator.userAgent, 1481 h = e.match(/msie/i), 1482 g = e.match(/opera/i), 1483 k = e.match(/safari/i), 1484 p = e.match(/chrome/i); 1485 e.match(/firefox/i); 1486 var q = e.match(/ipad|iphone/i), 1487 r = "undefined" === typeof a.G_vmlCanvasManager && "undefined" !== typeof document.createElement("canvas").getContext("2d"), 1488 n = g || p ? 359.9 : 360, 1489 s = navigator.userAgent.match(/msie [678]/i) ? 1 : 2; 1490 this.excludeClass = "threesixty-exclude"; 1491 this.links = []; 1492 this.sounds = []; 1493 this.soundsByURL = []; 1494 this.indexByURL = []; 1495 this.lastTouchedSound = 1496 this.lastSound = null; 1497 this.soundCount = 0; 1498 this.vuMeter = this.oUIImageMap = this.oUITemplate = null; 1499 this.callbackCount = 0; 1500 this.peakDataHistory = []; 1501 this.config = 1502 { 1503 playNext: !1, 1504 autoPlay: !1, 1505 allowMultiple: !1, 1506 loadRingColor: "#ccc", 1507 playRingColor: "#000", 1508 backgroundRingColor: "#eee", 1509 segmentRingColor: "rgba(255,255,255,0.33)", 1510 segmentRingColorAlt: "rgba(0,0,0,0.1)", 1511 loadRingColorMetadata: "#ddd", 1512 playRingColorMetadata: "rgba(128,192,256,0.9)", 1513 circleDiameter: null, 1514 circleRadius: null, 1515 animDuration: 500, 1516 animTransition: a.Animator.tx.bouncy, 1517 showHMSTime: !1, 1518 scaleFont: !0, 1519 useWaveformData: !1, 1520 waveformDataColor: "#0099ff", 1521 waveformDataDownsample: 3, 1522 waveformDataOutside: !1, 1523 waveformDataConstrain: !1, 1524 waveformDataLineRatio: 0.64, 1525 useEQData: !1, 1526 eqDataColor: "#339933", 1527 eqDataDownsample: 4, 1528 eqDataOutside: !0, 1529 eqDataLineRatio: 0.54, 1530 usePeakData: !0, 1531 peakDataColor: "#ff33ff", 1532 peakDataOutside: !0, 1533 peakDataLineRatio: 0.5, 1534 useAmplifier: !0, 1535 fontSizeMax: null, 1536 scaleArcWidth: 1, 1537 useFavIcon: !1 1538 }; 1539 this.css = 1540 { 1541 sDefault: "sm2_link", 1542 sBuffering: "sm2_buffering", 1543 sPlaying: "sm2_playing", 1544 sPaused: "sm2_paused" 1545 }; 1546 this.addEventHandler = "undefined" !== typeof a.addEventListener ? 1547 function (b, a, c) 1548 { 1549 return b.addEventListener(a, c, !1) 1550 } : function (b, a, c) 1551 { 1552 b.attachEvent("on" + a, c) 1553 }; 1554 this.removeEventHandler = "undefined" !== typeof a.removeEventListener ? 1555 function (b, a, c) 1556 { 1557 return b.removeEventListener(a, c, !1) 1558 } : function (b, a, c) 1559 { 1560 return b.detachEvent("on" + a, c) 1561 }; 1562 this.hasClass = function (b, a) 1563 { 1564 return "undefined" !== typeof b.className ? b.className.match(RegExp("(\\s|^)" + a + "(\\s|$)")) : !1 1565 }; 1566 this.addClass = function (a, c) 1567 { 1568 if (!a || !c || b.hasClass(a, c)) return !1; 1569 a.className = (a.className ? a.className + " " : "") + c 1570 }; 1571 this.removeClass = function (a, c) 1572 { 1573 if (!a || !c || !b.hasClass(a, c)) return !1; 1574 a.className = a.className.replace(RegExp("( " + c + ")|(" + c + ")", "g"), "") 1575 }; 1576 this.getElementsByClassName = function (a, c, d) 1577 { 1578 var f = d || document; 1579 d = []; 1580 var e, g = []; 1581 if ("undefined" !== typeof c && "string" !== typeof c) for (e = c.length; e--;) 1582 { 1583 if (!g || !g[c[e]]) g[c[e]] = f.getElementsByTagName(c[e]) 1584 } 1585 else g = c ? f.getElementsByTagName(c) : f.all || f.getElementsByTagName("*"); 1586 if ("string" !== typeof c) for (e = c.length; e--;) for (f = 1587 g[c[e]].length; f--;) b.hasClass(g[c[e]][f], a) && d.push(g[c[e]][f]); 1588 else for (e = 0; e < g.length; e++) b.hasClass(g[e], a) && d.push(g[e]); 1589 return d 1590 }; 1591 this.getParentByNodeName = function (b, a) 1592 { 1593 if (!b || !a) return !1; 1594 for (a = a.toLowerCase(); b.parentNode && a !== b.parentNode.nodeName.toLowerCase();) b = b.parentNode; 1595 return b.parentNode && a === b.parentNode.nodeName.toLowerCase() ? b.parentNode : null 1596 }; 1597 this.getParentByClassName = function (a, c) 1598 { 1599 if (!a || !c) return !1; 1600 for (; a.parentNode && !b.hasClass(a.parentNode, c);) a = a.parentNode; 1601 return a.parentNode && b.hasClass(a.parentNode, c) ? a.parentNode : null 1602 };
1603 this.getSoundByURL = function (a) 1604 { 1605 return "undefined" !== typeof b.soundsByURL[a] ? b.soundsByURL[a] : null 1606 }; 1607 this.isChildOfNode = function (b, a) 1608 { 1609 if (!b || !b.parentNode) return !1; 1610 a = a.toLowerCase(); 1611 do b = b.parentNode; 1612 while (b && b.parentNode && b.nodeName.toLowerCase() !== a); 1613 return b && b.nodeName.toLowerCase() === a ? b : null 1614 }; 1615 this.isChildOfClass = function (a, c) 1616 { 1617 if (!a || !c) return !1; 1618 for (; a.parentNode && !b.hasClass(a, c);) a = b.findParent(a); 1619 return b.hasClass(a, c) 1620 }; 1621 this.findParent = function (b) 1622 { 1623 if (!b || !b.parentNode) return !1; 1624 b = b.parentNode; 1625 if (2 === b.nodeType) for (; b && b.parentNode && 2 === b.parentNode.nodeType;) b = b.parentNode; 1626 return b 1627 }; 1628 this.getStyle = function (b, c) 1629 { 1630 try 1631 { 1632 if (b.currentStyle) return b.currentStyle[c]; 1633 if (a.getComputedStyle) return document.defaultView.getComputedStyle(b, null).getPropertyValue(c) 1634 } 1635 catch (d) 1636 { 1637 } 1638 return null 1639 }; 1640 this.findXY = function (b) 1641 { 1642 var a = 0, 1643 c = 0; 1644 do a += b.offsetLeft, c += b.offsetTop; 1645 while (b = b.offsetParent); 1646 return [a, c] 1647 }; 1648 this.getMouseXY = function (c) 1649 { 1650 c = c ? c : a.event; 1651 q && c.touches && (c = c.touches[0]); 1652 if (c.pageX || c.pageY) return [c.pageX, c.pageY]; 1653 if (c.clientX || c.clientY) return [c.clientX + b.getScrollLeft(), c.clientY + b.getScrollTop()] 1654 }; 1655 this.getScrollLeft = function () 1656 { 1657 return document.body.scrollLeft + document.documentElement.scrollLeft 1658 }; 1659 this.getScrollTop = function () 1660 { 1661 return document.body.scrollTop + document.documentElement.scrollTop 1662 }; 1663 this.events = 1664 { 1665 play: function () 1666 { 1667 c.removeClass(this._360data.oUIBox, this._360data.className); 1668 this._360data.className = c.css.sPlaying; 1669 c.addClass(this._360data.oUIBox, this._360data.className); 1670 b.fanOut(this) 1671 }, 1672 stop: function () 1673 { 1674 c.removeClass(this._360data.oUIBox, this._360data.className); 1675 this._360data.className = ""; 1676 b.fanIn(this) 1677 }, 1678 pause: function () 1679 { 1680 c.removeClass(this._360data.oUIBox, this._360data.className); 1681 this._360data.className = c.css.sPaused; 1682 c.addClass(this._360data.oUIBox, this._360data.className) 1683 }, 1684 resume: function () 1685 { 1686 c.removeClass(this._360data.oUIBox, this._360data.className); 1687 this._360data.className = c.css.sPlaying; 1688 c.addClass(this._360data.oUIBox, this._360data.className) 1689 }, 1690 finish: function () 1691 { 1692 var a; 1693 c.removeClass(this._360data.oUIBox, this._360data.className); 1694 this._360data.className = ""; 1695 this._360data.didFinish = !0; 1696 b.fanIn(this); 1697 c.config.playNext && (a = c.indexByURL[this._360data.oLink.href] + 1, a < c.links.length && c.handleClick( 1698 { 1699 target: c.links[a] 1700 })) 1701 }, 1702 whileloading: function () 1703 { 1704 this.paused && b.updatePlaying.apply(this) 1705 }, 1706 whileplaying: function () 1707 { 1708 b.updatePlaying.apply(this); 1709 this._360data.fps++ 1710 }, 1711 bufferchange: function () 1712 { 1713 this.isBuffering ? c.addClass(this._360data.oUIBox, c.css.sBuffering) : c.removeClass(this._360data.oUIBox, c.css.sBuffering) 1714 } 1715 }; 1716 this.stopEvent = function (b) 1717 { 1718 "undefined" !== typeof b && "undefined" !== typeof b.preventDefault ? b.preventDefault() : "undefined" !== typeof a.event && "undefined" !== typeof a.event.returnValue && (a.event.returnValue = !1); 1719 return !1 1720 }; 1721 this.getTheDamnLink = h ? 1722 function (b) 1723 { 1724 return b && b.target ? b.target : a.event.srcElement 1725 } : function (b) 1726 { 1727 return b.target 1728 }; 1729 this.handleClick = function (c) 1730 { 1731 if (1 < c.button) return !0; 1732 var d = b.getTheDamnLink(c), 1733 e, g, k, h, p, q; 1734 if ("a" !== d.nodeName.toLowerCase() && (d = b.isChildOfNode(d, "a"), !d) || !b.isChildOfClass(d, "ui360")) return !0; 1735 d.getAttribute("href"); 1736 if (!d.href || !f.canPlayLink(d) || b.hasClass(d, b.excludeClass)) return !0; 1737 f._writeDebug("handleClick()"); 1738 g = d.href; 1739 (k = b.getSoundByURL(g)) ? k === b.lastSound ? k.togglePause() : (k.togglePause(), f._writeDebug("sound different than last sound: " + b.lastSound.id), !b.config.allowMultiple && b.lastSound && b.stopSound(b.lastSound)) : (h = d.parentNode, p = b.getElementsByClassName("ui360-vis", "div", h.parentNode).length, k = f.createSound( 1740 { 1741 id: "ui360Sound" + b.soundCount++, 1742 url: g, 1743 onplay: b.events.play, 1744 onstop: b.events.stop, 1745 onpause: b.events.pause, 1746 onresume: b.events.resume, 1747 onfinish: b.events.finish, 1748 onbufferchange: b.events.bufferchange, 1749 type: d.type || null, 1750 whileloading: b.events.whileloading, 1751 whileplaying: b.events.whileplaying, 1752 useWaveformData: p && b.config.useWaveformData, 1753 useEQData: p && b.config.useEQData, 1754 usePeakData: p && b.config.usePeakData 1755 }), q = parseInt(b.getElementsByClassName("sm2-360ui", "div", h)[0].offsetWidth * s, 10), e = b.getElementsByClassName("sm2-canvas", "canvas", h), k._360data = 1756 {
1757 oUI360: b.getParentByClassName(d, "ui360"), 1758 oLink: d, 1759 className: b.css.sPlaying, 1760 oUIBox: b.getElementsByClassName("sm2-360ui", "div", h)[0], 1761 oCanvas: e[e.length - 1], 1762 oButton: b.getElementsByClassName("sm2-360btn", "span", h)[0], 1763 oTiming: b.getElementsByClassName("sm2-timing", "div", h)[0], 1764 oCover: b.getElementsByClassName("sm2-cover", "div", h)[0], 1765 circleDiameter: q, 1766 circleRadius: q / 2, 1767 lastTime: null, 1768 didFinish: null, 1769 pauseCount: 0, 1770 radius: 0, 1771 fontSize: 1, 1772 fontSizeMax: b.config.fontSizeMax, 1773 scaleFont: p && b.config.scaleFont, 1774 showHMSTime: p, 1775 amplifier: p && b.config.usePeakData ? 0.9 : 1, 1776 radiusMax: 0.175 * q, 1777 width: 0, 1778 widthMax: 0.4 * q, 1779 lastValues: { 1780 bytesLoaded: 0, 1781 bytesTotal: 0, 1782 position: 0, 1783 durationEstimate: 0 1784 }, 1785 animating: !1, 1786 oAnim: new a.Animator( 1787 { 1788 duration: b.config.animDuration, 1789 transition: b.config.animTransition, 1790 onComplete: function () 1791 { 1792 } 1793 }), 1794 oAnimProgress: function (a) 1795 { 1796 this._360data.radius = parseInt(this._360data.radiusMax * this._360data.amplifier * a, 10); 1797 this._360data.width = parseInt(this._360data.widthMax * this._360data.amplifier * a, 10); 1798 this._360data.scaleFont && null !== this._360data.fontSizeMax && (this._360data.oTiming.style.fontSize = parseInt(Math.max(1, this._360data.fontSizeMax * a), 10) + "px", this._360data.oTiming.style.opacity = a); 1799 (this.paused || 0 === this.playState || 0 === this._360data.lastValues.bytesLoaded || 0 === this._360data.lastValues.position) && b.updatePlaying.apply(this) 1800 }, 1801 fps: 0 1802 }, "undefined" !== typeof b.Metadata && b.getElementsByClassName("metadata", "div", k._360data.oUI360).length && (k._360data.metadata = new b.Metadata(k, b)), k._360data.scaleFont && null !== k._360data.fontSizeMax && (k._360data.oTiming.style.fontSize = "1px"), k._360data.oAnim.addSubject(k._360data.oAnimProgress, k), b.refreshCoords(k), b.updatePlaying.apply(k), b.soundsByURL[g] = k, b.sounds.push(k), !b.config.allowMultiple && b.lastSound && b.stopSound(b.lastSound), k.play()); 1803 b.lastSound = k; 1804 "undefined" !== typeof c && "undefined" !== typeof c.preventDefault ? c.preventDefault() : "undefined" !== typeof a.event && (a.event.returnValue = !1); 1805 return !1 1806 }; 1807 this.fanOut = function (c) 1808 { 1809 if (1 === c._360data.animating) return !1; 1810 c._360data.animating = 0; 1811 soundManager._writeDebug("fanOut: " + c.id + ": " + c._360data.oLink.href); 1812 c._360data.oAnim.seekTo(1); 1813 a.setTimeout(function () 1814 { 1815 c._360data.animating = 0 1816 }, b.config.animDuration + 20) 1817 }; 1818 this.fanIn = function (c) 1819 { 1820 if (-1 === c._360data.animating) return !1; 1821 c._360data.animating = -1; 1822 soundManager._writeDebug("fanIn: " + c.id + ": " + c._360data.oLink.href); 1823 c._360data.oAnim.seekTo(0); 1824 a.setTimeout(function () 1825 { 1826 c._360data.didFinish = !1; 1827 c._360data.animating = 0; 1828 b.resetLastValues(c) 1829 }, b.config.animDuration + 20) 1830 }; 1831 this.resetLastValues = function (b) 1832 { 1833 b._360data.lastValues.position = 0 1834 }; 1835 this.refreshCoords = function (a) 1836 { 1837 a._360data.canvasXY = b.findXY(a._360data.oCanvas); 1838 a._360data.canvasMid = [a._360data.circleRadius, a._360data.circleRadius]; 1839 a._360data.canvasMidXY = [a._360data.canvasXY[0] + a._360data.canvasMid[0], a._360data.canvasXY[1] + a._360data.canvasMid[1]] 1840 }; 1841 this.stopSound = function (b) 1842 { 1843 soundManager._writeDebug("stopSound: " + b.id); 1844 soundManager.stop(b.id); 1845 q || soundManager.unload(b.id) 1846 }; 1847 this.buttonClick = function (c) 1848 { 1849 b.handleClick( 1850 { 1851 target: b.getParentByClassName(c ? c.target ? c.target : c.srcElement : a.event.srcElement, "sm2-360ui").nextSibling 1852 }); 1853 return !1 1854 }; 1855 this.buttonMouseDown = function (a) 1856 { 1857 q ? b.addEventHandler(document, "touchmove", b.mouseDown) : document.onmousemove = function (a) 1858 { 1859 b.mouseDown(a) 1860 }; 1861 b.stopEvent(a); 1862 return !1 1863 }; 1864 this.mouseDown = function (c) 1865 { 1866 if (!q && 1 < c.button) return !0; 1867 if (!b.lastSound) return b.stopEvent(c), !1; 1868 var d = c ? c : a.event; 1869 q && d.touches && (d = d.touches[0]); 1870 d = b.getSoundByURL(b.getElementsByClassName("sm2_link", "a", b.getParentByClassName(
1870d.target || d.srcElement, "ui360"))[0].href); 1871 b.lastTouchedSound = 1872 d; 1873 b.refreshCoords(d); 1874 d = d._360data; 1875 b.addClass(d.oUIBox, "sm2_dragging"); 1876 d.pauseCount = b.lastTouchedSound.paused ? 1 : 0; 1877 b.mmh(c ? c : a.event); 1878 q ? (b.removeEventHandler(document, "touchmove", b.mouseDown), b.addEventHandler(document, "touchmove", b.mmh), b.addEventHandler(document, "touchend", b.mouseUp)) : (document.onmousemove = b.mmh, document.onmouseup = b.mouseUp); 1879 b.stopEvent(c); 1880 return !1 1881 }; 1882 this.mouseUp = function (a) 1883 { 1884 a = b.lastTouchedSound._360data; 1885 b.removeClass(a.oUIBox, "sm2_dragging"); 1886 0 === a.pauseCount && b.lastTouchedSound.resume(); 1887 q ? (b.removeEventHandler(document, "touchmove", b.mmh), b.removeEventHandler(document, "touchend", b.mouseUP)) : (document.onmousemove = null, document.onmouseup = null) 1888 }; 1889 this.mmh = function (c) 1890 { 1891 "undefined" === typeof c && (c = a.event); 1892 var d = b.lastTouchedSound, 1893 e = b.getMouseXY(c), 1894 e = Math.floor(n - (b.rad2deg(Math.atan2(e[0] - d._360data.canvasMidXY[0], e[1] - d._360data.canvasMidXY[1])) + 180)); 1895 d.setPosition(d.durationEstimate * (e / n)); 1896 b.stopEvent(c); 1897 return !1 1898 }; 1899 this.drawSolidArc = function (a, c, d, e, f, h, p) 1900 { 1901 var q = a, 1902 n; 1903 q.getContext && (n = q.getContext("2d")); 1904 a = n; 1905 p || b.clearCanvas(q); 1906 c && (n.fillStyle = c); 1907 a.beginPath(); 1908 isNaN(f) && (f = 0); 1909 c = d - e; 1910 e = g || k; 1911 if (!e || e && 0 < d) a.arc(0, 0, d, h, f, !1), d = b.getArcEndpointCoords(c, f), a.lineTo(d.x, d.y), a.arc(0, 0, c, f, h, !0), a.closePath(), a.fill() 1912 }; 1913 this.getArcEndpointCoords = function (a, b) 1914 { 1915 return { 1916 x: a * Math.cos(b), 1917 y: a * Math.sin(b) 1918 } 1919 }; 1920 this.deg2rad = function (a) 1921 { 1922 return a * Math.PI / 180 1923 }; 1924 this.rad2deg = function (a) 1925 { 1926 return 180 * a / Math.PI 1927 }; 1928 this.getTime = function (a, b) 1929 { 1930 var c = Math.floor(a / 1E3), 1931 d = Math.floor(c / 60), 1932 c = c - 60 * d; 1933 return b ? d + ":" + (10 > c ? "0" + c : c) : { 1934 min: d, 1935 sec: c 1936 } 1937 }; 1938 this.clearCanvas = function (a) 1939 { 1940 var b = null, 1941 c; 1942 a.getContext && (b = a.getContext("2d")); 1943 b && (c = a.offsetWidth, a = a.offsetHeight, b.clearRect(-(c / 2), -(a / 2), c, a)) 1944 }; 1945 this.updatePlaying = function () 1946 { 1947 var a = this._360data.showHMSTime ? b.getTime(this.position, !0) : parseInt(this.position / 1E3, 10), 1948 c = b.config.scaleArcWidth; 1949 this.bytesLoaded && (this._360data.lastValues.bytesLoaded = this.bytesLoaded, this._360data.lastValues.bytesTotal = this.bytesTotal); 1950 this.position && (this._360data.lastValues.position = this.position); 1951 this.durationEstimate && (this._360data.lastValues.durationEstimate = this.durationEstimate); 1952 b.drawSolidArc(this._360data.oCanvas, b.config.backgroundRingColor, this._360data.width, this._360data.radius * c, b.deg2rad(n), !1); 1953 b.drawSolidArc(this._360data.oCanvas, this._360data.metadata ? b.config.loadRingColorMetadata : b.config.loadRingColor, this._360data.width, this._360data.radius * c, b.deg2rad(n * (this._360data.lastValues.bytesLoaded / this._360data.lastValues.bytesTotal)), 0, !0); 1954 0 !== this._360data.lastValues.position && b.drawSolidArc(this._360data.oCanvas, this._360data.metadata ? b.config.playRingColorMetadata : b.config.playRingColor, this._360data.width, this._360data.radius * c, b.deg2rad(1 === this._360data.didFinish ? n : n * (this._360data.lastValues.position / this._360data.lastValues.durationEstimate)), 0, !0); 1955 this._360data.metadata && this._360data.metadata.events.whileplaying(); 1956 a !== this._360data.lastTime && (this._360data.lastTime = a, this._360data.oTiming.innerHTML = a); 1957 (this.instanceOptions.useWaveformData || this.instanceOptions.useEQData) && r && b.updateWaveform(this); 1958 b.config.useFavIcon && b.vuMeter && b.vuMeter.updateVU(this) 1959 }; 1960 this.updateWaveform = function (a) 1961 { 1962 if (!b.config.useWaveformData && !b.config.useEQData || !f.features.waveformData && !f.features.eqData || !a.waveformData.left.length && !a.eqData.length && !a.peakData.left) return !1; 1963 a._360data.oCanvas.getContext("2d"); 1964 var c = parseInt(a._360data.circleDiameter / 2, 10) / 2, 1965 d, e, g, k, h, p, q, n, r; 1966 if (b.config.useWaveformData) 1967 { 1968 g = b.config.waveformDataDownsample; 1969 g = Math.max(1, g); 1970 k = 256 / g; 1971 q = b.config.waveformDataOutside ? 1 : b.config.waveformDataConstrain ? 0.5 : 0.565; 1972 c = b.config.waveformDataOutside ? 0.7 : 0.75; 1973 n = b.deg2rad(360 / k * b.config.waveformDataLineRatio); 1974 for (d = 0; 256 > d; d += g) h = b.deg2rad(360 * (1 * (d / k) / g)), p = h + n, e = a.waveformData.left[d], 0 > e && b.config.waveformDataConstrain && (e = Math.abs(e)), b.drawSolidArc(a._360data.oCanvas, b.config.waveformDataColor, a._360data.width * q * (2 - b.config.scaleArcWidth), 1.25 * (a._360data.radius * c) * e, p, h, !0) 1975 } 1976 if (b.config.useEQData) 1977 { 1978 g = b.config.eqDataDownsample; 1979 g = Math.max(1, g); 1980 k = 192; 1981 q = b.config.eqDataOutside ? 1 : 0.565; 1982 e = b.config.eqDataOutside ? -1 : 1; 1983 c = b.config.eqDataOutside ? 0.5 : 0.75; 1984 n = b.deg2rad(360 / (k / g) * b.config.eqDataLineRatio); 1985 r = b.deg2rad(1 === a._360data.didFinish ? 360 : 360 * (a._360data.lastValues.position / a._360data.lastValues.durationEstimate)); 1986 for (d = 0; d < k; d += g) h = b.deg2rad(360 * (d / k)), p = h + n, b.drawSolidArc(a._360data.oCanvas, p > r ? b.config.eqDataColor : b.config.playRingColor, a._360data.width * q, a._360data.radius * c * a.eqData.left[d] * e, p, h, !0) 1987 } 1988 if (b.config.usePeakData && !a._360data.animating) 1989 { 1990 c = a.peakData.left || a.peakData.right; 1991 k = 3; 1992 for (d = 0; d < k; d++) c = 1993 c || a.eqData[d]; 1994 a._360data.amplifier = b.config.useAmplifier ? 0.9 + 0.1 * c : 1; 1995 a._360data.radiusMax = 0.175 * a._360data.circleDiameter * a._360data.amplifier; 1996 a._360data.widthMax = 0.4 * a._360data.circleDiameter * a._360data.amplifier; 1997 a._360data.radius = parseInt(a._360data.radiusMax * a._360data.amplifier, 10); 1998 a._360data.width = parseInt(a._360data.widthMax * a._360data.amplifier, 10) 1999 } 2000 }; 2001 this.getUIHTML = function (a) 2002 { 2003 return ['<canvas class="sm2-canvas" width="' + a + '" height="' + a + '"></canvas>', ' <span class="sm2-360btn sm2-360btn-default"></span>', ' <div class="sm2-timing' + (navigator.userAgent.match(/safari/i) ? " alignTweak" : "") + '"></div>', ' <div class="sm2-cover"></div>'] 2004 }; 2005 this.uiTest = function (a) 2006 { 2007 var c = document.createElement("div"), 2008 d, e, f; 2009 c.className = "sm2-360ui"; 2010 d = document.createElement("div"); 2011 d.className = "ui360" + (a ? " " + a : ""); 2012 c = d.appendChild(c.cloneNode(!0)); 2013 d.style.position = "absolute"; 2014 d.style.left = "-9999px"; 2015 a = document.body.appendChild(d); 2016 e = c.offsetWidth * s; 2017 f = b.getUIHTML(e); 2018 c.innerHTML = f[1] + f[2] + f[3]; 2019 c = parseInt(e, 10); 2020 e = parseInt(c / 2, 10); 2021 a = b.getElementsByClassName("sm2-timing", "div", a)[0]; 2022 a = parseInt(b.getStyle(a, "font-size"), 10); 2023 isNaN(a) && (a = null); 2024 d.parentNode.removeChild(d); 2025 return { 2026 circleDiameter: c, 2027 circleRadius: e, 2028 fontSizeMax: a 2029 } 2030 }; 2031 this.init = function () 2032 { 2033 f._writeDebug("threeSixtyPlayer.init()"); 2034 var c = b.getElementsByClassName("ui360", "div"), 2035 d, e, g = [], 2036 k = !1, 2037 p = 0, 2038 n, r, u, t, x; 2039 d = 0; 2040 for (e = c.length; d < e; d++) g.push(c[d].getElementsByTagName("a")[0]), c[d].style.backgroundImage = "none"; 2041 b.oUITemplate = document.createElement("div"); 2042 b.oUITemplate.className = "sm2-360ui"; 2043 b.oUITemplateVis = document.createElement("div"); 2044 b.oUITemplateVis.className = "sm2-360ui"; 2045 r = b.uiTest(); 2046 b.config.circleDiameter = r.circleDiameter; 2047 b.config.circleRadius = r.circleRadius; 2048 u = b.uiTest("ui360-vis"); 2049 b.config.fontSizeMax = u.fontSizeMax; 2050 b.oUITemplate.innerHTML = b.getUIHTML(b.config.circleDiameter).join(""); 2051 b.oUITemplateVis.innerHTML = b.getUIHTML(u.circleDiameter).join(""); 2052 d = 0; 2053 for (e = g.length; d < e; d++) f.canPlayLink(g[d]) && (!b.hasClass(g[d], b.excludeClass) && !b.hasClass(g[d], b.css.sDefault)) && (b.addClass(g[d], b.css.sDefault), b.links[p] = g[d], b.indexByURL[g[d].href] = 2054 p, p++, k = b.hasClass(g[d].parentNode, "ui360-vis"), n = (k ? u : r).
2054circleDiameter, c = (k ? u : r).circleRadius, k = g[d].parentNode.insertBefore((k ? b.oUITemplateVis : b.oUITemplate).cloneNode(!0), g[d]), h && "undefined" !== typeof a.G_vmlCanvasManager ? (t = document.createElement("canvas"), t.className = "sm2-canvas", x = "sm2_canvas_" + d + (new Date).getTime(), t.id = x, t.width = n, t.height = n, k.appendChild(t), a.G_vmlCanvasManager.initElement(t), n = document.getElementById(x), k = n.parentNode.getElementsByTagName("canvas"), 1 < k.length && (n = k[k.length - 1])) : n = g[d].parentNode.getElementsByTagName("canvas")[0], 1 < s && b.addClass(n, "hi-dpi"), k = b.getElementsByClassName("sm2-cover", "div", g[d].parentNode)[0], t = g[d].parentNode.getElementsByTagName("span")[0], b.addEventHandler(t, "click", b.buttonClick), q ? b.addEventHandler(k, "touchstart", b.mouseDown) : b.addEventHandler(k, "mousedown", b.mouseDown), n = n.getContext("2d"), n.translate(c, c), n.rotate(b.deg2rad(-90))); 2055 0 < p && (b.addEventHandler(document, "click", b.handleClick), b.config.autoPlay && b.handleClick( 2056 { 2057 target: b.links[0], 2058 preventDefault: function () 2059 { 2060 } 2061 })); 2062 f._writeDebug("threeSixtyPlayer.init(): Found " + p + " relevant items."); 2063 b.config.useFavIcon && "undefined" !== typeof this.VUMeter && (this.vuMeter = new this.VUMeter(this)) 2064 } 2065 } 2066 c.prototype.VUMeter = function (a) 2067 { 2068 var c = this, 2069 f = document.getElementsByTagName("head")[0], 2070 e = navigator.userAgent.match(/opera/i), 2071 h = navigator.userAgent.match(/firefox/i); 2072 this.vuMeterData = []; 2073 this.vuDataCanvas = null; 2074 this.setPageIcon = function (c) 2075 { 2076 if (!a.config.useFavIcon || !a.config.usePeakData || !c) return !1; 2077 var d = document.getElementById("sm2-favicon"); 2078 d && (f.removeChild(d), d = null); 2079 d || (d = document.createElement("link"), d.id = "sm2-favicon", d.rel = "shortcut icon", d.type = "image/png", d.href = c, document.getElementsByTagName("head")[0].appendChild(d)) 2080 }; 2081 this.resetPageIcon = function () 2082 { 2083 if (!a.config.useFavIcon) return !1; 2084 var c = document.getElementById("favicon"); 2085 c && (c.href = "/favicon.ico") 2086 }; 2087 this.updateVU = function (e) 2088 { 2089 9 <= soundManager.flashVersion && (a.config.useFavIcon && a.config.usePeakData) && c.setPageIcon(c.vuMeterData[parseInt(16 * e.peakData.left, 10)][parseInt(16 * e.peakData.right, 10)]) 2090 }; 2091 this.createVUData = function () 2092 { 2093 var a = 0, 2094 b = 0, 2095 e = c.vuDataCanvas.getContext("2d"), 2096 f = e.createLinearGradient(0, 16, 0, 0), 2097 h = e.createLinearGradient(0, 16, 0, 0); 2098 f.addColorStop(0, "rgb(0,192,0)"); 2099 f.addColorStop(0.3, "rgb(0,255,0)"); 2100 f.addColorStop(0.625, "rgb(255,255,0)"); 2101 f.addColorStop(0.85, "rgb(255,0,0)"); 2102 h.addColorStop(0, "rgba(0,0,0,0.2)"); 2103 h.addColorStop(1, "rgba(0,0,0,0.5)"); 2104 for (a = 0; 16 > a; a++) c.vuMeterData[a] = []; 2105 for (a = 0; 16 > a; a++) for (b = 0; 16 > b; b++) c.vuDataCanvas.setAttribute("width", 16), c.vuDataCanvas.setAttribute("height", 16), e.fillStyle = h, e.fillRect(0, 0, 7, 15), e.fillRect(8, 0, 7, 15), e.fillStyle = f, e.fillRect(0, 15 - a, 7, 16 - (16 - a)), e.fillRect(8, 15 - b, 7, 16 - (16 - b)), e.clearRect(0, 3, 16, 1), e.clearRect(0, 7, 16, 1), e.clearRect(0, 11, 16, 1), c.vuMeterData[a][b] = c.vuDataCanvas.toDataURL("image/png") 2106 }; 2107 this.testCanvas = function () 2108 { 2109 var a = document.createElement("canvas"), 2110 b = null; 2111 if (!a || "undefined" === typeof a.getContext) return null; 2112 b = a.getContext("2d"); 2113 if (!b || "function" !== typeof a.toDataURL) return null; 2114 try 2115 { 2116 a.toDataURL("image/png") 2117 } 2118 catch (c) 2119 { 2120 return null 2121 } 2122 return a 2123 }; 2124 this.init = function () 2125 { 2126 a.config.useFavIcon && (c.vuDataCanvas = c.testCanvas(), c.vuDataCanvas && (h || e) ? c.createVUData() : a.config.useFavIcon = !1) 2127 }; 2128 this.init() 2129 }; 2130 c.prototype.Metadata = function (a, c) 2131 { 2132 soundManager._wD("Metadata()"); 2133 var f = this, 2134 e = a._360data.oUI360, 2135 h = e.getElementsByTagName("ul")[0].getElementsByTagName("li"); 2136 navigator.userAgent.match(/firefox/i); 2137 var g; 2138 this.lastWPExec = 0; 2139 this.refreshInterval = 250; 2140 this.totalTime = 0; 2141 this.events = 2142 { 2143 whileplaying: function () 2144 { 2145 var e = a._360data.width, 2146 g = a._360data.radius, 2147 h = a.durationEstimate || 1E3 * f.totalTime, 2148 r = null, 2149 n, s; 2150 n = 0; 2151 for (s = f.data.length; n < s; n++) r = 0 === n % 2, c.drawSolidArc(a._360data.oCanvas, r ? c.config.segmentRingColorAlt : c.config.segmentRingColor, e, g / 2, c.deg2rad(360 * (f.data[n].endTimeMS / h)), c.deg2rad(360 * ((f.data[n].startTimeMS || 1) / h)), !0); 2152 e = new Date; 2153 e - f.lastWPExec > f.refreshInterval && (f.refresh(), f.lastWPExec = e) 2154 } 2155 }; 2156 this.refresh = function () 2157 { 2158 var c, d, e = null, 2159 f = a.position, 2160 g = a._360data.metadata.data; 2161 c = 0; 2162 for (d = g.length; c < d; c++) if (f >= g[c].startTimeMS && f <= g[c].endTimeMS) 2163 { 2164 e = c; 2165 break 2166 } 2167 e !== g.currentItem && e < g.length && (a._360data.oLink.innerHTML = g.mainTitle + ' <span class="metadata"><span class="sm2_divider"> | </span><span class="sm2_metadata">' + g[e].title + "</span></span>", g.currentItem = e) 2168 }; 2169 this.strToTime = function (a) 2170 { 2171 a = a.split(":"); 2172 var b = 0, 2173 c; 2174 for (c = a.length; c--;) b += parseInt(a[c], 10) * Math.pow(60, a.length - 1 - c); 2175 return b 2176 }; 2177 this.data = []; 2178 this.data.givenDuration = null; 2179 this.data.currentItem = null; 2180 this.data.mainTitle = a._360data.oLink.innerHTML; 2181 for (g = 0; g < h.length; g++) this.data[g] = 2182 { 2183 o: null, 2184 title: h[g].getElementsByTagName("p")[0].innerHTML, 2185 startTime: h[g].getElementsByTagName("span")[0].innerHTML, 2186 startSeconds: f.strToTime(h[g].getElementsByTagName("span")[0].innerHTML.replace(/[()]/g, "")), 2187 duration: 0, 2188 durationMS: null, 2189 startTimeMS: null, 2190 endTimeMS: null, 2191 oNote: null 2192 }; 2193 e = c.getElementsByClassName("duration", "div", e); 2194 this.data.givenDuration = e.length ? 1E3 * f.strToTime(e[0].innerHTML) : 0; 2195 for (g = 0; g < this.data.length; g++) this.data[g].duration = parseInt(this.data[g + 1] ? this.data[g + 1].startSeconds : (f.data.givenDuration ? f.data.givenDuration : a.durationEstimate) / 1E3, 10) - this.data[g].startSeconds, this.data[g].startTimeMS = 1E3 * this.data[g].startSeconds, this.data[g].durationMS = 1E3 * this.data[g].duration, this.data[g].endTimeMS = this.data[g].startTimeMS + this.data[g].durationMS, this.totalTime += this.data[g].duration 2196 }; 2197 navigator.userAgent.match(/webkit/i) && navigator.userAgent.match(/mobile/i) && soundManager.setup( 2198 { 2199 useHTML5Audio: !0 2200 }); 2201 soundManager.setup( 2202 { 2203 html5PollingInterval: 50, 2204 debugMode: a.location.href.match(/debug=1/i), 2205 consoleOnly: !0, 2206 flashVersion: 9, 2207 useHighPerformance: !0 2208 }); 2209 soundManager.debugMode && a.setInterval(function () 2210 { 2211 var b = a.threeSixtyPlayer; 2212 b && (b.lastSound && b.lastSound._360data.fps && "undefined" === typeof a.isHome) && (soundManager._writeDebug("fps: ~" + b.lastSound._360data.fps), b.lastSound._360data.fps = 0) 2213 }, 1E3); 2214 a.ThreeSixtyPlayer = c 2215})(window); 2216threeSixtyPlayer = new ThreeSixtyPlayer; 2217soundManager.onready(threeSixtyPlayer.init); 2218var IS_CHRISTMAS = document.domain.match(/schillmania.com/i) && 11 == (new Date).getMonth() || window.location.toString().match(/christmas/i); 2219 2220function _id(a) 2221{ 2222 return document.getElementById(a) 2223} 2224getSoundByURL = function (a) 2225{ 2226 return "undefined" != typeof self.soundsByURL[a] ? self.soundsByURL[a] : null 2227}; 2228
2229function init() 2230{ 2231 for (var a = document.getElementById("main"), c = a.getElementsByTagName("dt"), b = c.length; b--;) 0 == (b + 1) % 2 && utils.addClass(c[b], "alt"); 2232 c = a.getElementsByTagName("dl"); 2233 for (b = c.length; b--;) 0 == (b + 1) % 2 && utils.addClass(c[b], "alt"); 2234 IS_CHRISTMAS && (a = document.body.className.split(" "), a.push("has-lights"), document.body.className = a.join(" ")) 2235} 2236 2237function Utils() 2238{ 2239 var a = this; 2240 this.hasClass = function (a, b) 2241 { 2242 return "undefined" != typeof a.className ? RegExp("(^|\\s)" + b + "(\\s|$)").test(a.className) : !1 2243 }; 2244 this.addClass = function (c, b) 2245 { 2246 if (!c || !b || a.hasClass(c, b)) return !1; 2247 c.className = (c.className ? c.className + " " : "") + b 2248 }; 2249 this.removeClass = function (c, b) 2250 { 2251 if (!c || !b || !a.hasClass(c, b)) return !1; 2252 c.className = c.className.replace(RegExp("( " + b + ")|(" + b + ")", "g"), "") 2253 }; 2254 this.toggleClass = function (c, b) 2255 { 2256 (a.hasClass(c, b) ? a.removeClass : a.addClass)(c, b) 2257 }; 2258 this.getElementsByClassName = 2259 2260 function (c, b, d) 2261 { 2262 var f = d || document; 2263 d = []; 2264 var e, h = []; 2265 if ("undefined" != typeof b && "string" != typeof b) for (e = b.length; e--;) 2266 { 2267 if (!h || !h[b[e]]) h[b[e]] = f.getElementsByTagName(b[e]) 2268 } 2269 else h = b ? f.getElementsByTagName(b) : f.all || f.getElementsByTagName("*"); 2270 if ("string" != typeof b) for (e = b.length; e--;) for (f = h[b[e]].length; f--;) a.hasClass(h[b[e]][f], c) && (d[d.length] = h[b[e]][f]); 2271 else for (e = 0; e < h.length; e++) a.hasClass(h[e], c) && (d[d.length] = h[e]); 2272 return d 2273 }; 2274 this.findParent = function (a) 2275 { 2276 if (!a || !a.parentNode) return !1; 2277 a = a.parentNode; 2278 if (2 == a.nodeType) for (; a && a.parentNode && 2 == a.parentNode.nodeType;) a = a.parentNode; 2279 return a 2280 }; 2281 this.getOffY = function (a) 2282 { 2283 var b = 0; 2284 if (a.offsetParent) for (; a.offsetParent;) b += a.offsetTop, a = a.offsetParent; 2285 else a.y && (b += a.y); 2286 return b 2287 }; 2288 this.isChildOfClass = function (c, b) 2289 { 2290 if (!c || !b) return !1; 2291 for (; c.parentNode && !a.hasClass(c, b);) c = a.findParent(c); 2292 return a.hasClass(c, b) 2293 }; 2294 this.getParentByClassName = function (c, b) 2295 { 2296 if (!c || !b) return !1; 2297 for (b = b.toLowerCase(); c.parentNode && !a.hasClass(c.parentNode, b);) c = a.findParent(c); 2298 return c.parentNode && a.hasClass(c.parentNode, b) ? c.parentNode : null 2299 } 2300} 2301var utils = new Utils, 2302 lastSelected = null; 2303 2304function resetFilter(a) 2305{ 2306 var c = null; 2307 _id("filter-box").style.display = "none"; 2308 utils.removeClass(_id("main"), "filtered"); 2309 for (var b = utils.getElementsByClassName("f-block", ["div", "dl"], _id("main")), d = b.length; d--;) if (b[d].style.display = "block", c = utils.getParentByClassName(b[d], "columnar", _id("main"))) c.style.display = "block"; 2310 lastSelected && utils.removeClass(lastSelected, "active"); 2311 a && (lastSelected = a); 2312 return !1 2313} 2314 2315function setFilter(a, c) 2316{ 2317 var b = a ? a.target || a.srcElement : event.srcElement; 2318 utils.addClass(_id("main"), "filtered"); 2319 var d = b.nodeName.toLowerCase(); 2320 if ("a" == d) 2321 { 2322 var f = utils.findParent(b); 2323 f && "li" == f.nodeName.toLowerCase() && (b = f, d = b.nodeName.toLowerCase()) 2324 } 2325 var e = "", 2326 f = utils.getElementsByClassName("f-block", ["div", "dl"], _id("main")), 2327 h = utils.getElementsByClassName("columnar", "div", _id("main")), 2328 g = null, 2329 k = []; 2330 if ("li" != d || "ignore" == b.className) return !0; 2331 var p = lastSelected && lastSelected == b && utils.hasClass(lastSelected, "active"); 2332 if ("li" == d && p) return "undefined" !== typeof a.preventDefault && a.preventDefault(), resetFilter(); 2333 if ("li" == d) 2334 { 2335 e = b.getElementsByTagName("a").length ? b.getElementsByTagName("a")[0].innerHTML : b.innerHTML; 2336 e = c + e.substr(0, -1 != e.indexOf("(") ? e.indexOf("(") : 999).toLowerCase().replace(/\s+/i, "-"); 2337 d = e.substr(e.length - 1); 2338 if ("-" == d || " " == d) e = e.substr(0, e.length - 1); 2339 for (d = f.length; d--;) g = utils.getParentByClassName(f[d], "columnar", _id("main")), utils.hasClass(f[d], e) ? (f[d].style.display = "block", g && k.push(g)) : f[d].style.display = "none"; 2340 for (d = h.length; d--;) h[d].style.display = "none"; 2341 for (d = k.length; d--;) k[d].style.display = "block"; 2342 _id("search-results").innerHTML = '<h3><span class="option"><a href="#" title="Restore full content" onclick="resetFilter();return false" style="text-decoration:none"> clear filter </a></span>Content filter: ' + ("f-" == c ? "soundManager." : "s-" == c ? "[SMSound object]." : "") + '<b style="font-weight:bold">' + b.innerHTML + "</b></h3>"; 2343 _id("search-results").style.display = "block"; 2344 _id("filter-box").style.display = "block";
2345 p ? (_id("filter-box").style.paddingBottom = "0px", _id("filter-box").style.display = "none") : (_id("filter-box").style.paddingBottom = "0px", navigator.userAgent.match(/msie/i) || (_id("filter-box").style.paddingBottom = Math.max(0, (document.documentElement.scrollTop || window.scrollY) - utils.getOffY(_id("filter-box")) - parseInt(_id("filter-box").offsetHeight) - 20) + "px"), _id("filter-box").style.display = "block"); 2346 lastSelected ? lastSelected == b ? utils.toggleClass(lastSelected, "active") : (utils.removeClass(lastSelected, "active"), utils.addClass(b, "active")) : utils.addClass(b, "active"); 2347 lastSelected = b; 2348 "undefined" !== typeof a.preventDefault && a.preventDefault(); 2349 return !1 2350 } 2351} 2352function getLiveData() 2353{ 2354 getDynamicData(); 2355 var a = document.domain && document.domain.match(/schillmania.com/i) && "undefined" != typeof re_; 2356 loadScript("http://include.reinvigorate.net/re_.js"); 2357 setTimeout(function () 2358 { 2359 "undefined" != typeof re_ && re_(a ? "f6795-v062d0xv4u" : "u8v2l-jvr8058c6n") 2360 }, 3E3) 2361} 2362 2363function getDynamicData() 2364{ 2365 loadScript("http://www.schillmania.com/services/soundmanager2/info/?version=" + soundManager.versionNumber + "&rnd=" + parseInt(1048576 * Math.random())) 2366} 2367 2368function loadScript(a, c) 2369{ 2370 function b() 2371 { 2372 this.onload = this.onreadystatechange = null; 2373 window.setTimeout(c, 20) 2374 } 2375 var d = function () 2376 { 2377 var a = this.readyState; 2378 if ("loaded" == a || "complete" == a) this.onload = this.onreadystatechange = null, window.setTimeout(c, 20) 2379 }, 2380 f = document.createElement("script"); 2381 f.type = "text/javascript"; 2382 c && (f.onreadystatechange = d, f.onload = b); 2383 f.src = a; 2384 document.getElementsByTagName("head")[0].appendChild(f) 2385} 2386function doAltShortcuts() 2387{ 2388} 2389 2390function fixLinks() 2391{ 2392 if (document.location.protocol.match(/http/i)) return !1; 2393 for (var a = document.getElementsByTagName("a"), c = null, b = null, d = a.length; d--;) if (c = a[d].href.toString(), !c.match(/http/i) && !utils.hasClass(a[d], "norewrite") && (c.match(/doc/i) || c.match(/demo/i) || c.match(/../))) b = Math.max(c.lastIndexOf("?"), -1), b = Math.max(c.lastIndexOf("#"), b), b = Math.max(c.lastIndexOf("/") + 1, b), -1 == b && (b = c.length), c.match(/\.html/i) || a[d].setAttribute("href", c.substr(0, b) + "index.html" + c.substr(b)) 2394} 2395 2396function ie6Sucks() 2397{ 2398 if (!navigator.userAgent.match(/msie 6/i)) return !1; 2399 var a = _id("nav").getElementsByTagName("li")[1], 2400 c = a.getElementsByTagName("a")[0], 2401 b = a.getElementsByTagName("ul")[0]; 2402 c.onclick = function () 2403 { 2404 b.style.display = "block"; 2405 setTimeout(function () 2406 { 2407 document.onclick = function () 2408 { 2409 b.style.display = "none"; 2410 document.onclick = null 2411 } 2412 }, 20); 2413 return !1 2414 } 2415} 2416function doVersion() 2417{ 2418 var a = _id("version"); 2419 if (!a) return !1; 2420 a.innerHTML = soundManager.versionNumber 2421} 2422 2423function doChristmasLights() 2424{ 2425 IS_CHRISTMAS && (window.XLSF_URL_BASE = "demo/christmas-lights/", window.XLSF_LIGHT_CLASS = "pico", loadScript("demo/christmas-lights/christmaslights.js", function () 2426 { 2427 "undefined" != typeof smashInit && setTimeout(function () 2428 { 2429 smashInit() 2430 }, 20) 2431 })) 2432} 2433if (window.is_home) 2434{ 2435 soundManager.useHTML5Audio = !0; 2436 document.location.href.match(/sm2-usehtml5audio=1/i) ? soundManager.useHTML5Audio = !0 : document.location.href.match(/sm2-usehtml5audio=0/i) && (soundManager.useHTML5Audio = !1); 2437 soundManager.setup( 2438 { 2439 preferFlash: !1, 2440 useFlashBlock: !0, 2441 useHighPerformance: !0, 2442 bgColor: "#ffffff", 2443 debugMode: !1, 2444 url: "swf/", 2445 wmode: "transparent" 2446 }); 2447 var PP_CONFIG = 2448 { 2449 autoStart: !1, 2450 playNext: !0, 2451 useThrottling: !1, 2452 usePeakData: !0, 2453 useWaveformData: !1, 2454 useEQData: !1, 2455 useFavIcon: !1 2456 }; 2457 threeSixtyPlayer.config = 2458 { 2459 playNext: !1, 2460 autoPlay: !1, 2461 allowMultiple: !0, 2462 loadRingColor: "#ccc", 2463 playRingColor: "#000", 2464 backgroundRingColor: "#eee", 2465 circleDiameter: 256, 2466 circleRadius: 128, 2467 scaleArcWidth: 1, 2468 animDuration: 500, 2469 animTransition: Animator.tx.bouncy, 2470 showHMSTime: !0, 2471 useWaveformData: !0, 2472 waveformDataColor: "#0099ff", 2473 waveformDataDownsample: 2, 2474 waveformDataOutside: !1, 2475 waveformDataConstrain: !1, 2476 waveformDataLineRatio: 0.73, 2477 useEQData: !0, 2478 eqDataColor: "#339933", 2479 eqDataDownsample: 2, 2480 eqDataOutside: !0, 2481 eqDataLineRatio: 0.69, 2482 usePeakData: !0, 2483 peakDataColor: "#ff33ff", 2484 peakDataOutside: !0, 2485 peakDataLineRatio: 0.5, 2486 useAmplifier: !0 2487 }; 2488 navigator.platform.match(/win32/i) && navigator.userAgent.match(/firefox/i) && (soundManager.useHighPerformance = !1); 2489 var checkBadSafari = function () 2490 { 2491 var a = navigator.userAgent; 2492 !document.location.href.match(/sm2-usehtml5audio/i) && (!window.location.toString().match(/sm2\-ignorebadua/i) && a.match(/safari/i) && !a.match(/chrome/i) && a.match(/OS X 10_6_([3-7])/i)) && (a = document.createElement("li"), a.innerHTML = '<b>Note</b>: Partial HTML5 in effect. Using Flash for MP3/MP4 formats (if available) for this browser/OS due to HTML5 audio load/play failures in Safari 4 + 5 on Snow Leopard 10.6.3 - 10.6.7 (purportedly fixed in OS X 10.6.8 and 10.7 "Lion.") Issue caused by bugs in QuickTime X and/or underlying frameworks. See <a href="https://bugs.webkit.org/show_bug.cgi?id=32159#c9">bugs.webkit.org #32519</a>. (Safari on iOS, Leopard and Windows OK, however.) <p style="margin:0.5em 0px 0.5em 0px">Try <a href="?sm2-ignorebadua&sm2-usehtml5audio=1">HTML5 anyway?</a> (some MP3 playback may intermittently fail.)', _id("html5-audio-notes").appendChild(a)) 2493 }; 2494 soundManager.onready(function () 2495 { 2496 _id("sm2-support").style.display = "none"; 2497 _id("sm2-support-warning").style.display = "none"; 2498 soundManager.didFlashBlock && soundManager.createSound( 2499 { 2500 id: "success", 2501 url: "demo/_mp3/mouseover.mp3" 2502 }).play(); 2503 doChristmasLights(); 2504 var a, c = !1; 2505 a = navigator; 2506 var b = a.plugins, 2507 d, f = window.ActiveXObject; 2508 if (b && b.length)(a = a.mimeTypes) && (a["application/x-shockwave-flash"] && a["application/x-shockwave-flash"].enabledPlugin && a["application/x-shockwave-flash"].enabledPlugin.description) && (c = !0); 2509 else if ("undefined" !== typeof f) 2510 { 2511 try 2512 { 2513 d = new f("ShockwaveFlash.ShockwaveFlash") 2514 } 2515 catch (e) 2516 { 2517 } 2518 c = !! d 2519 } 2520 a = c; 2521 b = soundManager; 2522 if (b.useHTML5Audio && b.hasHTML5) 2523 { 2524 (c = document.getElementById("html5-support-li")) && c.parentNode.removeChild(c); 2525 d = document.createElement("div"); 2526 d.id = "html5-support-li"; 2527 d.className = "html5support"; 2528 c = []; 2529 f = !1; 2530 for (item in b.audioFormats) b.audioFormats.hasOwnProperty(item) && (f = soundManager.filePattern.test("." + item), c.push('<span class="' + (b.html5[item] ? "true" : "false") + (!b.html5[item] && f ? " partial" : "") + '" title="' + (b.html5[item] ? "Native HTML5 support found" : "No HTML5 support found" + (f ? ", using Flash fallback if present" : ", no Flash support either")) + '">' + (b.html5[item] ? "<" : "") + item + (b.html5[item] ? ">" : "") + "</span>")); 2531 d.innerHTML = ['<b>This browser\'s <em class="true"><HTML5></em> vs. <em class="partial">Flash</em>
2531 support:<p style="margin:0.5em 0px 0.5em 0px"></b>', c.join(""), '<br /><b class="note">', soundManager.html5.mp3 || soundManager.html5.mp4 ? a && soundManager.preferFlash ? 'Preferring flash for MP3/MP4; try <a href="?sm2-preferFlash=0" title="Try using soundManager.preferFlash=false to have HTML5 actually play MP3/MP4 formats and depending on support, run SM2 entirely without flash." class="cta">preferFlash=false</a> for HTML5-only mode.' : soundManager.html5Only ? "HTML5-only mode." + (!soundManager.canPlayMIME("audio/aac") ? ' Try <a href="?sm2-preferFlash=1,flash9" title="Try using soundManager.preferFlash=true to have Flash play MP3/MP4 formats." class="cta">preferFlash=true</a> for MP4 support as needed.' : "") : " Some flash required; allowing HTML5 to play MP3/MP4, as supported.</p>" : "Flash is required for this browser to play MP3/MP4.", "</b>"].join(""); 2532 _id("html5-audio-notes").appendChild(d); 2533 _id("without-html5").style.display = "inline" 2534 } 2535 else _id("without-html5").style.display = "none"; 2536 checkBadSafari(); 2537 c = utils.getElementsByClassName("button-exclude", "a", _id("inline-playlist")).concat(utils.getElementsByClassName("exclude", "a", _id("graphic-playlist"))); 2538 a = 0; 2539 for (b = c.length; a < b; a++) soundManager.canPlayLink(c[a]) || (c[a].className += " not-supported", c[a].title += ". \n\nNOTE: " + (soundManager.useHTML5Audio ? "Format apparently not supported under this configuration or browser." : "SoundManager 2's HTML5 feature is not currently enabled. (Try turning it on, see +html5 link.)")) 2540 }); 2541 soundManager.ontimeout(function () 2542 { 2543 if (navigator.userAgent.match(/msie 6/i)) return !1; 2544 var a = _id("sm2-support"), 2545 c = _id("sm2-support-warning"), 2546 b = '<div style="margin:0.5em;margin-top:-0.25em"><h3>Oh snap!</h3><p>' + (soundManager.hasHTML5 ? "The flash portion of " : "") + "SoundManager 2 was unable to start. " + (soundManager.useHTML5Audio ? soundManager.hasHTML5 ? "</p><p>Some HTML5 audio support is present, but flash is needed for MP3/MP4 support on this page." : "</p><p>No HTML5 support was found, so flash is required." : "") + '</p><p>All links to audio will degrade gracefully.</p><p id="flashblocker">If you have a flash blocker, try allowing the SWF to run - it may be visible below.</p><p id="flash-offline">' + (soundManager.useAltURL ? "<b>Viewing offline</b>? You may need to change a Flash security setting." : "Other possible causes: Missing .SWF, or no Flash?") + ' Not to worry, as guided help is provided.</p><p><a href="doc/getstarted/index.html#troubleshooting" class="feature-hot" style="display:inline-block;margin-left:0px">Troubleshooting</a></p></div>', 2547 d = navigator.userAgent.match(/(ipad|iphone|ipod)/i); 2548 if (soundManager.html5.mp3 && soundManager.html5.mp4) return soundManager._wD("Special homepage case: Flash appears to blocked, HTML5 support for MP3/MP4 exists; trying HTML5-only mode..."), soundManager.useHTML5Audio = !0, soundManager.preferFlash = !1, setTimeout(function () 2549 { 2550 soundManager.reboot(); 2551 soundManager.onready(function () 2552 { 2553 a.innerHTML = '<div style="margin:0.5em;margin-top:-0.25em"><h3>Support note</h3><p>SoundManager 2 tried to start using HTML5 + Flash, but rebooted in HTML5-only mode as flash was blocked. Visualization demo features will not be shown in this mode. To enable flash, whitelist the blocked movie and reload this page.</p>' + (soundManager.useAltURL ? '<p><b>Running offline?</b> Flash may be blocked due to security restrictions; see <a href="doc/getstarted/index.html#troubleshooting">troubleshooting</a> for more.' : "") + "</div>"; 2554 a.style.marginBottom = "1.5em"; 2555 a.style.display = "block" 2556 }) 2557 }, 1), !1; 2558 a.innerHTML = b; 2559 c.innerHTML = '<p style="margin:0px">SoundManager 2 could not start. <a href="#sm2-support">See below</a> for details.</p>'; 2560 if (d || soundManager.getMoviePercent()) _id("flashblocker").style.display = "none", d && (_id("flash-offline").style.display = "none"); 2561 a.style.marginBottom = "1.5em"; 2562 a.style.display = "block"; 2563 c.style.display = "inline-block" 2564 }) 2565} 2566 2567function startStuff() 2568{ 2569 navigator.userAgent.match(/safari/i) && (document.getElementsByTagName("html")[0].className = "isSafari"); 2570 doVersion(); 2571 ie6Sucks(); 2572 fixLinks(); 2573 getLiveData();
2574 doAltShortcuts() 2575} 2576document.addEventListener ? document.addEventListener("DOMContentLoaded", startStuff, !1) : window.onload = startStuff;
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.