function SoundManager(_1,_2){var _3=this;this.enabled=false;this.o=null;this.url=(_1||"soundmanager.swf");this.id=(_2||"soundmanagermovie");this.oMC=null;this.sounds=[];this.soundIDs=[];this.usePolling=true;this.isIE=(navigator.appName.indexOf("Microsoft")!=-1);this._didAppend=false;this._didInit=false;this._disabled=false;this.createMovieMethod="write";this.defaultOptions={debugMode:true,autoLoad:false,stream:true,autoPlay:false,onid3:null,onload:null,onprogress:null,onplay:null,whileplaying:null,onstop:null,onfinish:null,multiShot:true,pan:0,volume:100,foo:"bar"};this.getMovie=function(_4){return _3.isIE?window[_4]:document[_4];};this.loadFromXML=function(_5){try{_3.o._loadFromXML(_5);}catch(e){_3._failSafely();return true;}};this.createSound=function(_6){var _7=_3._mergeObjects(_6);_3._writeDebug("soundManager.createSound(): \"<a href=\"#\" onclick=\"soundManager.play('"+_7.id+"');return false\" title=\"play this sound\">"+_7.id+"</a>\" ("+_7.url+")");if(_3._idCheck(_7.id,true)){return false;}_3.sounds[_7.id]=new SMSound(_3,_7);_3.soundIDs[_3.soundIDs.length]=_7.id;try{_3.o._createSound(_7.id);}catch(e){_3._failSafely();return true;}if(_7.autoLoad||_7.autoPlay){_3.sounds[_7.id].load(_7);}};this.load=function(_8,_9){if(!_3._idCheck(_8)){return false;}_3.sounds[_8].load(_9);};this.play=function(_a,_b){if(!_3._idCheck(_a)){if(_b&&_b.url){soundManager._writeDebug("soundController.play(): attempting to create \""+_a+"\"");_b.id=_a;_3.createSound(_b);}else{return false;}}_3.sounds[_a].play(_b);};this.start=this.play;this.stop=function(_c){if(!_3._idCheck(_c)){return false;}_3.sounds[_c].stop();};this.stopAll=function(){for(var _d in _3.sounds){_d.stop();}};this.setPan=function(_e,_f){if(!_3._idCheck(_e)){return false;}_3.sounds[_e].setPan(_f);};this.setVolume=function(sID,_11){if(!_3._idCheck(sID)){return false;}_3.sounds[sID].setVolume(_11);};this.setPolling=function(_12){if(_3.usePolling&&_3.o){_3._writeDebug("soundManager.setPolling("+_12+")");_3.o._setPolling(_12);}};this.disable=function(){if(_3._disabled){return false;}_3._disabled=true;_3._writeDebug("soundManager.disable(): Disabling all functions - future calls will return false.");for(var i=_3.soundIDs.length;i--;){_3._disableObject(_3.sounds[_3.soundIDs[i]]);}_3.initComplete();_3._disableObject(_3);};this.getSoundById=function(sID,_15){var _16=_3.sounds[sID];if(!_16&&!_15){soundManager._writeDebug("\""+sID+"\" is an invalid sound ID.");}return _16;};this._idCheck=this.getSoundById;this._disableObject=function(o){for(var _18 in o){if(typeof o[_18]=="function"){o[_18]=function(){return false;};}}_18=null;};this._failSafely=function(){_3._writeDebug("soundManager.createSound(): JS-&gt;Flash communication failed (security restrictions?)");if(_3._didAppend){_3._writeDebug("Flash may be imposing restrictions due to the JS createElement() method. Try using the inline (plain old HTML) object/embed method if you're viewing this on the local filesystem.");}_3.disable();};this._createMovie=function(_19,_1a){var _1b=["<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"16\" height=\"16\" id=\""+_19+"\"><param name=\"movie\" value=\""+_1a+"\"><param name=\"quality\" value=\"high\"><param name=\"allowScriptAccess\" value=\"always\" /></object>","<embed name=\""+_19+"\" src=\""+_1a+"\" width=\"1\" height=\"1\" quality=\"high\" allowScriptAccess=\"always\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\"></embed>"];if(_3.createMovieMethod=="DOM"){_3.oMC=document.createElement("div");_3.oMC.className="movieContainer";_3.oMC.style.position="absolute";_3.oMC.style.left="-256px";_3.oMC.style.width="1px";_3.oMC.style.height="1px";_3.oMC.innerHTML=_1b[_3.isIE?0:1];document.getElementsByTagName("body")[0].appendChild(_3.oMC);}else{document.write("<div class=\"movieContainer\" style=\"position: absolute; left: -256px; width: 1px; height: 1px;\">"+(_1b[_3.isIE?0:1])+"</div>");}_3._didAppend=true;};this._writeDebug=function(_1c){if(!_3.defaultOptions.debugMode){return false;}var _1d="soundmanager-debug";try{var o=document.getElementById(_1d);if(!o){var _1f=document.createElement("div");_1f.id=_1d;o=document.body.appendChild(_1f);if(!o){return false;}}var p=document.createElement("div");p.innerHTML=_1c;o.insertBefore(p,o.firstChild);}catch(e){}o=null;};this._debug=function(){_3._writeDebug("soundManager._debug(): sounds by id/url:");for(var i=0,j=_3.soundIDs.length;i<j;i++){_3._writeDebug(_3.sounds[_3.soundIDs[i]].sID+" | "+_3.sounds[_3.soundIDs[i]].url);}};this._mergeObjects=function(_22,_23){var o1=_22;var o2=(typeof _23=="undefined"?_3.defaultOptions:_23);for(var o in o2){if(typeof o1[o]=="undefined"){o1[o]=o2[o];}}return o1;};this._initMovie=function(){if(_3.o){return false;}_3.o=_3.getMovie(_3.id);if(!_3.o){_3._createMovie(_3.id,_3.url);_3.o=_3.getMovie(_3.id);}if(!_3.o){_3._writeDebug("SoundManager(): Could not find object/embed element. Sound will be disabled.");_3.disable();}else{_3._writeDebug("SoundManager(): Got "+_3.o.nodeName+" element ("+(_3._didAppend?"created via JS":"static HTML")+")");}};this.initComplete=function(){if(_3._didInit){return false;}_3._didInit=true;_3._writeDebug("soundManager.initComplete()");if(typeof soundManagerLoad!="undefined"){try{soundManagerLoad();}catch(e){_3._writeDebug("soundManagerLoad() threw an exception.");return true;}}};this.init=function(){_3._initMovie();if(window.removeEventListener){window.removeEventListener("load",soundManagerInit,false);}else{if(window.detachEvent){window.detachEvent("onload",soundManagerInit);}}try{_3.o._externalInterfaceTest();_3._writeDebug("Flash ExternalInterface call (JS -&gt; Flash) succeeded.");if(!_3.usePolling){_3._writeDebug("Polling (onprogress/whileplaying support) is disabled.");}_3.setPolling(true);_3.enabled=true;}catch(e){_3._failSafely();_3.initComplete();return false;}_3.initComplete();};this.destructor=function(){_3.o=null;_3.oMC=null;};}function SMSound(oSM,_28){var _29=this;var sm=oSM;this.sID=_28.id;this.url=_28.url;this.options=sm._mergeObjects(_28);this.id3={};this.bytesLoaded=null;this.bytesTotal=null;this.position=null;this.duration=null;this.loaded=false;this.loadSuccess=null;this.playState=0;this.readyState=0;this.load=function(_2b){_29.loaded=false;_29.loadSuccess=null;_29.readyState=1;var _2c=sm._mergeObjects(_2b);if(typeof _2c.url=="undefined"){_2c.url=_29.url;}try{sm.o._load(_29.sID,_2c.url,_2c.stream,_2c.autoPlay,_2c.onprogress?1:0);}catch(e){sm._writeDebug("SMSound().load(): JS-&gt;Flash communication failed.");}};this.play=function(_2d){if(!_2d){_2d={};}var _2e=sm._mergeObjects(_2d);if(_29.playState==1){var _2f=_2e.multiShot;if(!_2f){sm._writeDebug("SMSound.play(): \""+_29.sID+"\" already playing? (one-shot)");return false;}else{sm._writeDebug("SMSound.play(): \""+_29.sID+"\" already playing (multi-shot)");}}if(!_29.loaded){if(_29.readyState==0){sm._writeDebug("SMSound.play(): .play() before load request. Attempting to load \""+_29.sID+"\"");_2e.stream=true;_2e.autoPlay=true;_29.load(_2e);}else{if(_29.readyState==2){sm._writeDebug("SMSound.play(): Could not load \""+_29.sID+"\" - exiting");return false;}else{sm._writeDebug("SMSound.play(): \""+_29.sID+"\" is loading - attempting to play..");}}}else{sm._writeDebug("SMSound.play(): \""+_29.sID+"\"");}_29.playState=1;_29.position=0;if(_2e.onplay){_2e.onplay.apply(_29);}_29.setVolume(_2e.volume);_29.setPan(_2e.pan);sm.o._start(_29.sID,_2e.loop||1,_2e.offset||0);};this.start=this.play;this.stop=function(_30){if(_29.playState==1){_29.playState=0;if(sm.defaultOptions.onstop){sm.defaultOptions.onstop.apply(_29);}sm.o._stop(_29.sID);}};this.setPan=function(_31){if(typeof _31=="undefined"){_31=0;}sm.o._setPan(_29.sID,_31);_29.options.pan=_31;};this.setVolume=function(_32){if(typeof _32=="undefined"){_32=100;}sm.o._setVolume(_29.sID,_32);_29.options.volume=_32;};this._onprogress=function(_33,_34,_35){_29.bytesLoaded=_33;_29.bytesTotal=_34;_29.duration=_35;if(_29.readyState!=3&&_29.options.onprogress){_29.options.onprogress.apply(_29);}};this._onid3=function(_36,_37){sm._writeDebug("SMSound()._onid3(): \""+this.sID+"\" ID3 data received.");var _38=[];for(var i=0,j=_36.length;i<j;i++){_38[_36[i]]=_37[i];}_29.id3=sm._mergeObjects(_29.id3,_38);if(_29.options.onid3){_29.options.onid3.apply(_29);}};this._whileplaying=function(_3a){if(isNaN(_3a)){return false;}_29.position=_3a;if(_29.playState==1&&_29.options.whileplaying){_29.options.whileplaying.apply(_29);}};this._onload=function(_3b){sm._writeDebug("SMSound._onload(): \""+_29.sID+"\""+(_3b?" loaded.":" failed to load."));_29.loaded=_3b;_29.loadSuccess=_3b;_29.readyState=_3b?3:2;if(_29.options.onload){_29.options.onload.apply(_29);}};this._onfinish=function(){sm._writeDebug("SMSound._onfinish(): \""+_29.sID+"\" finished playing");_29.playState=0;_29.position=0;if(_29.options.onfinish){_29.options.onfinish.apply(_29);}};}function soundManagerInit(){soundManager._initMovie();setTimeout(soundManager.init,1000);}function soundManagerPreinit(){soundManager._initMovie();}if(window.addEventListener){window.addEventListener("load",soundManagerInit,false);}else{if(window.attachEvent){window.attachEvent("onload",soundManagerInit);}else{soundManager.disable();}}