var soundManager=null;function SoundManager(B,A){this.flashVersion=8;this.debugMode=true;this.useConsole=true;this.consoleOnly=false;this.waitForWindowLoad=false;this.nullURL="null.mp3";this.allowPolling=true;this.useMovieStar=false;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashLoadTimeout=750;this.wmode=null;this.allowFullScreen=true;this.defaultOptions={autoLoad:false,stream:true,autoPlay:false,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5000,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,position:null,pan:0,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions={onmetadata:null,useVideo:false,bufferTime:null};var F=null;var E=this;this.version=null;this.versionNumber="V2.95a.20090501";this.movieURL=null;this.url=null;this.altURL=null;this.swfLoaded=false;this.enabled=false;this.o=null;this.id=(A||"sm2movie");this.oMC=null;this.sounds={};this.soundIDs=[];this.muted=false;this.isFullScreen=false;this.isIE=(navigator.userAgent.match(/MSIE/i));this.isSafari=(navigator.userAgent.match(/safari/i));this.isGecko=(navigator.userAgent.match(/gecko/i));this.debugID="soundmanager-debug";this.specialWmodeCase=false;this._debugOpen=true;this._didAppend=false;this._appendSuccess=false;this._didInit=false;this._disabled=false;this._windowLoaded=false;this._hasConsole=(typeof console!="undefined"&&typeof console.log!="undefined");this._debugLevels=["log","info","warn","error"];this._defaultFlashVersion=8;this._oRemoved=null;this._oRemovedHTML=null;var G=function(H){return document.getElementById(H)};this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.filePattern=null;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._setVersionInfo=function(){if(E.flashVersion!=8&&E.flashVersion!=9){alert('soundManager.flashVersion must be 8 or 9. "'+E.flashVersion+'" is invalid. Reverting to '+E._defaultFlashVersion+".");E.flashVersion=E._defaultFlashVersion}E.version=E.versionNumber+(E.flashVersion==9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(E.flashVersion>8){E.defaultOptions=E._mergeObjects(E.defaultOptions,E.flash9Options);E.features.buffering=true}if(E.flashVersion>8&&E.useMovieStar){E.defaultOptions=E._mergeObjects(E.defaultOptions,E.movieStarOptions);E.filePatterns.flash9=new RegExp("\\.(mp3|"+E.netStreamTypes.join("|")+")(\\?.*)?$","i");E.features.movieStar=true}else{E.useMovieStar=false;E.features.movieStar=false}E.filePattern=E.filePatterns[(E.flashVersion!=8?"flash9":"flash8")];E.movieURL=(E.flashVersion==8?"soundmanager2.swf":"soundmanager2_flash9.swf");E.features.peakData=E.features.waveformData=E.features.eqData=(E.flashVersion>8)};this._overHTTP=(document.location?document.location.protocol.match(/http/i):null);this._waitingforEI=false;this._initPending=false;this._tryInitOnFocus=(this.isSafari&&typeof document.hasFocus=="undefined");this._isFocused=(typeof document.hasFocus!="undefined"?document.hasFocus():null);this._okToDisable=!this._tryInitOnFocus;this.useAltURL=!this._overHTTP;var D="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html";this.strings={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."};this.supported=function(){return(E._didInit&&!E._disabled)};this.getMovie=function(H){return E.isIE?window[H]:(E.isSafari?G(H)||document[H]:G(H))};this.loadFromXML=function(H){try{E.o._loadFromXML(H)}catch(I){E._failSafely();return true}};this.createSound=function(I){if(!E._didInit){throw E._complain("soundManager.createSound(): "+E.strings.notReady,arguments.callee.caller)}if(arguments.length==2){I={id:arguments[0],url:arguments[1]}}var J=E._mergeObjects(I);var H=J;E._wD("soundManager.createSound(): "+H.id+" ("+H.url+")",1);if(E._idCheck(H.id,true)){E._wD("soundManager.createSound(): "+H.id+" exists",1);return E.sounds[H.id]}if(E.flashVersion>8&&E.useMovieStar){if(H.isMovieStar===null){H.isMovieStar=(H.url.match(E.netStreamPattern)?true:false)}if(H.isMovieStar){E._wD("soundManager.createSound(): using MovieStar handling")}if(H.isMovieStar&&(H.usePeakData||H.useWaveformData||H.useEQData)){E._wD("Warning: peak/waveform/eqData features unsupported for non-MP3 formats");H.usePeakData=false;H.useWaveformData=false;H.useEQData=false}}E.sounds[H.id]=new F(H);E.soundIDs[E.soundIDs.length]=H.id;if(E.flashVersion==8){E.o._createSound(H.id,H.onjustbeforefinishtime)}else{E.o._createSound(H.id,H.url,H.onjustbeforefinishtime,H.usePeakData,H.useWaveformData,H.useEQData,H.isMovieStar,(H.isMovieStar?H.useVideo:false),(H.isMovieStar?H.bufferTime:false))}if(H.autoLoad||H.autoPlay){if(E.sounds[H.id]){E.sounds[H.id].load(H)}}if(H.autoPlay){E.sounds[H.id].play()}return E.sounds[H.id]};this.createVideo=function(H){if(arguments.length==2){H={id:arguments[0],url:arguments[1]}}if(E.flashVersion>=9){H.isMovieStar=true;H.useVideo=true}else{E._wD("soundManager.createVideo(): flash 9 required for video. Exiting.",2);return false}if(!E.useMovieStar){E._wD("soundManager.createVideo(): MovieStar mode not enabled. Exiting.",2)}return E.createSound(H)};this.destroySound=function(I,H){if(!E._idCheck(I)){return false}for(var J=0;J<E.soundIDs.length;J++){if(E.soundIDs[J]==I){E.soundIDs.splice(J,1);continue}}E.sounds[I].unload();if(!H){E.sounds[I].destruct()}delete E.sounds[I]};this.destroyVideo=this.destroySound;this.load=function(H,I){if(!E._idCheck(H)){return false}E.sounds[H].load(I)};this.unload=function(H){if(!E._idCheck(H)){return false}E.sounds[H].unload()};this.play=function(H,I){if(!E._didInit){throw E._complain("soundManager.play(): "+E.strings.notReady,arguments.callee.caller)}if(!E._idCheck(H)){if(typeof I!="Object"){I={url:I}}if(I&&I.url){E._wD('soundController.play(): attempting to create "'+H+'"',1);I.id=H;E.createSound(I)}else{return false}}E.sounds[H].play(I)};this.start=this.play;this.setPosition=function(H,I){if(!E._idCheck(H)){return false}E.sounds[H].setPosition(I)};this.stop=function(H){if(!E._idCheck(H)){return false}E._wD("soundManager.stop("+H+")",1);E.sounds[H].stop()};this.stopAll=function(){E._wD("soundManager.stopAll()",1);for(var H in E.sounds){if(E.sounds[H] instanceof F){E.sounds[H].stop()}}};this.pause=function(H){if(!E._idCheck(H)){return false}E.sounds[H].pause()};this.pauseAll=function(){for(var H=E.soundIDs.length;H--;){E.sounds[E.soundIDs[H]].pause()}};this.resume=function(H){if(!E._idCheck(H)){return false}E.sounds[H].resume()};this.resumeAll=function(){for(var H=E.soundIDs.length;H--;){E.sounds[E.soundIDs[H]].resume()}};this.togglePause=function(H){if(!E._idCheck(H)){return false}E.sounds[H].togglePause()};this.setPan=function(H,I){if(!E._idCheck(H)){return false}E.sounds[H].setPan(I)};this.setVolume=function(I,H){if(!E._idCheck(I)){return false}E.sounds[I].setVolume(H)};this.mute=function(H){if(typeof H!="string"){H=null}if(!H){E._wD("soundManager.mute(): Muting all sounds");for(var I=E.soundIDs.length;I--;){E.sounds[E.soundIDs[I]].mute()}E.muted=true}else{if(!E._idCheck(H)){return false}E._wD('soundManager.mute(): Muting "'+H+'"');E.sounds[H].mute()}};this.muteAll=function(){E.mute()};this.unmute=function(H){if(typeof H!="string"){H=null}if(!H){E._wD("soundManager.unmute(): Unmuting all sounds");for(var I=E.soundIDs.length;I--;){E.sounds[E.soundIDs[I]].unmute()}E.muted=false}else{if(!E._idCheck(H)){return false}E._wD('soundManager.unmute(): Unmuting "'+H+'"');E.sounds[H].unmute()}};this.unmuteAll=function(){E.unmute()};this.getMemoryUse=function(){if(E.flashVersion==8){return 0}if(E.o){return parseInt(E.o._getMemoryUse(),10)}};this.setPolling=function(H){if(!E.o||!E.allowPolling){return false}E.o._setPolling(H)};this.disable=function(I){if(typeof I=="undefined"){I=false}if(E._disabled){return false}E._disabled=true;E._wD("soundManager.disable(): Shutting down",1);for(var H=E.soundIDs.length;H--;){E._disableObject(E.sounds[E.soundIDs[H]])}E.initComplete(I)};this.canPlayURL=function(H){return(H?(H.match(E.filePattern)?true:false):null)};this.getSoundById=function(I,J){if(!I){throw new Error("SoundManager.getSoundById(): sID is null/undefined")}var H=E.sounds[I];if(!H&&!J){E._wD('"'+I+'" is an invalid sound ID.',2)}return H};this.onload=function(){soundManager._wD("Warning: soundManager.onload() is undefined.",2)};this.onerror=function(){};this._idCheck=this.getSoundById;this._complain=function(I,K){var J="Error: ";if(!K){return new Error(J+I)}var M=new Error("");var N=null;if(M.stack){try{var O="@";var P=M.stack.split(O);N=P[4]}catch(L){N=M.stack}}if(typeof console!="undefined"&&typeof console.trace!="undefined"){console.trace()}var H=J+I+". \nCaller: "+K.toString()+(M.stack?" \nTop of stacktrace: "+N:(M.message?" \nMessage: "+M.message:""));return new Error(H)};var C=function(){return false};C._protected=true;this._disableObject=function(I){for(var H in I){if(typeof I[H]=="function"&&typeof I[H]._protected=="undefined"){I[H]=C}}H=null};this._failSafely=function(H){if(typeof H=="undefined"){H=false}if(!E._disabled||H){E._wD("soundManager: Failed to initialise.",2);E.disable(H)}};this._normalizeMovieURL=function(H){var I=null;if(H){if(H.match(/\.swf(\?.*)?$/i)){I=H.substr(H.toLowerCase().lastIndexOf(".swf?")+4);if(I){return H}}else{if(H.lastIndexOf("/")!=H.length-1){H=H+"/"}}}return(H&&H.lastIndexOf("/")!=-1?H.substr(0,H.lastIndexOf("/")+1):"./")+E.movieURL};this._getDocument=function(){return(document.body?document.body:(document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]))};this._getDocument._protected=true;this._createMovie=function(W,N){if(E._didAppend&&E._appendSuccess){return false}if(window.location.href.indexOf("debug=1")+1){E.debugMode=true}E._didAppend=true;E._setVersionInfo();var V=(N?N:E.url);var R=(E.altURL?E.altURL:V);E.url=E._normalizeMovieURL(E._overHTTP?V:R);N=E.url;var S=null;if(E.useHighPerformance&&E.useMovieStar&&E.defaultOptions.useVideo===true){S="soundManager note: disabling highPerformance, not applicable with movieStar mode + useVideo";E.useHighPerformance=false}E.wmode=(!E.wmode&&E.useHighPerformance&&!E.useMovieStar?"transparent":E.wmode);if(E.wmode!==null&&E.flashLoadTimeout!==0&&!E.useHighPerformance&&!E.isIE&&navigator.platform.match(/win32/i)){E.specialWmodeCase=true;E._wD("soundManager note: Removing wmode, preventing off-screen SWF loading issue");E.wmode=null}if(E.flashVersion==8){E.allowFullScreen=false}var Y={name:W,id:W,src:N,width:"100%",height:"100%",quality:"high",allowScriptAccess:"always",bgcolor:E.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:E.wmode,allowfullscreen:(E.allowFullScreen?"true":"false")};if(!E.wmode){delete Y.wmode}var H={id:W,data:N,type:"application/x-shockwave-flash",width:"100%",height:"100%",wmode:E.wmode};var O=null;var Z=null;if(E.isIE){O=document.createElement("div");var T='<object id="'+W+'" data="'+N+'" type="application/x-shockwave-flash" width="100%" height="100%"><param name="movie" value="'+N+'" /><param name="AllowScriptAccess" value="always" /><param name="quality" value="high" />'+(E.wmode?'<param name="wmode" value="'+E.wmode+'" /> ':"")+'<param name="bgcolor" value="'+E.bgColor+'" /><param name="allowFullScreen" value="'+(E.allowFullScreen?"true":"false")+'" /><!-- --></object>'}else{O=document.createElement("embed");for(Z in Y){if(Y.hasOwnProperty(Z)){O.setAttribute(Z,Y[Z])}}}var J=document.createElement("div");J.id=E.debugID+"-toggle";var K={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};J.appendChild(document.createTextNode("-"));J.onclick=E._toggleDebug;J.title="Toggle SM2 debug console";if(navigator.userAgent.match(/msie 6/i)){J.style.position="absolute";J.style.cursor="hand"}for(Z in K){if(K.hasOwnProperty(Z)){J.style[Z]=K[Z]}}var U=E._getDocument();if(U){E.oMC=G("sm2-container")?G("sm2-container"):document.createElement("div");if(!E.oMC.id){E.oMC.id="sm2-container";E.oMC.className="movieContainer";var P=null;var Q=null;if(E.useHighPerformance){P={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px"}}else{P={position:"absolute",width:"1px",height:"1px",top:"-999px",left:"-999px"}}var L=null;for(L in P){if(P.hasOwnProperty(L)){E.oMC.style[L]=P[L]}}try{if(!E.isIE){E.oMC.appendChild(O)}U.appendChild(E.oMC);if(E.isIE){Q=E.oMC.appendChild(document.createElement("div"));Q.className="sm2-object-box";Q.innerHTML=T}E._appendSuccess=true}catch(X){throw new Error(E.strings.appXHTML)}}else{E.oMC.appendChild(O);if(E.isIE){Q=E.oMC.appendChild(document.createElement("div"));Q.className="sm2-object-box";Q.innerHTML=T}E._appendSuccess=true}if(!G(E.debugID)&&((!E._hasConsole||!E.useConsole)||(E.useConsole&&E._hasConsole&&!E.consoleOnly))){var M=document.createElement("div");M.id=E.debugID;M.style.display=(E.debugMode?"block":"none");if(E.debugMode&&!G(J.id)){try{U.appendChild(J)}catch(I){throw new Error(E.strings.appXHTML)}U.appendChild(M)}}U=null}if(S){E._wD(S)}E._wD("-- SoundManager 2 "+E.version+(E.useMovieStar?", MovieStar mode":"")+(E.useHighPerformance?", high performance mode":"")+(E.wmode?", wmode: "+E.wmode:"")+" --",1);E._wD("soundManager._createMovie(): Trying to load "+N+(!E._overHTTP&&E.altURL?" (alternate URL)":""),1)};this._writeDebug=function(I,O,K){if(!E.debugMode){return false}if(typeof K!="undefined"&&K){I=I+" | "+new Date().getTime()}if(E._hasConsole&&E.useConsole){var H=E._debugLevels[O];if(typeof console[H]!="undefined"){console[H](I)}else{console.log(I)}if(E.useConsoleOnly){return true}}var N="soundmanager-debug";try{var M=G(N);if(!M){return false}var L=document.createElement("div");if(++E._wdCount%2===0){L.className="sm2-alt"}if(typeof O=="undefined"){O=0}else{O=parseInt(O,10)}L.appendChild(document.createTextNode(I));if(O){if(O>=2){L.style.fontWeight="bold"}if(O==3){L.style.color="#ff3333"}}M.insertBefore(L,M.firstChild)}catch(J){}M=null};this._writeDebug._protected=true;this._wdCount=0;this._wdCount._protected=true;this._wD=this._writeDebug;this._wDAlert=function(H){alert(H)};if(window.location.href.indexOf("debug=alert")+1&&E.debugMode){E._wD=E._wDAlert}this._toggleDebug=function(){var I=G(E.debugID);var H=G(E.debugID+"-toggle");if(!I){return false}if(E._debugOpen){H.innerHTML="+";I.style.display="none"}else{H.innerHTML="-";I.style.display="block"}E._debugOpen=!E._debugOpen};this._toggleDebug._protected=true;this._debug=function(){E._wD("--- soundManager._debug(): Current sound objects ---",1);for(var I=0,H=E.soundIDs.length;I<H;I++){E.sounds[E.soundIDs[I]]._debug()}};this._debugTS=function(K,H,I){if(typeof sm2Debugger!="undefined"){try{sm2Debugger.handleEvent(K,H,I)}catch(J){}}};this._debugTS._protected=true;this._mergeObjects=function(I,H){var L={};for(var J in I){if(I.hasOwnProperty(J)){L[J]=I[J]}}var K=(typeof H=="undefined"?E.defaultOptions:H);for(var M in K){if(K.hasOwnProperty(M)&&typeof L[M]=="undefined"){L[M]=K[M]}}return L};this.createMovie=function(H){if(H){E.url=H}E._initMovie()};this.go=this.createMovie;this._initMovie=function(){if(E.o){return false}E.o=E.getMovie(E.id);if(!E.o){if(!E.oRemoved){E._createMovie(E.id,E.url)}else{if(!E.isIE){E.oMC.appendChild(E.oRemoved)}else{E.oMC.innerHTML=E.oRemovedHTML}E.oRemoved=null;E._didAppend=true}E.o=E.getMovie(E.id)}if(E.o){E._wD("soundManager._initMovie(): Got "+E.o.nodeName+" element ("+(E._didAppend?"created via JS":"static HTML")+")",1);if(E.flashLoadTimeout>0){E._wD("soundManager._initMovie(): Waiting for ExternalInterface call from Flash..")}}};this.waitForExternalInterface=function(){if(E._waitingForEI){return false}E._waitingForEI=true;if(E._tryInitOnFocus&&!E._isFocused){E._wD("soundManager: Special case: Waiting for focus-related event..");return false}if(E.flashLoadTimeout>0){if(!E._didInit){E._wD("soundManager: Getting impatient, still waiting for Flash.. ;)")}setTimeout(function(){if(!E._didInit){E._wD("soundManager: No Flash response within reasonable time after document load.\nPossible causes: Loading "+E.movieURL+" failed, Flash version under "+E.flashVersion+", no support, flash blocked or JS-Flash security error.",2);if(!E._overHTTP){E._wD('soundManager: Loading this page from local/network file system (not over HTTP?) Flash security likely restricting JS-Flash access. Consider adding current URL to "trusted locations" in the Flash player security settings manager at '+D+", or simply serve this content over HTTP.",2)}E._debugTS("flashtojs",false,": Timed out"+(E._overHTTP)?" (Check flash security)":" (No plugin/missing SWF?)")}if(!E._didInit&&E._okToDisable){E._failSafely(true)}},E.flashLoadTimeout)}else{if(!E.didInit){E._wD("soundManager: Waiting indefinitely for Flash...")}}};this.handleFocus=function(){if(E._isFocused||!E._tryInitOnFocus){return true}E._okToDisable=true;E._isFocused=true;E._wD("soundManager.handleFocus()");if(E._tryInitOnFocus){window.removeEventListener("mousemove",E.handleFocus,false)}E._waitingForEI=false;setTimeout(E.waitForExternalInterface,500);if(window.removeEventListener){window.removeEventListener("focus",E.handleFocus,false)}else{if(window.detachEvent){window.detachEvent("onfocus",E.handleFocus)}}};this.initComplete=function(H){if(E._didInit){return false}E._didInit=true;E._wD("-- SoundManager 2 "+(E._disabled?"failed to load":"loaded")+" ("+(E._disabled?"security/load error":"OK")+") --",1);if(E._disabled||H){E._wD("soundManager.initComplete(): calling soundManager.onerror()",1);E._debugTS("onload",false);E.onerror.apply(window);return false}else{E._debugTS("onload",true)}if(E.waitForWindowLoad&&!E._windowLoaded){E._wD("soundManager: Waiting for window.onload()");if(window.addEventListener){window.addEventListener("load",E.initUserOnload,false)}else{if(window.attachEvent){window.attachEvent("onload",E.initUserOnload)}}return false}else{if(E.waitForWindowLoad&&E._windowLoaded){E._wD("soundManager: Document already loaded")}E.initUserOnload()}};this.initUserOnload=function(){E._wD("soundManager.initComplete(): calling soundManager.onload()",1);E.onload.apply(window);E._wD("soundManager.onload() complete",1)};this.init=function(){E._wD("-- soundManager.init() --");E._initMovie();if(E._didInit){E._wD("soundManager.init(): Already called?");return false}if(window.removeEventListener){window.removeEventListener("load",E.beginDelayedInit,false)}else{if(window.detachEvent){window.detachEvent("onload",E.beginDelayedInit)}}try{E._wD("Attempting to call Flash from JS..");E.o._externalInterfaceTest(false);if(!E.allowPolling){E._wD("Polling (whileloading/whileplaying support) is disabled.",1)}E.setPolling(true);if(!E.debugMode){E.o._disableDebug()}E.enabled=true;E._debugTS("jstoflash",true)}catch(H){E._debugTS("jstoflash",false);E._failSafely(true);E.initComplete();return false}E.initComplete()};this.beginDelayedInit=function(){E._wD("soundManager.beginDelayedInit()");E._windowLoaded=true;setTimeout(E.waitForExternalInterface,500);setTimeout(E.beginInit,20)};this.beginInit=function(){if(E._initPending){return false}E.createMovie();E._initMovie();E._initPending=true;return true};this.domContentLoaded=function(){E._wD("soundManager.domContentLoaded()");if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",E.domContentLoaded,false)}E.go()};this._externalInterfaceOK=function(){if(E.swfLoaded){return false}E._wD("soundManager._externalInterfaceOK()");E._debugTS("swf",true);E._debugTS("flashtojs",true);E.swfLoaded=true;E._tryInitOnFocus=false;if(E.isIE){setTimeout(E.init,100)}else{E.init()}};this._setSandboxType=function(H){var I=E.sandbox;I.type=H;I.description=I.types[(typeof I.types[H]!="undefined"?H:"unknown")];E._wD("Flash security sandbox type: "+I.type);if(I.type=="localWithFile"){I.noRemote=true;I.noLocal=false;E._wD("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",2)}else{if(I.type=="localWithNetwork"){I.noRemote=false;I.noLocal=true}else{if(I.type=="localTrusted"){I.noRemote=false;I.noLocal=false}}}};this.reboot=function(){E._wD("soundManager.reboot()");if(E.soundIDs.length){E._wD("Destroying "+E.soundIDs.length+" SMSound objects...")}for(var H=E.soundIDs.length;H--;){E.sounds[E.soundIDs[H]].destruct()}try{if(E.isIE){E.oRemovedHTML=E.o.innerHTML}E.oRemoved=E.o.parentNode.removeChild(E.o);E._wD("Flash movie removed.")}catch(I){E._wD("Warning: Failed to remove flash movie.",2)}E.enabled=false;E._didInit=false;E._waitingForEI=false;E._initPending=false;E._didInit=false;E._didAppend=false;E._appendSuccess=false;E._didInit=false;E._disabled=false;E._waitingforEI=true;E.swfLoaded=false;E.soundIDs={};E.sounds=[];E.o=null;E._wD("soundManager: Rebooting...");window.setTimeout(function(){soundManager.beginDelayedInit()},20)};this.destruct=function(){E._wD("soundManager.destruct()");E.disable(true)};F=function(H){var I=this;this.sID=H.id;this.url=H.url;this.options=E._mergeObjects(H);this.instanceOptions=this.options;this._iO=this.instanceOptions;this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this._debug=function(){if(E.debugMode){var L=null;var N=[];var K=null;var M=null;var J=64;for(L in I.options){if(I.options[L]!==null){if(I.options[L] instanceof Function){K=I.options[L].toString();K=K.replace(/\s\s+/g," ");M=K.indexOf("{");N[N.length]=" "+L+": {"+K.substr(M+1,(Math.min(Math.max(K.indexOf("\n")-1,J),J))).replace(/\n/g,"")+"... }"}else{N[N.length]=" "+L+": "+I.options[L]}}}E._wD("SMSound() merged options: {\n"+N.join(", \n")+"\n}")}};this._debug();this.id3={};this.resetProperties=function(J){I.bytesLoaded=null;I.bytesTotal=null;I.position=null;I.duration=null;I.durationEstimate=null;I.loaded=false;I.playState=0;I.paused=false;I.readyState=0;I.muted=false;I.didBeforeFinish=false;I.didJustBeforeFinish=false;I.isBuffering=false;I.instanceOptions={};I.instanceCount=0;I.peakData={left:0,right:0};I.waveformData={left:[],right:[]};I.eqData=[]};I.resetProperties();this.load=function(J){if(typeof J!="undefined"){I._iO=E._mergeObjects(J);I.instanceOptions=I._iO}else{J=I.options;I._iO=J;I.instanceOptions=I._iO;if(I._lastURL&&I._lastURL!=I.url){E._wD("SMSound.load(): Using manually-assigned URL");I._iO.url=I.url;I.url=null}}if(typeof I._iO.url=="undefined"){I._iO.url=I.url}E._wD("soundManager.load(): "+I._iO.url,1);if(I._iO.url==I.url&&I.readyState!==0&&I.readyState!=2){E._wD("soundManager.load(): current URL already assigned.",1);return false}I.url=I._iO.url;I._lastURL=I._iO.url;I.loaded=false;I.readyState=1;I.playState=0;try{if(E.flashVersion==8){E.o._load(I.sID,I._iO.url,I._iO.stream,I._iO.autoPlay,(I._iO.whileloading?1:0))}else{E.o._load(I.sID,I._iO.url,I._iO.stream?true:false,I._iO.autoPlay?true:false);if(I._iO.isMovieStar&&I._iO.autoLoad&&!I._iO.autoPlay){I.pause()}}}catch(K){E._wD("SMSound.load(): Exception: JS-Flash communication failed, or JS error.",2);E._debugTS("onload",false);E.onerror();E.disable()}};this.unload=function(){if(I.readyState!==0){E._wD('SMSound.unload(): "'+I.sID+'"');if(I.readyState!=2){I.setPosition(0,true)}E.o._unload(I.sID,E.nullURL);I.resetProperties()}};this.destruct=function(){E._wD('SMSound.destruct(): "'+I.sID+'"');E.o._destroySound(I.sID);E.destroySound(I.sID,true)};this.play=function(K){if(!K){K={}}I._iO=E._mergeObjects(K,I._iO);I._iO=E._mergeObjects(I._iO,I.options);I.instanceOptions=I._iO;if(I.playState==1){var J=I._iO.multiShot;if(!J){E._wD('SMSound.play(): "'+I.sID+'" already playing (one-shot)',1);return false}else{E._wD('SMSound.play(): "'+I.sID+'" already playing (multi-shot)',1)}}if(!I.loaded){if(I.readyState===0){E._wD('SMSound.play(): Attempting to load "'+I.sID+'"',1);I._iO.stream=true;I._iO.autoPlay=true;I.load(I._iO)}else{if(I.readyState==2){E._wD('SMSound.play(): Could not load "'+I.sID+'" - exiting',2);return false}else{E._wD('SMSound.play(): "'+I.sID+'" is loading - attempting to play..',1)}}}else{E._wD('SMSound.play(): "'+I.sID+'"')}if(I.paused){I.resume()}else{I.playState=1;if(!I.instanceCount||E.flashVersion>8){I.instanceCount++}I.position=(typeof I._iO.position!="undefined"&&!isNaN(I._iO.position)?I._iO.position:0);if(I._iO.onplay){I._iO.onplay.apply(I)}I.setVolume(I._iO.volume,true);I.setPan(I._iO.pan,true);E.o._start(I.sID,I._iO.loop||1,(E.flashVersion==9?I.position:I.position/1000))}};this.start=this.play;this.stop=function(J){if(I.playState==1){I.playState=0;I.paused=false;if(I._iO.onstop){I._iO.onstop.apply(I)}E.o._stop(I.sID,J);I.instanceCount=0;I._iO={}}};this.setPosition=function(K,J){if(typeof K=="undefined"){K=0}var L=Math.min(I.duration,Math.max(K,0));I._iO.position=L;if(!J){}E.o._setPosition(I.sID,(E.flashVersion==9?I._iO.position:I._iO.position/1000),(I.paused||!I.playState))};this.pause=function(){if(I.paused||I.playState===0){return false}E._wD("SMSound.pause()");I.paused=true;E.o._pause(I.sID);if(I._iO.onpause){I._iO.onpause.apply(I)}};this.resume=function(){if(!I.paused||I.playState===0){return false}E._wD("SMSound.resume()");I.paused=false;E.o._pause(I.sID);if(I._iO.onresume){I._iO.onresume.apply(I)}};this.togglePause=function(){E._wD("SMSound.togglePause()");if(I.playState===0){I.play({position:(E.flashVersion==9?I.position:I.position/1000)});return false}if(I.paused){I.resume()}else{I.pause()}};this.setPan=function(K,J){if(typeof K=="undefined"){K=0}if(typeof J=="undefined"){J=false}E.o._setPan(I.sID,K);I._iO.pan=K;if(!J){I.pan=K}};this.setVolume=function(J,K){if(typeof J=="undefined"){J=100}if(typeof K=="undefined"){K=false}E.o._setVolume(I.sID,(E.muted&&!I.muted)||I.muted?0:J);I._iO.volume=J;if(!K){I.volume=J}};this.mute=function(){I.muted=true;E.o._setVolume(I.sID,0)};this.unmute=function(){I.muted=false;var J=typeof I._iO.volume!="undefined";E.o._setVolume(I.sID,J?I._iO.volume:I.options.volume)};this._whileloading=function(J,K,L){if(!I._iO.isMovieStar){I.bytesLoaded=J;I.bytesTotal=K;I.duration=Math.floor(L);I.durationEstimate=parseInt((I.bytesTotal/I.bytesLoaded)*I.duration,10);if(I.readyState!=3&&I._iO.whileloading){I._iO.whileloading.apply(I)}}else{I.bytesLoaded=J;I.bytesTotal=K;I.duration=Math.floor(L);I.durationEstimate=I.duration;if(I.readyState!=3&&I._iO.whileloading){I._iO.whileloading.apply(I)}}};this._onid3=function(M,J){E._wD('SMSound._onid3(): "'+this.sID+'" ID3 data received.');var N=[];for(var L=0,K=M.length;L<K;L++){N[M[L]]=J[L]}I.id3=E._mergeObjects(I.id3,N);if(I._iO.onid3){I._iO.onid3.apply(I)}};this._whileplaying=function(K,L,N,J,M){if(isNaN(K)||K===null){return false}if(I.playState===0&&K>0){K=0}I.position=K;if(I._iO.usePeakData&&typeof L!="undefined"&&L){I.peakData={left:L.leftPeak,right:L.rightPeak}}if(I._iO.useWaveformData&&typeof N!="undefined"&&N){I.waveformData={left:N.split(","),right:J.split(",")}}if(I._iO.useEQData&&typeof M!="undefined"&&M){I.eqData=M}if(I.playState==1){if(I.isBuffering){I._onbufferchange(0)}if(I._iO.whileplaying){I._iO.whileplaying.apply(I)}if(I.loaded&&I._iO.onbeforefinish&&I._iO.onbeforefinishtime&&!I.didBeforeFinish&&I.duration-I.position<=I._iO.onbeforefinishtime){E._wD("duration-position &lt;= onbeforefinishtime: "+I.duration+" - "+I.position+" &lt= "+I._iO.onbeforefinishtime+" ("+(I.duration-I.position)+")");I._onbeforefinish()}}};this._onload=function(J){J=(J==1?true:false);E._wD('SMSound._onload(): "'+I.sID+'"'+(J?" loaded.":" failed to load? - "+I.url),(J?1:2));if(!J){if(E.sandbox.noRemote===true){E._wD("SMSound._onload(): Reminder: Flash security is denying network/internet access",1)}if(E.sandbox.noLocal===true){E._wD("SMSound._onload(): Reminder: Flash security is denying local access",1)}}I.loaded=J;I.readyState=J?3:2;if(I._iO.onload){I._iO.onload.apply(I)}};this._onbeforefinish=function(){if(!I.didBeforeFinish){I.didBeforeFinish=true;if(I._iO.onbeforefinish){E._wD('SMSound._onbeforefinish(): "'+I.sID+'"');I._iO.onbeforefinish.apply(I)}}};this._onjustbeforefinish=function(J){if(!I.didJustBeforeFinish){I.didJustBeforeFinish=true;if(I._iO.onjustbeforefinish){E._wD('SMSound._onjustbeforefinish(): "'+I.sID+'"');I._iO.onjustbeforefinish.apply(I)}}};this._onfinish=function(){if(I._iO.onbeforefinishcomplete){I._iO.onbeforefinishcomplete.apply(I)}I.didBeforeFinish=false;I.didJustBeforeFinish=false;if(I.instanceCount){I.instanceCount--;if(!I.instanceCount){I.playState=0;I.paused=false;I.instanceCount=0;I.instanceOptions={};if(I._iO.onfinish){E._wD('SMSound._onfinish(): "'+I.sID+'"');I._iO.onfinish.apply(I)}}}else{if(I.useVideo){}}};this._onmetadata=function(J){E._wD("SMSound.onmetadata()");if(!J.width&&!J.height){E._wD("No width/height given, assuming defaults");J.width=320;J.height=240}I.metadata=J;I.width=J.width;I.height=J.height;if(I._iO.onmetadata){E._wD('SMSound._onmetadata(): "'+I.sID+'"');I._iO.onmetadata.apply(I)}E._wD("SMSound.onmetadata() complete")};this._onbufferchange=function(J){if(I.playState===0){return false}if(J==I.isBuffering){E._wD("_onbufferchange: ignoring false default / loaded sound");return false}I.isBuffering=(J==1?true:false);if(I._iO.onbufferchange){E._wD("SMSound._onbufferchange(): "+J);I._iO.onbufferchange.apply(I)}};this._ondataerror=function(J){if(I.playState>0){E._wD("SMSound._ondataerror(): "+J);if(I._iO.ondataerror){I._iO.ondataerror.apply(I)}}else{}}};this._onfullscreenchange=function(H){E._wD("onfullscreenchange(): "+H);E.isFullScreen=(H==1?true:false);if(!E.isFullScreen){try{window.focus();E._wD("window.focus()")}catch(I){}}};if(window.addEventListener){window.addEventListener("focus",E.handleFocus,false);window.addEventListener("load",E.beginDelayedInit,false);window.addEventListener("unload",E.destruct,false);if(E._tryInitOnFocus){window.addEventListener("mousemove",E.handleFocus,false)}}else{if(window.attachEvent){window.attachEvent("onfocus",E.handleFocus);window.attachEvent("onload",E.beginDelayedInit);window.attachEvent("unload",E.destruct)}else{E._debugTS("onload",false);soundManager.onerror();soundManager.disable()}}if(document.addEventListener){document.addEventListener("DOMContentLoaded",E.domContentLoaded,false)}}if(typeof SM2_DEFER=="undefined"||!SM2_DEFER){soundManager=new SoundManager()};
