Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

i can't believe i just committed this stuff publicly

  • Loading branch information...
commit 2146650aed2ac18b60bc68b801ef7e7d1707a04d 0 parents
@jessevondoom jessevondoom authored
Showing with 7,923 additions and 0 deletions.
  1. +35 −0 README.md
  2. +12 −0 misc/adddownloadcodes.php
  3. +28 −0 misc/uploadasset.php
  4. +2 −0  securestreams/.htaccess
  5. +34 −0 securestreams/publicfacing/assets/css/main.css
  6. BIN  securestreams/publicfacing/assets/images/cash.png
  7. +4 −0 securestreams/publicfacing/assets/scripts/flower/enhancements/flower_anchor.js
  8. +6 −0 securestreams/publicfacing/assets/scripts/flower/flower_core.js
  9. +9 −0 securestreams/publicfacing/assets/scripts/flower/flower_init.js
  10. +7 −0 securestreams/publicfacing/assets/scripts/flower/media/flower_imagebox.js
  11. +1 −0  securestreams/publicfacing/assets/scripts/flower/media/flower_moviebox.js
  12. +4 −0 securestreams/publicfacing/assets/scripts/flower/media/flower_overlay.js
  13. BIN  securestreams/publicfacing/assets/scripts/flower/soundplayer/assets/defaultSoundPlayerUI/images/next.png
  14. BIN  securestreams/publicfacing/assets/scripts/flower/soundplayer/assets/defaultSoundPlayerUI/images/pause.png
  15. BIN  securestreams/publicfacing/assets/scripts/flower/soundplayer/assets/defaultSoundPlayerUI/images/play.png
  16. BIN  securestreams/publicfacing/assets/scripts/flower/soundplayer/assets/defaultSoundPlayerUI/images/previous.png
  17. +18 −0 securestreams/publicfacing/assets/scripts/flower/soundplayer/flower_soundplayer.js
  18. +95 −0 securestreams/publicfacing/assets/scripts/flower/soundplayer/lib/soundmanager2/soundmanager2-jsmin.js
  19. +72 −0 securestreams/publicfacing/assets/scripts/flower/soundplayer/lib/soundmanager2/soundmanager2-nodebug-jsmin.js
  20. +2,766 −0 securestreams/publicfacing/assets/scripts/flower/soundplayer/lib/soundmanager2/soundmanager2.js
  21. +95 −0 securestreams/publicfacing/assets/scripts/flower/soundplayer/lib/soundmanager2/stable/soundmanager2-jsmin.js
  22. +72 −0 ...eams/publicfacing/assets/scripts/flower/soundplayer/lib/soundmanager2/stable/soundmanager2-nodebug-jsmin.js
  23. +2,780 −0 securestreams/publicfacing/assets/scripts/flower/soundplayer/lib/soundmanager2/stable/soundmanager2.js
  24. BIN  securestreams/publicfacing/assets/scripts/flower/soundplayer/lib/soundmanager2/swf/soundmanager2.swf
  25. BIN  securestreams/publicfacing/assets/scripts/flower/soundplayer/lib/soundmanager2/swf/soundmanager2_debug.swf
  26. BIN  securestreams/publicfacing/assets/scripts/flower/soundplayer/lib/soundmanager2/swf/soundmanager2_flash9.swf
  27. BIN  ...streams/publicfacing/assets/scripts/flower/soundplayer/lib/soundmanager2/swf/soundmanager2_flash9_debug.swf
  28. BIN  ...treams/publicfacing/assets/scripts/flower/soundplayer/lib/soundmanager2/swf/soundmanager2_flash_xdomain.zip
  29. +2 −0  securestreams/publicfacing/assets/scripts/flower/utility/flower_utility.js
  30. +32 −0 securestreams/publicfacing/assets/scripts/securestream_flower_init.js
  31. +68 −0 securestreams/publicfacing/classes/SecureStream.php
  32. +33 −0 securestreams/publicfacing/config.php
  33. +94 −0 securestreams/publicfacing/index.php
  34. +28 −0 securestreams/publicfacing/track.php
  35. +20 −0 securestreams/publicfacing/unlock.php
  36. BIN  securestreams/v1admin/images/cashlogo.gif
  37. +23 −0 securestreams/v1admin/scripts/hg_init.js
  38. +60 −0 securestreams/v1admin/scripts/securestreams.js
  39. +334 −0 securestreams/v1admin/securestreams.php
  40. BIN  securestreams/v1admin/ss1.png
  41. BIN  securestreams/v1admin/ss2.png
  42. BIN  securestreams/v1admin/ss3.png
  43. BIN  securestreams/v1admin/ss4.png
  44. +1,189 −0 v1corefunctions/core.php
35 README.md
@@ -0,0 +1,35 @@
+#Some Old Bullshit#
+This is a collection of various scripts that need to be (or are in the process
+of being) ported to the new platform. Generally that means taking bunches of
+functions and creating proper objects, leveraging underlying functionality, and
+cleaning up scratch code that should never have made it into production as-is.
+
+There's some code that's decent, but most of the core.php stuff was written in
+an extreme hurry responding to one last-minute request or another.
+
+Index:
+
+##v1corefunctions##
+This is a single file of functions that's used by a lot of the early CASH stuff.
+Some newer projects use it too, but mostly for the db connection and little else.
+It's a mess, but a lot of the raw code needed for objects in the DIY platform
+has either come from here or will, and creating decent OO code from the functions
+has actually been pretty okay.
+
+##securestreams##
+The 'publicfacing' directory is the latest revision of the php/javascript used
+to power the secure stream stuff. It's pretty tidy, easy to work with, and aside
+from minor dependencies on the core.php file for DB connections I'd say it's
+not awful code. The JS init works nicely with the 1.0 version of the CASH JS
+lib (ex-Flower) and we should be able to push this into the platform very nicely.
+
+The 'v1admin' is an utter piece of shit. It won't be hard to improve upon for
+the platform, but I wanted to include reference to the way it was. Screenshots
+are included so no one has to go through the pain and suffering of reading the
+code.
+
+##misc##
+Two small scripts: one to add a defined number of download codes for a specific
+asset, and one to upload an asset to s3 with the correct content disposition
+header (attachment) for forcing download instead of in-browser display of media
+content on direct request.
12 misc/adddownloadcodes.php
@@ -0,0 +1,12 @@
+<?php
+ // outputs a basic CSV file for download codes
+ include_once('./path/to/core/core.php');
+ $go = false;
+ if ($go) {
+ for ($i=1; $i<=100; $i++) {
+ $download_id = 0; // id of download
+ $download_code = dl_addNewDownloadCode($download_id);
+ echo $download_id . $download_code . "\n";
+ }
+ }
+?>
28 misc/uploadasset.php
@@ -0,0 +1,28 @@
+<?php
+ // uploads a file to s3 with attachment disposition
+ // (forces download for MP3, instead of play-in-browser)
+ require_once('../../settings/S3.php');
+
+ if (!defined('awsAccessKey')) define('awsAccessKey', 's3key');
+ if (!defined('awsSecretKey')) define('awsSecretKey', 's3secretkey');
+
+ // Instantiate the class
+ $s3 = new S3(awsAccessKey, awsSecretKey);
+
+ $bucket = 'bucketname';
+ $uri = 'url/for/asset/inside/bucket/name.mp3';
+
+ // PUT with custom headers:
+
+ $put = S3::putObject(
+ S3::inputFile('./path/to/loca/file/name.mp3'),
+ $bucket,
+ $uri,
+ S3::ACL_PUBLIC_READ,
+ array(),
+ array( // Custom $requestHeaders
+ "Content-Disposition" => "attachment;filename=name.mp3"
+ )
+ );
+ var_dump($put); // spits out true/fase. that's some high-tech shit right there
+?>
2  securestreams/.htaccess
@@ -0,0 +1,2 @@
+RewriteEngine on
+RewriteRule ^track.mp3$ track.php
34 securestreams/publicfacing/assets/css/main.css
@@ -0,0 +1,34 @@
+/* RESETS */
+html,body {margin:0;padding:0;}
+body {background-color:#000;font:75%/1.5em 'helvetica neue',helvetica,arial,sans-serif;color:#fff;text-align:left;}
+img {border:0;}
+a {color:#ffe400;text-decoration:none;}
+a:hover {text-decoration:none;color:#fff;}
+p {margin:0 0 1em 0;}
+
+h1 {text-transform:uppercase;font-family:'helvetica neue',helvetica,arial,sans-serif;font-size:3.75em;margin:0;color:#fff;}
+h2 {text-transform:uppercase;font-weight:normal;font-size:0.85em;margin-top:12px;}
+
+/* PAGE-SPECIFIC IDS */
+#mainspc {position:relative;top:0;left:0;width:280px;margin:0 auto;padding:90px 0 0 0;}
+#playerspc,#loginspc {margin-top:40px;}
+#infospc,#helpspc {margin-top:60px;font-size:0.8em;}
+#errorspc {color:#300;font-weight:bold;}
+
+/* PAGE-SPECIFIC CLASSES */
+.clearall {height:1px;overflow:hidden;visibility:hidden;clear:both;}
+
+/* PLAYER-SPECIFICS */
+.flower_soundplaylist {color:#fff;}
+.flower_soundplayer_title {color:#000;width:auto;float:left;font-weight:bold;}
+.flower_soundplayer_time {width:auto;float:right;color:#444;font-size:0.6em;}
+.flower_soundplayer_seekbarcontainer {clear:both;background-color:#ad766a !important;}
+.flower_soundplayer_seekbar {background-color:#ffa956 !important;}
+.flower_soundplayer_positionmarker {background-color:#fff !important;}
+
+/* FORM STUFFS */
+input, textarea {padding:0.42em 4px 0.42em 4px;border:1px solid #777;width:195px;}
+input:active, input:focus, textarea:active, textarea:focus {outline:0;border:1px solid #888;}
+input.button {display:block;background-color:#404040;color:#ccc;padding:0.42em 10px 0.42em 10px;font-weight:bold;cursor:pointer;width:auto;margin-top:30px;}
+input.button:hover {background-color:#000;}
+label {display:block;margin:0;padding:0;font-size:0.8em;text-transform:uppercase;color:#000;}
BIN  securestreams/publicfacing/assets/images/cash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 securestreams/publicfacing/assets/scripts/flower/enhancements/flower_anchor.js
@@ -0,0 +1,4 @@
+var FlowerLinkExternal=new Class({initialize:function(){this.name="linkexternal";this.version=1.1},attachToElement:function(a){a.removeEvents("click");a.addEvent("click",function(c){var b=a.getProperty("href");c.stop();window.open(b,"flower_"+$random(10000,99999))})}});var FlowerLinkPopup=new Class({initialize:function(){this.name="linkpopup";this.version=1;this.openoptions="width=480,height=320,scrollbars=yes,resizable=yes,location=no,directories=no,status=no"},attachToElement:function(c){var b=c.getProperty("rev"),a=this.openoptions;c.removeEvents("click");if(b){if(b.contains("popup:")){a=b.substring(6,b.length)}}c.addEvent("click",function(f){var d=c.getProperty("href");f.stop();window.open(d,"flower_external"+$random(10000,99999),a)}.bind(this))}});var FlowerLinkInside=new Class({initialize:function(){this.name="linkinside";this.version=1.2},attachToElement:function(a){a.removeEvents("click");a.addEvent("click",function(i){i.stop();var h="",f="",d=a.getProperty("href"),g=a.getProperty("rev"),j=false,c,b;if(d.contains("?")){h=d.split("?")[1];d=d.split("?")[0]}if(g){if(g.contains("linkinside:")){$A(g.substring(11,g.length).split(",")).each(function(e){c=e.split("=");if(c[0]=="target"){f=c[1]
+}})}if(f=="parent"){j=true}else{if(!f){f=document.id(f)}}}if(!f||f=="parent"){f=document.id(a.getParent());if(!j){while(f.getTag()!="div"){f=f.getParent()}}}b=new Request.HTML({url:d,update:f,data:h,onSuccess:function(){if(this.flowerCore){this.flowerCore.htmlContentChanged(f)}}.bind(this)}).get()}.bind(this))}});var FlowerDrawer=new Class({Implements:Options,options:{closeOnAttach:false},initialize:function(a){this.name="drawer";this.version=1;this.setOptions(a)},closedrawer:function(a){a.setStyle("height",1);a.setStyle("display","none");a.store("FlowerDrawer_state",1)},toggle:function(a,c){var b;if(a.retrieve("FlowerDrawer_state")==11){b=a.getScrollSize().y;a.store("FlowerDrawer_state",10);a.setStyle("height",b);a.get("tween",{property:"height",duration:250,link:"cancel"}).start(b,1).chain(function(){a.setStyle("display","none");a.store("FlowerDrawer_state",1);var d=a.retrieve("FlowerDrawer_altText");if(d){a.store("FlowerDrawer_altText",c.get("html"));c.set("html",d)}}.bind(this))}else{if(a.retrieve("FlowerDrawer_state")==1){a.store("FlowerDrawer_state",10);a.setStyle("display","block");b=a.getScrollSize().y;a.get("tween",{property:"height",duration:250,link:"cancel"}).start(1,b).chain(function(){a.setStyle("height","auto");
+a.store("FlowerDrawer_state",11);var d=a.retrieve("FlowerDrawer_altText");if(d){a.store("FlowerDrawer_altText",c.get("html"));c.set("html",d)}}.bind(this))}}},attachToElement:function(d){var c=d.getProperty("rev"),b=false,g=false,e=false,a;if(c){if(c.contains("drawer:")){$A(c.substring(7,c.length).split(",")).each(function(i){var h=i.split("=");switch(h[0]){case"target":if(h[1]){b=document.id(h[1])}break;case"hideLink":if(h[1]){g=h[1]}break;case"altLinkText":if(h[1]){e=h[1]}break}})}if(b){var f=b.getStyle("position");if(f!="absolute"&&f!="relative"&&f!="fixed"){b.setStyles({position:"relative",overflow:"hidden"})}else{b.setStyle("overflow","hidden")}if(e){b.store("FlowerDrawer_altText",e)}d.removeEvents("click");d.setStyle("cursor","pointer");if(b.currentStyle){a=b.currentStyle.display}else{a=document.defaultView.getComputedStyle(b,null);if(a!==null){a=a.getPropertyValue("display")}else{a="none"}}if(a=="none"){this.closedrawer(b)}else{b.store("FlowerDrawer_state",11);if(this.options.closeOnAttach){this.toggle(b,d)}}d.addEvent("click",function(i){var h;i.stop();this.toggle(b,d);if(g){d.setStyle("display","none")}}.bind(this))}else{if(this.debugMsg){this.debugMsg(1,"invalid target specified")
+}}}else{if(this.debugMsg){this.debugMsg(1,'a target must be specified (rev="drawer:target=elementId") with a toggle anchor')}}}});window.addEvent("domready",function(){if(typeof(flowerUID)=="object"){flowerUID.registerModule(FlowerLinkExternal,"linkexternal");flowerUID.registerModule(FlowerLinkPopup,"linkpopup");flowerUID.registerModule(FlowerLinkInside,"linkinside");flowerUID.registerModule(FlowerDrawer,"drawer")}else{var c=new FlowerLinkExternal(),d=new FlowerLinkPopup(),a=new FlowerLinkInside(),b=new FlowerLinkInside();$$("a.external").each(function(e){c.attachToElement(e)});$$("a.popup").each(function(e){d.attachToElement(e)});$$("a.flower_linkinside").each(function(e){a.attachToElement(e)});$$("a.flower_drawertoggle").each(function(e){b.attachToElement(e)})}});
6 securestreams/publicfacing/assets/scripts/flower/flower_core.js
@@ -0,0 +1,6 @@
+var FlowerDebug=new Class({debug:0,flowerCore:false,setFlowerCore:function(b){this.flowerCore=b;this.debug=this.flowerCore.debug;if(typeof(a)!="object"){var a={}}if(!a.log){a.log=function(){}}if(!a.warn){a.warn=a.log}if(!a.error){a.error=a.warn}},debugMsg:function(b,d){if(this.debug){var a="",c;b=b+0;if(this.flowerCore&&this.name){a="["+this.name+"] "}c=["Flower Error: ","Flower Warning: ","Flower Notice: "];switch(b){case 0:console.error(c[b]+a+d);break;case 1:console.warn(c[b]+a+d);break;default:console.log(c[b]+a+d)}}},debugLoadMsg:function(){if(this.debug){var a="Flower Module Loaded: "+this.name+" (v"+this.version+")",b=this.listAllOptions();if(b){a+="\n\tOptions:\n\t"+b}console.log(a.replace(/, /g,"\n\t"))}},listAllOptions:function(){if(!this.donotdebugoptions){var b="",a="",c="";$H(this.options).each(function(e,d){if(typeof(e)=="string"){c="'"}b+=a+d+" = "+c+e+c;a=", ";c=""});if(b){return b}else{return false}}else{return false}}});var FlowerCore=new Class({Implements:[Options,Events,FlowerDebug],options:{debug:0,autoBoot:0,timeout:500},initialize:function(a){this.setOptions(a);this.name="Flower";this.version=1;this.modules=$H();this.commonCache=$H();this.injectedFiles=[];this.debug=0;
+this.timeout=this.options.timeout;this.documenthead=$$("head")[0];var b=this.documenthead.getElement("script[src*=flower_core.js]");if(b){var c=b.getProperty("src");this.libpath=c.substring(0,c.lastIndexOf("/")+1)}$$("*.ifjs_visibilityhidden","div.flower_soundplayer").each(function(e){e.setStyle("visibility","hidden")});$$("*.ifjs_visibilityvisible").each(function(e){e.setStyle("visibility","visible")});$$("*.ifjs_displaynone").each(function(e){e.setStyle("display","none")});$$("*.ifjs_displayblock").each(function(e){e.setStyle("display","block")});$$("*.ifjs_displayinline").each(function(e){e.setStyle("display","inline")});this.defineLibrary();if(this.options.autoBoot){this.bootstrap()}if(this.options.debug&&typeof(console)!="undefined"){this.debug=1;var d=this.listAllOptions();if(this.libpath){console.log("Flower (v"+this.version+") loaded.\n\tPath: '"+this.libpath+"'\n\tMooTools version: "+MooTools.version+"\n\tOptions: "+d)}else{console.log("Flower loaded with errors. Version: "+this.version+' Path unknown. Please make sure the flower core JS file is named "flower_core.js"\n\tOptions: '+d)}}},injectScript:function(a,b){var c;if(b){a=this.libpath+a}if(this.injectedFiles.indexOf(a)==-1){c=new Element("script",{type:"text/javascript",src:a}).injectInside(this.documenthead);
+this.injectedFiles.push(a)}},htmlContentChanged:function(a){this.allModulesAutoAttach(a);this.fireEvent("htmlChanged",a)},storeModule:function(c,b,g,f,e,a){var d={path:c,dependencies:g,autoLaunch:f,attach:e,relativePath:a,pointer:null,options:null};this.modules.set(b,d)},loadModule:function(a){var c=this.modules.get(a),b;if(c){if(c.pointer===null){if(c.dependencies){b=$A(c.dependencies.split(","));b.each(function(d){if(this.modules.get(d).pointer===null){this.loadModule(d)}}.bind(this));this.loadAfterDependencies(a,b,0)}else{this.injectScript(c.path,c.relativePath)}}else{this.debugMsg(2,"requested module ('"+a+"') already loaded");return false}}else{this.debugMsg(0,"requested module ('"+a+"') is not defined, cannot load");return false}},loadAfterDependencies:function(c,h,f){var b=h.length,g=0,a,e,d;h.each(function(i){if(this.modules.get(i).pointer){g++}}.bind(this));if(g<b){if(f<this.timeout){a=f+100;e=[c,h,a];this.loadAfterDependencies.delay(100,this,e)}else{this.debugMsg(0,"requested module ('"+c+"') could not load, dependency loading exceeded timeout")}}else{d=this.modules.get(c);this.injectScript(d.path,d.relativePath)}},getModule:function(b){var a=this.modules.get(b);if(a){return a.pointer
+}else{return null}},getModuleOptions:function(b){var a=this.modules.get(b);if(a){return a.options}else{return null}},setModuleOptions:function(a,b){var c=this.modules.get(a);if(c){c.options=b}this.modules.set(a,c)},setModulePointer:function(b,a){var c=this.modules.get(b);if(c){c.pointer=a}this.modules.set(b,c)},moduleCallback:function(a){if(typeof(a)=="object"){if(this.modules.has(a.name)){this.setModulePointer(a.name,a)}else{this.storeModule(0,a.name,0);this.setModulePointer(a.name,a)}this.fireEvent("moduleLoad",a.name);a.debugLoadMsg();this.moduleAutoAttach(a.name)}else{this.debugMsg(0,"moduleCallback() must be provided with an object")}},moduleAutoAttach:function(b,d){var c=this.modules.get(b),a,e;if(c.autoLaunch&&c.attach&&typeof(c.pointer.attachToElement)=="function"){a=$A(c.autoLaunch.split(","));e=$$(a);if(e.length>0){if(!d){$$(a).each(function(f){c.pointer.attachToElement(f)})}else{a.each(function(f){document.id(d).getElements(f).each(function(g){c.pointer.attachToElement(g)})})}}}},allModulesAutoAttach:function(a){this.modules.each(function(c,b){if(c.autoLaunch&&c.pointer){if(!a){this.moduleAutoAttach(b)}else{this.moduleAutoAttach(b,a)}}}.bind(this))},registerModule:function(d,c,a){d.implement(new FlowerDebug());
+var b=this.getModuleOptions(c),e;if(b){e=new d(b)}else{e=new d()}e.setFlowerCore(this);if(a==true){return e}else{this.moduleCallback(e)}},bootstrap:function(){var b=[],a;this.modules.each(function(d,c){if(d.autoLaunch&&!d.pointer){a=$A(d.autoLaunch.split(","));if($$(a).length>0){this.loadModule(c);b.push(c)}}}.bind(this));if(b.length>0){this.debugMsg(2,"boot started, attempting to load necessary modules:"+b.join("\n\t"))}this.checkBootStatus(b,0)},checkBootStatus:function(a,d){if(a.length==0){this.fireEvent("bootComplete",true)}else{var f=a.length,e=0,b,c;a.each(function(g){if(this.modules.get(g).pointer){e++}}.bind(this));if(e<f){if(d<(this.timeout+2000)){b=d+100;c=[a,b];this.checkBootStatus.delay(100,this,c)}else{this.fireEvent("bootComplete",false);this.debugMsg(1,"boot failure, could not load all modules")}}else{this.fireEvent("bootComplete",true);this.debugMsg(2,"boot successfully completed")}}},defineLibrary:function(){this.storeModule("enhancements/flower_anchor.js","linkexternal",0,"a.external",1,1);this.storeModule("enhancements/flower_anchor.js","linkpopup",0,"a.popup",1,1);this.storeModule("enhancements/flower_anchor.js","linkinside",0,"a.flower_linkinside",1,1);this.storeModule("enhancements/flower_anchor.js","drawer",0,"a.flower_drawertoggle",1,1);
+this.storeModule("utility/flower_utility.js","utility",0,0,0,1);this.storeModule("media/flower_overlay.js","overlay",0,0,0,1);this.storeModule("media/flower_imagebox.js","imagebox","utility,overlay","a.flower_imagebox,div.flower_imagebox",1,1);this.storeModule("media/flower_moviebox.js","moviebox","utility,overlay","a[href$=.mov],a[href$=.mp4],a[href$=.MOV],a[href$=.MP4],a[href^=http://www.youtube.com/watch?v],a[href^=http://youtube.com/watch?v],a[href^=http://vimeo.com/],a[href^=http://www.vimeo.com/],a[href^=http://video.google.com/videoplay?docid],a[href^=http://myspacetv.com/index.cfm?fuseaction=vids.individual&videoid],a[href^=http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid],a[href^=http://www.vevo.com/watch]",1,1);this.storeModule("soundplayer/flower_soundplayer.js","soundplayer",0,"*.flower_soundplayer,div.flower_soundplayer_pageplayer",1,1)},clearAutoLoad:function(a){var b=this.modules.get(a);b.autoLaunch=0},addToAutoLoad:function(a,c){var b=this.modules.get(a);if(b.autoLaunch){b.autoLaunch+=(","+c)}else{b.autoLaunch=c}}});
9 securestreams/publicfacing/assets/scripts/flower/flower_init.js
@@ -0,0 +1,9 @@
+/*
+CASH Music Flower bootstrap script
+more information/downloads available at: http://cashmusic.org/tools/
+*/
+var flowerUID;
+window.addEvent('domready', function(){
+ flowerUID = new FlowerCore();
+ flowerUID.bootstrap();
+});
7 securestreams/publicfacing/assets/scripts/flower/media/flower_imagebox.js
@@ -0,0 +1,7 @@
+var FlowerImagebox=new Class({Extends:FlowerOverlay,Implements:Options,options:{contentspcbg:"#ffffff",boxwidth:60,boxheight:60,fixedSize:false,fullPreload:false},initialize:function(a){this.name="imagebox";this.version=1;this.donotdebugoptions=false;this.ismobile=flowerUID.getModule("utility").checkForMobile();this.state=0;this.setOptions(a);this.caption="";this.renderboxheight=this.options.boxheight;this.renderboxwidth=this.options.boxwidth;this.collections=$H();this.newCollection("default");this.addKeyEvents();this.computeMaxSize()},attachToElement:function(b){if(!this.ismobile){if(b.get("tag")=="a"){this.addFromLink(b,"default")}else{if(b.get("tag")=="div"){var c="default",a=b.get("id");if(a){c=a}b.getElements("a[href*=.jpg],a[href*=.jpeg],a[href*=.gif],a[href*=.png]").each(function(d){this.addFromLink(d,c)}.bind(this))}}}},addFromLink:function(a,b){a.removeEvents("click");var g=a.getProperty("href"),e=a.getProperty("title"),f=a.getProperty("rev"),h=0,i=0,d="featured imgage",j,c;if(f){if(f.contains("imagebox:")){$A(f.substring(9,f.length).split(",")).each(function(l){var k=l.split("=");switch(k[0]){case"width":if(k[1]){h=k[1]}break;case"height":if(k[1]){i=k[1]}break;case"alt":if(k[1]){d=k[1]
+}break;case"collection":if(k[1]){b=k[1]}break}}.bind(this))}}if(!this.collections.get(b)){this.newCollection(b)}c=g;this.addToCollection(b,g,e,d,h,i,a);a.addEvent("click",function(k){this.showImage(b,g);k.stop()}.bind(this))},showImage:function(a,b){this.currentCollection=a;this.collections.get(a).set("currentKey",b);if(this.state==0){this.createDomElements();this.resizeContentSpc=new Fx.Morph(this.overlayContentSpc,{duration:400});this.fadeOverlayCaptionSpc=new Fx.Tween(this.overlayCaptionSpc,{property:"opacity",duration:100,link:"cancel"});this.createImages();this.currentImg.fade("hide");this.state=1}this.showOverlay()},addControlElements:function(){this.parent();this.overlayCloseLink.set("html","close <small>[esc]</small>");this.overlayPrevLink=new Element("a",{"class":"flower_overlay_controllink",styles:{color:this.options.linkcolor,margin:"0 1.3em 0 0",cursor:"pointer"},html:"previous <small>[&#8592;]</small>",events:{mouseover:function(a){this.overlayPrevLink.setStyle("color",this.options.linkovercolor)}.bind(this),mouseout:function(a){this.overlayPrevLink.setStyle("color",this.options.linkcolor)}.bind(this),click:function(a){this.previousImage();a.stop()}.bind(this)}}).inject(this.overlayCloseLink,"before");
+this.overlayNextLink=new Element("a",{"class":"flower_overlay_controllink",styles:{color:this.options.linkcolor,margin:"0 0 0 1.3em",cursor:"pointer"},html:"next <small>[&#8594;]</small>",events:{mouseover:function(a){this.overlayNextLink.setStyle("color",this.options.linkovercolor)}.bind(this),mouseout:function(a){this.overlayNextLink.setStyle("color",this.options.linkcolor)}.bind(this),click:function(a){this.nextImage();a.stop()}.bind(this)}}).inject(this.overlayCloseLink,"after")},addKeyEvents:function(){document.addEvent("keydown",function(a){if(this.state==11){switch(a.key){case"left":this.previousImage();break;case"right":this.nextImage();break;case"esc":this.hideOverlay();break}}}.bind(this))},computeMaxSize:function(){var a=window.getSize();this.maxSize=$H({x:a.x-80,y:a.y-120})},newCollection:function(a){this.collections.set(a,$H());this.collections.get(a).set("order",[]);this.collections.get(a).set("currentKey",0)},addToCollection:function(d,f,g,h,i,c,b){var a,e=this.collections.get(d);a=$H({el:b,href:f,caption:g,alt:h,w:i,h:c,loaded:-1});e.set(f,a);e.get("order").push(f);if(this.options.fullPreload){this.preloadAndMeasure(d,f)}},preloadAndMeasure:function(c,e){var g=this.collections.get(c).get(e),f,b,a,d;
+if(g&&g.get("loaded")==-1){g.set("loaded",0);f=g.get("href");b=g.get("w");a=g.get("h");d=new Image();d.onload=function(){if(b==0||a==0){g.set("w",d.width);g.set("h",d.height)}g.set("loaded",1);if(this.debugMsg){this.debugMsg(1,'loaded "'+d.src+'" in collection "'+c+'"')}};d.onerror=function(){var h=this.collections.get(c);if(h.get(f).get("el")){h.get(f).get("el").removeEvents("click")}h.erase(e);h.get("order").erase(e);if(this.debugMsg){this.debugMsg(1,'cannot load "'+d.src+'", removing it from collection "'+c+'"')}}.bind(this);d.src=f}},createImages:function(){this.currentImg=new Element("img",{"class":"flower_imagebox_img",src:"",alt:"",styles:{visibility:"hidden",position:"relative",width:"100%",height:"100%","z-index":10}}).inject(this.overlayContentSpc);this.currentImg.addEvent("click",function(){this.nextImage()}.bind(this));this.fadeCurrentImage=new Fx.Tween(this.currentImg,{property:"opacity",duration:200,link:"chain"})},changeImage:function(d,h){var e=this.collections.get(d),a=e.get(h);e.set("currentKey",h);if(!a){if(e.getLength()>0){this.nextImage()}else{this.state=11;this.hideOverlay()}}else{if(a.get("loaded")<1){this.state=11;this.preloadAndMeasure(d,h);(function(){this.changeImage(d,h)
+}.bind(this)).delay(100)}else{this.state=10;this.preloadAndMeasure(d,e.get("order")[this.nextPlace()]);this.preloadAndMeasure(d,e.get("order")[this.previousPlace()]);this.fadeCurrentImage.start(0);if(!this.options.fixedSize){this.computeMaxSize();if(a.get("w")==0){this.renderboxwidth=this.options.boxwidth}else{this.renderboxwidth=a.get("w")}if(a.get("h")==0){this.renderboxheight=this.options.boxheight}else{this.renderboxheight=a.get("h")}var g=this.maxSize.get("x"),f=this.maxSize.get("y");if(this.renderboxwidth>g||this.renderboxheight>f){var c=this.renderboxwidth,b=this.renderboxheight,j=c-g,i=b-f;if(j>i){this.renderboxwidth=g;this.renderboxheight=(b*(g/c)).round()}else{this.renderboxheight=f;this.renderboxwidth=(c*(f/b)).round()}}}this.caption=a.get("caption");this.currentImg.set("alt",a.get("alt"));this.fadeOverlayCaptionSpc.set(0);this.positionCaption();this.state=10;this.resizeContentSpc.start({height:this.renderboxheight,width:this.renderboxwidth,"margin-top":(0-(this.renderboxheight/2)-this.options.borderwidth),"margin-left":(0-(this.renderboxwidth/2)-this.options.borderwidth)}).chain(function(){this.currentImg.src=a.get("href");(function(){this.fadeCurrentImage.start(1).chain(function(){this.state=11
+}.bind(this));this.fadeOverlayCaptionSpc.start(1)}.bind(this)).delay(120)}.bind(this))}}},nextPlace:function(){var c=this.collections.get(this.currentCollection),b=c.get("order").length,a=0;if(c.get("order").indexOf(c.get("currentKey"))+2<=b){a=c.get("order").indexOf(c.get("currentKey"))+1}return a},previousPlace:function(){var c=this.collections.get(this.currentCollection),a=c.get("order").length,b;if(c.get("order").indexOf(c.get("currentKey"))>0){b=c.get("order").indexOf(c.get("currentKey"))-1}else{b=a-1}return b},nextImage:function(){if(this.state==11){var b=this.collections.get(this.currentCollection),a=b.get("order").length;if(a>1){this.changeImage(this.currentCollection,b.get("order")[this.nextPlace()])}}},previousImage:function(){if(this.state==11){var b=this.collections.get(this.currentCollection),a=b.get("order").length;if(a>1){this.changeImage(this.currentCollection,b.get("order")[this.previousPlace()])}}},showOverlay:function(){if(this.state==1){if(this.collections.get(this.currentCollection).get("order").length<2){this.overlayPrevLink.setStyle("display","none");this.overlayNextLink.setStyle("display","none")}this.parent();this.state=10}},showContent:function(){this.fadeCurrentImage.set(0);
+this.changeImage(this.currentCollection,this.collections.get(this.currentCollection).get("currentKey"))},hideOverlay:function(){if(this.state==11){this.currentImg.setStyle("visibility","hidden");this.currentImg.src="";if(!this.options.fixedSize){this.renderboxheight=this.options.boxheight;this.renderboxwidth=this.options.boxwidth;this.overlayContentSpc.setStyles({height:this.renderboxheight,width:this.renderboxwidth,"margin-top":(0-(this.renderboxheight/2)),"margin-left":(0-(this.renderboxwidth/2))})}this.overlayCaptionSpc.fade("hide");this.parent();if(this.collections.get(this.currentCollection).getLength()<2){this.overlayPrevLink.setStyle("display","inline");this.overlayNextLink.setStyle("display","inline")}this.state=1}}});window.addEvent("domready",function(){if(typeof(flowerUID)=="object"){flowerUID.registerModule(FlowerImagebox,"imagebox")}else{var a=new FlowerImagebox();$$("a.flower_imagebox,div.flower_imagebox").each(function(b){a.attachToElement(b)})}});
1  securestreams/publicfacing/assets/scripts/flower/media/flower_moviebox.js
@@ -0,0 +1 @@
+var FlowerMoviebox=new Class({Extends:FlowerOverlay,Implements:[Options,Events],options:{caption:"",movieObjectID:"moviebox"+$random(10000,99999),showcontrols:"false"},initialize:function(a){this.name="moviebox";this.version=1.3;this.donotdebugoptions=false;this.currentMovie=null;this.movieurl=null;this.flower_utility=flowerUID.getModule("utility");this.state=0;this.setOptions(a);this.renderboxheight=this.options.boxheight;this.renderboxwidth=this.options.boxwidth;this.flashDetected=this.flower_utility.detectPluginOrAxo("Flash");this.qtDetected=this.flower_utility.detectPluginOrAxo("QuickTime");this.ismobile=this.flower_utility.checkForMobile();this.addKeyEvents()},attachToElement:function(a){if(!this.ismobile){var f=a.getProperty("href"),b=f.toLowerCase(),d=a.getProperty("title"),e=a.getProperty("rev"),h=this.renderboxwidth,c=this.renderboxheight,i=false,g;if(e){if(e.contains("moviebox:")){$A(e.substring(9,e.length).split(",")).each(function(k){var j=k.split("=");switch(j[0]){case"width":if(j[1]){h=j[1]}break;case"height":if(j[1]){c=j[1]}break}})}}if((b.contains(".mov")||b.contains(".mp4"))&&this.qtDetected){i="qt";if(this.options.showcontrols=="true"){c+=16}}else{if(b.contains("youtube.com/watch?v=")&&this.flashDetected){i="yt";c=(h*0.5625).round()+25}else{if((b.contains("myspacetv.com")||b.contains("vids.myspace.com"))&&b.contains("vids.individual&videoid=")&&this.flashDetected){i="ms";c=(h*0.5625).round()+40}else{if(b.contains("video.google.com/videoplay?docid=")&&this.flashDetected){i="gv";c=(h*0.5625).round()+26}else{if(b.test(/vimeo.com\/\d/)&&this.flashDetected){i="vm"}else{if(b.contains("vevo.com/watch")&&this.flashDetected){i="vv"}}}}}}if(i){a.removeEvents("click");a.addEvent("click",function(j){this.showMovie(i,d,f,h,c);j.stop()}.bind(this))}}},showMovie:function(e,a,c,b,d){this.movieType=e;this.caption=a;this.movieurl=c;this.renderboxwidth=b;this.renderboxheight=d;if(this.state==0){this.createDomElements();this.overlayCloseLink.set("html","close <small>[esc]</small>");this.state=1}this.showOverlay()},showOverlay:function(){if(this.state==1){if(window.flowerUID){var a=flowerUID.getModule("soundplayer");if(a){a.pauseCurrentSound()}}this.parent()}},showContent:function(){if(this.movieType=="qt"){if(Browser.Engine.trident){this.overlayContentSpc.set("html",'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" standby="loading quicktime..." codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="'+this.renderboxwidth+'" height="'+this.renderboxheight+'" id="'+this.options.movieObjectID+'"><param name="src" value="'+this.movieurl+'" /><param name="scale" value="aspect" /><param name="controller" value="'+this.options.showcontrols+'" /><param name="cache" value="false" /><param name="autoplay" value="true" /><param name="bgcolor" value="'+this.options.contentspcbg+'" /><param name="enablejavascript" value="true" /></object>')}else{this.overlayContentSpc.set("html",'<object id="'+this.options.movieObjectID+'" standby="loading quicktime..." type="video/quicktime" codebase="http://www.apple.com/qtactivex/qtplugin.cab" data="'+this.movieurl+'" width="'+this.renderboxwidth+'" height="'+this.renderboxheight+'"><param name="src" value="'+this.movieurl+'" /><param name="scale" value="aspect" /><param name="controller" value="'+this.options.showcontrols+'" /><param name="cache" value="false" /><param name="autoplay" value="true" /><param name="bgcolor" value="'+this.options.contentspcbg+'" /><param name="enablejavascript" value="true" /></object>')}this.currentMovie=document.getElementById(this.options.movieObjectID);(function(){this.state=11}.bind(this)).delay(1200)}else{if(this.movieType=="yt"||this.movieType=="gv"||this.movieType=="vm"||this.movieType=="ms"||this.movieType=="vv"){var a=this.parseVideoURL(this.movieurl);this.overlayContentSpc.set("html",'<object id="'+this.options.movieObjectID+'" standby="loading video..." type="application/x-shockwave-flash" width="'+this.renderboxwidth+'" height="'+this.renderboxheight+'" data="'+a+'"><param name="movie" value="'+a+'" /><param name="bgcolor" value="'+this.options.contentspcbg+'" /><param name="allowFullScreen" value="true" /><param name="wmode" value="window" /><param name="allowScriptAccess" value="always" /></object>');this.currentMovie=document.id(this.options.movieObjectID);this.state=11}}this.positionCaption();this.fireEvent("videoCreated",this.currentMovie)},parseVideoURL:function(c){var d=false,a=c.toLowerCase(),b;if(a.contains("youtube.com/watch?v=")){d=c.replace(/watch\?v\=/i,"v/");b=d.indexOf("&");if(b>-1){d=d.substr(0,b)}d+="&amp;autoplay=1"}else{if(a.contains("fuseaction=vids.individual&videoid=")){d="http://lads.myspace.com/videos/vplayer.swf?m=";b=a.lastIndexOf("=")+1;d+=a.substr(b,a.length-b);d+="&v=2&type=video&a=1"}else{if(a.contains("video.google.com/videoplay?docid=")){d=this.movieurl.replace(/videoplay/i,"googleplayer.swf");b=d.indexOf("&");if(b>-1){d=d.substr(0,b)}}else{if(a.contains("vimeo.com/")){d=this.movieurl.replace("vimeo.com/","vimeo.com/moogaloop.swf?clip_id=");d+="&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;js_api=1&amp;autoplay=1"}else{if(a.contains("vevo.com/watch")){d="http://www.vevo.com/VideoPlayer/Embedded?videoId=";b=a.lastIndexOf("/")+1;d+=a.substr(b,a.length-b);d+="&autoplay=1&playerType=embedded&playlist=false"}}}}}return d},hideOverlay:function(){if(this.state==11){if(this.movieType=="qt"){if(Browser.Engine.webkit||Browser.Engine.trident){this.currentMovie.Stop();this.currentMovie.style.display="none"}}else{if(!Browser.Engine.trident){this.currentMovie.dispose()}}this.currentMovie=null;this.overlayContentSpc.set("html","");this.movieType=false;this.parent();this.state=1}}});window.addEvent("domready",function(){if(typeof(flowerUID)=="object"){flowerUID.registerModule(FlowerMoviebox,"moviebox")}else{var a=new FlowerMoviebox();$$("a[href$=.mov],a[href$=.mp4],a[href$=.MOV],a[href$=.MP4],a[href^=http://www.youtube.com/watch?v],a[href^=http://youtube.com/watch?v],a[href^=http://vimeo.com/],a[href^=http://www.vimeo.com/],a[href^=http://video.google.com/videoplay?docid],a[href^=http://www.youtube.com/watch?v],a[href^=http://myspacetv.com/index.cfm?fuseaction=vids.individual&videoid],a[href^=http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid]").each(function(b){a.attachToElement(b)})}});
4 securestreams/publicfacing/assets/scripts/flower/media/flower_overlay.js
@@ -0,0 +1,4 @@
+var FlowerOverlay=new Class({initialize:function(){this.name="overlay";this.version=1.1;this.donotdebugoptions=true},options:{fadelevel:0.85,overlaycolor:"#000000",contentspcbg:"#000000",linkcolor:"#999999",linkovercolor:"#ffffff",textcolor:"#cccccc",borderwidth:5,boxwidth:640,boxheight:360,zindex:1234},createDomElements:function(){this.overlaySpc=new Element("div",{"class":"flower_overlay_container",styles:{position:(Browser.Engine.trident4)?"absolute":"fixed",top:"0px",left:"0px",width:"100%",height:"100%",background:"transparent","z-index":this.options.zindex,display:"none"}}).inject(document.body);this.overlay=new Element("div",{"class":"flower_overlay",styles:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",visibility:"hidden",background:this.options.overlaycolor,"z-index":"1"}}).inject(this.overlaySpc);this.overlayContentSpc=new Element("div",{"class":"flower_overlay_contentcontainer",styles:{position:"absolute",top:"50%",left:"50%","margin-top":(0-(this.renderboxheight/2)-this.options.borderwidth)+"px","margin-left":(0-(this.renderboxwidth/2)-this.options.borderwidth)+"px",width:this.renderboxwidth+"px",height:"1px","background-color":this.options.contentspcbg,border:this.options.borderwidth+"px solid "+this.options.contentspcbg,overflow:"hidden",visibility:"hidden","z-index":"10"}}).inject(this.overlaySpc);
+this.overlayCaptionSpc=new Element("div",{"class":"flower_overlay_captioncontainer",styles:{position:"absolute",top:"50%",right:"50%","margin-top":((this.renderboxheight/2)+this.options.borderwidth)+"px","margin-right":0-(this.renderboxwidth/2)+"px","background-color":"transparent",width:this.renderboxwidth+"px","text-align":"right",visibility:"hidden","z-index":"20"}}).inject(this.overlaySpc);this.overlayCaption=new Element("p",{"class":"flower_overlay_caption",styles:{color:this.options.textcolor,display:"none",margin:"5px 0 0 0",padding:"0","z-index":"10"}}).inject(this.overlayCaptionSpc);this.addControlElements();this.addOverlayEffects();this.addOverlayEvents();if(Browser.Engine.trident4){this.fixIe6Fixed();window.addEvent("scroll",this.fixIe6Fixed.bind(this))}},addControlElements:function(){this.overlayControlSpc=new Element("div",{"class":"flower_overlay_controls",styles:{margin:"5px 0 0 0","white-space":"nowrap","z-index":"15"}}).inject(this.overlayCaptionSpc);this.overlayCloseLink=new Element("a",{"class":"flower_overlay_controllink",styles:{color:this.options.linkcolor,margin:"0",cursor:"pointer"},html:"close",events:{mouseover:function(a){this.overlayCloseLink.setStyle("color",this.options.linkovercolor)
+}.bind(this),mouseout:function(a){this.overlayCloseLink.setStyle("color",this.options.linkcolor)}.bind(this),click:function(a){this.hideOverlay();a.stop()}.bind(this)}}).inject(this.overlayControlSpc)},addOverlayEvents:function(){this.overlay.addEvent("click",this.hideOverlay.bind(this))},addOverlayEffects:function(){this.fxOverlay=new Fx.Tween(this.overlay,{property:"opacity",fps:33,duration:250});this.fxOpenContentSpc=new Fx.Tween(this.overlayContentSpc,{property:"height",fps:33,duration:500})},addKeyEvents:function(){document.addEvent("keydown",function(a){if(this.state==11&&a.key=="esc"){this.hideOverlay()}}.bind(this))},showOverlay:function(){this.overlayContentSpc.setStyles({width:this.renderboxwidth+"px","margin-left":(0-(this.renderboxwidth/2)-this.options.borderwidth)+"px","margin-top":(0-(this.renderboxheight/2)-this.options.borderwidth)+"px"});this.overlaySpc.setStyle("display","block");this.fxOverlay.start(0,this.options.fadelevel).chain(function(){this.overlayContentSpc.setStyle("visibility","visible");this.fxOpenContentSpc.start(1,this.renderboxheight).chain(function(){this.showContent()}.bind(this))}.bind(this))},positionCaption:function(){if(this.caption){this.overlayCaption.set("html",this.caption);
+this.overlayCaption.setStyle("display","block")}else{this.overlayCaption.setStyle("display","none")}this.overlayCaptionSpc.setStyles({width:this.renderboxwidth+"px","margin-top":((this.renderboxheight/2)+this.options.borderwidth)+"px","margin-right":0-(this.renderboxwidth/2)+"px",visibility:"visible"})},hideOverlay:function(){this.overlayContentSpc.setStyles({visibility:"hidden",height:"1px"});this.overlayCaptionSpc.setStyle("visibility","hidden");this.fxOverlay.start(this.options.fadelevel,0).chain(function(){this.overlay.setStyle("visibility","hidden");if(!this.caption){this.caption="";this.overlayCaption.set("html","")}this.overlayCaption.setStyle("display","none");this.overlaySpc.setStyle("display","none")}.bind(this))},fixIe6Fixed:function(){this.overlaySpc.setStyles({top:window.getScroll().y+"px",left:window.getScroll().x+"px",width:"100%",height:"100%"})}});window.addEvent("domready",function(){if(typeof(flowerUID)=="object"){flowerUID.registerModule(FlowerOverlay,"overlay")}});
BIN  securestreams/publicfacing/assets/scripts/flower/soundplayer/assets/defaultSoundPlayerUI/images/next.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  securestreams/publicfacing/assets/scripts/flower/soundplayer/assets/defaultSoundPlayerUI/images/pause.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  securestreams/publicfacing/assets/scripts/flower/soundplayer/assets/defaultSoundPlayerUI/images/play.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  ...restreams/publicfacing/assets/scripts/flower/soundplayer/assets/defaultSoundPlayerUI/images/previous.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 securestreams/publicfacing/assets/scripts/flower/soundplayer/flower_soundplayer.js
@@ -0,0 +1,18 @@
+var FlowerSoundPlayer=new Class({Implements:[Events,Options],options:{volume:100,debug:false,forceFlash:false,sm2LoadTimeout:1500,sm2Location:"/assets/scripts/lib/soundmanager2/soundmanager2.js",sm2swfLocation:"/assets/scripts/lib/soundmanager2/swf/"},initialize:function(a){this.setOptions(a);this.name="soundplayer";this.version=1.1;this.donotdebugoptions=false;this.sm2Loaded=false;this.currentSound=null;this.currentPlaylist=null;this.Playlists=$H();this.soundManager=null;this.sm2LoadTimer=null;this.sm2LoadTime=0;this.isReady=false;this.isAppleiDevice=false;if((navigator.userAgent.match(/iPad/i)!==null)||(navigator.userAgent.match(/iPhone/i)!==null)||(navigator.userAgent.match(/iPod/i)!==null)){this.isAppleiDevice=true}window.addEvent("domready",function(){window.SM2_DEFER=true;injected=new Element("script",{type:"text/javascript",src:this.options.sm2Location}).injectInside($$("head")[0]);this.sm2LoadTimer=(function(){if(typeof(soundManager)!="undefined"){this.initializeSM2();$clear(this.sm2LoadTimer)}else{this.sm2LoadTime+=50;if(this.sm2LoadTime>this.options.sm2LoadTimeout){this.onError("soundmanager2 could not be loaded/found.");$clear(this.sm2LoadTimer)}}}).periodical(50,this)}.bind(this))
+},initializeSM2:function(){window.soundManager=new SoundManager();soundManager.url=this.options.sm2swfLocation;soundManager.flashVersion=9;soundManager.useFlashBlock=false;if(!this.options.forceFlash){soundManager.useHTML5Audio=true}soundManager.flashLoadTimeout=this.options.sm2LoadTimeout;soundManager.debugMode=this.options.debug;soundManager.onready(function(){if(soundManager.supported()){this.soundManager=soundManager;this.onSM2Loaded()}else{this.onError("soundmanager2 loaded but is not supported")}}.bind(this));soundManager.beginDelayedInit()},attachToElement:function(d){if(!this.ismobile){if(d.get("tag")=="a"){var c=d.getProperty("rev"),a=d.getProperty("href");if(this.soundManager.canPlayURL(a)){var e=a,f=d.getProperty("title");d.store("isPlaying",false);d.store("prePlayTxt","");d.store("postPlayTxt",' <span class="flower_soundplayer_inlineplaypause">[play]</span>');d.store("prePauseTxt","");d.store("postPauseTxt",' <span class="flower_soundplayer_inlineplaypause">[pause]</span>');d.store("originalHTML",d.get("html"));this.loadPlaylist(e,[{url:a,title:f,artist:"Unknown"}]);if(c){d.store("postPlayTxt","");d.store("postPauseTxt","");$A(c.substring(12,c.length).split(",")).each(function(j){var i=j.split("=");
+switch(i[0]){case"playTextBefore":if(i[1]){d.store("prePlayTxt",i[1])}break;case"playTextAfter":if(i[1]){d.store("postPlayTxt",i[1])}break;case"pauseTextBefore":if(i[1]){d.store("prePauseTxt",i[1])}break;case"pauseTextAfter":if(i[1]){d.store("postPauseTxt",i[1])}break}}.bind(this))}}d.removeEvents("click");d.setStyle("cursor","pointer");d.set("html",d.retrieve("prePlayTxt")+d.retrieve("originalHTML")+d.retrieve("postPlayTxt"));d.addEvent("click",function(i){i.stop();this.switchPlaylist(e);this.currentPlaylist.playOrToggleByURL(d.get("href"))}.bind(this));this.addEvent("play",function(){if(this.currentPlaylist.name==e){d.set("html",d.retrieve("prePauseTxt")+d.retrieve("originalHTML")+d.retrieve("postPauseTxt"));d.store("isPlaying",true)}}.bind(this));this.addEvent("resume",function(){if(this.currentPlaylist.name==e){d.set("html",d.retrieve("prePauseTxt")+d.retrieve("originalHTML")+d.retrieve("postPauseTxt"));d.store("isPlaying",true)}}.bind(this));this.addEvent("pause",function(){if(this.currentPlaylist.name==e){d.set("html",d.retrieve("prePlayTxt")+d.retrieve("originalHTML")+d.retrieve("postPlayTxt"));d.store("isPlaying",false)}}.bind(this));this.addEvent("stop",function(){if(this.currentPlaylist.name==e){d.set("html",d.retrieve("prePlayTxt")+d.retrieve("originalHTML")+d.retrieve("postPlayTxt"));
+d.store("isPlaying",false)}}.bind(this))}else{if(d.get("tag")=="div"){if(d.hasClass("flower_soundplayer_pageplayer")){this.createPagePlayer(d)}else{var b=d.get("id"),g=[],e,h;if(b){e=b}else{e=$random(10000,99999)}d.getElements("a").each(function(i){var j=this.parseAforPlaylist(i);if(j){g.push(j)}}.bind(this));if(g.length>0){document.id(d).set("html","");this.loadPlaylist(e,g);h=new defaultSoundPlayerUI(this.currentPlaylist,d);h.drawUI();d.setStyle("visibility","visible")}}}}}},parseAforPlaylist:function(b){var c=b.getProperty("href"),d=b.getProperty("title");if(!d){d=b.getProperty("text")}if(this.soundManager.canPlayURL(c)){return{url:c,title:d,artist:"Unknown"}}else{return false}},createPagePlayer:function(d,a){if(document.id(d)){var c=[],b,e;if(a){b=a}else{b=document.URL}$$("a[href$=.mp3]","a[href$=.MP3]","a[href$=.ogg]","a[href$=.OGG]","a[href$=.m4a]","a[href$=.M4A]","a[href$=.wav]","a[href$=.WAV]").each(function(f){var g=f.getParents("div.flower_soundplayer");if(g.length==0&&!f.hasClass("flower_soundplayer")){var h=this.parseAforPlaylist(f);if(h){c.push(h)}f.removeEvents("click");f.addEvent("click",function(i){i.stop();this.switchPlaylist(b);this.currentPlaylist.playOrToggleByURL(f.get("href"))
+}.bind(this))}}.bind(this));if(c.length>0){this.loadPlaylist(b,c);e=new defaultSoundPlayerUI(this.currentPlaylist,document.id(d));e.drawUI()}}},debugMessage:function(a){if(typeof(console)=="object"&&this.options.debug){console.log(a)}},loadPlaylist:function(b,a){if(!this.sm2Loaded){this.onError("flash object not yet loaded. please use the 'ready' event.")}else{this.currentPlaylist=this.Playlists.get(b);if(this.currentPlaylist===null){this.Playlists.set(b,new SoundPlaylist(b));this.currentPlaylist=this.Playlists.get(b)}this.currentPlaylist.setSoundPlayer(this);a.each(function(c){this.currentPlaylist.loadSound(c)},this);this.currentPlaylist.generateKeyIndex()}return this},switchPlaylist:function(a){if(this.Playlists.get(a)!==null&&this.currentPlaylist.name!=a){if(this.currentPlaylist.currentSound){this.pauseCurrentSound()}this.currentPlaylist=this.Playlists.get(a)}},playCurrentSound:function(){if(this.currentPlaylist===null){this.onError("there are no playlists loaded.")}else{this.currentPlaylist.playCurrentSound()}},stopCurrentSound:function(){if(this.currentPlaylist===null){this.onError("there are no playlists loaded.")}else{this.currentPlaylist.stopCurrentSound()}},resumeCurrentSound:function(){if(this.currentPlaylist===null){this.onError("there are no playlists loaded.")
+}else{this.currentPlaylist.resumeCurrentSound()}},pauseCurrentSound:function(){if(this.currentPlaylist===null){this.onError("there are no playlists loaded.")}else{this.currentPlaylist.pauseCurrentSound()}},toggleCurrentSound:function(){if(this.currentPlaylist===null){this.onError("there are no playlists loaded.")}else{this.currentPlaylist.toggleCurrentSound()}},jumpCurrentSoundTo:function(a){if(this.currentPlaylist===null){this.onError("there are no playlists loaded.")}else{this.currentPlaylist.jumpCurrentSoundTo(a)}},setVolume:function(a){this.swf.setVolume(a);this.options.volume=a;return this},getVolume:function(){return this.options.volume},onSM2Loaded:function(){if(!this.isReady){this.sm2Loaded=true;this.soundManager.defaultOptions.volume=this.options.volume;this.fireEvent("ready");this.isReady=true}},onError:function(a){this.debugMessage("flower soundplayer error: "+a);this.fireEvent("error")}});var SoundPlaylist=new Class({Implements:[Events],options:{loopPlaylist:false},initialize:function(a){this.SoundPlayer=null;this.sounds=$H();this.currentSound=null;this.currentKey=0;this.usingHTML5=false;this.name=a;this.allSoundKeys=null},setSoundPlayer:function(a){this.SoundPlayer=a;return this
+},loadSound:function(b){var a=b;if(typeof(b)=="string"){a={url:b,title:false,artist:false}}this.sounds.set(a.url,{sound:this.SoundPlayer.soundManager.createSound({id:a.url,url:a.url,onfinish:function(){this.SoundPlayer.fireEvent("stop",this.currentSound.sound.url);this.playSound("next")}.bind(this),whileplaying:function(){var c=this.currentSound.sound;if(!c.loaded){currentDuration=c.durationEstimate}else{currentDuration=c.duration}approximatePosition=c.position/currentDuration;this.SoundPlayer.fireEvent("position",[approximatePosition,c.url]);currentDuration=Math.round(currentDuration/1000);figureSec=Math.floor(currentDuration%60);figureSec=(String(figureSec).length<2)?figureSec=String("0"+figureSec):figureSec=String(figureSec);currentDuration=Math.floor(currentDuration/60)+":"+figureSec;currentPosition=Math.round(c.position/1000);figureSec=Math.floor(currentPosition%60);figureSec=(String(figureSec).length<2)?figureSec=String("0"+figureSec):figureSec=String(figureSec);currentPosition=Math.floor(currentPosition/60)+":"+figureSec;this.SoundPlayer.fireEvent("positiontime",[currentPosition+" / "+currentDuration,c.url]);if(this.usingHTML5){loadPercentage=c.bytesLoaded/c.bytesTotal;this.SoundPlayer.fireEvent("progress",loadPercentage)
+}}.bind(this),whileloading:function(){if(!this.usingHTML5){loadPercentage=this.currentSound.sound.bytesLoaded/this.currentSound.sound.bytesTotal;this.SoundPlayer.fireEvent("progress",loadPercentage)}}.bind(this)}),title:a.title,artist:a.artist});if(this.sounds.get(a.url).sound.isHTML5){this.usingHTML5=true}if(!this.currentSound){this.currentSound=this.sounds.get(a.url)}return this},generateKeyIndex:function(){this.allSoundKeys=this.sounds.getKeys()},playSound:function(c){this.makeCurrent();var e,b,d=false,a=this.sounds.getKeys();if(c=="next"){if(this.currentKey==(a.length-1)&&this.options.loopPlaylist){d=0}else{if(this.currentKey==(a.length-1)&&!this.options.loopPlaylist){d=false}else{d=this.currentKey+1}}}else{if(c=="forcenext"){if(this.currentKey==(a.length-1)){d=0}else{d=this.currentKey+1}}else{if(c=="previous"){if(this.currentKey==0){d=a.length-1}else{d=this.currentKey-1}}else{if(c=="random"){d=Math.floor(Math.random()*a.length)}else{if(c=="first"){d=0}}}}}if(this.currentSound){this.currentSound.sound.setPosition(0);this.stopCurrentSound()}if(d!==false){b=a[d];e=this.sounds.get(b);this.currentKey=d;this.currentSound=e;this.playCurrentSound()}},resumeCurrentSound:function(){this.makeCurrent();
+if(this.currentSound.sound.paused){this.currentSound.sound.resume();this.SoundPlayer.fireEvent("resume",this.currentSound.sound.url)}},playCurrentSound:function(){this.makeCurrent();if(this.currentSound.sound.paused){this.currentSound.sound.setPosition(0);this.currentSound.sound.resume()}else{this.currentSound.sound.play()}this.SoundPlayer.fireEvent("play",[this.currentSound.sound.url,this.currentSound.title,this.currentSound.artist])},pauseCurrentSound:function(){this.makeCurrent();if(this.currentSound.sound.playState==1){this.currentSound.sound.pause();this.SoundPlayer.fireEvent("pause",this.currentSound.sound.url)}},stopCurrentSound:function(){this.makeCurrent();if(this.currentSound.sound.playState!=0){this.currentSound.sound.stop();this.SoundPlayer.fireEvent("stop",this.currentSound.sound.url)}},toggleCurrentSound:function(){this.makeCurrent();if(this.currentSound){if(this.currentSound.sound.playState==0){this.playCurrentSound()}else{if(this.currentSound.sound.paused){this.resumeCurrentSound()}else{this.pauseCurrentSound()}}}else{this.playSound("first")}},playOrToggleByURL:function(a){var b=this.sounds.get(a);if(this.currentSound!=b){this.currentSound.sound.setPosition(0);this.stopCurrentSound();
+this.currentKey=this.allSoundKeys.indexOf(a);this.currentSound=b;this.playCurrentSound()}else{this.toggleCurrentSound()}},jumpCurrentSoundTo:function(a){this.makeCurrent();this.currentSound.sound.setPosition(a);if(this.currentSound.sound.paused){this.resumeCurrentSound()}this.SoundPlayer.fireEvent("play",[this.currentSound.sound.url,this.currentSound.title,this.currentSound.artist])},makeCurrent:function(){if(this.SoundPlayer.currentPlaylist!=this){this.SoundPlayer.switchPlaylist(this.name)}}});var SoundPlayerUI=new Class({Implements:[Options,Events],options:{debug:false},initialize:function(c,b,a){this.setOptions(a);if(this.options.playlist!=false){this.supportsAppleiDevices=true;this.targetElement=b;this.playlist=c;this.isAppleiDevice=this.playlist.SoundPlayer.isAppleiDevice;this.allSoundKeys=this.playlist.allSoundKeys}else{if(this.options.debug){this.debugMessage("No playlist specified, cannot draw UI.")}}},debugMessage:function(a){if(typeof(console)=="object"&&this.options.debug){console.log(a)}}});var defaultSoundPlayerUI=new Class({Extends:SoundPlayerUI,Implements:[Options,Events],options:{debug:false,forceAppleiDevice:false,drawController:true,drawPlaylist:true,loadTitle:"Press Play",assetPath:""},initialize:function(d,b,a){this.parent(d,b,a);
+this.setOptions(a);var c=this.playlist.SoundPlayer.options.sm2swfLocation.replace("/lib/soundmanager2/swf/","");this.controlImages={previous:c+"/assets/defaultSoundPlayerUI/images/previous.png",next:c+"/assets/defaultSoundPlayerUI/images/next.png",play:c+"/assets/defaultSoundPlayerUI/images/play.png",pause:c+"/assets/defaultSoundPlayerUI/images/pause.png"};if(this.options.forceAppleiDevice){this.isAppleiDevice=true}this.allPlaylistLi=$H();this.notesSpan=new Element("span",{text:"(tap to stop)",styles:{display:"none",color:"#111","padding-left":"1em"}});this.elementStyles=$H({seekbarSpc:{position:"relative","background-color":"#666",height:"9px",width:"100%","margin-top":"4px",overflow:"hidden"},seekbar:{position:"absolute","background-color":"#c00",height:"9px",width:"0%",cursor:"pointer","z-index":"10"},position:{position:"absolute",left:"0%",width:"3px",height:"9px","background-color":"#000","z-index":"15"},controls:{"margin-top":"8px","text-align":"right"},iDeviceLiStyles:{background:"-webkit-gradient(linear, left top, left bottom, from(#666), to(#222))",color:"#fff"},iDeviceLiStylesClicked:{background:"-webkit-gradient(linear, left top, left bottom, from(#00acf1), to(#002939))",color:"#ed028d"},controlImageStyles:{"margin-left":"4px",cursor:"pointer",width:"20px",height:"21px"}})
+},clearAllPlaylistLi:function(){this.notesSpan.setStyle("display","none");this.allPlaylistLi.each(function(a){a.get("li").setStyles(this.elementStyles.get("iDeviceLiStyles"));a.get("titlespan").setStyle("color","#fff");a.get("timespan").set("html","")}.bind(this))},handlePlaylistLiClick:function(a){this.playlist.SoundPlayer.switchPlaylist(this.playlist.name);this.playlist.playOrToggleByURL(track.sound.url)},highlightPlayingLi:function(b){this.clearAllPlaylistLi();var d=this.allPlaylistLi.get(b);var e=d.get("timespan");var c=d.get("titlespan");var a=d.get("li");if(e.get("html")==""){e.set("html","loading...")}a.setStyles(this.elementStyles.get("iDeviceLiStylesClicked"));c.setStyle("color","#000");this.notesSpan.inject(a);this.notesSpan.setStyle("display","inline")},addPlaylistElements:function(){if(!this.isAppleiDevice){var a=1;this.mainPlaylistOl=new Element("ol",{"class":"flower_soundplaylist",styles:{"font-size":"0.85em",padding:0,margin:0,"list-style-type":"decimal-leading-zero"}});this.playlist.sounds.each(function(c,d){var b=new Element("li",{styles:{"list-style-position":"inside"}}).inject(this.mainPlaylistOl);if(a%2==0){b.addClass("flower_soundplaylist_altli")}a+=1;var e=new Element("span",{text:c.title,styles:{cursor:"pointer"},events:{click:function(){this.playlist.SoundPlayer.switchPlaylist(this.playlist.name);
+this.playlist.playOrToggleByURL(c.sound.url)}.bind(this)}}).inject(b)},this);this.mainPlaylistOl.inject(this.playerSpc)}else{this.mainPlaylistOl=new Element("ol",{styles:{"font-size":"0.85em",padding:0,margin:0,"list-style-type":"decimal-leading-zero"}});this.playlist.sounds.each(function(c,d){var b=new Element("li",{styles:{"list-style-position":"inside",background:"-webkit-gradient(linear, left top, left bottom, from(#666), to(#222))",border:"1px solid #777","-webkit-border-radius":"3px","margin-bottom":"4px",padding:"3px",height:"4em",cursor:"pointer",color:"#fff"}}).inject(this.mainPlaylistOl);var e=new Element("span",{text:c.title,styles:{"font-size":"1.5em","line-height":"1em","font-weight":"bold",display:"block"}}).inject(b);var f=new Element("span",{styles:{"padding-left":"1.95em",color:"#fff"}}).inject(b);b.addEvent("click",function(){this.handlePlaylistLiClick(c.sound.url)}.bind(this));this.allPlaylistLi.set(c.sound.url,$H({li:b,titlespan:e,timespan:f}))},this);this.mainPlaylistOl.inject(this.playerSpc)}},addPlaylistEvents:function(){if(!this.isAppleiDevice){}else{this.playlist.SoundPlayer.addEvent("play",function(a){if(this.playlist.SoundPlayer.currentPlaylist==this.playlist){this.highlightPlayingLi(a)
+}}.bind(this));this.playlist.SoundPlayer.addEvent("positiontime",function(b,a){if(this.playlist.SoundPlayer.currentPlaylist==this.playlist){this.allPlaylistLi.get(a).get("timespan").set("html",b)}}.bind(this))}},drawPlaylist:function(){var a=false;if(!this.playerSpc){a=true}if(a){this.playerSpc=new Element("div",{"class":"flower_soundplayer"})}this.addPlaylistElements();this.addPlaylistEvents();if(a){this.playerSpc.inject(document.id(this.targetElement))}},addControllerElements:function(){this.controlsSpc=new Element("div",{"class":"flower_soundplayer_ui"}).inject(this.playerSpc);this.soundtitle=new Element("div",{"class":"flower_soundplayer_title",html:this.options.loadTitle}).inject(this.controlsSpc);this.soundtime=new Element("div",{"class":"flower_soundplayer_time",html:"&nbsp;"}).inject(this.controlsSpc);this.seekbarSpc=new Element("div",{"class":"flower_soundplayer_seekbarcontainer",styles:this.elementStyles.get("seekbarSpc")}).inject(this.controlsSpc);this.seekbar=new Element("div",{"class":"flower_soundplayer_seekbar",styles:this.elementStyles.get("seekbar")}).inject(this.seekbarSpc);this.position=new Element("div",{"class":"flower_soundplayer_positionmarker",styles:this.elementStyles.get("position")}).inject(this.seekbarSpc);
+this.controls=new Element("div",{"class":"flower_soundplayer_controls",styles:this.elementStyles.get("controls")}).inject(this.controlsSpc);this.previousEl=new Element("img",{"class":"flower_soundplayer_prev",alt:"prev",src:this.controlImages.previous,styles:this.elementStyles.get("controlImageStyles"),events:{click:function(){this.playlist.playSound("previous")}.bind(this)}}).inject(this.controls);this.playPauseEl=new Element("img",{"class":"flower_soundplayer_play",alt:"play",src:this.controlImages.play,styles:this.elementStyles.get("controlImageStyles"),events:{click:function(){this.playlist.toggleCurrentSound()}.bind(this)}}).inject(this.controls);this.nextEl=new Element("img",{"class":"flower_soundplayer_next",alt:"next",src:this.controlImages.next,styles:this.elementStyles.get("controlImageStyles"),events:{click:function(){this.playlist.playSound("forcenext")}.bind(this)}}).inject(this.controls)},addControllerEvents:function(){this.seekbar.addEvent("click",function(d){if(this.playlist.SoundPlayer.currentPlaylist!=this.playlist){this.playlist.SoundPlayer.switchPlaylist(this.playlist.name)}var b;if(!this.playlist.currentSound.sound.loaded){b=this.playlist.currentSound.sound.durationEstimate
+}else{b=this.playlist.currentSound.sound.duration}var g=this.seekbarSpc.getCoordinates();var f=this.seekbar.getCoordinates();var c=(d.page.x-f.left)/g.width;var a=c*b;this.playlist.jumpCurrentSoundTo(a)}.bind(this));this.playlist.SoundPlayer.addEvent("play",function(b,c,a){if(this.playlist.SoundPlayer.currentPlaylist==this.playlist){if(c){this.soundtitle.set("text",c)}else{this.soundtitle.set("text",b)}}}.bind(this));this.playlist.SoundPlayer.addEvent("progress",function(b){if(this.playlist.SoundPlayer.currentPlaylist==this.playlist){if(b<0.95){var a=this.seekbarSpc.getSize().x;this.seekbar.setStyle("width",Math.round(a*b))}else{this.seekbar.setStyle("width","100%")}}}.bind(this));this.playlist.SoundPlayer.addEvent("position",function(c,a){if(this.playlist.SoundPlayer.currentPlaylist==this.playlist&&this.playlist.currentSound.sound.url==a){var b=this.seekbarSpc.getSize().x;this.position.setStyle("left",Math.round(b*c))}}.bind(this));this.playlist.SoundPlayer.addEvent("positiontime",function(b,a){if(this.playlist.SoundPlayer.currentPlaylist==this.playlist&&this.playlist.currentSound.sound.url==a){this.soundtime.set("html",b)}}.bind(this));this.playlist.SoundPlayer.addEvent("play",function(a){if(this.playlist.SoundPlayer.currentPlaylist==this.playlist&&this.playlist.currentSound.sound.url==a){this.playPauseEl.set("src",this.controlImages.pause)
+}}.bind(this));this.playlist.SoundPlayer.addEvent("resume",function(a){if(this.playlist.SoundPlayer.currentPlaylist==this.playlist&&this.playlist.currentSound.sound.url==a){this.playPauseEl.set("src",this.controlImages.pause)}}.bind(this));this.playlist.SoundPlayer.addEvent("pause",function(a){if(this.playlist.SoundPlayer.currentPlaylist==this.playlist&&this.playlist.currentSound.sound.url==a){this.playPauseEl.set("src",this.controlImages.play)}}.bind(this));this.playlist.SoundPlayer.addEvent("stop",function(a){if(this.playlist.SoundPlayer.currentPlaylist==this.playlist&&this.playlist.currentSound.sound.url==a){this.playPauseEl.set("src",this.controlImages.play)}}.bind(this))},drawController:function(){var a=false;if(!this.playerSpc){a=true}if(a){this.playerSpc=new Element("div",{"class":"flower_soundplayer"})}this.addControllerElements();this.addControllerEvents();if(a){this.playerSpc.inject(document.id(this.targetElement))}},drawUI:function(){this.playerSpc=new Element("div",{"class":"flower_soundplayer"});if(this.isAppleiDevice){this.options.drawController=false;this.options.drawPlaylist=true}if(this.options.drawController){this.drawController()}if(this.options.drawPlaylist){this.drawPlaylist()
+}this.playerSpc.inject(document.id(this.targetElement))}});window.addEvent("domready",function(){if(typeof(flowerUID)=="object"){flowerUID.setModuleOptions("soundplayer",{sm2Location:flowerUID.libpath+"soundplayer/lib/soundmanager2/soundmanager2.js",sm2swfLocation:flowerUID.libpath+"soundplayer/lib/soundmanager2/swf/",forceFlash:true});var a=flowerUID.registerModule(FlowerSoundPlayer,"soundplayer",true);a.addEvent("ready",function(){flowerUID.moduleCallback(a)})}else{}});
95 securestreams/publicfacing/assets/scripts/flower/soundplayer/lib/soundmanager2/soundmanager2-jsmin.js
@@ -0,0 +1,95 @@
+/*
+
+ SoundManager 2: Javascript Sound for the Web
+ --------------------------------------------
+ http://schillmania.com/projects/soundmanager2/
+
+ Copyright (c) 2007, Scott Schiller. All rights reserved.
+ Code provided under the BSD License:
+ http://schillmania.com/projects/soundmanager2/license.txt
+
+ V2.96a.20100624
+*/
+(function(j){function oa(Q,Z){function $(){if(b.debugURLParam.test(C))b.debugMode=true;var c,a,f,h;if(b.debugMode){c=document.createElement("div");c.id=b.debugID+"-toggle";a={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001};c.appendChild(document.createTextNode("-"));c.onclick=pa;c.title="Toggle SM2 debug console";if(A.match(/msie 6/i)){c.style.position=
+"absolute";c.style.cursor="hand"}for(h in a)if(a.hasOwnProperty(h))c.style[h]=a[h]}if(b.debugMode&&!t(b.debugID)&&(!aa||!b.useConsole||b.useConsole&&aa&&!b.consoleOnly)){a=document.createElement("div");a.id=b.debugID;a.style.display=b.debugMode?"block":"none";if(b.debugMode&&!t(c.id)){try{f=ba();f.appendChild(c)}catch(e){throw new Error(p("appXHTML"));}f.appendChild(a)}}f=null;$=function(){}}this.flashVersion=8;this.debugMode=true;this.debugFlash=false;this.useConsole=true;this.waitForWindowLoad=
+this.consoleOnly=false;this.nullURL="about:blank";this.allowPolling=true;this.useFastPolling=false;this.useMovieStar=true;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashLoadTimeout=1E3;this.wmode=null;this.allowFullScreen=true;this.allowScriptAccess="always";this.useHTML5Audio=this.useFlashBlock=false;this.html5Test=/^probably$/i;this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:true},mp4:{related:["aac","m4a"],
+type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:true},ogg:{type:["audio/ogg; codecs=vorbis"],required:false},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:false}};this.defaultOptions={autoLoad:false,stream:true,autoPlay:false,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5E3,
+onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,multiShotEvents:false,position:null,pan:0,type:null,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions={onmetadata:null,useVideo:false,bufferTime:3,serverURL:null,onconnect:null};this.version=null;this.versionNumber="V2.96a.20100624";this.movieURL=null;this.url=Q||null;this.altURL=null;this.enabled=
+this.swfLoaded=false;this.o=null;this.movieID="sm2-container";this.id=Z||"sm2movie";this.swfCSS={swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"};this.oMC=null;this.sounds={};this.soundIDs=[];this.isFullScreen=this.muted=false;this.isIE=navigator.userAgent.match(/MSIE/i);this.isSafari=navigator.userAgent.match(/safari/i);this.debugID="soundmanager-debug";this.debugURLParam=
+/([#?&])debug=1/i;this.didFlashBlock=this.specialWmodeCase=false;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.baseMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.mimePattern=this.baseMimeTypes;this.features=
+{buffering:false,peakData:false,waveformData:false,eqData:false,movieStar:false};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null};this.hasHTML5=null;this.html5={usingFlash:null};this.ignoreFlash=false;var ca,b=this,t,A=navigator.userAgent,C=j.location.href.toString(),
+o=this.flashVersion,qa,R,D=[],da=true,v,E=false,J=false,r=false,x=false,ea=false,k,ra,K,u,sa,F,G,ta,fa,ga,B,ua,S,T,L,ha,ba,U,va,Da=["log","info","warn","error"],wa,M,xa,N=null,ia=null,p,ja,O,pa,V,ka,q,W=false,la=false,ya,za,H=null,Aa,X,y=false,P,z,ma,Ba;Q=A.match(/pre\//i);Z=A.match(/(ipad|iphone)/i);A.match(/mobile/i);var aa=typeof console!=="undefined"&&typeof console.log!=="undefined",na=typeof document.hasFocus!=="undefined"?document.hasFocus():null,I=typeof document.hasFocus==="undefined"&&this.isSafari,
+Ca=!I;this._use_maybe=C.match(/sm2\-useHTML5Maybe\=1/i);this._overHTTP=document.location?document.location.protocol.match(/http/i):null;this.useAltURL=!this._overHTTP;if(Z||Q){b.useHTML5Audio=true;b.ignoreFlash=true}if(Q||this._use_maybe)b.html5Test=/^(probably|maybe)$/i;(function(){var c=C,a=null;if(c.indexOf("#sm2-usehtml5audio=")!==-1){a=c.substr(c.indexOf("#sm2-usehtml5audio=")+19)==="1";if(typeof console!=="undefined"&&typeof console.log!=="undefined")console.log((a?"Enabling ":"Disabling ")+
+"useHTML5Audio via URL parameter");b.useHTML5Audio=a}})();this.supported=function(){return H?r&&!x:b.useHTML5Audio&&b.hasHTML5};this.getMovie=function(c){return b.isIE?j[c]:b.isSafari?t(c)||document[c]:t(c)};this.loadFromXML=function(c){try{b.o._loadFromXML(c)}catch(a){M();return true}};this.createSound=function(c){function a(){f=V(f);b.sounds[e.id]=new ca(e);b.soundIDs.push(e.id);return b.sounds[e.id]}var f=null,h=null,e=null;if(!r)throw ka("soundManager.createSound(): "+p("notReady"),arguments.callee.caller);
+if(arguments.length===2)c={id:arguments[0],url:arguments[1]};e=f=u(c);e.id.toString().charAt(0).match(/^[0-9]$/)&&b._wD("soundManager.createSound(): "+p("badID",e.id),2);b._wD("soundManager.createSound(): "+e.id+" ("+e.url+")",1);if(q(e.id,true)){b._wD("soundManager.createSound(): "+e.id+" exists",1);return b.sounds[e.id]}if(X(e)){h=a();b._wD("Loading sound "+e.id+" from HTML5");h._setup_html5(e)}else{if(o>8&&b.useMovieStar){if(e.isMovieStar===null)e.isMovieStar=e.serverURL||(e.type?e.type.match(b.netStreamPattern):
+false)||e.url.match(b.netStreamPattern)?true:false;e.isMovieStar&&b._wD("soundManager.createSound(): using MovieStar handling");if(e.isMovieStar){if(e.usePeakData){k("noPeak");e.usePeakData=false}e.loops>1&&k("noNSLoop")}}h=a();if(o===8)b.o._createSound(e.id,e.onjustbeforefinishtime,e.loops||1);else{b.o._createSound(e.id,e.url,e.onjustbeforefinishtime,e.usePeakData,e.useWaveformData,e.useEQData,e.isMovieStar,e.isMovieStar?e.useVideo:false,e.isMovieStar?e.bufferTime:false,e.loops||1,e.serverURL,e.duration||
+null,e.totalBytes||null,e.autoPlay,true);if(!e.serverURL){h.connected=true;e.onconnect&&e.onconnect.apply(h)}}}if(e.autoLoad||e.autoPlay)if(h)if(b.isHTML5){h.autobuffer="auto";h.preload="auto"}else h.load(e);e.autoPlay&&h.play();return h};this.createVideo=function(c){if(arguments.length===2)c={id:arguments[0],url:arguments[1]};if(o>=9){c.isMovieStar=true;c.useVideo=true}else{b._wD("soundManager.createVideo(): "+p("f9Vid"),2);return false}b.useMovieStar||b._wD("soundManager.createVideo(): "+p("noMS"),
+2);return b.createSound(c)};this.destroyVideo=this.destroySound=function(c,a){if(!q(c))return false;for(var f=0;f<b.soundIDs.length;f++)b.soundIDs[f]===c&&b.soundIDs.splice(f,1);b.sounds[c].unload();a||b.sounds[c].destruct();delete b.sounds[c]};this.load=function(c,a){if(!q(c))return false;return b.sounds[c].load(a)};this.unload=function(c){if(!q(c))return false;return b.sounds[c].unload()};this.start=this.play=function(c,a){if(!r)throw ka("soundManager.play(): "+p("notReady"),arguments.callee.caller);
+if(!q(c)){a instanceof Object||(a={url:a});if(a&&a.url){b._wD('soundManager.play(): attempting to create "'+c+'"',1);a.id=c;return b.createSound(a).play()}else return false}return b.sounds[c].play(a)};this.setPosition=function(c,a){if(!q(c))return false;return b.sounds[c].setPosition(a)};this.stop=function(c){if(!q(c))return false;b._wD("soundManager.stop("+c+")",1);return b.sounds[c].stop()};this.stopAll=function(){b._wD("soundManager.stopAll()",1);for(var c in b.sounds)b.sounds[c]instanceof ca&&
+b.sounds[c].stop()};this.pause=function(c){if(!q(c))return false;return b.sounds[c].pause()};this.pauseAll=function(){for(var c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].pause()};this.resume=function(c){if(!q(c))return false;return b.sounds[c].resume()};this.resumeAll=function(){for(var c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].resume()};this.togglePause=function(c){if(!q(c))return false;return b.sounds[c].togglePause()};this.setPan=function(c,a){if(!q(c))return false;return b.sounds[c].setPan(a)};
+this.setVolume=function(c,a){if(!q(c))return false;return b.sounds[c].setVolume(a)};this.mute=function(c){var a=0;if(typeof c!=="string")c=null;if(c){if(!q(c))return false;b._wD('soundManager.mute(): Muting "'+c+'"');return b.sounds[c].mute()}else{b._wD("soundManager.mute(): Muting all sounds");for(a=b.soundIDs.length;a--;)b.sounds[b.soundIDs[a]].mute();b.muted=true}};this.muteAll=function(){b.mute()};this.unmute=function(c){if(typeof c!=="string")c=null;if(c){if(!q(c))return false;b._wD('soundManager.unmute(): Unmuting "'+
+c+'"');return b.sounds[c].unmute()}else{b._wD("soundManager.unmute(): Unmuting all sounds");for(c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].unmute();b.muted=false}};this.unmuteAll=function(){b.unmute()};this.toggleMute=function(c){if(!q(c))return false;return b.sounds[c].toggleMute()};this.getMemoryUse=function(){if(o===8)return 0;if(b.o)return parseInt(b.o._getMemoryUse(),10)};this.disable=function(c){if(typeof c==="undefined")c=false;if(x)return false;x=true;k("shutdown",1);for(var a=b.soundIDs.length;a--;)wa(b.sounds[b.soundIDs[a]]);
+K(c);j.removeEventListener&&j.removeEventListener("load",G,false)};this.canPlayMIME=function(c){var a;if(b.hasHTML5)a=P({type:c});return!H||a?a:c?c.match(b.mimePattern)?true:false:null};this.canPlayURL=function(c){var a;if(b.hasHTML5)a=P(c);return!H||a?a:c?c.match(b.filePattern)?true:false:null};this.canPlayLink=function(c){if(typeof c.type!=="undefined"&&c.type)if(b.canPlayMIME(c.type))return true;return b.canPlayURL(c.href)};this.getSoundById=function(c,a){if(!c)throw new Error("SoundManager.getSoundById(): sID is null/undefined");
+var f=b.sounds[c];!f&&!a&&b._wD('"'+c+'" is an invalid sound ID.',2);return f};this.onready=function(c,a){if(c&&c instanceof Function){r&&k("queue");a||(a=j);sa(c,a);F();return true}else throw p("needFunction");};this.oninitmovie=function(){};this.onload=function(){b._wD("soundManager.onload()",1)};this.onerror=function(){};this.getMoviePercent=function(){return b.o&&typeof b.o.PercentLoaded!=="undefined"?b.o.PercentLoaded():null};this._wD=this._writeDebug=function(c,a,f){var h,e;if(!b.debugMode)return false;
+if(typeof f!=="undefined"&&f)c=c+" | "+(new Date).getTime();if(aa&&b.useConsole){f=Da[a];typeof console[f]!=="undefined"?console[f](c):console.log(c);if(b.useConsoleOnly)return true}try{h=t("soundmanager-debug");if(!h)return false;e=document.createElement("div");if(++ra%2===0)e.className="sm2-alt";a=typeof a==="undefined"?0:parseInt(a,10);e.appendChild(document.createTextNode(c));if(a){if(a>=2)e.style.fontWeight="bold";if(a===3)e.style.color="#ff3333"}h.insertBefore(e,h.firstChild)}catch(m){}};this._debug=
+function(){k("currentObj",1);for(var c=0,a=b.soundIDs.length;c<a;c++)b.sounds[b.soundIDs[c]]._debug()};this.reboot=function(){b._wD("soundManager.reboot()");b.soundIDs.length&&b._wD("Destroying "+b.soundIDs.length+" SMSound objects...");for(var c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].destruct();try{if(b.isIE)ia=b.o.innerHTML;N=b.o.parentNode.removeChild(b.o);b._wD("Flash movie removed.")}catch(a){k("badRemove",2)}N=ia=null;x=J=E=la=W=r=b.enabled=false;b.swfLoaded=false;b.soundIDs=[];b.sounds=
+[];b.o=null;for(c=D.length;c--;)D[c].fired=false;b._wD("soundManager: Rebooting...");j.setTimeout(function(){b.beginDelayedInit()},20)};this.destruct=function(){b._wD("soundManager.destruct()");b.disable(true)};this.beginDelayedInit=function(){ea=true;L();setTimeout(fa,500);setTimeout(ua,20)};X=function(c){return(c.type?P({type:c.type}):false)||P(c.url)};P=function(c){if(!b.useHTML5Audio||!b.hasHTML5)return false;var a,f=b.audioFormats;if(!z){z=[];for(a in f)if(f.hasOwnProperty(a)){z.push(a);if(f[a].related)z=
+z.concat(f[a].related)}z=new RegExp("\\.("+z.join("|")+")","i")}a=typeof c.type!=="undefined"?c.type:null;c=typeof c==="string"?c.toLowerCase().match(z):null;if(!c||!c.length){if(!a)return false}else c=c[0].substr(1);if(c&&typeof b.html5[c]!=="undefined")return b.html5[c];else{if(!a)if(c&&b.html5[c])return b.html5[c];else a="audio/"+c;a=b.html5.canPlayType(a);return b.html5[c]=a}};Ba=function(){function c(l){var i,d,g=false;if(!a||typeof a.canPlayType!=="function")return false;if(l instanceof Array){i=
+0;for(d=l.length;i<d&&!g;i++)if(b.html5[l[i]]||a.canPlayType(l[i]).match(b.html5Test)){g=true;b.html5[l[i]]=true}return g}else return(l=a&&typeof a.canPlayType==="function"?a.canPlayType(l):false)&&(l.match(b.html5Test)?true:false)}if(!b.useHTML5Audio||typeof Audio==="undefined")return false;var a=typeof Audio!=="undefined"?new Audio:null,f,h={},e,m;e=b.audioFormats;for(f in e)if(e.hasOwnProperty(f)){h[f]=c(e[f].type);if(e[f]&&e[f].related)for(m=0;m<e[f].related.length;m++)b.html5[e[f].related[m]]=
+h[f]}h.canPlayType=a?c:null;b.html5=u(b.html5,h)};S={notReady:"Not loaded yet - wait for soundManager.onload() before calling sound-related methods",appXHTML:"soundManager::createMovie(): appendChild/innerHTML set failed. May be app/xhtml+xml DOM-related.",spcWmode:"soundManager::createMovie(): Removing wmode, preventing win32 below-the-fold SWF loading issue",swf404:"soundManager: Verify that %s is a valid path.",tryDebug:"Try soundManager.debugFlash = true for more security details (output goes to SWF.)",
+checkSWF:"See SWF output for more debug info.",localFail:"soundManager: Non-HTTP page ("+document.location.protocol+" URL?) Review Flash player security settings for this special case:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/",waitFocus:"soundManager: Special case: Waiting for focus-related event..",waitImpatient:"soundManager: Getting impatient, still waiting for Flash%s...",waitForever:"soundManager: Waiting indefinitely for Flash (will recover if unblocked)...",
+needFunction:"soundManager.onready(): Function object expected",badID:'Warning: Sound ID "%s" should be a string, starting with a non-numeric character',fl9Vid:"flash 9 required for video. Exiting.",noMS:"MovieStar mode not enabled. Exiting.",currentObj:"--- soundManager._debug(): Current sound objects ---",waitEI:"soundManager::initMovie(): Waiting for ExternalInterface call from Flash..",waitOnload:"soundManager: Waiting for window.onload()",docLoaded:"soundManager: Document already loaded",onload:"soundManager::initComplete(): calling soundManager.onload()",
+onloadOK:"soundManager.onload() complete",init:"-- soundManager::init() --",didInit:"soundManager::init(): Already called?",flashJS:"soundManager: Attempting to call Flash from JS..",noPolling:"soundManager: Polling (whileloading()/whileplaying() support) is disabled.",secNote:"Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html",
+badRemove:"Warning: Failed to remove flash movie.",noPeak:"Warning: peakData features unsupported for movieStar formats",shutdown:"soundManager.disable(): Shutting down",queue:"soundManager.onready(): Queueing handler",smFail:"soundManager: Failed to initialise.",smError:"SMSound.load(): Exception: JS-Flash communication failed, or JS error.",fbTimeout:"No flash response, applying ."+b.swfCSS.swfTimedout+" CSS..",fbLoaded:"Flash loaded",manURL:"SMSound.load(): Using manually-assigned URL",onURL:"soundManager.load(): current URL already assigned.",
+badFV:'soundManager.flashVersion must be 8 or 9. "%s" is invalid. Reverting to %s.',as2loop:"Note: Setting stream:false so looping can work (flash 8 limitation)",noNSLoop:"Note: Looping not implemented for MovieStar formats",needfl9:"Note: Switching to flash 9, required for MP4 formats."};t=function(c){return document.getElementById(c)};ra=0;p=function(){var c=Array.prototype.slice.call(arguments),a=c.shift();a=S&&S[a]?S[a]:"";var f,h;if(a&&c&&c.length){f=0;for(h=c.length;f<h;f++)a=a.replace("%s",
+c[f])}return a};V=function(c){if(o===8&&c.loops>1&&c.stream){k("as2loop");c.stream=false}return c};ka=function(c,a){if(!a)return new Error("Error: "+c);typeof console!=="undefined"&&typeof console.trace!=="undefined"&&console.trace();c="Error: "+c+". \nCaller: "+a.toString();return new Error(c)};qa=function(){return false};wa=function(c){for(var a in c)if(c.hasOwnProperty(a)&&typeof c[a]==="function")c[a]=qa};M=function(c){if(typeof c==="undefined")c=false;if(x||c){k("smFail",2);b.disable(c)}};xa=
+function(c){var a=null;if(c)if(c.match(/\.swf(\?\.*)?$/i)){if(a=c.substr(c.toLowerCase().lastIndexOf(".swf?")+4))return c}else if(c.lastIndexOf("/")!==c.length-1)c+="/";return(c&&c.lastIndexOf("/")!==-1?c.substr(0,c.lastIndexOf("/")+1):"./")+b.movieURL};ga=function(){if(o!==8&&o!==9){b._wD(p("badFV",o,8));b.flashVersion=8}var c=b.debugMode||b.debugFlash?"_debug.swf":".swf";if(b.flashVersion<9&&b.useHTML5Audio&&b.audioFormats.mp4.required){b._wD(p("needfl9"));b.flashVersion=9}o=b.flashVersion;b.version=
+b.versionNumber+(y?" (HTML5-only mode)":o===9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(o>8){b.defaultOptions=u(b.defaultOptions,b.flash9Options);b.features.buffering=true}if(o>8&&b.useMovieStar){b.defaultOptions=u(b.defaultOptions,b.movieStarOptions);b.filePatterns.flash9=new RegExp("\\.(mp3|"+b.netStreamTypes.join("|")+")(\\?.*)?$","i");b.mimePattern=b.netStreamMimeTypes;b.features.movieStar=true}else b.features.movieStar=false;b.filePattern=b.filePatterns[o!==8?"flash9":"flash8"];b.movieURL=(o===8?
+"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",c);b.features.peakData=b.features.waveformData=b.features.eqData=o>8};ba=function(){return document.body?document.body:document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]};va=function(c,a){if(!b.o||!b.allowPolling)return false;b.o._setPolling(c,a)};U=function(c,a){function f(){b._wD("-- SoundManager 2 "+b.version+(!y&&b.useHTML5Audio?b.hasHTML5?" + HTML5 audio":", no HTML5 audio support":"")+(b.useMovieStar?
+", MovieStar mode":"")+(b.useHighPerformance?", high performance mode, ":", ")+((b.useFastPolling?"fast":"normal")+" polling")+(b.wmode?", wmode: "+b.wmode:"")+(b.debugFlash?", flash debug mode":"")+(b.useFlashBlock?", flashBlock mode":"")+" --",1)}var h=null;a=a?a:b.url;var e=b.altURL?b.altURL:a,m,l,i,d;c=typeof c==="undefined"?b.id:c;if(E&&J)return false;if(y){ga();f();b.oMC=t(b.movieID);R();J=E=true;return false}E=true;ga();b.url=xa(this._overHTTP?a:e);a=b.url;if(b.useHighPerformance&&b.useMovieStar&&
+b.defaultOptions.useVideo===true){h="soundManager note: disabling highPerformance, not applicable with movieStar mode+useVideo";b.useHighPerformance=false}b.wmode=!b.wmode&&b.useHighPerformance&&!b.useMovieStar?"transparent":b.wmode;if(b.wmode!==null&&!b.isIE&&!b.useHighPerformance&&navigator.platform.match(/win32/i)){b.specialWmodeCase=true;k("spcWmode");b.wmode=null}if(o===8)b.allowFullScreen=false;m={name:c,id:c,src:a,width:"100%",height:"100%",quality:"high",allowScriptAccess:b.allowScriptAccess,
+bgcolor:b.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:b.wmode,allowfullscreen:b.allowFullScreen?"true":"false"};if(b.debugFlash)m.FlashVars="debug=1";b.wmode||delete m.wmode;if(b.isIE){e=document.createElement("div");i='<object id="'+c+'" data="'+a+'" type="'+m.type+'" width="'+m.width+'" height="'+m.height+'"><param name="movie" value="'+a+'" /><param name="AllowScriptAccess" value="'+b.allowScriptAccess+'" /><param name="quality" value="'+
+m.quality+'" />'+(b.wmode?'<param name="wmode" value="'+b.wmode+'" /> ':"")+'<param name="bgcolor" value="'+b.bgColor+'" /><param name="allowFullScreen" value="'+m.allowFullScreen+'" />'+(b.debugFlash?'<param name="FlashVars" value="'+m.FlashVars+'" />':"")+"<!-- --\></object>"}else{e=document.createElement("embed");for(l in m)m.hasOwnProperty(l)&&e.setAttribute(l,m[l])}$();l=O();if(c=ba()){b.oMC=t(b.movieID)?t(b.movieID):document.createElement("div");if(b.oMC.id){c=b.oMC.className;b.oMC.className=
+(c?c+" ":b.swfCSS.swfDefault)+(l?" "+l:"");b.oMC.appendChild(e);if(b.isIE){l=b.oMC.appendChild(document.createElement("div"));l.className="sm2-object-box";l.innerHTML=i}J=true}else{b.oMC.id=b.movieID;b.oMC.className=b.swfCSS.swfDefault+" "+l;l=m=null;b.useFlashBlock||(m=b.useHighPerformance?{position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:{position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"});d=null;if(!b.debugFlash)for(d in m)if(m.hasOwnProperty(d))b.oMC.style[d]=
+m[d];try{b.isIE||b.oMC.appendChild(e);c.appendChild(b.oMC);if(b.isIE){l=b.oMC.appendChild(document.createElement("div"));l.className="sm2-object-box";l.innerHTML=i}J=true}catch(g){throw new Error(p("appXHTML"));}}}h&&b._wD(h);f();b._wD("soundManager::createMovie(): Trying to load "+a+(!this._overHTTP&&b.altURL?" (alternate URL)":""),1)};q=this.getSoundById;k=function(c,a){return c?b._wD(p(c),a):""};if(C.indexOf("debug=alert")+1&&b.debugMode)b._wD=function(c){alert(c)};pa=function(){var c=t(b.debugID),
+a=t(b.debugID+"-toggle");if(!c)return false;if(da){a.innerHTML="+";c.style.display="none"}else{a.innerHTML="-";c.style.display="block"}da=!da};v=function(c,a,f){if(typeof sm2Debugger!=="undefined")try{sm2Debugger.handleEvent(c,a,f)}catch(h){}};u=function(c,a){var f={},h,e;for(h in c)if(c.hasOwnProperty(h))f[h]=c[h];c=typeof a==="undefined"?b.defaultOptions:a;for(e in c)if(c.hasOwnProperty(e)&&typeof f[e]==="undefined")f[e]=c[e];return f};T=function(){if(y){U();return false}if(b.o)return false;b.o=
+b.getMovie(b.id);if(!b.o){if(N){if(b.isIE)b.oMC.innerHTML=ia;else b.oMC.appendChild(N);N=null;E=true}else U(b.id,b.url);b.o=b.getMovie(b.id)}if(b.o){b._wD("soundManager::initMovie(): Got "+b.o.nodeName+" element ("+(E?"created via JS":"static HTML")+")");k("waitEI")}typeof b.oninitmovie==="function"&&setTimeout(b.oninitmovie,1)};ta=function(c){if(c)b.url=c;T()};fa=function(){if(W)return false;W=true;if(I&&!na){k("waitFocus");return false}var c;if(!r){c=b.getMoviePercent();b._wD(p("waitImpatient",
+c===100?" (SWF loaded)":c>0?" (SWF "+c+"% loaded)":""))}setTimeout(function(){c=b.getMoviePercent();if(!r){b._wD("soundManager: No Flash response within expected time.\nLikely causes: "+(c===0?"Loading "+b.movieURL+" may have failed (and/or Flash "+o+"+ not present?), ":"")+"Flash blocked or JS-Flash security error."+(b.debugFlash?" "+p("checkSWF"):""),2);if(!this._overHTTP&&c){k("localFail",2);b.debugFlash||k("tryDebug",2)}c===0&&b._wD(p("swf404",b.url));v("flashtojs",false,": Timed out"+this._overHTTP?
+" (Check flash security or flash blockers)":" (No plugin/missing SWF?)")}if(!r&&Ca)if(c===null)if(b.useFlashBlock||b.flashLoadTimeout===0){b.useFlashBlock&&ja();k("waitForever")}else M(true);else b.flashLoadTimeout===0?k("waitForever"):M(true)},b.flashLoadTimeout)};O=function(){var c=[];b.debugMode&&c.push(b.swfCSS.sm2Debug);b.debugFlash&&c.push(b.swfCSS.flashDebug);b.useHighPerformance&&c.push(b.swfCSS.highPerf);return c.join(" ")};ja=function(){var c=b.getMoviePercent();if(b.supported()){b.didFlashBlock&&
+b._wD("soundManager::flashBlockHandler(): Unblocked");if(b.oMC)b.oMC.className=O()+" "+b.swfCSS.swfDefault+(" "+b.swfCSS.swfUnblocked)}else{if(H){b.oMC.className=O()+" "+b.swfCSS.swfDefault+" "+(c===null?b.swfCSS.swfTimedout:b.swfCSS.swfError);b._wD("soundManager::flashBlockHandler(): "+p("fbTimeout")+(c?" ("+p("fbLoaded")+")":""))}b.didFlashBlock=true;F(true);b.onerror instanceof Function&&b.onerror.apply(j)}};B=function(){if(na||!I)return true;na=Ca=true;b._wD("soundManager::handleFocus()");I&&
+j.removeEventListener("mousemove",B,false);W=false;setTimeout(fa,500);if(j.removeEventListener)j.removeEventListener("focus",B,false);else j.detachEvent&&j.detachEvent("onfocus",B)};K=function(c){if(r)return false;if(y){b._wD("-- SoundManager 2: loaded --");r=true;F();G();return true}b.useFlashBlock&&b.flashLoadTimeout&&!b.getMoviePercent()||(r=true);b._wD("-- SoundManager 2 "+(x?"failed to load":"loaded")+" ("+(x?"security/load error":"OK")+") --",1);if(x||c){if(b.useFlashBlock)b.oMC.className=O()+
+" "+(b.getMoviePercent()===null?b.swfCSS.swfTimedout:b.swfCSS.swfError);F();v("onload",false);b.onerror instanceof Function&&b.onerror.apply(j);return false}else v("onload",true);if(b.waitForWindowLoad&&!ea){k("waitOnload");if(j.addEventListener)j.addEventListener("load",G,false);else j.attachEvent&&j.attachEvent("onload",G);return false}else{b.waitForWindowLoad&&ea&&k("docLoaded");G()}};sa=function(c,a){D.push({method:c,scope:a||null,fired:false})};F=function(c){if(!r&&!c)return false;c={success:c?
+b.supported():!x};var a=[],f,h,e=!b.useFlashBlock||b.useFlashBlock&&!b.supported();f=0;for(h=D.length;f<h;f++)D[f].fired!==true&&a.push(D[f]);if(a.length){b._wD("soundManager: Firing "+a.length+" onready() item"+(a.length>1?"s":""));f=0;for(h=a.length;f<h;f++){a[f].scope?a[f].method.apply(a[f].scope,[c]):a[f].method(c);if(!e)a[f].fired=true}}};G=function(){j.setTimeout(function(){b.useFlashBlock&&ja();F();k("onload",1);b.onload.apply(j);k("onloadOK",1)},1)};Aa=function(){var c,a,f=!C.match(/usehtml5audio/i)&&
+!C.match(/sm2\-ignorebadua/i)&&b.isSafari&&A.match(/OS X 10_6_(3|4)/i)&&A.match(/(531\.22\.7|533\.16)/i);if(A.match(/iphone os (1|2|3_0|3_1)/i)?true:false){b.hasHTML5=false;y=true;if(b.oMC)b.oMC.style.display="none";return false}if(b.useHTML5Audio){if(!b.html5||!b.html5.canPlayType){b._wD("SoundManager: No HTML5 Audio() support detected.");b.hasHTML5=false;return true}else b.hasHTML5=true;if(f){b._wD("SoundManager::Note: Buggy HTML5 Audio in this specific browser + OS, see https://bugs.webkit.org/show_bug.cgi?id=32159 - disabling HTML5",
+1);b.useHTML5Audio=false;b.hasHTML5=false;return true}}else return true;for(a in b.audioFormats)if(b.audioFormats.hasOwnProperty(a))if(b.audioFormats[a].required&&!b.html5.canPlayType(b.audioFormats[a].type))c=true;if(b.ignoreFlash)c=false;y=b.useHTML5Audio&&b.hasHTML5&&!c;return c};R=function(){function c(){if(j.removeEventListener)j.removeEventListener("load",b.beginDelayedInit,false);else j.detachEvent&&j.detachEvent("onload",b.beginDelayedInit)}var a,f=[];k("init");if(r){k("didInit");return false}if(b.hasHTML5){for(a in b.audioFormats)b.audioFormats.hasOwnProperty(a)&&
+f.push(a+": "+b.html5[a]);b._wD("-- SoundManager 2: HTML5 support tests ("+b.html5Test+"): "+f.join(", ")+" --",1)}if(y){if(!r){c();b.enabled=true;K()}return true}T();try{k("flashJS");b.o._externalInterfaceTest(false);b.allowPolling?va(true,b.useFastPolling?true:false):k("noPolling",1);b.debugMode||b.o._disableDebug();b.enabled=true;v("jstoflash",true)}catch(h){b._wD("js/flash exception: "+h.toString());v("jstoflash",false);M(true);K();return false}K();c()};ua=function(){if(la)return false;U();T();
+return la=true};L=function(){if(ha)return false;ha=true;$();Ba();b.html5.usingFlash=Aa();H=b.html5.usingFlash;ha=true;ta()};ya=function(c){if(!c._hasTimer)c._hasTimer=true};za=function(c){if(c._hasTimer)c._hasTimer=false};this._setSandboxType=function(c){var a=b.sandbox;a.type=c;a.description=a.types[typeof a.types[c]!=="undefined"?c:"unknown"];b._wD("Flash security sandbox type: "+a.type);if(a.type==="localWithFile"){a.noRemote=true;a.noLocal=false;k("secNote",2)}else if(a.type==="localWithNetwork"){a.noRemote=
+false;a.noLocal=true}else if(a.type==="localTrusted"){a.noRemote=false;a.noLocal=false}};this._externalInterfaceOK=function(c){if(b.swfLoaded)return false;var a=(new Date).getTime();b._wD("soundManager::externalInterfaceOK()"+(c?" (~"+(a-c)+" ms)":""));v("swf",true);v("flashtojs",true);b.swfLoaded=true;I=false;b.isIE?setTimeout(R,100):R()};this._onfullscreenchange=function(c){b._wD("onfullscreenchange(): "+c);b.isFullScreen=c===1?true:false;if(!b.isFullScreen)try{j.focus();b._wD("window.focus()")}catch(a){}};
+ca=function(c){var a=this,f,h,e,m,l,i;this.sID=c.id;this.url=c.url;this._iO=this.instanceOptions=this.options=u(c);this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this.isHTML5=false;this.id3={};this._debug=function(){if(b.debugMode){var d=null,g=[],n,s;for(d in a.options)if(a.options[d]!==null)if(a.options[d]instanceof Function){n=a.options[d].toString();n=n.replace(/\s\s+/g," ");s=n.indexOf("{");g.push(" "+d+": {"+n.substr(s+1,Math.min(Math.max(n.indexOf("\n")-1,64),
+64)).replace(/\n/g,"")+"... }")}else g.push(" "+d+": "+a.options[d]);b._wD("SMSound() merged options: {\n"+g.join(", \n")+"\n}")}};this._debug();this.load=function(d){var g=null;if(typeof d!=="undefined"){a._iO=u(d);a.instanceOptions=a._iO}else{d=a.options;a._iO=d;a.instanceOptions=a._iO;if(a._lastURL&&a._lastURL!==a.url){k("manURL");a._iO.url=a.url;a.url=null}}b._wD("soundManager.load(): "+a._iO.url,1);if(a._iO.url===a.url&&a.readyState!==0&&a.readyState!==2){k("onURL",1);return a}a._lastURL=a.url;
+a.loaded=false;a.readyState=1;a.playState=0;if(X(a._iO)){b._wD("HTML 5 load: "+a._iO.url);g=a._setup_html5(a._iO);g.load();a._iO.autoPlay&&a.play()}else try{a.isHTML5=false;a._iO=V(a._iO);if(o===8)b.o._load(a.sID,a._iO.url,a._iO.stream,a._iO.autoPlay,a._iO.whileloading?1:0,a._iO.loops||1);else{b.o._load(a.sID,a._iO.url,a._iO.stream?true:false,a._iO.autoPlay?true:false,a._iO.loops||1);a._iO.isMovieStar&&a._iO.autoLoad&&!a._iO.autoPlay&&a.pause()}}catch(n){k("smError",2);v("onload",false);b.onerror();
+b.disable()}return a};this.unload=function(){if(a.readyState!==0){b._wD('SMSound.unload(): "'+a.sID+'"');a.readyState!==2&&a.setPosition(0,true);if(a.isHTML5){e();if(i){i.pause();i.src=b.nullURL;i.load();i=a._audio=null}}else if(o===8)b.o._unload(a.sID,b.nullURL);else{a.setAutoPlay(false);b.o._unload(a.sID)}f()}return a};this.destruct=function(){b._wD('SMSound.destruct(): "'+a.sID+'"');if(a.isHTML5){e();if(i){i.pause();i.src="about:blank";i.load();i=a._audio=null}}else{a._iO.onfailure=null;b.o._destroySound(a.sID)}b.destroySound(a.sID,
+true)};this.start=this.play=function(d){d||(d={});a._iO=u(d,a._iO);a._iO=u(a._iO,a.options);a.instanceOptions=a._iO;if(a._iO.serverURL)if(!a.connected){b._wD("SMSound.play(): Netstream not connected yet - setting autoPlay");a.setAutoPlay(true);return a}if(X(a._iO)){a._setup_html5(a._iO);m()}if(a.playState===1)if(d=a._iO.multiShot){b._wD('SMSound.play(): "'+a.sID+'" already playing (multi-shot)',1);a.isHTML5&&a.setPosition(a._iO.position)}else{b._wD('SMSound.play(): "'+a.sID+'" already playing (one-shot)',
+1);return a}if(a.loaded)b._wD('SMSound.play(): "'+a.sID+'"');else if(a.readyState===0){b._wD('SMSound.play(): Attempting to load "'+a.sID+'"',1);if(a.isHTML5){a.load(a._iO);a.readyState=1}else if(!a._iO.serverURL){a._iO.autoPlay=true;a.load(a._iO)}}else if(a.readyState===2){b._wD('SMSound.play(): Could not load "'+a.sID+'" - exiting',2);return a}else b._wD('SMSound.play(): "'+a.sID+'" is loading - attempting to play..',1);if(a.paused){b._wD('SMSound.play(): "'+a.sID+'" is resuming from paused state',
+1);a.resume()}else{b._wD('SMSound.play(): "'+a.sID+'" is starting to play');a.playState=1;if(!a.instanceCount||o>8&&!a.isHTML5)a.instanceCount++;a.position=typeof a._iO.position!=="undefined"&&!isNaN(a._iO.position)?a._iO.position:0;a._iO=V(a._iO);a._iO.onplay&&a._iO.onplay.apply(a);a.setVolume(a._iO.volume,true);a.setPan(a._iO.pan,true);if(a.isHTML5){m();a._setup_html5().play()}else{o===9&&a._iO.serverURL&&a.setAutoPlay(true);b.o._start(a.sID,a._iO.loops||1,o===9?a.position:a.position/1E3)}}return a};
+this.stop=function(d){if(a.playState===1){a._onbufferchange(0);a.resetOnPosition(0);if(!a.isHTML5)a.playState=0;a.paused=false;a._iO.onstop&&a._iO.onstop.apply(a);if(a.isHTML5){if(i){a.setPosition(0);i.pause();a.playState=0;a._onTimer();e();a.unload()}}else{b.o._stop(a.sID,d);a._iO.serverURL&&a.unload()}a.instanceCount=0;a._iO={}}return a};this.setAutoPlay=function(d){a._iO.autoPlay=d;b.o._setAutoPlay(a.sID,d);if(d)a.instanceCount||a.instanceCount++};this.setPosition=function(d){if(typeof d==="undefined")d=
+0;d=a.isHTML5?Math.max(d,0):Math.min(a.duration,Math.max(d,0));a._iO.position=d;a.resetOnPosition(a._iO.position);if(a.isHTML5){if(i){b._wD("setPosition(): setting position to "+a._iO.position/1E3);if(a.playState)try{i.currentTime=a._iO.position/1E3}catch(g){b._wD("setPosition("+a._iO.position+"): WARN: Caught exception: "+g.message,2)}else b._wD("HTML 5 warning: cannot set position while playState == 0 (not playing)",2);if(a.paused){a._onTimer(true);a._iO.useMovieStar&&a.resume()}}}else b.o._setPosition(a.sID,
+o===9?a._iO.position:a._iO.position/1E3,a.paused||!a.playState);return a};this.pause=function(d){if(a.paused||a.playState===0&&a.readyState!==1)return a;b._wD("SMSound.pause()");a.paused=true;if(a.isHTML5){a._setup_html5().pause();e()}else if(d||d===undefined)b.o._pause(a.sID);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){if(!a.paused||a.playState===0)return a;b._wD("SMSound.resume()");a.paused=false;a.playState=1;if(a.isHTML5){a._setup_html5().play();m()}else b.o._pause(a.sID);
+a._iO.onresume&&a._iO.onresume.apply(a);return a};this.togglePause=function(){b._wD("SMSound.togglePause()");if(a.playState===0){a.play({position:o===9&&!a.isHTML5?a.position:a.position/1E3});return a}a.paused?a.resume():a.pause();return a};this.setPan=function(d,g){if(typeof d==="undefined")d=0;if(typeof g==="undefined")g=false;a.isHTML5||b.o._setPan(a.sID,d);a._iO.pan=d;if(!g)a.pan=d;return a};this.setVolume=function(d,g){if(typeof d==="undefined")d=100;if(typeof g==="undefined")g=false;if(a.isHTML5){if(i)i.volume=
+d/100}else b.o._setVolume(a.sID,b.muted&&!a.muted||a.muted?0:d);a._iO.volume=d;if(!g)a.volume=d;return a};this.mute=function(){a.muted=true;if(a.isHTML5){if(i)i.muted=true}else b.o._setVolume(a.sID,0);return a};this.unmute=function(){a.muted=false;var d=typeof a._iO.volume!=="undefined";if(a.isHTML5){if(i)i.muted=false}else b.o._setVolume(a.sID,d?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=function(d,g,n){a._onPositionItems.push({position:d,
+method:g,scope:typeof n!=="undefined"?n:a,fired:false});return a};this.processOnPosition=function(){var d,g;d=a._onPositionItems.length;if(!d||!a.playState||a._onPositionFired>=d)return false;for(d=d;d--;){g=a._onPositionItems[d];if(!g.fired&&a.position>=g.position){g.method.apply(g.scope,[g.position]);g.fired=true;b._onPositionFired++}}};this.resetOnPosition=function(d){var g,n;g=a._onPositionItems.length;if(!g)return false;for(g=g;g--;){n=a._onPositionItems[g];if(n.fired&&d<=n.position){n.fired=
+false;b._onPositionFired--}}};this._onTimer=function(d){if(a._hasTimer||d)if(i&&(d||(a.playState>0||a.readyState===1)&&!a.paused)){a.duration=l();a.durationEstimate=a.duration;d=i.currentTime?i.currentTime*1E3:0;a._whileplaying(d,{},{},{},{});return true}else{b._wD('_onTimer: Warn for "'+a.sID+'": '+(!i?"Could not find element. ":"")+(a.playState===0?"playState bad, 0?":"playState = "+a.playState+", OK"));return false}};l=function(){var d=i?i.duration*1E3:undefined;if(d)return!isNaN(d)?d:null};m=
+function(){a.isHTML5&&ya(a)};e=function(){a.isHTML5&&za(a)};f=function(){a._onPositionItems=[];a._onPositionFired=0;a._hasTimer=null;a._added_events=null;i=a._audio=null;a.bytesLoaded=null;a.bytesTotal=null;a.position=null;a.duration=null;a.durationEstimate=null;a.failures=0;a.loaded=false;a.playState=0;a.paused=false;a.readyState=0;a.muted=false;a.didBeforeFinish=false;a.didJustBeforeFinish=false;a.isBuffering=false;a.instanceOptions={};a.instanceCount=0;a.peakData={left:0,right:0};a.waveformData=
+{left:[],right:[]};a.eqData=[];a.eqData.left=[];a.eqData.right=[]};f();this._setup_html5=function(d){d=u(a._iO,d);if(i){if(a.url!==d.url){b._wD("setting new URL on existing object: "+d.url);i.src=d.url}}else{b._wD("creating HTML 5 audio element with URL: "+d.url);a._audio=new Audio(d.url);i=a._audio;a.isHTML5=true;h()}i.loop=d.loops>1?"loop":"";return a._audio};h=function(){function d(g,n,s){return i?i.addEventListener(g,n,s||false):null}if(a._added_events)return false;a._added_events=true;d("load",
+function(){b._wD("HTML5::load: "+a.sID);if(i){a._onbufferchange(0);a._whileloading(a.bytesTotal,a.bytesTotal,l());a._onload(1)}},false);d("canplay",function(){b._wD("HTML5::canplay: "+a.sID);a._onbufferchange(0)},false);d("waiting",function(){b._wD("HTML5::waiting: "+a.sID);a._onbufferchange(1)},false);d("progress",function(g){b._wD("HTML5::progress: "+a.sID+": loaded/total: "+(g.loaded||0)+","+(g.total||1));if(!a.loaded&&i){a._onbufferchange(0);a._whileloading(g.loaded||0,g.total||1,l())}},false);
+d("error",function(){if(i){b._wD("HTML5::error: "+i.error.code);a._onload(0)}},false);d("loadstart",function(){b._wD("HTML5::loadstart: "+a.sID);a._onbufferchange(1)},false);d("play",function(){b._wD("HTML5::play: "+a.sID);a._onbufferchange(0)},false);d("playing",function(){b._wD("HTML5::playing: "+a.sID);a._onbufferchange(0)},false);d("timeupdate",function(){a._onTimer()},false);setTimeout(function(){a&&i&&d("ended",function(){b._wD("HTML5::ended: "+a.sID);a._onfinish()},false)},250)};this._whileloading=
+function(d,g,n,s){a.bytesLoaded=d;a.bytesTotal=g;a.duration=Math.floor(n);if(a._iO.isMovieStar){a.durationEstimate=a.duration;a.readyState!==3&&a._iO.whileloading&&a._iO.whileloading.apply(a)}else{a.durationEstimate=parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10);if(a.durationEstimate===undefined)a.durationEstimate=a.duration;a.bufferLength=s;if((a._iO.isMovieStar||a.readyState!==3)&&a._iO.whileloading)a._iO.whileloading.apply(a)}};this._onid3=function(d,g){b._wD('SMSound._onid3(): "'+this.sID+
+'" ID3 data received.');var n=[],s,w;s=0;for(w=d.length;s<w;s++)n[d[s]]=g[s];a.id3=u(a.id3,n);a._iO.onid3&&a._iO.onid3.apply(a)};this._whileplaying=function(d,g,n,s,w){if(isNaN(d)||d===null)return false;if(a.playState===0&&d>0)d=0;a.position=d;a.processOnPosition();if(o>8&&!a.isHTML5){if(a._iO.usePeakData&&typeof g!=="undefined"&&g)a.peakData={left:g.leftPeak,right:g.rightPeak};if(a._iO.useWaveformData&&typeof n!=="undefined"&&n)a.waveformData={left:n.split(","),right:s.split(",")};if(a._iO.useEQData)if(typeof w!==
+"undefined"&&w&&w.leftEQ){d=w.leftEQ.split(",");a.eqData=d;a.eqData.left=d;if(typeof w.rightEQ!=="undefined"&&w.rightEQ)a.eqData.right=w.rightEQ.split(",")}}if(a.playState===1){!a.isHTML5&&a.isBuffering&&a._onbufferchange(0);a._iO.whileplaying&&a._iO.whileplaying.apply(a);if((a.loaded||!a.loaded&&a._iO.isMovieStar)&&a._iO.onbeforefinish&&a._iO.onbeforefinishtime&&!a.didBeforeFinish&&a.duration-a.position<=a._iO.onbeforefinishtime){b._wD("duration-position &lt;= onbeforefinishtime: "+a.duration+" - "+
+a.position+" &lt= "+a._iO.onbeforefinishtime+" ("+(a.duration-a.position)+")");a._onbeforefinish()}}};this._onconnect=function(d){d=d===1;b._wD('SMSound._onconnect(): "'+a.sID+'"'+(d?" connected.":" failed to connect? - "+a.url),d?1:2);if(a.connected=d){a.failures=0;if(a._iO.autoLoad||a._iO.autoPlay)a.load(a._iO);a._iO.autoPlay&&a.play();a._iO.onconnect&&a._iO.onconnect.apply(a,[d])}};this._onload=function(d){d=d===1?true:false;b._wD('SMSound._onload(): "'+a.sID+'"'+(d?" loaded.":" failed to load? - "+
+a.url),d?1:2);if(!d&&!a.isHTML5){b.sandbox.noRemote===true&&b._wD("SMSound._onload(): "+p("noNet"),1);b.sandbox.noLocal===true&&b._wD("SMSound._onload(): "+p("noLocal"),1)}a.loaded=d;a.readyState=d?3:2;a._iO.onload&&a._iO.onload.apply(a)};this._onfailure=function(d){a.failures++;b._wD('SMSound._onfailure(): "'+a.sID+'" count '+a.failures);a._iO.onfailure&&a.failures===1?a._iO.onfailure(a,d):b._wD("SMSound._onfailure(): ignoring")};this._onbeforefinish=function(){if(!a.didBeforeFinish){a.didBeforeFinish=
+true;if(a._iO.onbeforefinish){b._wD('SMSound._onbeforefinish(): "'+a.sID+'"');a._iO.onbeforefinish.apply(a)}}};this._onjustbeforefinish=function(){if(!a.didJustBeforeFinish){a.didJustBeforeFinish=true;if(a._iO.onjustbeforefinish){b._wD('SMSound._onjustbeforefinish(): "'+a.sID+'"');a._iO.onjustbeforefinish.apply(a)}}};this._onfinish=function(){a._onbufferchange(0);a.resetOnPosition(0);a._iO.onbeforefinishcomplete&&a._iO.onbeforefinishcomplete.apply(a);a.didBeforeFinish=false;a.didJustBeforeFinish=
+false;if(a.instanceCount){a.instanceCount--;if(!a.instanceCount){a.playState=0;a.paused=false;a.instanceCount=0;a.instanceOptions={};e()}if(!a.instanceCount||a._iO.multiShotEvents)if(a._iO.onfinish){b._wD('SMSound._onfinish(): "'+a.sID+'"');a._iO.onfinish.apply(a)}else a.isHTML5&&a.unload()}};this._onmetadata=function(d){b._wD("SMSound.onmetadata()");if(!d.width&&!d.height){k("noWH");d.width=320;d.height=240}a.metadata=d;a.width=d.width;a.height=d.height;if(a._iO.onmetadata){b._wD('SMSound.onmetadata(): "'+
+a.sID+'"');a._iO.onmetadata.apply(a)}b._wD("SMSound.onmetadata() complete")};this._onbufferchange=function(d){if(a.playState===0)return false;if(d&&a.isBuffering||!d&&!a.isBuffering)return false;a.isBuffering=d===1?true:false;if(a._iO.onbufferchange){b._wD("SMSound._onbufferchange(): "+d);a._iO.onbufferchange.apply(a)}};this._ondataerror=function(d){if(a.playState>0){b._wD("SMSound._ondataerror(): "+d);a._iO.ondataerror&&a._iO.ondataerror.apply(a)}}};if(!b.hasHTML5||H)if(j.addEventListener){j.addEventListener("focus",
+B,false);j.addEventListener("load",b.beginDelayedInit,false);j.addEventListener("unload",b.destruct,false);I&&j.addEventListener("mousemove",B,false)}else if(j.attachEvent){j.attachEvent("onfocus",B);j.attachEvent("onload",b.beginDelayedInit);j.attachEvent("unload",b.destruct)}else{v("onload",false);Y.onerror();Y.disable()}ma=function(){if(document.readyState==="complete"){L();document.detachEvent("onreadystatechange",ma)}};if(document.addEventListener)document.addEventListener("DOMContentLoaded",
+L,false);else document.attachEvent&&document.attachEvent("onreadystatechange",ma);document.readyState==="complete"&&setTimeout(L,100)}var Y=null;if(typeof SM2_DEFER==="undefined"||!SM2_DEFER)Y=new oa;j.SoundManager=oa;j.soundManager=Y})(window);
72 ...estreams/publicfacing/assets/scripts/flower/soundplayer/lib/soundmanager2/soundmanager2-nodebug-jsmin.js
@@ -0,0 +1,72 @@
+/*
+
+ SoundManager 2: Javascript Sound for the Web
+ --------------------------------------------
+ http://schillmania.com/projects/soundmanager2/
+
+ Copyright (c) 2007, Scott Schiller. All rights reserved.
+ Code provided under the BSD License:
+ http://schillmania.com/projects/soundmanager2/license.txt
+
+ V2.96a.20100624
+*/
+(function(j){function ha(N,X){function ia(){if(b.debugURLParam.test(O))b.debugMode=true}this.flashVersion=8;this.debugFlash=this.debugMode=false;this.useConsole=true;this.waitForWindowLoad=this.consoleOnly=false;this.nullURL="about:blank";this.allowPolling=true;this.useFastPolling=false;this.useMovieStar=true;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashLoadTimeout=1E3;this.wmode=null;this.allowFullScreen=true;this.allowScriptAccess="always";this.useHTML5Audio=this.useFlashBlock=
+false;this.html5Test=/^probably$/i;this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:true},mp4:{related:["aac","m4a"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:true},ogg:{type:["audio/ogg; codecs=vorbis"],required:false},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:false}};this.defaultOptions={autoLoad:false,stream:true,
+autoPlay:false,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5E3,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,multiShotEvents:false,position:null,pan:0,type:null,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions=
+{onmetadata:null,useVideo:false,bufferTime:3,serverURL:null,onconnect:null};this.version=null;this.versionNumber="V2.96a.20100624";this.movieURL=null;this.url=N||null;this.altURL=null;this.enabled=this.swfLoaded=false;this.o=null;this.movieID="sm2-container";this.id=X||"sm2movie";this.swfCSS={swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"};this.oMC=null;this.sounds={};
+this.soundIDs=[];this.isFullScreen=this.muted=false;this.isIE=navigator.userAgent.match(/MSIE/i);this.isSafari=navigator.userAgent.match(/safari/i);this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.didFlashBlock=this.specialWmodeCase=false;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.baseMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamTypes=
+["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.mimePattern=this.baseMimeTypes;this.features={buffering:false,peakData:false,waveformData:false,eqData:false,movieStar:false};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},
+description:null,noRemote:null,noLocal:null};this.hasHTML5=null;this.html5={usingFlash:null};this.ignoreFlash=false;var Y,b=this,x,y=navigator.userAgent,O=j.location.href.toString(),l=this.flashVersion,ja,P,z=[],E=false,F=false,p=false,u=false,ka=false,G,q,la,A,B,ma,Z,$,v,na,Q,R,H,aa,oa,S,pa,qa,I,ra,J=null,ba=null,K,ca,L,T,da,o,U=false,ea=false,sa,ta,C=null,ua,V,w=false,M,t,fa,va;N=y.match(/pre\//i);X=y.match(/(ipad|iphone)/i);y.match(/mobile/i);var ga=typeof document.hasFocus!=="undefined"?document.hasFocus():
+null,D=typeof document.hasFocus==="undefined"&&this.isSafari,wa=!D;this._use_maybe=O.match(/sm2\-useHTML5Maybe\=1/i);this._overHTTP=document.location?document.location.protocol.match(/http/i):null;this.useAltURL=!this._overHTTP;if(X||N){b.useHTML5Audio=true;b.ignoreFlash=true}if(N||this._use_maybe)b.html5Test=/^(probably|maybe)$/i;this.supported=function(){return C?p&&!u:b.useHTML5Audio&&b.hasHTML5};this.getMovie=function(c){return b.isIE?j[c]:b.isSafari?x(c)||document[c]:x(c)};this.loadFromXML=function(c){try{b.o._loadFromXML(c)}catch(a){I();
+return true}};this.createSound=function(c){function a(){f=T(f);b.sounds[e.id]=new Y(e);b.soundIDs.push(e.id);return b.sounds[e.id]}var f=null,i=null,e=null;if(!p)throw da("soundManager.createSound(): "+K("notReady"),arguments.callee.caller);if(arguments.length===2)c={id:arguments[0],url:arguments[1]};e=f=q(c);if(o(e.id,true))return b.sounds[e.id];if(V(e)){i=a();i._setup_html5(e)}else{if(l>8&&b.useMovieStar){if(e.isMovieStar===null)e.isMovieStar=e.serverURL||(e.type?e.type.match(b.netStreamPattern):
+false)||e.url.match(b.netStreamPattern)?true:false;if(e.isMovieStar)if(e.usePeakData)e.usePeakData=false}i=a();if(l===8)b.o._createSound(e.id,e.onjustbeforefinishtime,e.loops||1);else{b.o._createSound(e.id,e.url,e.onjustbeforefinishtime,e.usePeakData,e.useWaveformData,e.useEQData,e.isMovieStar,e.isMovieStar?e.useVideo:false,e.isMovieStar?e.bufferTime:false,e.loops||1,e.serverURL,e.duration||null,e.totalBytes||null,e.autoPlay,true);if(!e.serverURL){i.connected=true;e.onconnect&&e.onconnect.apply(i)}}}if(e.autoLoad||
+e.autoPlay)if(i)if(b.isHTML5){i.autobuffer="auto";i.preload="auto"}else i.load(e);e.autoPlay&&i.play();return i};this.createVideo=function(c){if(arguments.length===2)c={id:arguments[0],url:arguments[1]};if(l>=9){c.isMovieStar=true;c.useVideo=true}else return false;return b.createSound(c)};this.destroyVideo=this.destroySound=function(c,a){if(!o(c))return false;for(var f=0;f<b.soundIDs.length;f++)b.soundIDs[f]===c&&b.soundIDs.splice(f,1);b.sounds[c].unload();a||b.sounds[c].destruct();delete b.sounds[c]};
+this.load=function(c,a){if(!o(c))return false;return b.sounds[c].load(a)};this.unload=function(c){if(!o(c))return false;return b.sounds[c].unload()};this.start=this.play=function(c,a){if(!p)throw da("soundManager.play(): "+K("notReady"),arguments.callee.caller);if(!o(c)){a instanceof Object||(a={url:a});if(a&&a.url){a.id=c;return b.createSound(a).play()}else return false}return b.sounds[c].play(a)};this.setPosition=function(c,a){if(!o(c))return false;return b.sounds[c].setPosition(a)};this.stop=function(c){if(!o(c))return false;
+return b.sounds[c].stop()};this.stopAll=function(){for(var c in b.sounds)b.sounds[c]instanceof Y&&b.sounds[c].stop()};this.pause=function(c){if(!o(c))return false;return b.sounds[c].pause()};this.pauseAll=function(){for(var c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].pause()};this.resume=function(c){if(!o(c))return false;return b.sounds[c].resume()};this.resumeAll=function(){for(var c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].resume()};this.togglePause=function(c){if(!o(c))return false;
+return b.sounds[c].togglePause()};this.setPan=function(c,a){if(!o(c))return false;return b.sounds[c].setPan(a)};this.setVolume=function(c,a){if(!o(c))return false;return b.sounds[c].setVolume(a)};this.mute=function(c){var a=0;if(typeof c!=="string")c=null;if(c){if(!o(c))return false;return b.sounds[c].mute()}else{for(a=b.soundIDs.length;a--;)b.sounds[b.soundIDs[a]].mute();b.muted=true}};this.muteAll=function(){b.mute()};this.unmute=function(c){if(typeof c!=="string")c=null;if(c){if(!o(c))return false;
+return b.sounds[c].unmute()}else{for(c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].unmute();b.muted=false}};this.unmuteAll=function(){b.unmute()};this.toggleMute=function(c){if(!o(c))return false;return b.sounds[c].toggleMute()};this.getMemoryUse=function(){if(l===8)return 0;if(b.o)return parseInt(b.o._getMemoryUse(),10)};this.disable=function(c){if(typeof c==="undefined")c=false;if(u)return false;u=true;for(var a=b.soundIDs.length;a--;)qa(b.sounds[b.soundIDs[a]]);G(c);j.removeEventListener&&j.removeEventListener("load",
+B,false)};this.canPlayMIME=function(c){var a;if(b.hasHTML5)a=M({type:c});return!C||a?a:c?c.match(b.mimePattern)?true:false:null};this.canPlayURL=function(c){var a;if(b.hasHTML5)a=M(c);return!C||a?a:c?c.match(b.filePattern)?true:false:null};this.canPlayLink=function(c){if(typeof c.type!=="undefined"&&c.type)if(b.canPlayMIME(c.type))return true;return b.canPlayURL(c.href)};this.getSoundById=function(c){if(!c)throw new Error("SoundManager.getSoundById(): sID is null/undefined");return b.sounds[c]};this.onready=
+function(c,a){if(c&&c instanceof Function){a||(a=j);la(c,a);A();return true}else throw K("needFunction");};this.oninitmovie=function(){};this.onload=function(){};this.onerror=function(){};this.getMoviePercent=function(){return b.o&&typeof b.o.PercentLoaded!=="undefined"?b.o.PercentLoaded():null};this._wD=this._writeDebug=function(){};this._debug=function(){};this.reboot=function(){for(var c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].destruct();try{if(b.isIE)ba=b.o.innerHTML;J=b.o.parentNode.removeChild(b.o)}catch(a){}J=
+ba=null;u=F=E=ea=U=p=b.enabled=false;b.swfLoaded=false;b.soundIDs=[];b.sounds=[];b.o=null;for(c=z.length;c--;)z[c].fired=false;j.setTimeout(function(){b.beginDelayedInit()},20)};this.destruct=function(){b.disable(true)};this.beginDelayedInit=function(){ka=true;H();setTimeout(Z,500);setTimeout(na,20)};V=function(c){return(c.type?M({type:c.type}):false)||M(c.url)};M=function(c){if(!b.useHTML5Audio||!b.hasHTML5)return false;var a,f=b.audioFormats;if(!t){t=[];for(a in f)if(f.hasOwnProperty(a)){t.push(a);
+if(f[a].related)t=t.concat(f[a].related)}t=new RegExp("\\.("+t.join("|")+")","i")}a=typeof c.type!=="undefined"?c.type:null;c=typeof c==="string"?c.toLowerCase().match(t):null;if(!c||!c.length){if(!a)return false}else c=c[0].substr(1);if(c&&typeof b.html5[c]!=="undefined")return b.html5[c];else{if(!a)if(c&&b.html5[c])return b.html5[c];else a="audio/"+c;a=b.html5.canPlayType(a);return b.html5[c]=a}};va=function(){function c(n){var h,d,g=false;if(!a||typeof a.canPlayType!=="function")return false;if(n instanceof
+Array){h=0;for(d=n.length;h<d&&!g;h++)if(b.html5[n[h]]||a.canPlayType(n[h]).match(b.html5Test)){g=true;b.html5[n[h]]=true}return g}else return(n=a&&typeof a.canPlayType==="function"?a.canPlayType(n):false)&&(n.match(b.html5Test)?true:false)}if(!b.useHTML5Audio||typeof Audio==="undefined")return false;var a=typeof Audio!=="undefined"?new Audio:null,f,i={},e,k;e=b.audioFormats;for(f in e)if(e.hasOwnProperty(f)){i[f]=c(e[f].type);if(e[f]&&e[f].related)for(k=0;k<e[f].related.length;k++)b.html5[e[f].related[k]]=
+i[f]}i.canPlayType=a?c:null;b.html5=q(b.html5,i)};Q={};x=function(c){return document.getElementById(c)};K=function(){var c=Array.prototype.slice.call(arguments),a=c.shift();a=Q&&Q[a]?Q[a]:"";var f,i;if(a&&c&&c.length){f=0;for(i=c.length;f<i;f++)a=a.replace("%s",c[f])}return a};T=function(c){if(l===8&&c.loops>1&&c.stream)c.stream=false;return c};da=function(c,a){if(!a)return new Error("Error: "+c);typeof console!=="undefined"&&typeof console.trace!=="undefined"&&console.trace();c="Error: "+c+". \nCaller: "+
+a.toString();return new Error(c)};ja=function(){return false};qa=function(c){for(var a in c)if(c.hasOwnProperty(a)&&typeof c[a]==="function")c[a]=ja};I=function(c){if(typeof c==="undefined")c=false;if(u||c)b.disable(c)};ra=function(c){var a=null;if(c)if(c.match(/\.swf(\?\.*)?$/i)){if(a=c.substr(c.toLowerCase().lastIndexOf(".swf?")+4))return c}else if(c.lastIndexOf("/")!==c.length-1)c+="/";return(c&&c.lastIndexOf("/")!==-1?c.substr(0,c.lastIndexOf("/")+1):"./")+b.movieURL};$=function(){if(l!==8&&l!==
+9)b.flashVersion=8;var c=b.debugMode||b.debugFlash?"_debug.swf":".swf";if(b.flashVersion<9&&b.useHTML5Audio&&b.audioFormats.mp4.required)b.flashVersion=9;l=b.flashVersion;b.version=b.versionNumber+(w?" (HTML5-only mode)":l===9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(l>8){b.defaultOptions=q(b.defaultOptions,b.flash9Options);b.features.buffering=true}if(l>8&&b.useMovieStar){b.defaultOptions=q(b.defaultOptions,b.movieStarOptions);b.filePatterns.flash9=new RegExp("\\.(mp3|"+b.netStreamTypes.join("|")+")(\\?.*)?$",
+"i");b.mimePattern=b.netStreamMimeTypes;b.features.movieStar=true}else b.features.movieStar=false;b.filePattern=b.filePatterns[l!==8?"flash9":"flash8"];b.movieURL=(l===8?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",c);b.features.peakData=b.features.waveformData=b.features.eqData=l>8};oa=function(){return document.body?document.body:document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]};pa=function(c,a){if(!b.o||!b.allowPolling)return false;b.o._setPolling(c,
+a)};S=function(c,a){function f(){}var i=null;i=a?a:b.url;a=b.altURL?b.altURL:i;var e,k,n;c=typeof c==="undefined"?b.id:c;if(E&&F)return false;if(w){$();f();b.oMC=x(b.movieID);P();F=E=true;return false}E=true;$();b.url=ra(this._overHTTP?i:a);a=b.url;if(b.useHighPerformance&&b.useMovieStar&&b.defaultOptions.useVideo===true){i="soundManager note: disabling highPerformance, not applicable with movieStar mode+useVideo";b.useHighPerformance=false}b.wmode=!b.wmode&&b.useHighPerformance&&!b.useMovieStar?
+"transparent":b.wmode;if(b.wmode!==null&&!b.isIE&&!b.useHighPerformance&&navigator.platform.match(/win32/i)){b.specialWmodeCase=true;b.wmode=null}if(l===8)b.allowFullScreen=false;e={name:c,id:c,src:a,width:"100%",height:"100%",quality:"high",allowScriptAccess:b.allowScriptAccess,bgcolor:b.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:b.wmode,allowfullscreen:b.allowFullScreen?"true":"false"};if(b.debugFlash)e.FlashVars="debug=1";b.wmode||
+delete e.wmode;if(b.isIE){i=document.createElement("div");n='<object id="'+c+'" data="'+a+'" type="'+e.type+'" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+a+'" /><param name="AllowScriptAccess" value="'+b.allowScriptAccess+'" /><param name="quality" value="'+e.quality+'" />'+(b.wmode?'<param name="wmode" value="'+b.wmode+'" /> ':"")+'<param name="bgcolor" value="'+b.bgColor+'" /><param name="allowFullScreen" value="'+e.allowFullScreen+'" />'+(b.debugFlash?'<param name="FlashVars" value="'+
+e.FlashVars+'" />':"")+"<!-- --\></object>"}else{i=document.createElement("embed");for(k in e)e.hasOwnProperty(k)&&i.setAttribute(k,e[k])}ia();k=L();if(c=oa()){b.oMC=x(b.movieID)?x(b.movieID):document.createElement("div");if(b.oMC.id){c=b.oMC.className;b.oMC.className=(c?c+" ":b.swfCSS.swfDefault)+(k?" "+k:"");b.oMC.appendChild(i);if(b.isIE){k=b.oMC.appendChild(document.createElement("div"));k.className="sm2-object-box";k.innerHTML=n}F=true}else{b.oMC.id=b.movieID;b.oMC.className=b.swfCSS.swfDefault+
+" "+k;k=a=null;b.useFlashBlock||(a=b.useHighPerformance?{position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:{position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"});e=null;if(!b.debugFlash)for(e in a)if(a.hasOwnProperty(e))b.oMC.style[e]=a[e];try{b.isIE||b.oMC.appendChild(i);c.appendChild(b.oMC);if(b.isIE){k=b.oMC.appendChild(document.createElement("div"));k.className="sm2-object-box";k.innerHTML=n}F=true}catch(h){throw new Error(K("appXHTML"));
+}}}f()};o=this.getSoundById;q=function(c,a){var f={},i,e;for(i in c)if(c.hasOwnProperty(i))f[i]=c[i];c=typeof a==="undefined"?b.defaultOptions:a;for(e in c)if(c.hasOwnProperty(e)&&typeof f[e]==="undefined")f[e]=c[e];return f};R=function(){if(w){S();return false}if(b.o)return false;b.o=b.getMovie(b.id);if(!b.o){if(J){if(b.isIE)b.oMC.innerHTML=ba;else b.oMC.appendChild(J);J=null;E=true}else S(b.id,b.url);b.o=b.getMovie(b.id)}typeof b.oninitmovie==="function"&&setTimeout(b.oninitmovie,1)};ma=function(c){if(c)b.url=
+c;R()};Z=function(){if(U)return false;U=true;if(D&&!ga)return false;var c;p||(c=b.getMoviePercent());setTimeout(function(){c=b.getMoviePercent();if(!p&&wa)if(c===null)if(b.useFlashBlock||b.flashLoadTimeout===0)b.useFlashBlock&&ca();else I(true);else b.flashLoadTimeout!==0&&I(true)},b.flashLoadTimeout)};L=function(){var c=[];b.debugMode&&c.push(b.swfCSS.sm2Debug);b.debugFlash&&c.push(b.swfCSS.flashDebug);b.useHighPerformance&&c.push(b.swfCSS.highPerf);return c.join(" ")};ca=function(){var c=b.getMoviePercent();
+if(b.supported()){if(b.oMC)b.oMC.className=L()+" "+b.swfCSS.swfDefault+(" "+b.swfCSS.swfUnblocked)}else{if(C)b.oMC.className=L()+" "+b.swfCSS.swfDefault+" "+(c===null?b.swfCSS.swfTimedout:b.swfCSS.swfError);b.didFlashBlock=true;A(true);b.onerror instanceof Function&&b.onerror.apply(j)}};v=function(){if(ga||!D)return true;ga=wa=true;D&&j.removeEventListener("mousemove",v,false);U=false;setTimeout(Z,500);if(j.removeEventListener)j.removeEventListener("focus",v,false);else j.detachEvent&&j.detachEvent("onfocus",
+v)};G=function(c){if(p)return false;if(w){p=true;A();B();return true}b.useFlashBlock&&b.flashLoadTimeout&&!b.getMoviePercent()||(p=true);if(u||c){if(b.useFlashBlock)b.oMC.className=L()+" "+(b.getMoviePercent()===null?b.swfCSS.swfTimedout:b.swfCSS.swfError);A();b.onerror instanceof Function&&b.onerror.apply(j);return false}if(b.waitForWindowLoad&&!ka){if(j.addEventListener)j.addEventListener("load",B,false);else j.attachEvent&&j.attachEvent("onload",B);return false}else B()};la=function(c,a){z.push({method:c,
+scope:a||null,fired:false})};A=function(c){if(!p&&!c)return false;c={success:c?b.supported():!u};var a=[],f,i,e=!b.useFlashBlock||b.useFlashBlock&&!b.supported();f=0;for(i=z.length;f<i;f++)z[f].fired!==true&&a.push(z[f]);if(a.length){f=0;for(i=a.length;f<i;f++){a[f].scope?a[f].method.apply(a[f].scope,[c]):a[f].method(c);if(!e)a[f].fired=true}}};B=function(){j.setTimeout(function(){b.useFlashBlock&&ca();A();b.onload.apply(j)},1)};ua=function(){var c,a,f=!O.match(/usehtml5audio/i)&&!O.match(/sm2\-ignorebadua/i)&&
+b.isSafari&&y.match(/OS X 10_6_(3|4)/i)&&y.match(/(531\.22\.7|533\.16)/i);if(y.match(/iphone os (1|2|3_0|3_1)/i)?true:false){b.hasHTML5=false;w=true;if(b.oMC)b.oMC.style.display="none";return false}if(b.useHTML5Audio){if(!b.html5||!b.html5.canPlayType){b.hasHTML5=false;return true}else b.hasHTML5=true;if(f){b.useHTML5Audio=false;b.hasHTML5=false;return true}}else return true;for(a in b.audioFormats)if(b.audioFormats.hasOwnProperty(a))if(b.audioFormats[a].required&&!b.html5.canPlayType(b.audioFormats[a].type))c=
+true;if(b.ignoreFlash)c=false;w=b.useHTML5Audio&&b.hasHTML5&&!c;return c};P=function(){function c(){if(j.removeEventListener)j.removeEventListener("load",b.beginDelayedInit,false);else j.detachEvent&&j.detachEvent("onload",b.beginDelayedInit)}var a,f=[];if(p)return false;if(b.hasHTML5)for(a in b.audioFormats)b.audioFormats.hasOwnProperty(a)&&f.push(a+": "+b.html5[a]);if(w){if(!p){c();b.enabled=true;G()}return true}R();try{b.o._externalInterfaceTest(false);if(b.allowPolling)pa(true,b.useFastPolling?
+true:false);b.debugMode||b.o._disableDebug();b.enabled=true}catch(i){I(true);G();return false}G();c()};na=function(){if(ea)return false;S();R();return ea=true};H=function(){if(aa)return false;aa=true;ia();va();b.html5.usingFlash=ua();C=b.html5.usingFlash;aa=true;ma()};sa=function(c){if(!c._hasTimer)c._hasTimer=true};ta=function(c){if(c._hasTimer)c._hasTimer=false};this._setSandboxType=function(c){var a=b.sandbox;a.type=c;a.description=a.types[typeof a.types[c]!=="undefined"?c:"unknown"];if(a.type===
+"localWithFile"){a.noRemote=true;a.noLocal=false}else if(a.type==="localWithNetwork"){a.noRemote=false;a.noLocal=true}else if(a.type==="localTrusted"){a.noRemote=false;a.noLocal=false}};this._externalInterfaceOK=function(){if(b.swfLoaded)return false;(new Date).getTime();b.swfLoaded=true;D=false;b.isIE?setTimeout(P,100):P()};this._onfullscreenchange=function(c){b.isFullScreen=c===1?true:false;if(!b.isFullScreen)try{j.focus()}catch(a){}};Y=function(c){var a=this,f,i,e,k,n,h;this.sID=c.id;this.url=
+c.url;this._iO=this.instanceOptions=this.options=q(c);this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this.isHTML5=false;this.id3={};this._debug=function(){};this._debug();this.load=function(d){var g=null;if(typeof d!=="undefined"){a._iO=q(d);a.instanceOptions=a._iO}else{d=a.options;a._iO=d;a.instanceOptions=a._iO;if(a._lastURL&&a._lastURL!==a.url){a._iO.url=a.url;a.url=null}}if(a._iO.url===a.url&&a.readyState!==0&&a.readyState!==2)return a;a._lastURL=a.url;a.loaded=false;
+a.readyState=1;a.playState=0;if(V(a._iO)){g=a._setup_html5(a._iO);g.load();a._iO.autoPlay&&a.play()}else try{a.isHTML5=false;a._iO=T(a._iO);if(l===8)b.o._load(a.sID,a._iO.url,a._iO.stream,a._iO.autoPlay,a._iO.whileloading?1:0,a._iO.loops||1);else{b.o._load(a.sID,a._iO.url,a._iO.stream?true:false,a._iO.autoPlay?true:false,a._iO.loops||1);a._iO.isMovieStar&&a._iO.autoLoad&&!a._iO.autoPlay&&a.pause()}}catch(m){b.onerror();b.disable()}return a};this.unload=function(){if(a.readyState!==0){a.readyState!==
+2&&a.setPosition(0,true);if(a.isHTML5){e();if(h){h.pause();h.src=b.nullURL;h.load();h=a._audio=null}}else if(l===8)b.o._unload(a.sID,b.nullURL);else{a.setAutoPlay(false);b.o._unload(a.sID)}f()}return a};this.destruct=function(){if(a.isHTML5){e();if(h){h.pause();h.src="about:blank";h.load();h=a._audio=null}}else{a._iO.onfailure=null;b.o._destroySound(a.sID)}b.destroySound(a.sID,true)};this.start=this.play=function(d){d||(d={});a._iO=q(d,a._iO);a._iO=q(a._iO,a.options);a.instanceOptions=a._iO;if(a._iO.serverURL)if(!a.connected){a.setAutoPlay(true);
+return a}if(V(a._iO)){a._setup_html5(a._iO);k()}if(a.playState===1)if(d=a._iO.multiShot)a.isHTML5&&a.setPosition(a._iO.position);else return a;if(!a.loaded)if(a.readyState===0)if(a.isHTML5){a.load(a._iO);a.readyState=1}else{if(!a._iO.serverURL){a._iO.autoPlay=true;a.load(a._iO)}}else if(a.readyState===2)return a;if(a.paused)a.resume();else{a.playState=1;if(!a.instanceCount||l>8&&!a.isHTML5)a.instanceCount++;a.position=typeof a._iO.position!=="undefined"&&!isNaN(a._iO.position)?a._iO.position:0;a._iO=
+T(a._iO);a._iO.onplay&&a._iO.onplay.apply(a);a.setVolume(a._iO.volume,true);a.setPan(a._iO.pan,true);if(a.isHTML5){k();a._setup_html5().play()}else{l===9&&a._iO.serverURL&&a.setAutoPlay(true);b.o._start(a.sID,a._iO.loops||1,l===9?a.position:a.position/1E3)}}return a};this.stop=function(d){if(a.playState===1){a._onbufferchange(0);a.resetOnPosition(0);if(!a.isHTML5)a.playState=0;a.paused=false;a._iO.onstop&&a._iO.onstop.apply(a);if(a.isHTML5){if(h){a.setPosition(0);h.pause();a.playState=0;a._onTimer();
+e();a.unload()}}else{b.o._stop(a.sID,d);a._iO.serverURL&&a.unload()}a.instanceCount=0;a._iO={}}return a};this.setAutoPlay=function(d){a._iO.autoPlay=d;b.o._setAutoPlay(a.sID,d);if(d)a.instanceCount||a.instanceCount++};this.setPosition=function(d){if(typeof d==="undefined")d=0;d=a.isHTML5?Math.max(d,0):Math.min(a.duration,Math.max(d,0));a._iO.position=d;a.resetOnPosition(a._iO.position);if(a.isHTML5){if(h){if(a.playState)try{h.currentTime=a._iO.position/1E3}catch(g){}if(a.paused){a._onTimer(true);
+a._iO.useMovieStar&&a.resume()}}}else b.o._setPosition(a.sID,l===9?a._iO.position:a._iO.position/1E3,a.paused||!a.playState);return a};this.pause=function(d){if(a.paused||a.playState===0&&a.readyState!==1)return a;a.paused=true;if(a.isHTML5){a._setup_html5().pause();e()}else if(d||d===undefined)b.o._pause(a.sID);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){if(!a.paused||a.playState===0)return a;a.paused=false;a.playState=1;if(a.isHTML5){a._setup_html5().play();k()}else b.o._pause(a.sID);
+a._iO.onresume&&a._iO.onresume.apply(a);return a};this.togglePause=function(){if(a.playState===0){a.play({position:l===9&&!a.isHTML5?a.position:a.position/1E3});return a}a.paused?a.resume():a.pause();return a};this.setPan=function(d,g){if(typeof d==="undefined")d=0;if(typeof g==="undefined")g=false;a.isHTML5||b.o._setPan(a.sID,d);a._iO.pan=d;if(!g)a.pan=d;return a};this.setVolume=function(d,g){if(typeof d==="undefined")d=100;if(typeof g==="undefined")g=false;if(a.isHTML5){if(h)h.volume=d/100}else b.o._setVolume(a.sID,
+b.muted&&!a.muted||a.muted?0:d);a._iO.volume=d;if(!g)a.volume=d;return a};this.mute=function(){a.muted=true;if(a.isHTML5){if(h)h.muted=true}else b.o._setVolume(a.sID,0);return a};this.unmute=function(){a.muted=false;var d=typeof a._iO.volume!=="undefined";if(a.isHTML5){if(h)h.muted=false}else b.o._setVolume(a.sID,d?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=function(d,g,m){a._onPositionItems.push({position:d,method:g,scope:typeof m!==
+"undefined"?m:a,fired:false});return a};this.processOnPosition=function(){var d,g;d=a._onPositionItems.length;if(!d||!a.playState||a._onPositionFired>=d)return false;for(d=d;d--;){g=a._onPositionItems[d];if(!g.fired&&a.position>=g.position){g.method.apply(g.scope,[g.position]);g.fired=true;b._onPositionFired++}}};this.resetOnPosition=function(d){var g,m;g=a._onPositionItems.length;if(!g)return false;for(g=g;g--;){m=a._onPositionItems[g];if(m.fired&&d<=m.position){m.fired=false;b._onPositionFired--}}};
+this._onTimer=function(d){if(a._hasTimer||d)if(h&&(d||(a.playState>0||a.readyState===1)&&!a.paused)){a.duration=n();a.durationEstimate=a.duration;d=h.currentTime?h.currentTime*1E3:0;a._whileplaying(d,{},{},{},{});return true}else return false};n=function(){var d=h?h.duration*1E3:undefined;if(d)return!isNaN(d)?d:null};k=function(){a.isHTML5&&sa(a)};e=function(){a.isHTML5&&ta(a)};f=function(){a._onPositionItems=[];a._onPositionFired=0;a._hasTimer=null;a._added_events=null;h=a._audio=null;a.bytesLoaded=
+null;a.bytesTotal=null;a.position=null;a.duration=null;a.durationEstimate=null;a.failures=0;a.loaded=false;a.playState=0;a.paused=false;a.readyState=0;a.muted=false;a.didBeforeFinish=false;a.didJustBeforeFinish=false;a.isBuffering=false;a.instanceOptions={};a.instanceCount=0;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.eqData=[];a.eqData.left=[];a.eqData.right=[]};f();this._setup_html5=function(d){d=q(a._iO,d);if(h){if(a.url!==d.url)h.src=d.url}else{a._audio=new Audio(d.url);h=
+a._audio;a.isHTML5=true;i()}h.loop=d.loops>1?"loop":"";return a._audio};i=function(){function d(g,m,r){return h?h.addEventListener(g,m,r||false):null}if(a._added_events)return false;a._added_events=true;d("load",function(){if(h){a._onbufferchange(0);a._whileloading(a.bytesTotal,a.bytesTotal,n());a._onload(1)}},false);d("canplay",function(){a._onbufferchange(0)},false);d("waiting",function(){a._onbufferchange(1)},false);d("progress",function(g){if(!a.loaded&&h){a._onbufferchange(0);a._whileloading(g.loaded||
+0,g.total||1,n())}},false);d("error",function(){h&&a._onload(0)},false);d("loadstart",function(){a._onbufferchange(1)},false);d("play",function(){a._onbufferchange(0)},false);d("playing",function(){a._onbufferchange(0)},false);d("timeupdate",function(){a._onTimer()},false);setTimeout(function(){a&&h&&d("ended",function(){a._onfinish()},false)},250)};this._whileloading=function(d,g,m,r){a.bytesLoaded=d;a.bytesTotal=g;a.duration=Math.floor(m);if(a._iO.isMovieStar){a.durationEstimate=a.duration;a.readyState!==
+3&&a._iO.whileloading&&a._iO.whileloading.apply(a)}else{a.durationEstimate=parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10);if(a.durationEstimate===undefined)a.durationEstimate=a.duration;a.bufferLength=r;if((a._iO.isMovieStar||a.readyState!==3)&&a._iO.whileloading)a._iO.whileloading.apply(a)}};this._onid3=function(d,g){var m=[],r,s;r=0;for(s=d.length;r<s;r++)m[d[r]]=g[r];a.id3=q(a.id3,m);a._iO.onid3&&a._iO.onid3.apply(a)};this._whileplaying=function(d,g,m,r,s){if(isNaN(d)||d===null)return false;
+if(a.playState===0&&d>0)d=0;a.position=d;a.processOnPosition();if(l>8&&!a.isHTML5){if(a._iO.usePeakData&&typeof g!=="undefined"&&g)a.peakData={left:g.leftPeak,right:g.rightPeak};if(a._iO.useWaveformData&&typeof m!=="undefined"&&m)a.waveformData={left:m.split(","),right:r.split(",")};if(a._iO.useEQData)if(typeof s!=="undefined"&&s&&s.leftEQ){d=s.leftEQ.split(",");a.eqData=d;a.eqData.left=d;if(typeof s.rightEQ!=="undefined"&&s.rightEQ)a.eqData.right=s.rightEQ.split(",")}}if(a.playState===1){!a.isHTML5&&
+a.isBuffering&&a._onbufferchange(0);a._iO.whileplaying&&a._iO.whileplaying.apply(a);if((a.loaded||!a.loaded&&a._iO.isMovieStar)&&a._iO.onbeforefinish&&a._iO.onbeforefinishtime&&!a.didBeforeFinish&&a.duration-a.position<=a._iO.onbeforefinishtime)a._onbeforefinish()}};this._onconnect=function(d){d=d===1;if(a.connected=d){a.failures=0;if(a._iO.autoLoad||a._iO.autoPlay)a.load(a._iO);a._iO.autoPlay&&a.play();a._iO.onconnect&&a._iO.onconnect.apply(a,[d])}};this._onload=function(d){d=d===1?true:false;a.loaded=
+d;a.readyState=d?3:2;a._iO.onload&&a._iO.onload.apply(a)};this._onfailure=function(d){a.failures++;a._iO.onfailure&&a.failures===1&&a._iO.onfailure(a,d)};this._onbeforefinish=function(){if(!a.didBeforeFinish){a.didBeforeFinish=true;a._iO.onbeforefinish&&a._iO.onbeforefinish.apply(a)}};this._onjustbeforefinish=function(){if(!a.didJustBeforeFinish){a.didJustBeforeFinish=true;a._iO.onjustbeforefinish&&a._iO.onjustbeforefinish.apply(a)}};this._onfinish=function(){a._onbufferchange(0);a.resetOnPosition(0);
+a._iO.onbeforefinishcomplete&&a._iO.onbeforefinishcomplete.apply(a);a.didBeforeFinish=false;a.didJustBeforeFinish=false;if(a.instanceCount){a.instanceCount--;if(!a.instanceCount){a.playState=0;a.paused=false;a.instanceCount=0;a.instanceOptions={};e()}if(!a.instanceCount||a._iO.multiShotEvents)if(a._iO.onfinish)a._iO.onfinish.apply(a);else a.isHTML5&&a.unload()}};this._onmetadata=function(d){if(!d.width&&!d.height){d.width=320;d.height=240}a.metadata=d;a.width=d.width;a.height=d.height;a._iO.onmetadata&&
+a._iO.onmetadata.apply(a)};this._onbufferchange=function(d){if(a.playState===0)return false;if(d&&a.isBuffering||!d&&!a.isBuffering)return false;a.isBuffering=d===1?true:false;a._iO.onbufferchange&&a._iO.onbufferchange.apply(a)};this._ondataerror=function(){a.playState>0&&a._iO.ondataerror&&a._iO.ondataerror.apply(a)}};if(!b.hasHTML5||C)if(j.addEventListener){j.addEventListener("focus",v,false);j.addEventListener("load",b.beginDelayedInit,false);j.addEventListener("unload",b.destruct,false);D&&j.addEventListener("mousemove",
+v,false)}else if(j.attachEvent){j.attachEvent("onfocus",v);j.attachEvent("onload",b.beginDelayedInit);j.attachEvent("unload",b.destruct)}else{W.onerror();W.disable()}fa=function(){if(document.readyState==="complete"){H();document.detachEvent("onreadystatechange",fa)}};if(document.addEventListener)document.addEventListener("DOMContentLoaded",H,false);else document.attachEvent&&document.attachEvent("onreadystatechange",fa);document.readyState==="complete"&&setTimeout(H,100)}var W=null;if(typeof SM2_DEFER===
+"undefined"||!SM2_DEFER)W=new ha;j.SoundManager=ha;j.soundManager=W})(window);
2,766 securestreams/publicfacing/assets/scripts/flower/soundplayer/lib/soundmanager2/soundmanager2.js
@@ -0,0 +1,2766 @@
+/** @license
+ * SoundManager 2: Javascript Sound for the Web
+ * --------------------------------------------
+ * http://schillmania.com/projects/soundmanager2/
+ *
+ * Copyright (c) 2007, Scott Schiller. All rights reserved.
+ * Code provided under the BSD License:
+ * http://schillmania.com/projects/soundmanager2/license.txt
+ *
+ * V2.96a.20100624
+ */
+
+/*jslint white: false, onevar: true, undef: true, nomen: false, eqeqeq: true, plusplus: false, bitwise: true, regexp: true, newcap: true, immed: true, regexp: false */
+/*global SM2_DEFER, sm2Debugger, alert, console, document, navigator, setTimeout, window, document, setInterval, clearInterval, Audio */
+
+(function(window) {
+
+var soundManager = null;
+
+function SoundManager(smURL, smID) {
+
+ this.flashVersion = 8; // version of flash to require, either 8 or 9. Some API features require Flash 9.
+ this.debugMode = true; // enable debugging output (div#soundmanager-debug, OR console if available+configured)
+ this.debugFlash = false; // enable debugging output inside SWF, troubleshoot Flash/browser issues
+ this.useConsole = true; // use firebug/safari console.log()-type debug console if available
+ this.consoleOnly = false; // if console is being used, do not create/write to #soundmanager-debug
+ this.waitForWindowLoad = false; // force SM2 to wait for window.onload() before trying to call soundManager.onload()
+ this.nullURL = 'about:blank'; // path to "null" (empty) MP3 file, used to unload sounds (Flash 8 only)
+ this.allowPolling = true; // allow flash to poll for status update (required for whileplaying() events, peak, sound spectrum functions to work.)
+ this.useFastPolling = false; // uses lower flash timer interval for higher callback frequency, best combined with useHighPerformance
+ this.useMovieStar = true; // enable support for Flash 9.0r115+ (codename "MovieStar") MPEG4 audio+video formats (AAC, M4V, FLV, MOV etc.)
+ this.bgColor = '#ffffff'; // movie (.swf) background color, '#000000' useful if showing on-screen/full-screen video etc.
+ this.useHighPerformance = false; // position:fixed flash movie can help increase js/flash speed, minimize lag
+ this.flashLoadTimeout = 1000; // msec to wait for flash movie to load before failing (0 = infinity)
+ this.wmode = null; // mode to render the flash movie in - null, transparent, opaque (last two allow layering of HTML on top)
+ this.allowFullScreen = true; // enter full-screen (via double-click on movie) for flash 9+ video
+ this.allowScriptAccess = 'always'; // for scripting the SWF (object/embed property), either 'always' or 'sameDomain'
+ this.useFlashBlock = false; // *requires flashblock.css, see demos* - allow recovery from flash blockers. Wait indefinitely and apply timeout CSS to SWF, if applicable.
+ this.useHTML5Audio = false; // EXPERIMENTAL IN-PROGRESS feature: Use HTML 5 Audio() where API is supported (most Safari, Chrome versions), Firefox (no MP3/MP4.) Ideally, transparent vs. Flash API where possible.
+ this.html5Test = /^probably$/i; // HTML5 Audio() canPlayType() test. /^(probably|maybe)$/i if you want to be more liberal/risky.
+
+ this.audioFormats = {
+ // determines HTML5 support, flash requirements
+ // eg. if MP3 or MP4 required, Flash fallback is used if HTML5 can't play it
+ // shotgun approach to MIME testing due to browser variance
+ 'mp3': {
+ type: ['audio/mpeg; codecs="mp3"','audio/mpeg','audio/mp3','audio/MPA','audio/mpa-robust'],
+ required: true
+ },
+ 'mp4': {
+ related: ['aac','m4a'], // additional formats under the MP4 container.
+ type: ['audio/mp4; codecs="mp4a.40.2"','audio/aac','audio/x-m4a','audio/MP4A-LATM','audio/mpeg4-generic'],
+ required: true
+ },
+ 'ogg': {
+ type: ['audio/ogg; codecs=vorbis'],
+ required: false
+ },
+ 'wav': {
+ type: ['audio/wav; codecs="1"','audio/wav','audio/wave','audio/x-wav'],
+ required: false
+ }
+ };
+
+ this.defaultOptions = {
+ 'autoLoad': false, // enable automatic loading (otherwise .load() will be called on demand with .play(), the latter being nicer on bandwidth - if you want to .load yourself, you also can)
+ 'stream': true, // allows playing before entire file has loaded (recommended)
+ 'autoPlay': false, // enable playing of file as soon as possible (much faster if "stream" is true)
+ 'loops': 1, // how many times to repeat the sound (position will wrap around to 0, setPosition() will break out of loop when >0)
+ 'onid3': null, // callback function for "ID3 data is added/available"
+ 'onload': null, // callback function for "load finished"
+ 'whileloading': null, // callback function for "download progress update" (X of Y bytes received)
+ 'onplay': null, // callback for "play" start
+ 'onpause': null, // callback for "pause"
+ 'onresume': null, // callback for "resume" (pause toggle)
+ 'whileplaying': null, // callback during play (position update)
+ 'onstop': null, // callback for "user stop"
+ 'onfinish': null, // callback function for "sound finished playing"
+ 'onbeforefinish': null, // callback for "before sound finished playing (at [time])"
+ 'onbeforefinishtime': 5000, // offset (milliseconds) before end of sound to trigger beforefinish (eg. 1000 msec = 1 second)
+ 'onbeforefinishcomplete': null,// function to call when said sound finishes playing
+ 'onjustbeforefinish': null, // callback for [n] msec before end of current sound
+ 'onjustbeforefinishtime': 200, // [n] - if not using, set to 0 (or null handler) and event will not fire.
+ 'multiShot': true, // let sounds "restart" or layer on top of each other when played multiple times, rather than one-shot/one at a time
+ 'multiShotEvents': false, // fire multiple sound events (currently onfinish() only) when multiShot is enabled
+ 'position': null, // offset (milliseconds) to seek to within loaded sound data.
+ 'pan': 0, // "pan" settings, left-to-right, -100 to 100
+ 'type': null, // MIME-like hint for file pattern / canPlay() tests, eg. audio/mp3
+ 'volume': 100 // self-explanatory. 0-100, the latter being the max.
+ };
+
+ this.flash9Options = { // flash 9-only options, merged into defaultOptions if flash 9 is being used
+ 'isMovieStar': null, // "MovieStar" MPEG4 audio/video mode. Null (default) = auto detect MP4, AAC etc. based on URL. true = force on, ignore URL
+ 'usePeakData': false, // enable left/right channel peak (level) data
+ 'useWaveformData': false, // enable sound spectrum (raw waveform data) - WARNING: CPU-INTENSIVE: may set CPUs on fire.
+ 'useEQData': false, // enable sound EQ (frequency spectrum data) - WARNING: Also CPU-intensive.
+ 'onbufferchange': null, // callback for "isBuffering" property change
+ 'ondataerror': null // callback for waveform/eq data access error (flash playing audio in other tabs/domains)
+ };
+
+ this.movieStarOptions = { // flash 9.0r115+ MPEG4 audio/video options, merged into defaultOptions if flash 9+movieStar mode is enabled
+ 'onmetadata': null, // callback for when video width/height etc. are received
+ 'useVideo': false, // if loading movieStar content, whether to show video
+ 'bufferTime': 3, // seconds of data to buffer before playback begins (null = flash default of 0.1 seconds - if AAC playback is gappy, try increasing.)
+ 'serverURL': null, // rtmp: FMS or FMIS server to connect to, required when requesting media via RTMP or one of its variants
+ 'onconnect': null // rtmp: callback for connection to flash media server
+/*
+ 'duration': null, // rtmp: song duration (msec)
+ 'totalbytes': null // rtmp: byte size of the song
+*/
+ };
+
+ this.version = null;
+ this.versionNumber = 'V2.96a.20100624';
+ this.movieURL = null;
+ this.url = (smURL || null);
+ this.altURL = null;
+ this.swfLoaded = false;
+ this.enabled = false;
+ this.o = null;
+ this.movieID = 'sm2-container';
+ this.id = (smID || 'sm2movie');
+ this.swfCSS = {
+ swfDefault: 'movieContainer',
+ swfError: 'swf_error', // SWF loaded, but SM2 couldn't start (other error)
+ swfTimedout: 'swf_timedout',
+ swfUnblocked: 'swf_unblocked', // or loaded OK
+ sm2Debug: 'sm2_debug',
+ highPerf: 'high_performance',
+ flashDebug: 'flash_debug'
+ };
+ this.oMC = null;
+ this.sounds = {};
+ this.soundIDs = [];
+ this.muted = false;
+ this.isFullScreen = false; // set later by flash 9+
+ this.isIE = (navigator.userAgent.match(/MSIE/i));
+ this.isSafari = (navigator.userAgent.match(/safari/i));
+ this.debugID = 'soundmanager-debug';
+ this.debugURLParam = /([#?&])debug=1/i;
+ this.specialWmodeCase = false;
+ this.didFlashBlock = false;
+
+ this.filePattern = null;
+ this.filePatterns = {
+ flash8: /\.mp3(\?.*)?$/i,
+ flash9: /\.mp3(\?.*)?$/i
+ };
+
+ this.baseMimeTypes = /^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i; // mp3
+ this.netStreamMimeTypes = /^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i; // mp3, mp4, aac etc.
+ this.netStreamTypes = ['aac', 'flv', 'mov', 'mp4', 'm4v', 'f4v', 'm4a', 'mp4v', '3gp', '3g2']; // Flash v9.0r115+ "moviestar" formats
+ this.netStreamPattern = new RegExp('\\.(' + this.netStreamTypes.join('|') + ')(\\?.*)?$', 'i');
+ this.mimePattern = this.baseMimeTypes;
+
+ this.features = {
+ buffering: false,
+ peakData: false,
+ waveformData: false,
+ eqData: false,
+ movieStar: false
+ };
+
+ this.sandbox = {
+ 'type': null,
+ 'types': {
+ 'remote': 'remote (domain-based) rules',
+ 'localWithFile': 'local with file access (no internet access)',
+ 'localWithNetwork': 'local with network (internet access only, no local access)',
+ 'localTrusted': 'local, trusted (local+internet access)'
+ },
+ 'description': null,
+ 'noRemote': null,
+ 'noLocal': null
+ };
+
+ this.hasHTML5 = null; // switch for handling logic
+ this.html5 = { // stores canPlayType() results, etc. read-only.
+ // mp3: boolean
+ // mp4: boolean
+ usingFlash: null // set if/when flash fallback is needed
+ };
+ this.ignoreFlash = false; // used for special cases (eg. iPad/iPhone/palm OS?)
+
+ // --- private SM2 internals ---
+
+ var SMSound,
+ _s = this, _sm = 'soundManager', _id, _ua = navigator.userAgent, _wl = window.location.href.toString(), _fV = this.flashVersion, _doNothing, _init, _onready = [], _debugOpen = true, _debugTS, _didAppend = false, _appendSuccess = false, _didInit = false, _disabled = false, _windowLoaded = false, _wDS, _wdCount, _initComplete, _mergeObjects, _addOnReady, _processOnReady, _initUserOnload, _go, _waitForEI, _setVersionInfo, _handleFocus, _beginInit, _strings, _initMovie, _dcLoaded, _didDCLoaded, _getDocument, _createMovie, _setPolling, _debugLevels = ['log', 'info', 'warn', 'error'], _defaultFlashVersion = 8, _disableObject, _failSafely, _normalizeMovieURL, _oRemoved = null, _oRemovedHTML = null, _str, _flashBlockHandler, _getSWFCSS, _toggleDebug, _loopFix, _complain, _idCheck, _waitingForEI = false, _initPending = false, _smTimer, _onTimer, _startTimer, _stopTimer, _needsFlash = null, _featureCheck, _html5OK, _html5Only = false, _html5CanPlay, _html5Ext, _dcIE, _testHTML5,
+ _is_pre = _ua.match(/pre\//i),
+ _iPadOrPhone = _ua.match(/(ipad|iphone)/i),
+ _isMobile = (_ua.match(/mobile/i) || _is_pre || _iPadOrPhone),
+ _hasConsole = (typeof console !== 'undefined' && typeof console.log !== 'undefined'),
+ _isFocused = (typeof document.hasFocus !== 'undefined'?document.hasFocus():null),
+ _tryInitOnFocus = (typeof document.hasFocus === 'undefined' && this.isSafari),
+ _okToDisable = !_tryInitOnFocus;
+
+ this._use_maybe = (_wl.match(/sm2\-useHTML5Maybe\=1/i)); // temporary feature: #sm2-useHTML5Maybe=1 forces loose canPlay() check
+ this._overHTTP = (document.location?document.location.protocol.match(/http/i):null);
+ this.useAltURL = !this._overHTTP; // use altURL if not "online"
+
+ if (_iPadOrPhone || _is_pre) {
+ // might as well force it on Apple + Palm, flash support unlikely
+ _s.useHTML5Audio = true;
+ _s.ignoreFlash = true;
+ }
+
+ if (_is_pre || this._use_maybe) {
+ // less-strict canPlayType() checking option
+ _s.html5Test = /^(probably|maybe)$/i;
+ }
+
+ // Temporary feature: allow force of HTML5 via URL: #sm2-usehtml5audio=0 or 1
+ // <d>
+ (function(){
+ var a = '#sm2-usehtml5audio=', l = _wl, b = null;
+ if (l.indexOf(a) !== -1) {
+ b = (l.substr(l.indexOf(a)+a.length) === '1');
+ if (typeof console !== 'undefined' && typeof console.log !== 'undefined') {
+ console.log((b?'Enabling ':'Disabling ')+'useHTML5Audio via URL parameter');
+ }
+ _s.useHTML5Audio = b;
+ }
+ }());
+ // </d>
+
+ // --- public API methods ---
+
+ this.supported = function() {
+ return (_needsFlash?(_didInit && !_disabled):(_s.useHTML5Audio && _s.hasHTML5));
+ };
+
+ this.getMovie = function(smID) {
+ return _s.isIE?window[smID]:(_s.isSafari?_id(smID) || document[smID]:_id(smID));
+ };
+
+ this.loadFromXML = function(sXmlUrl) {
+ try {
+ _s.o._loadFromXML(sXmlUrl);
+ } catch(e) {
+ _failSafely();
+ return true;
+ }
+ };
+
+ this.createSound = function(oOptions) {
+ var _cs = 'soundManager.createSound(): ',
+ thisOptions = null, oSound = null, _tO = null;
+ if (!_didInit) {
+ throw _complain(_cs + _str('notReady'), arguments.callee.caller);
+ }
+ if (arguments.length === 2) {
+ // function overloading in JS! :) ..assume simple createSound(id,url) use case
+ oOptions = {
+ 'id': arguments[0],
+ 'url': arguments[1]
+ };
+ }
+ thisOptions = _mergeObjects(oOptions); // inherit SM2 defaults
+ _tO = thisOptions; // alias
+ // <d>
+ if (_tO.id.toString().charAt(0).match(/^[0-9]$/)) {
+ _s._wD(_cs + _str('badID', _tO.id), 2);
+ }
+ _s._wD(_cs + _tO.id + ' (' + _tO.url + ')', 1);
+ // </d>
+ if (_idCheck(_tO.id, true)) {
+ _s._wD(_cs + _tO.id + ' exists', 1);
+ return _s.sounds[_tO.id];
+ }
+
+ function make() {
+ thisOptions = _loopFix(thisOptions);
+ _s.sounds[_tO.id] = new SMSound(_tO);
+ _s.soundIDs.push(_tO.id);
+ return _s.sounds[_tO.id];
+ }
+
+ if (_html5OK(_tO)) {
+ oSound = make();
+ _s._wD('Loading sound '+_tO.id+' from HTML5');
+ oSound._setup_html5(_tO);
+ } else {
+ if (_fV > 8 && _s.useMovieStar) {
+ if (_tO.isMovieStar === null) {
+ _tO.isMovieStar = ((_tO.serverURL || (_tO.type?_tO.type.match(_s.netStreamPattern):false)||_tO.url.match(_s.netStreamPattern))?true:false);
+ }
+ if (_tO.isMovieStar) {
+ _s._wD(_cs + 'using MovieStar handling');
+ }
+ if (_tO.isMovieStar) {
+ if (_tO.usePeakData) {
+ _wDS('noPeak');
+ _tO.usePeakData = false;
+ }
+ if (_tO.loops > 1) {
+ _wDS('noNSLoop');
+ }
+ }
+ }
+ oSound = make();
+ // flash AS2
+ if (_fV === 8) {
+ _s.o._createSound(_tO.id, _tO.onjustbeforefinishtime, _tO.loops||1);
+ } else {
+ _s.o._createSound(_tO.id, _tO.url, _tO.onjustbeforefinishtime, _tO.usePeakData, _tO.useWaveformData, _tO.useEQData, _tO.isMovieStar, (_tO.isMovieStar?_tO.useVideo:false), (_tO.isMovieStar?_tO.bufferTime:false), _tO.loops||1, _tO.serverURL, _tO.duration||null, _tO.totalBytes||null, _tO.autoPlay, true);
+ if (!_tO.serverURL) {
+ // We are connected immediately
+ oSound.connected = true;
+ if (_tO.onconnect) {
+ _tO.onconnect.apply(oSound);
+ }
+ }
+ }
+ }
+
+ if (_tO.autoLoad || _tO.autoPlay) {
+ if (oSound) {
+ if (_s.isHTML5) {
+ oSound.autobuffer = 'auto'; // early HTML5 implementation (non-standard)
+ oSound.preload = 'auto'; // standard
+ } else {
+ oSound.load(_tO);
+ }
+ }
+ }
+ if (_tO.autoPlay) {
+ oSound.play();
+ }
+ return oSound;
+ };
+
+ this.createVideo = function(oOptions) {
+ var fN = 'soundManager.createVideo(): ';
+ if (arguments.length === 2) {
+ oOptions = {
+ 'id': arguments[0],
+ 'url': arguments[1]
+ };
+ }
+ if (_fV >= 9) {
+ oOptions.isMovieStar = true;
+ oOptions.useVideo = true;
+ } else {
+ _s._wD(fN + _str('f9Vid'), 2);
+ return false;
+ }
+ if (!_s.useMovieStar) {
+ _s._wD(fN + _str('noMS'), 2);
+ }
+ return _s.createSound(oOptions);
+ };
+
+ this.destroySound = function(sID, bFromSound) {
+ // explicitly destroy a sound before normal page unload, etc.
+ if (!_idCheck(sID)) {
+ return false;
+ }
+ for (var i = 0; i < _s.soundIDs.length; i++) {
+ if (_s.soundIDs[i] === sID) {
+ _s.soundIDs.splice(i, 1);
+ continue;
+ }
+ }
+ _s.sounds[sID].unload();
+ if (!bFromSound) {
+ // ignore if being called from SMSound instance
+ _s.sounds[sID].destruct();
+ }
+ delete _s.sounds[sID];
+ };
+
+ this.destroyVideo = this.destroySound;
+
+ this.load = function(sID, oOptions) {
+ if (!_idCheck(sID)) {
+ return false;
+ }
+ return _s.sounds[sID].load(oOptions);
+ };
+
+ this.unload = function(sID) {
+ if (!_idCheck(sID)) {
+ return false;
+ }
+ return _s.sounds[sID].unload();
+ };
+
+ this.play = function(sID, oOptions) {
+ var fN = 'soundManager.play(): ';
+ if (!_didInit) {
+ throw _complain(fN + _str('notReady'), arguments.callee.caller);
+ }
+ if (!_idCheck(sID)) {
+ if (!(oOptions instanceof Object)) {
+ oOptions = {
+ url: oOptions
+ }; // overloading use case: play('mySound','/path/to/some.mp3');
+ }
+ if (oOptions && oOptions.url) {
+ // overloading use case, creation+playing of sound: .play('someID',{url:'/path/to.mp3'});
+ _s._wD(fN + 'attempting to create "' + sID + '"', 1);
+ oOptions.id = sID;
+ return _s.createSound(oOptions).play();
+ } else {
+ return false;
+ }
+ }
+ return _s.sounds[sID].play(oOptions);
+ };
+
+ this.start = this.play; // just for convenience
+
+ this.setPosition = function(sID, nMsecOffset) {
+ if (!_idCheck(sID)) {
+ return false;
+ }
+ return _s.sounds[sID].setPosition(nMsecOffset);
+ };
+
+ this.stop = function(sID) {
+ if (!_idCheck(sID)) {
+ return false;
+ }
+ _s._wD('soundManager.stop(' + sID + ')', 1);
+ return _s.sounds[sID].stop();
+ };
+
+ this.stopAll = function() {
+ _s._wD('soundManager.stopAll()', 1);
+ for (var oSound in _s.sounds) {
+ if (_s.sounds[oSound] instanceof SMSound) {
+ _s.sounds[oSound].stop(); // apply only to sound objects
+ }
+ }
+ };
+
+ this.pause = function(sID) {
+ if (!_idCheck(sID)) {
+ return false;
+ }
+ return _s.sounds[sID].pause();
+ };
+
+ this.pauseAll = function() {
+ for (var i = _s.soundIDs.length; i--;) {
+ _s.sounds[_s.soundIDs[i]].pause();
+ }
+ };
+
+ this.resume = function(sID) {
+ if (!_idCheck(sID)) {
+ return false;
+ }
+ return _s.sounds[sID].resume();
+ };
+
+ this.resumeAll = function() {
+ for (var i = _s.soundIDs.length; i--;) {
+ _s.sounds[_s.soundIDs[i]].resume();
+ }
+ };
+
+ this.togglePause = function(sID) {
+ if (!_idCheck(sID)) {
+ return false;
+ }
+ return _s.sounds[sID].togglePause();
+ };
+
+ this.setPan = function(sID, nPan) {
+ if (!_idCheck(sID)) {
+ return false;
+ }
+ return _s.sounds[sID].setPan(nPan);
+ };
+
+ this.setVolume = function(sID, nVol) {
+ if (!_idCheck(sID)) {
+ return false;
+ }
+ return _s.sounds[sID].setVolume(nVol);
+ };
+
+ this.mute = function(sID) {
+ var fN = 'soundManager.mute(): ',
+ i = 0;
+ if (typeof sID !== 'string') {
+ sID = null;
+ }
+ if (!sID) {
+ _s._wD(fN + 'Muting all sounds');
+ for (i = _s.soundIDs.length; i--;) {
+ _s.sounds[_s.soundIDs[i]].mute();
+ }
+ _s.muted = true;
+ } else {
+ if (!_idCheck(sID)) {
+ return false;
+ }
+ _s._wD(fN + 'Muting "' + sID + '"');
+ return _s.sounds[sID].mute();
+ }
+ };
+
+ this.muteAll = function() {
+ _s.mute();
+ };
+
+ this.unmute = function(sID) {
+ var fN = 'soundManager.unmute(): ', i;
+ if (typeof sID !== 'string') {
+ sID = null;
+ }
+ if (!sID) {
+ _s._wD(fN + 'Unmuting all sounds');
+ for (i = _s.soundIDs.length; i--;) {
+ _s.sounds[_s.soundIDs[i]].unmute();
+ }
+ _s.muted = false;
+ } else {
+ if (!_idCheck(sID)) {
+ return false;
+ }
+ _s._wD(fN + 'Unmuting "' + sID + '"');
+ return _s.sounds[sID].unmute();
+ }
+ };
+
+ this.unmuteAll = function() {
+ _s.unmute();
+ };
+
+ this.toggleMute = function(sID) {
+ if (!_idCheck(sID)) {
+ return false;
+ }
+ return _s.sounds[sID].toggleMute();
+ };
+
+ this.getMemoryUse = function() {
+ if (_fV === 8) {
+ // not supported in Flash 8
+ return 0;
+ }
+ if (_s.o) {
+ return parseInt(_s.o._getMemoryUse(), 10);
+ }
+ };
+
+ this.disable = function(bNoDisable) {
+ // destroy all functions
+ if (typeof bNoDisable === 'undefined') {
+ bNoDisable = false;
+ }
+ if (_disabled) {
+ return false;
+ }
+ _disabled = true;
+ _wDS('shutdown', 1);
+ for (var i = _s.soundIDs.length; i--;) {
+ _disableObject(_s.sounds[_s.soundIDs[i]]);
+ }
+ _initComplete(bNoDisable); // fire "complete", despite fail
+ if (window.removeEventListener) {
+ window.removeEventListener('load', _initUserOnload, false);
+ }
+ // _disableObject(_s); // taken out to allow reboot()
+ };
+
+ this.canPlayMIME = function(sMIME) {
+ var result;
+ if (_s.hasHTML5) {
+ result = _html5CanPlay({type:sMIME});
+ }
+ if (!_needsFlash || result) {
+ // no flash, or OK
+ return result;
+ } else {
+ return (sMIME?(sMIME.match(_s.mimePattern)?true:false):null);
+ }
+ };
+
+ this.canPlayURL = function(sURL) {
+ var result;
+ if (_s.hasHTML5) {
+ result = _html5CanPlay(sURL);
+ }
+ if (!_needsFlash || result) {
+ // no flash, or OK
+ return result;
+ } else {
+ return (sURL?(sURL.match(_s.filePattern)?true:false):null);
+ }
+ };
+
+ this.canPlayLink = function(oLink) {
+ if (typeof oLink.type !== 'undefined' && oLink.type) {
+ if (_s.canPlayMIME(oLink.type)) {
+ return true;
+ }
+ }
+ return _s.canPlayURL(oLink.href);
+ };
+
+ this.getSoundById = function(sID, suppressDebug) {
+ if (!sID) {
+ throw new Error('SoundManager.getSoundById(): sID is null/undefined');
+ }
+ var result = _s.sounds[sID];
+ if (!result && !suppressDebug) {
+ _s._wD('"' + sID + '" is an invalid sound ID.', 2);
+ // soundManager._wD('trace: '+arguments.callee.caller);
+ }
+ return result;
+ };
+
+ this.onready = function(oMethod, oScope) {
+ /*
+ soundManager.onready(function(oStatus) {
+ console.log('SM2 init success: '+oStatus.success);
+ });
+ */
+ if (oMethod && oMethod instanceof Function) {
+ if (_didInit) {
+ _wDS('queue');
+ }
+ if (!oScope) {
+ oScope = window;
+ }
+ _addOnReady(oMethod, oScope);
+ _processOnReady();
+ return true;
+ } else {
+ throw _str('needFunction');
+ }
+ };
+
+ this.oninitmovie = function() {
+ // called after SWF has been appended to the DOM via JS (or retrieved from HTML)
+ // this is a stub for your own scripts.
+ };
+
+ this.onload = function() {
+ // window.onload() equivalent for SM2, ready to create sounds etc.
+ // this is a stub for your own scripts.
+ _s._wD('soundManager.onload()', 1);
+ };
+
+ this.onerror = function() {
+ // stub for user handler, called when SM2 fails to load/init
+ };
+
+ this.getMoviePercent = function() {
+ return (_s.o && typeof _s.o.PercentLoaded !== 'undefined'?_s.o.PercentLoaded():null);
+ };
+
+ this._writeDebug = function(sText, sType, bTimestamp) {
+ // pseudo-private console.log()-style output
+ // <d>
+ var sDID = 'soundmanager-debug', o, oItem, sMethod;
+ if (!_s.debugMode) {
+ return false;
+ }
+ if (typeof bTimestamp !== 'undefined' && bTimestamp) {
+ sText = sText + ' | ' + new Date().getTime();
+ }
+ if (_hasConsole && _s.useConsole) {
+ sMethod = _debugLevels[sType];
+ if (typeof console[sMethod] !== 'undefined') {
+ console[sMethod](sText);
+ } else {
+ console.log(sText);
+ }
+ if (_s.useConsoleOnly) {
+ return true;
+ }
+ }
+ try {
+ o = _id(sDID);
+ if (!o) {
+ return false;
+ }
+ oItem = document.createElement('div');
+ if (++_wdCount % 2 === 0) {
+ oItem.className = 'sm2-alt';
+ }
+ // sText = sText.replace(/\n/g,'<br />');
+ if (typeof sType === 'undefined') {
+ sType = 0;
+ } else {
+ sType = parseInt(sType, 10);
+ }
+ oItem.appendChild(document.createTextNode(sText));
+ if (sType) {
+ if (sType >= 2) {
+ oItem.style.fontWeight = 'bold';
+ }
+ if (sType === 3) {
+ oItem.style.color = '#ff3333';
+ }
+ }
+ // o.appendChild(oItem); // top-to-bottom
+ o.insertBefore(oItem, o.firstChild); // bottom-to-top
+ } catch(e) {
+ // oh well
+ }
+ o = null;
+ // </d>
+ };
+ this._wD = this._writeDebug; // alias
+
+ this._debug = function() {
+ // <d>
+ _wDS('currentObj', 1);
+ for (var i = 0, j = _s.soundIDs.length; i < j; i++) {
+ _s.sounds[_s.soundIDs[i]]._debug();
+ }
+ // </d>
+ };
+
+ this.reboot = function() {
+ // attempt to reset and init SM2
+ _s._wD('soundManager.reboot()');
+ if (_s.soundIDs.length) {
+ _s._wD('Destroying ' + _s.soundIDs.length + ' SMSound objects...');
+ }
+ for (var i = _s.soundIDs.length; i--;) {
+ _s.sounds[_s.soundIDs[i]].destruct();
+ }
+ // trash ze flash
+ try {
+ if (_s.isIE) {
+ _oRemovedHTML = _s.o.innerHTML;
+ }
+ _oRemoved = _s.o.parentNode.removeChild(_s.o);
+ _s._wD('Flash movie removed.');
+ } catch(e) {
+ // uh-oh.
+ _wDS('badRemove', 2);
+ }
+ // actually, force recreate of movie.
+ _oRemovedHTML = null;
+ _oRemoved = null;
+ _s.enabled = false;
+ _didInit = false;
+ _waitingForEI = false;
+ _initPending = false;
+ _didAppend = false;
+ _appendSuccess = false;
+ _disabled = false;
+ _s.swfLoaded = false;
+ _s.soundIDs = [];
+ _s.sounds = [];
+ _s.o = null;
+ for (i = _onready.length; i--;) {
+ _onready[i].fired = false;
+ }
+ _s._wD(_sm + ': Rebooting...');
+ window.setTimeout(function() {
+ _s.beginDelayedInit();
+ }, 20);
+ };
+
+ this.destruct = function() {
+ _s._wD('soundManager.destruct()');
+ _s.disable(true);
+ };
+
+ this.beginDelayedInit = function() {
+ // _s._wD('soundManager.beginDelayedInit()');
+ _windowLoaded = true;
+ _dcLoaded();
+ setTimeout(_waitForEI, 500);
+ setTimeout(_beginInit, 20);
+ };
+
+ // --- private SM2 internals ---
+
+ _html5OK = function(iO) {
+ return ((iO.type?_html5CanPlay({type:iO.type}):false)||_html5CanPlay(iO.url));
+ };
+
+ _html5CanPlay = function(sURL) {
+ // try to find MIME, test and return truthiness
+ if (!_s.useHTML5Audio || !_s.hasHTML5) {
+ return false;
+ }
+ var result, mime, fileExt, item, aF = _s.audioFormats;
+ if (!_html5Ext) {
+ _html5Ext = [];
+ for (item in aF) {
+ if (aF.hasOwnProperty(item)) {
+ _html5Ext.push(item);
+ if (aF[item].related) {
+ _html5Ext = _html5Ext.concat(aF[item].related);
+ }
+ }
+ }
+ _html5Ext = new RegExp('\\.('+_html5Ext.join('|')+')','i');
+ }
+ mime = (typeof sURL.type !== 'undefined'?sURL.type:null);
+ fileExt = (typeof sURL === 'string'?sURL.toLowerCase().match(_html5Ext):null); // TODO: Strip URL queries, etc.
+ if (!fileExt || !fileExt.length) {
+ if (!mime) {
+ return false;
+ }
+ } else {
+ fileExt = fileExt[0].substr(1); // "mp3", for example
+ }
+ if (fileExt && typeof _s.html5[fileExt] !== 'undefined') {
+ // result known
+ return _s.html5[fileExt];
+ } else {
+ if (!mime) {
+ if (fileExt && _s.html5[fileExt]) {
+ return _s.html5[fileExt];
+ } else {
+ // best-case guess, audio/whatever-dot-filename-format-you're-playing
+ mime = 'audio/'+fileExt;
+ }
+ }
+ result = _s.html5.canPlayType(mime);
+ _s.html5[fileExt] = result;
+ // _s._wD('canPlayType, found result: '+result);
+ return result;
+ }
+ };
+
+ _testHTML5 = function() {
+ if (!_s.useHTML5Audio || typeof Audio === 'undefined') {
+ return false;
+ }
+ var a = (typeof Audio !== 'undefined' ? new Audio():null), item, support = {}, aF, i;
+
+ function _cp(m) {
+ var canPlay, i, j, isOK = false;
+ if (!a || typeof a.canPlayType !== 'function') {
+ return false;
+ }
+ if (m instanceof Array) {
+ // iterate through all mime types, return any successes
+ for (i=0, j=m.length; i<j && !isOK; i++) {
+ if (_s.html5[m[i]] || a.canPlayType(m[i]).match(_s.html5Test)) {
+ isOK = true;
+ _s.html5[m[i]] = true;
+ }
+ }
+ return isOK;
+ } else {
+ canPlay = (a && typeof a.canPlayType === 'function' ? a.canPlayType(m) : false);
+ return (canPlay && (canPlay.match(_s.html5Test)?true:false));
+ }
+ }
+
+ // test all registered formats + codecs
+ aF = _s.audioFormats;
+ for (item in aF) {
+ if (aF.hasOwnProperty(item)) {
+ support[item] = _cp(aF[item].type);
+ // assign result to related formats, too
+ if (aF[item] && aF[item].related) {
+ for (i=0; i<aF[item].related.length; i++) {
+ _s.html5[aF[item].related[i]] = support[item];
+ }
+ }
+ }
+ }
+ support.canPlayType = (a?_cp:null);
+
+ _s.html5 = _mergeObjects(_s.html5, support);
+
+ };
+
+ _strings = {
+ notReady: 'Not loaded yet - wait for soundManager.onload() before calling sound-related methods',
+ appXHTML: _sm + '::createMovie(): appendChild/innerHTML set failed. May be app/xhtml+xml DOM-related.',
+ spcWmode: _sm + '::createMovie(): Removing wmode, preventing win32 below-the-fold SWF loading issue',
+ swf404: _sm + ': Verify that %s is a valid path.',
+ tryDebug: 'Try ' + _sm + '.debugFlash = true for more security details (output goes to SWF.)',
+ checkSWF: 'See SWF output for more debug info.',
+ localFail: _sm + ': Non-HTTP page (' + document.location.protocol + ' URL?) Review Flash player security settings for this special case:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/',
+ waitFocus: _sm + ': Special case: Waiting for focus-related event..',
+ waitImpatient: _sm + ': Getting impatient, still waiting for Flash%s...',
+ waitForever: _sm + ': Waiting indefinitely for Flash (will recover if unblocked)...',
+ needFunction: _sm + '.onready(): Function object expected',
+ badID: 'Warning: Sound ID "%s" should be a string, starting with a non-numeric character',
+ fl9Vid: 'flash 9 required for video. Exiting.',
+ noMS: 'MovieStar mode not enabled. Exiting.',
+ currentObj: '--- ' + _sm + '._debug(): Current sound objects ---',
+ waitEI: _sm + '::initMovie(): Waiting for ExternalInterface call from Flash..',
+ waitOnload: _sm + ': Waiting for window.onload()',
+ docLoaded: _sm + ': Document already loaded',
+ onload: _sm + '::initComplete(): calling soundManager.onload()',
+ onloadOK: _sm + '.onload() complete',
+ init: '-- ' + _sm + '::init() --',
+ didInit: _sm + '::init(): Already called?',
+ flashJS: _sm + ': Attempting to call Flash from JS..',
+ noPolling: _sm + ': Polling (whileloading()/whileplaying() support) is disabled.',
+ secNote: 'Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html',
+ badRemove: 'Warning: Failed to remove flash movie.',
+ noPeak: 'Warning: peakData features unsupported for movieStar formats',
+ shutdown: _sm + '.disable(): Shutting down',
+ queue: _sm + '.onready(): Queueing handler',
+ smFail: _sm + ': Failed to initialise.',
+ smError: 'SMSound.load(): Exception: JS-Flash communication failed, or JS error.',
+ fbTimeout: 'No flash response, applying .'+_s.swfCSS.swfTimedout+' CSS..',
+ fbLoaded: 'Flash loaded',
+ manURL: 'SMSound.load(): Using manually-assigned URL',
+ onURL: _sm + '.load(): current URL already assigned.',
+ badFV: 'soundManager.flashVersion must be 8 or 9. "%s" is invalid. Reverting to %s.',
+ as2loop: 'Note: Setting stream:false so looping can work (flash 8 limitation)',
+ noNSLoop: 'Note: Looping not implemented for MovieStar formats',
+ needfl9: 'Note: Switching to flash 9, required for MP4 formats.'
+ };
+
+ _id = function(sID) {
+ return document.getElementById(sID);
+ };
+
+ _wdCount = 0;
+
+ _str = function() { // o [,items to replace]
+ var params = Array.prototype.slice.call(arguments), // real array, please
+ o = params.shift(), // first arg
+ str = (_strings && _strings[o]?_strings[o]:''), i, j;
+ if (str && params && params.length) {
+ for (i = 0, j = params.length; i < j; i++) {
+ str = str.replace('%s', params[i]);
+ }
+ }
+ return str;
+ };
+
+ _loopFix = function(sOpt) {
+ // flash 8 requires stream = false for looping to work.
+ if (_fV === 8 && sOpt.loops > 1 && sOpt.stream) {
+ _wDS('as2loop');
+ sOpt.stream = false;
+ }
+ return sOpt;
+ };
+
+ _complain = function(sMsg, oCaller) {