/*

 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.20100520
*/
(function(i){function sa(L,T){function ca(){if(b.debugURLParam.test(i.location.href.toString()))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=ta;c.title="Toggle SM2 debug console";
if(C.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&&!s(b.debugID)&&(!da||!b.useConsole||b.useConsole&&da&&!b.consoleOnly)){a=document.createElement("div");a.id=b.debugID;a.style.display=b.debugMode?"block":"none";if(b.debugMode&&!s(c.id)){try{f=ea();f.appendChild(c)}catch(e){throw new Error(o("appXHTML"));}f.appendChild(a)}}f=null;ca=function(){}}this.flashVersion=8;this.debugMode=true;this.debugFlash=false;this.useConsole=
true;this.waitForWindowLoad=this.consoleOnly=false;this.nullURL="null.mp3";this.allowPolling=true;this.useMovieStar=this.useFastPolling=false;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}};if(this.audioFormats.mp4.required)this.flashVersion=9;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,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions={onmetadata:null,useVideo:false,bufferTime:3};this.version=null;this.versionNumber="V2.96a.20100520";this.movieURL=null;this.url=L||null;this.altURL=
null;this.enabled=this.swfLoaded=false;this.o=null;this.movieID="sm2-container";this.id=T||"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={};this.ignoreFlash=false;var fa,b=this,s,C=navigator.userAgent,ua,U,E=
[],ga=true,u,F=false,M=false,r=false,y=false,ha=false,l,va,N,t,wa,G,H,V,ia,ja,D,xa,W,X,Y,ya,ea,Z,za,Ha=["log","info","warn","error"],Aa,O,Ba,P=null,ka=null,o,la,Q,ta,$,ma,q,aa=false,na=false,Ca,Da,I=true,Ea,oa,z,J,A,pa,Fa;L=C.match(/pre\//i);T=C.match(/(ipad|iphone)/i);var Ia=C.match(/mobile/i)||L||T,da=typeof console!=="undefined"&&typeof console.log!=="undefined",R=document.location?document.location.protocol.match(/http/i):null,qa=typeof document.hasFocus!=="undefined"?document.hasFocus():null,
K=typeof document.hasFocus==="undefined"&&this.isSafari,Ga=!K;this.useAltURL=!R;if(T||L){b.useHTML5Audio=true;b.ignoreFlash=true}if(L)b.html5Test=/^(probably|maybe)$/i;(function(){var c=i.location.href.toString(),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 I?
r&&!y:b.useHTML5Audio&&b.hasHTML5};this.getMovie=function(c){return b.isIE?i[c]:b.isSafari?s(c)||document[c]:s(c)};this.loadFromXML=function(c){try{b.o._loadFromXML(c)}catch(a){O();return true}};this.createSound=function(c){function a(){f=$(f);b.sounds[e.id]=new fa(e);b.soundIDs.push(e.id);return b.sounds[e.id]}var f=null,h=null,e=null;if(!r)throw ma("soundManager.createSound(): "+o("notReady"),arguments.callee.caller);if(arguments.length===2)c={id:arguments[0],url:arguments[1]};e=f=t(c);e.id.toString().charAt(0).match(/^[0-9]$/)&&
b._wD("soundManager.createSound(): "+o("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(J(e.url)){h=a();b._wD("Loading sound "+e.id+" from HTML5");h._setup_html5(e)}else{if(b.flashVersion>8&&b.useMovieStar){if(e.isMovieStar===null)e.isMovieStar=e.url.match(b.netStreamPattern)?true:false;e.isMovieStar&&b._wD("soundManager.createSound(): using MovieStar handling");if(e.isMovieStar){if(e.usePeakData){l("noPeak");
e.usePeakData=false}e.loops>1&&l("noNSLoop")}}h=a();b.flashVersion===8?b.o._createSound(e.id,e.onjustbeforefinishtime,e.loops||1):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)}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(b.flashVersion>=9){c.isMovieStar=true;c.useVideo=true}else{b._wD("soundManager.createVideo(): "+o("f9Vid"),2);return false}b.useMovieStar||b._wD("soundManager.createVideo(): "+o("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;b.sounds[c].load(a)};
this.unload=function(c){if(!q(c))return false;b.sounds[c].unload()};this.start=this.play=function(c,a){if(!r)throw ma("soundManager.play(): "+o("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}b.sounds[c].play(a)};this.setPosition=function(c,a){if(!q(c))return false;b.sounds[c].setPosition(a)};this.stop=function(c){if(!q(c))return false;b._wD("soundManager.stop("+
c+")",1);b.sounds[c].stop()};this.stopAll=function(){b._wD("soundManager.stopAll()",1);for(var c in b.sounds)b.sounds[c]instanceof fa&&b.sounds[c].stop()};this.pause=function(c){if(!q(c))return false;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;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;
b.sounds[c].togglePause()};this.setPan=function(c,a){if(!q(c))return false;b.sounds[c].setPan(a)};this.setVolume=function(c,a){if(!q(c))return false;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+'"');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+'"');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;b.sounds[c].toggleMute()};this.getMemoryUse=function(){if(b.flashVersion===8)return 0;if(b.o)return parseInt(b.o._getMemoryUse(),10)};this.disable=
function(c){if(typeof c==="undefined")c=false;if(y)return false;y=true;l("shutdown",1);for(var a=b.soundIDs.length;a--;)Aa(b.sounds[b.soundIDs[a]]);N(c);i.removeEventListener&&i.removeEventListener("load",H,false)};this.canPlayMIME=function(c){var a;if(b.hasHTML5)a=J({type:c});return!I||a?a:c?c.match(b.mimePattern)?true:false:null};this.canPlayURL=function(c){var a;if(b.hasHTML5)a=J(c);return!I||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&&l("queue");a||(a=i);wa(c,a);G();return true}else throw o("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(da&&b.useConsole){f=Ha[a];typeof console[f]!=="undefined"?console[f](c):console.log(c);if(b.useConsoleOnly)return true}try{h=s("soundmanager-debug");if(!h)return false;e=document.createElement("div");if(++va%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(){l("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)ka=
b.o.innerHTML;P=b.o.parentNode.removeChild(b.o);b._wD("Flash movie removed.")}catch(a){l("badRemove",2)}P=ka=null;y=M=F=na=aa=r=b.enabled=false;b.swfLoaded=false;b.soundIDs={};b.sounds=[];b.o=null;for(c=E.length;c--;)E[c].fired=false;b._wD("soundManager: Rebooting...");i.setTimeout(function(){b.beginDelayedInit()},20)};this.destruct=function(){b._wD("soundManager.destruct()");b.disable(true)};this.beginDelayedInit=function(){ha=true;setTimeout(ia,500);setTimeout(xa,20)};J=function(c){if(!b.useHTML5Audio||
!b.hasHTML5)return false;var a,f=b.audioFormats;if(!A){A=[];for(a in f)if(f.hasOwnProperty(a)){A.push(a);if(f[a].related)A=A.concat(f[a].related)}A=new RegExp("\\.("+A.join("|")+")","i")}a=typeof c.type!=="undefined"?c.type:null;c=typeof c==="string"?c.match(A):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}};Fa=function(){function c(j){var v,
S,B=false;if(!f||typeof f.canPlayType!=="function")return false;if(j instanceof Array){v=0;for(S=j.length;v<S&&!B;v++)if(b.html5[j[v]]||f.canPlayType(j[v]).match(b.html5Test)){B=true;b.html5[j[v]]=true}return B}else return(j=f&&typeof f.canPlayType==="function"?f.canPlayType(j):false)&&(j.match(b.html5Test)?true:false)}function a(j,v){function S(){if(m>=e&&!oa){oa=true;ya&&V()}}function B(w){if(!ra){ra=true;m++;n[j]=w;v(w);S()}}var x,ra=false;e++;if(Ia){m++;v();S();return false}if(typeof n[j]!=="undefined"){ra=
true;v(n[j])}else{x=new Audio(h[j]);x.addEventListener("canplay",function(w){B(true,w);x=null},false);x.addEventListener("canplaythrough",function(w){B(true,w);x=null},false);x.addEventListener("error",function(w){B(false,this.error?this.error:w);x=null},false);x.addEventListener("stalled",function(w){B(false,w);x=null},false);x.load()}}if(!b.useHTML5Audio||typeof Audio==="undefined")return false;var f=typeof Audio!=="undefined"?new Audio:null,h={mp3:"data:audio/mpeg;base64,/+MYxAALOAHgCAAAAD////////////v6OGAfB8HwfAgIAgCAYB8HwfB8CAgCAIAgD4Pg+D4OAgCAIP9Xt6vb1CV0qLA0DQND/+MYxA4FcAHcAAAAAISgqCtvV7eqTEFNRTMuOTguNKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq/+MYxDMAAANIAAAAAKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",
wav:"data:audio/wave;base64,UklGRiYAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YQIAAAD//w=="},e=0,m=0,n={},d,g={},k,p;k=b.audioFormats;for(d in k)if(k.hasOwnProperty(d)){g[d]=c(k[d].type);if(k[d]&&k[d].related)for(p=0;p<k[d].related.length;p++)b.html5[k[d].related[p]]=g[d]}g.canPlayType=f?c:null;b.html5=t(b.html5,g);b.html5.mp3||a("mp3",function(j){if(j)b.html5.mp3=j});b.html5.wav||a("wav",function(j){if(j)b.html5.wav=j})};W={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"};
s=function(c){return document.getElementById(c)};va=0;o=function(){var c=Array.prototype.slice.call(arguments),a=c.shift();a=W&&W[a]?W[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};$=function(c){if(b.flashVersion===8&&c.loops>1&&c.stream){l("as2loop");c.stream=false}return c};ma=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)};ua=function(){return false};Aa=function(c){for(var a in c)if(c.hasOwnProperty(a)&&typeof c[a]==="function")c[a]=ua};O=function(c){if(typeof c==="undefined")c=false;if(y||c){l("smFail",2);b.disable(c)}};Ba=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};ja=function(){if(b.flashVersion!==
8&&b.flashVersion!==9){alert(o("badFV",b.flashVersion,8));b.flashVersion=8}var c=b.debugMode||b.debugFlash?"_debug.swf":".swf";b.version=b.versionNumber+(z?" (HTML5-only mode)":b.flashVersion===9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(b.flashVersion>8){b.defaultOptions=t(b.defaultOptions,b.flash9Options);b.features.buffering=true}if(b.flashVersion>8&&b.useMovieStar){b.defaultOptions=t(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[b.flashVersion!==8?"flash9":"flash8"];b.movieURL=(b.flashVersion===8?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",c);b.features.peakData=b.features.waveformData=b.features.eqData=b.flashVersion>8};ea=function(){return document.body?document.body:document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]};za=function(c,a){if(!b.o||
!b.allowPolling)return false;b.o._setPolling(c,a)};Z=function(c,a){function f(){b._wD("-- SoundManager 2 "+b.version+(!z&&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,n,d,g;c=typeof c==="undefined"?b.id:c;if(F&&M)return false;if(z){ja();f();b.oMC=s(b.movieID);U();M=F=true;return false}F=true;ja();b.url=Ba(R?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;l("spcWmode");b.wmode=null}if(b.flashVersion===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");d='<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(n in m)m.hasOwnProperty(n)&&e.setAttribute(n,m[n])}ca();n=Q();if(c=ea()){b.oMC=s(b.movieID)?s(b.movieID):document.createElement("div");if(b.oMC.id){c=b.oMC.className;b.oMC.className=(c?c+" ":b.swfCSS.swfDefault)+(n?" "+n:"");b.oMC.appendChild(e);if(b.isIE){n=b.oMC.appendChild(document.createElement("div"));n.className="sm2-object-box";n.innerHTML=d}M=true}else{b.oMC.id=b.movieID;b.oMC.className=b.swfCSS.swfDefault+" "+n;n=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"});g=null;if(!b.debugFlash)for(g in m)if(m.hasOwnProperty(g))b.oMC.style[g]=m[g];try{b.isIE||b.oMC.appendChild(e);c.appendChild(b.oMC);if(b.isIE){n=b.oMC.appendChild(document.createElement("div"));n.className="sm2-object-box";n.innerHTML=d}M=true}catch(k){throw new Error(o("appXHTML"));}}}h&&b._wD(h);f();b._wD("soundManager::createMovie(): Trying to load "+a+(!R&&b.altURL?
" (alternate URL)":""),1)};q=this.getSoundById;l=function(c,a){return c?b._wD(o(c),a):""};if(i.location.href.indexOf("debug=alert")+1&&b.debugMode)b._wD=function(c){alert(c)};ta=function(){var c=s(b.debugID),a=s(b.debugID+"-toggle");if(!c)return false;if(ga){a.innerHTML="+";c.style.display="none"}else{a.innerHTML="-";c.style.display="block"}ga=!ga};u=function(c,a,f){if(typeof sm2Debugger!=="undefined")try{sm2Debugger.handleEvent(c,a,f)}catch(h){}};t=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};X=function(){if(z){Z();return false}if(b.o)return false;b.o=b.getMovie(b.id);if(!b.o){if(P){if(b.isIE)b.oMC.innerHTML=ka;else b.oMC.appendChild(P);P=null;F=true}else Z(b.id,b.url);b.o=b.getMovie(b.id)}if(b.o){b._wD("soundManager::initMovie(): Got "+b.o.nodeName+" element ("+(F?"created via JS":"static HTML")+")");l("waitEI")}typeof b.oninitmovie==="function"&&setTimeout(b.oninitmovie,
1)};V=function(c){if(c)b.url=c;X()};ia=function(){if(aa)return false;aa=true;if(K&&!qa){l("waitFocus");return false}var c;if(!r){c=b.getMoviePercent();b._wD(o("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 "+b.flashVersion+"+ not present?), ":"")+"Flash blocked or JS-Flash security error."+
(b.debugFlash?" "+o("checkSWF"):""),2);if(!R&&c){l("localFail",2);b.debugFlash||l("tryDebug",2)}c===0&&b._wD(o("swf404",b.url));u("flashtojs",false,": Timed out"+R?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)")}if(!r&&Ga)if(c===null)if(b.useFlashBlock||b.flashLoadTimeout===0){b.useFlashBlock&&la();l("waitForever")}else O(true);else b.flashLoadTimeout===0?l("waitForever"):O(true)},b.flashLoadTimeout)};Q=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(" ")};la=function(){var c=b.getMoviePercent();if(b.supported()){b.didFlashBlock&&b._wD("soundManager::flashBlockHandler(): Unblocked");if(b.oMC)b.oMC.className=Q()+" "+b.swfCSS.swfDefault+(" "+b.swfCSS.swfUnblocked)}else{if(I){b.oMC.className=Q()+" "+b.swfCSS.swfDefault+" "+(c===null?b.swfCSS.swfTimedout:b.swfCSS.swfError);b._wD("soundManager::flashBlockHandler(): "+o("fbTimeout")+(c?" ("+o("fbLoaded")+")":""))}G(true);
b.onerror instanceof Function&&b.onerror.apply(i);b.didFlashBlock=true}};D=function(){if(qa||!K)return true;qa=Ga=true;b._wD("soundManager::handleFocus()");K&&i.removeEventListener("mousemove",D,false);aa=false;setTimeout(ia,500);if(i.removeEventListener)i.removeEventListener("focus",D,false);else i.detachEvent&&i.detachEvent("onfocus",D)};N=function(c){if(r)return false;if(z){b._wD("-- SoundManager 2: loaded --");r=true;G();H();return true}b.useFlashBlock&&b.flashLoadTimeout&&!b.getMoviePercent()||
(r=true);b._wD("-- SoundManager 2 "+(y?"failed to load":"loaded")+" ("+(y?"security/load error":"OK")+") --",1);if(y||c){if(b.useFlashBlock)b.oMC.className=Q()+" "+(b.getMoviePercent()===null?b.swfCSS.swfTimedout:b.swfCSS.swfError);G();u("onload",false);b.onerror instanceof Function&&b.onerror.apply(i);return false}else u("onload",true);if(b.waitForWindowLoad&&!ha){l("waitOnload");if(i.addEventListener)i.addEventListener("load",H,false);else i.attachEvent&&i.attachEvent("onload",H);return false}else{b.waitForWindowLoad&&
ha&&l("docLoaded");H()}};wa=function(c,a){E.push({method:c,scope:a||null,fired:false})};G=function(c){if(!r&&!c)return false;c={success:c?b.supported():!y};var a=[],f,h,e=!b.useFlashBlock||b.useFlashBlock&&!b.supported();f=0;for(h=E.length;f<h;f++)E[f].fired!==true&&a.push(E[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}}};H=function(){i.setTimeout(function(){b.useFlashBlock&&
la();G();l("onload",1);b.onload.apply(i);l("onloadOK",1)},1)};Ea=function(){var c,a,f=b.isSafari&&C.match(/OS X 10_6_3/i)&&C.match(/531\.22\.7/i);if(C.match(/iphone os (1|2|3_0|3_1)/i)?true:false){b.hasHTML5=false;z=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("Note: Buggy HTML5 in this version of Safari, 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;z=b.useHTML5Audio&&b.hasHTML5&&!c;return c};U=function(){function c(){if(i.removeEventListener)i.removeEventListener("load",b.beginDelayedInit,false);else i.detachEvent&&i.detachEvent("onload",b.beginDelayedInit)}var a,f=[];l("init");if(r){l("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(z){if(!r){c();b.enabled=true;N()}return true}X();try{l("flashJS");b.o._externalInterfaceTest(false);b.allowPolling?za(true,b.useFastPolling?true:false):l("noPolling",1);b.debugMode||b.o._disableDebug();b.enabled=true;u("jstoflash",true)}catch(h){b._wD("js/flash exception: "+h.toString());u("jstoflash",false);O(true);N();return false}N();c()};xa=function(){if(na)return false;Z();X();
return na=true};Y=function(){ca();Fa();I=Ea();ya=true;if(b.useHTML5Audio&&b.hasHTML5)oa&&V();else V()};Ca=function(c){if(!c._hasTimer)c._hasTimer=true};Da=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;l("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)":""));u("swf",true);u("flashtojs",true);b.swfLoaded=true;K=false;b.isIE?setTimeout(U,100):U()};this._onfullscreenchange=function(c){b._wD("onfullscreenchange(): "+c);b.isFullScreen=c===1?true:false;if(!b.isFullScreen)try{i.focus();b._wD("window.focus()")}catch(a){}};
fa=function(c){var a=this,f,h,e,m,n;this.sID=c.id;this.url=c.url;this._iO=this.instanceOptions=this.options=t(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=[],k,p;for(d in a.options)if(a.options[d]!==null)if(a.options[d]instanceof Function){k=a.options[d].toString();k=k.replace(/\s\s+/g," ");p=k.indexOf("{");g.push(" "+d+": {"+k.substr(p+1,Math.min(Math.max(k.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){if(typeof d!=="undefined"){a._iO=t(d);a.instanceOptions=a._iO}else{d=a.options;a._iO=d;a.instanceOptions=a._iO;if(a._lastURL&&a._lastURL!==a.url){l("manURL");a._iO.url=a.url;a.url=null}}if(typeof a._iO.url==="undefined")a._iO.url=a.url;b._wD("soundManager.load(): "+a._iO.url,1);if(a._iO.url===a.url&&a.readyState!==0&&a.readyState!==2){l("onURL",1);return false}a.url=
a._iO.url;a._lastURL=a._iO.url;a.loaded=false;a.readyState=1;a.playState=0;if(J(a._iO.url)){b._wD("HTML 5 load: "+a._iO.url);a._setup_html5(a._iO);a._iO.autoPlay&&a.play()}else try{a.isHTML5=false;a._iO=$(a._iO);if(b.flashVersion===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(g){l("smError",
2);u("onload",false);b.onerror();b.disable()}};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(a.__element){a.__element.pause();a.__element.src="about:blank";a.__element.load();a.__element=null}}else b.o._unload(a.sID,b.nullURL);f()}};this.destruct=function(){b._wD('SMSound.destruct(): "'+a.sID+'"');if(a.isHTML5){e();if(a.__element){a.__element.pause();a.__element.src="about:blank";a.__element.load();a.__element=
null}}else b.o._destroySound(a.sID);b.destroySound(a.sID,true)};this.start=this.play=function(d){d||(d={});a._iO=t(d,a._iO);a._iO=t(a._iO,a.options);a.instanceOptions=a._iO;if(J(a._iO.url)){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 false}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.readyState=1;else{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 false}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||b.flashVersion>
8&&!a.isHTML5)a.instanceCount++;a.position=typeof a._iO.position!=="undefined"&&!isNaN(a._iO.position)?a._iO.position:0;a._iO=$(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 b.o._start(a.sID,a._iO.loops||1,b.flashVersion===9?a.position:a.position/1E3)}};this.stop=function(d){if(a.playState===1){a._onbufferchange(0);if(!a.isHTML5)a.playState=0;a.paused=false;a._iO.onstop&&a._iO.onstop.apply(a);if(a.isHTML5){if(a.__element){a.setPosition(0);
a.__element.pause();a.playState=0;a._onTimer();e();a.unload();a.__element=null}}else b.o._stop(a.sID,d);a.instanceCount=0;a._iO={}}};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;if(a.isHTML5){if(a.__element){b._wD("setPosition(): setting position to "+a._iO.position/1E3);if(a.playState)try{a.__element.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);a.paused&&a._onTimer(true)}}else b.o._setPosition(a.sID,b.flashVersion===9?a._iO.position:a._iO.position/1E3,a.paused||!a.playState)};this.pause=function(){if(a.paused||a.playState===0)return false;b._wD("SMSound.pause()");a.paused=true;if(a.isHTML5){a._setup_html5().pause();e()}else b.o._pause(a.sID);a._iO.onpause&&a._iO.onpause.apply(a)};this.resume=function(){if(!a.paused||a.playState===0)return false;
b._wD("SMSound.resume()");a.paused=false;if(a.isHTML5){a._setup_html5().play();m()}else b.o._pause(a.sID);a._iO.onresume&&a._iO.onresume.apply(a)};this.togglePause=function(){b._wD("SMSound.togglePause()");if(a.playState===0){a.play({position:b.flashVersion===9&&!a.isHTML5?a.position:a.position/1E3});return false}a.paused?a.resume():a.pause()};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};this.setVolume=
function(d,g){if(typeof d==="undefined")d=100;if(typeof g==="undefined")g=false;if(a.isHTML5){if(a.__element)a.__element.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};this.mute=function(){a.muted=true;if(a.isHTML5){if(a.__element)a.__element.muted=true}else b.o._setVolume(a.sID,0)};this.unmute=function(){a.muted=false;var d=typeof a._iO.volume!=="undefined";if(a.isHTML5){if(a.__element)a.__element.muted=false}else b.o._setVolume(a.sID,d?a._iO.volume:
a.options.volume)};this.toggleMute=function(){a.muted?a.unmute():a.mute()};this._onTimer=function(d){if(a._hasTimer||d){var g;if(a.__element&&(d||(a.playState>0||a.readyState===1)&&!a.paused)){g=a.__element;a.duration=n();a.durationEstimate=a.duration;d=g.currentTime?g.currentTime*1E3:0;a._whileplaying(d,{},{},{},{});return true}else{b._wD('_onTimer: Warn for "'+a.sID+'": '+(!g?"Could not find element. ":"")+(a.playState===0?"playState bad, 0?":"playState = "+a.playState+", OK"));return false}}};
n=function(){var d=a.__element?a.__element.duration*1E3:undefined;if(d)return!isNaN(d)?d:null};m=function(){a.isHTML5&&Ca(a)};e=function(){a.isHTML5&&Da(a)};f=function(){a._hasTimer=null;a._added_events=null;a.__element=null;a.bytesLoaded=null;a.bytesTotal=null;a.position=null;a.duration=null;a.durationEstimate=null;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=t(a._iO,d);if(a.__element){if(a.url!==d.url){b._wD("setting new URL on existing object: "+d.url);a.__element.src=d.url}}else{b._wD("creating HTML 5 audio element with URL: "+d.url);a.__element=new Audio(d.url);a.isHTML5=true;h()}a.__element.loop=d.loops>1?"loop":"";return a.__element};h=function(){function d(g,k,p){return a.__element?a.__element.addEventListener(g,
k,p||false):null}if(a._added_events)return false;a._added_events=true;d("load",function(){var g=a.__element;b._wD("HTML5::load: "+a.sID);if(g){a._onbufferchange(0);a._whileloading(a.bytesTotal,a.bytesTotal,n());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){var k=a.__element;b._wD("HTML5::progress: "+a.sID+": loaded/total: "+(g.loaded||
0)+","+(g.total||1));if(!a.loaded&&k){a._onbufferchange(0);a._whileloading(g.loaded||0,g.total||1,n())}},false);d("end",function(){b._wD("HTML5::end: "+a.sID);a._onfinish()},false);d("error",function(){if(a.__element){b._wD("HTML5::error: "+a.__element.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);a.__element.addEventListener("timeupdate",function(){a._onTimer()},false);setTimeout(function(){a&&a.__element&&d("ended",function(){b._wD("HTML5::ended: "+a.sID);a._onfinish()},false)},250)};this._whileloading=function(d,g,k){if(a._iO.isMovieStar){a.bytesLoaded=d;a.bytesTotal=g;a.duration=Math.floor(k);a.durationEstimate=a.duration}else{a.bytesLoaded=d;a.bytesTotal=g;a.duration=Math.floor(k);a.durationEstimate=parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10);
if(a.durationEstimate===undefined)a.durationEstimate=a.duration}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 k=[],p,j;p=0;for(j=d.length;p<j;p++)k[d[p]]=g[p];a.id3=t(a.id3,k);a._iO.onid3&&a._iO.onid3.apply(a)};this._whileplaying=function(d,g,k,p,j){if(isNaN(d)||d===null)return false;if(a.playState===0&&d>0)d=0;a.position=d;if(b.flashVersion>8&&!a.isHTML5){if(a._iO.usePeakData&&typeof g!==
"undefined"&&g)a.peakData={left:g.leftPeak,right:g.rightPeak};if(a._iO.useWaveformData&&typeof k!=="undefined"&&k)a.waveformData={left:k.split(","),right:p.split(",")};if(a._iO.useEQData)if(typeof j!=="undefined"&&j&&j.leftEQ){d=j.leftEQ.split(",");a.eqData=d;a.eqData.left=d;if(typeof j.rightEQ!=="undefined"&&j.rightEQ)a.eqData.right=j.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._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._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(): "+o("noNet"),1);b.sandbox.noLocal===
true&&b._wD("SMSound._onload(): "+o("noLocal"),1)}a.loaded=d;a.readyState=d?3:2;a._iO.onload&&a._iO.onload.apply(a)};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._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)}if(a.isHTML5){a.unload();a.__element=null}}};this._onmetadata=function(d){b._wD("SMSound.onmetadata()");
if(!d.width&&!d.height){l("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||I)if(i.addEventListener){i.addEventListener("focus",D,false);i.addEventListener("load",b.beginDelayedInit,false);i.addEventListener("unload",b.destruct,false);K&&i.addEventListener("mousemove",D,false)}else if(i.attachEvent){i.attachEvent("onfocus",D);i.attachEvent("onload",b.beginDelayedInit);i.attachEvent("unload",b.destruct)}else{u("onload",false);ba.onerror();ba.disable()}pa=function(){if(document.readyState===
"complete"){Y();document.detachEvent("onreadystatechange",pa)}};if(document.addEventListener)document.addEventListener("DOMContentLoaded",Y,false);else document.attachEvent&&document.attachEvent("onreadystatechange",pa);document.readyState==="complete"&&setTimeout(Y,100)}var ba=null;if(typeof SM2_DEFER==="undefined"||!SM2_DEFER)ba=new sa;i.SoundManager=sa;i.soundManager=ba})(window);
