r108895 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108894‎ | r108895 | r108896 >
Date:05:42, 14 January 2012
Author:kroocsiogsi
Status:deferred
Tags:
Comment:
Roll SoundManager 2.97a.20111220
Modified paths:
  • /trunk/extensions/SoundManager2Button/script/mp3-player-button.js (modified) (history)
  • /trunk/extensions/SoundManager2Button/script/soundmanager2-jsmin.js (modified) (history)
  • /trunk/extensions/SoundManager2Button/script/soundmanager2-nodebug-jsmin.js (modified) (history)
  • /trunk/extensions/SoundManager2Button/script/soundmanager2-nodebug.js (modified) (history)
  • /trunk/extensions/SoundManager2Button/script/soundmanager2.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SoundManager2Button/script/soundmanager2-nodebug-jsmin.js
@@ -8,69 +8,70 @@
99 * Code provided under the BSD License:
1010 * http://schillmania.com/projects/soundmanager2/license.txt
1111 *
12 - * V2.97a.20111030
 12+ * V2.97a.20111220
1313 */
14 -(function($){function N(N,Z){function j(c){return function(a){return!this._t||!this._t._a?null:c.call(this,a)}}this.flashVersion=8;this.debugFlash=this.debugMode=false;this.useConsole=true;this.waitForWindowLoad=this.consoleOnly=false;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashPollingInterval=null;this.flashLoadTimeout=1E3;this.wmode=null;this.allowScriptAccess="always";this.useFlashBlock=false;this.useHTML5Audio=true;this.html5Test=/^(probably|maybe)$/i;this.preferFlash=true;
15 -this.noSWFCache=false;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:false},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,
16 -loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfailure:null,onfinish:null,multiShot:true,multiShotEvents:false,position:null,pan:0,type:null,usePolicyFile:false,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null};this.movieID="sm2-container";this.id=Z||"sm2movie";
17 -this.swfCSS={swfBox:"sm2-object-box",swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfLoaded:"swf_loaded",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"};this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.versionNumber="V2.97a.20111030";this.movieURL=this.version=null;this.url=N||null;this.altURL=null;this.enabled=this.swfLoaded=false;this.oMC=this.o=null;this.sounds={};this.soundIDs=[];
18 -this.didFlashBlock=this.specialWmodeCase=this.muted=false;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.features={buffering:false,peakData:false,waveformData:false,eqData:false,movieStar:false};this.sandbox={};var F;try{F=typeof Audio!=="undefined"&&typeof(new Audio).canPlayType!=="undefined"}catch(Oa){F=false}this.hasHTML5=F;this.html5={usingFlash:null};this.flash={};this.ignoreFlash=this.html5Only=false;var ra,c=this,O,o=navigator.userAgent,i=$,aa=
19 -i.location.href.toString(),h=document,ba,P,g,s=[],G=false,H=false,m=false,t=false,sa=false,I,n,ca,z,A,Q,ta,da,x,R,B,ea,fa,S,C,ua,ga,va,T,wa,J=null,ha=null,y,ia,D,U,V,ja,l,W=false,ka=false,xa,ya,q=null,za,X,K,u,la,ma,Aa,k,Ia=Array.prototype.slice,L=false,p,Y,Ba,r,Ca,na=o.match(/(ipad|iphone|ipod)/i),Ja=o.match(/firefox/i),Ka=o.match(/droid/i),v=o.match(/msie/i),La=o.match(/webkit/i),M=o.match(/safari/i)&&!o.match(/chrome/i),Ma=o.match(/opera/i);F=o.match(/(mobile|pre\/|xoom)/i)||na;var oa=!aa.match(/usehtml5audio/i)&&
20 -!aa.match(/sm2\-ignorebadua/i)&&M&&o.match(/OS X 10_6_([3-7])/i),pa=typeof h.hasFocus!=="undefined"?h.hasFocus():null,E=M&&typeof h.hasFocus==="undefined",Da=!E,Ea=/(mp3|mp4|mpa)/i,qa=h.location?h.location.protocol.match(/http/i):null,Fa=!qa?"http://":"",Ga=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|mp4v|3gp|3g2)\s*(?:$|;)/i,Ha="mpeg4,aac,flv,mov,mp4,m4v,f4v,m4a,mp4v,3gp,3g2".split(","),Na=RegExp("\\.("+Ha.join("|")+")(\\?.*)?$","i");this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;
21 -this.useAltURL=!qa;this._global_a=null;if(F&&(c.useHTML5Audio=true,c.preferFlash=false,na))L=c.ignoreFlash=true;this.supported=this.ok=function(){return q?m&&!t:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(c){return O(c)||h[c]||i[c]};this.createSound=function(b){function a(){e=U(e);c.sounds[d.id]=new ra(d);c.soundIDs.push(d.id);return c.sounds[d.id]}var e=null,f=null,d=null;if(!m||!c.ok())return ja("soundManager.createSound(): "+y(!m?"notReady":"notOK")),false;arguments.length===2&&(b={id:arguments[0],
22 -url:arguments[1]});d=e=n(b);if(l(d.id,true))return c.sounds[d.id];if(X(d))f=a(),f._setup_html5(d);else{if(g>8){if(d.isMovieStar===null)d.isMovieStar=d.serverURL||(d.type?d.type.match(Ga):false)||d.url.match(Na);if(d.isMovieStar&&d.usePeakData)d.usePeakData=false}d=V(d,"soundManager.createSound(): ");f=a();if(g===8)c.o._createSound(d.id,d.loops||1,d.usePolicyFile);else if(c.o._createSound(d.id,d.url,d.usePeakData,d.useWaveformData,d.useEQData,d.isMovieStar,d.isMovieStar?d.bufferTime:false,d.loops||
23 -1,d.serverURL,d.duration||null,d.autoPlay,true,d.autoLoad,d.usePolicyFile),!d.serverURL)f.connected=true,d.onconnect&&d.onconnect.apply(f);!d.serverURL&&(d.autoLoad||d.autoPlay)&&f.load(d)}!d.serverURL&&d.autoPlay&&f.play();return f};this.destroySound=function(b,a){if(!l(b))return false;var e=c.sounds[b],f;e._iO={};e.stop();e.unload();for(f=0;f<c.soundIDs.length;f++)if(c.soundIDs[f]===b){c.soundIDs.splice(f,1);break}a||e.destruct(true);delete c.sounds[b];return true};this.load=function(b,a){return!l(b)?
24 -false:c.sounds[b].load(a)};this.unload=function(b){return!l(b)?false:c.sounds[b].unload()};this.onposition=function(b,a,e,f){return!l(b)?false:c.sounds[b].onposition(a,e,f)};this.start=this.play=function(b,a){if(!m||!c.ok())return ja("soundManager.play(): "+y(!m?"notReady":"notOK")),false;return!l(b)?(a instanceof Object||(a={url:a}),a&&a.url?(a.id=b,c.createSound(a).play()):false):c.sounds[b].play(a)};this.setPosition=function(b,a){return!l(b)?false:c.sounds[b].setPosition(a)};this.stop=function(b){return!l(b)?
25 -false:c.sounds[b].stop()};this.stopAll=function(){for(var b in c.sounds)c.sounds.hasOwnProperty(b)&&c.sounds[b].stop()};this.pause=function(b){return!l(b)?false:c.sounds[b].pause()};this.pauseAll=function(){var b;for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].pause()};this.resume=function(b){return!l(b)?false:c.sounds[b].resume()};this.resumeAll=function(){var b;for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].resume()};this.togglePause=function(b){return!l(b)?false:c.sounds[b].togglePause()};
26 -this.setPan=function(b,a){return!l(b)?false:c.sounds[b].setPan(a)};this.setVolume=function(b,a){return!l(b)?false:c.sounds[b].setVolume(a)};this.mute=function(b){var a=0;typeof b!=="string"&&(b=null);if(b)return!l(b)?false:c.sounds[b].mute();else{for(a=c.soundIDs.length;a--;)c.sounds[c.soundIDs[a]].mute();c.muted=true}return true};this.muteAll=function(){c.mute()};this.unmute=function(b){typeof b!=="string"&&(b=null);if(b)return!l(b)?false:c.sounds[b].unmute();else{for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].unmute();
27 -c.muted=false}return true};this.unmuteAll=function(){c.unmute()};this.toggleMute=function(b){return!l(b)?false:c.sounds[b].toggleMute()};this.getMemoryUse=function(){var b=0;c.o&&g!==8&&(b=parseInt(c.o._getMemoryUse(),10));return b};this.disable=function(b){var a;typeof b==="undefined"&&(b=false);if(t)return false;t=true;for(a=c.soundIDs.length;a--;)va(c.sounds[c.soundIDs[a]]);I(b);k.remove(i,"load",A);return true};this.canPlayMIME=function(b){var a;c.hasHTML5&&(a=K({type:b}));return!q||a?a:b?!!(g>
28 -8&&b.match(Ga)||b.match(c.mimePattern)):null};this.canPlayURL=function(b){var a;c.hasHTML5&&(a=K({url:b}));return!q||a?a:b?!!b.match(c.filePattern):null};this.canPlayLink=function(b){return typeof b.type!=="undefined"&&b.type&&c.canPlayMIME(b.type)?true:c.canPlayURL(b.href)};this.getSoundById=function(b){if(!b)throw Error("soundManager.getSoundById(): sID is null/undefined");return c.sounds[b]};this.onready=function(c,a){if(c&&c instanceof Function)return a||(a=i),ca("onready",c,a),z(),true;else throw y("needFunction",
29 -"onready");};this.ontimeout=function(c,a){if(c&&c instanceof Function)return a||(a=i),ca("ontimeout",c,a),z({type:"ontimeout"}),true;else throw y("needFunction","ontimeout");};this._wD=this._writeDebug=function(){return true};this._debug=function(){};this.reboot=function(){var b,a;for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].destruct();try{if(v)ha=c.o.innerHTML;J=c.o.parentNode.removeChild(c.o)}catch(e){}ha=J=q=null;c.enabled=ea=m=W=ka=G=H=t=c.swfLoaded=false;c.soundIDs=c.sounds=[];c.o=null;
30 -for(b in s)if(s.hasOwnProperty(b))for(a=s[b].length;a--;)s[b][a].fired=false;i.setTimeout(c.beginDelayedInit,20)};this.getMoviePercent=function(){return c.o&&typeof c.o.PercentLoaded!=="undefined"?c.o.PercentLoaded():null};this.beginDelayedInit=function(){sa=true;B();setTimeout(function(){if(ka)return false;S();R();return ka=true},20);Q()};this.destruct=function(){c.disable(true)};ra=function(b){var a=this,e,f,d;this.sID=b.id;this.url=b.url;this._iO=this.instanceOptions=this.options=n(b);this.pan=
31 -this.options.pan;this.volume=this.options.volume;this._lastURL=null;this.isHTML5=false;this._a=null;this.id3={};this._debug=function(){};this.load=function(b){var d=null;if(typeof b!=="undefined")a._iO=n(b,a.options),a.instanceOptions=a._iO;else if(b=a.options,a._iO=b,a.instanceOptions=a._iO,a._lastURL&&a._lastURL!==a.url)a._iO.url=a.url,a.url=null;if(!a._iO.url)a._iO.url=a.url;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=
32 -0;if(X(a._iO)){if(d=a._setup_html5(a._iO),!d._called_load)a._html5_canplay=false,d.load(),d._called_load=true,a._iO.autoPlay&&a.play()}else try{a.isHTML5=false,a._iO=V(U(a._iO)),g===8?c.o._load(a.sID,a._iO.url,a._iO.stream,a._iO.autoPlay,a._iO.whileloading?1:0,a._iO.loops||1,a._iO.usePolicyFile):c.o._load(a.sID,a._iO.url,!!a._iO.stream,!!a._iO.autoPlay,a._iO.loops||1,!!a._iO.autoLoad,a._iO.usePolicyFile)}catch(e){C({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:true})}return a};this.unload=function(){a.readyState!==
33 -0&&(a.isHTML5?(f(),a._a&&(a._a.pause(),la(a._a))):g===8?c.o._unload(a.sID,"about:blank"):c.o._unload(a.sID),e());return a};this.destruct=function(b){if(a.isHTML5){if(f(),a._a)a._a.pause(),la(a._a),L||a._remove_html5_events(),a._a._t=null,a._a=null}else a._iO.onfailure=null,c.o._destroySound(a.sID);b||c.destroySound(a.sID,true)};this.start=this.play=function(b,w){var e,w=w===void 0?true:w;b||(b={});a._iO=n(b,a._iO);a._iO=n(a._iO,a.options);a.instanceOptions=a._iO;if(a._iO.serverURL&&!a.connected)return a.getAutoPlay()||
34 -a.setAutoPlay(true),a;X(a._iO)&&(a._setup_html5(a._iO),d());if(a.playState===1&&!a.paused&&(e=a._iO.multiShot,!e))return a;if(!a.loaded)if(a.readyState===0){if(!a.isHTML5)a._iO.autoPlay=true;a.load(a._iO)}else if(a.readyState===2)return a;if(!a.isHTML5&&g===9&&a.position>0&&a.position===a.duration)a._iO.position=0;if(a.paused&&a.position&&a.position>0)a.resume();else{a.playState=1;a.paused=false;(!a.instanceCount||a._iO.multiShotEvents||!a.isHTML5&&g>8&&!a.getAutoPlay())&&a.instanceCount++;a.position=
35 -typeof a._iO.position!=="undefined"&&!isNaN(a._iO.position)?a._iO.position:0;if(!a.isHTML5)a._iO=V(U(a._iO));if(a._iO.onplay&&w)a._iO.onplay.apply(a),a._onplay_called=true;a.setVolume(a._iO.volume,true);a.setPan(a._iO.pan,true);a.isHTML5?(d(),e=a._setup_html5(),a.setPosition(a._iO.position),e.play()):c.o._start(a.sID,a._iO.loops||1,g===9?a._iO.position:a._iO.position/1E3)}return a};this.stop=function(b){if(a.playState===1){a._onbufferchange(0);a.resetOnPosition(0);a.paused=false;if(!a.isHTML5)a.playState=
36 -0;a._iO.onstop&&a._iO.onstop.apply(a);if(a.isHTML5){if(a._a)a.setPosition(0),a._a.pause(),a.playState=0,a._onTimer(),f()}else c.o._stop(a.sID,b),a._iO.serverURL&&a.unload();a.instanceCount=0;a._iO={}}return a};this.setAutoPlay=function(b){a._iO.autoPlay=b;a.isHTML5||(c.o._setAutoPlay(a.sID,b),b&&!a.instanceCount&&a.readyState===1&&a.instanceCount++)};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPosition=function(b){b===void 0&&(b=0);var d=a.isHTML5?Math.max(b,0):Math.min(a.duration||
37 -a._iO.duration,Math.max(b,0));a.position=d;b=a.position/1E3;a.resetOnPosition(a.position);a._iO.position=d;if(a.isHTML5){if(a._a&&a._html5_canplay&&a._a.currentTime!==b)try{a._a.currentTime=b,(a.playState===0||a.paused)&&a._a.pause()}catch(e){}}else b=g===9?a.position:b,a.readyState&&a.readyState!==2&&c.o._setPosition(a.sID,b,a.paused||!a.playState);a.isHTML5&&a.paused&&a._onTimer(true);return a};this.pause=function(b){if(a.paused||a.playState===0&&a.readyState!==1)return a;a.paused=true;a.isHTML5?
38 -(a._setup_html5().pause(),f()):(b||b===void 0)&&c.o._pause(a.sID);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){if(!a.paused)return a;a.paused=false;a.playState=1;a.isHTML5?(a._setup_html5().play(),d()):(a._iO.isMovieStar&&a.setPosition(a.position),c.o._pause(a.sID));!a._onplay_called&&a._iO.onplay?(a._iO.onplay.apply(a),a._onplay_called=true):a._iO.onresume&&a._iO.onresume.apply(a);return a};this.togglePause=function(){if(a.playState===0)return a.play({position:g===9&&!a.isHTML5?
39 -a.position:a.position/1E3}),a;a.paused?a.resume():a.pause();return a};this.setPan=function(b,d){typeof b==="undefined"&&(b=0);typeof d==="undefined"&&(d=false);a.isHTML5||c.o._setPan(a.sID,b);a._iO.pan=b;if(!d)a.pan=b,a.options.pan=b;return a};this.setVolume=function(b,d){typeof b==="undefined"&&(b=100);typeof d==="undefined"&&(d=false);if(a.isHTML5){if(a._a)a._a.volume=Math.max(0,Math.min(1,b/100))}else c.o._setVolume(a.sID,c.muted&&!a.muted||a.muted?0:b);a._iO.volume=b;if(!d)a.volume=b,a.options.volume=
40 -b;return a};this.mute=function(){a.muted=true;if(a.isHTML5){if(a._a)a._a.muted=true}else c.o._setVolume(a.sID,0);return a};this.unmute=function(){a.muted=false;var b=typeof a._iO.volume!=="undefined";if(a.isHTML5){if(a._a)a._a.muted=false}else c.o._setVolume(a.sID,b?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=function(b,c,d){a._onPositionItems.push({position:b,method:c,scope:typeof d!=="undefined"?d:a,fired:false});return a};
41 -this.processOnPosition=function(){var b,d;b=a._onPositionItems.length;if(!b||!a.playState||a._onPositionFired>=b)return false;for(;b--;)if(d=a._onPositionItems[b],!d.fired&&a.position>=d.position)d.fired=true,c._onPositionFired++,d.method.apply(d.scope,[d.position]);return true};this.resetOnPosition=function(b){var d,e;d=a._onPositionItems.length;if(!d)return false;for(;d--;)if(e=a._onPositionItems[d],e.fired&&b<=e.position)e.fired=false,c._onPositionFired--;return true};d=function(){a.isHTML5&&xa(a)};
42 -f=function(){a.isHTML5&&ya(a)};e=function(){a._onPositionItems=[];a._onPositionFired=0;a._hasTimer=null;a._onplay_called=false;a._a=null;a._html5_canplay=false;a.bytesLoaded=null;a.bytesTotal=null;a.position=null;a.duration=a._iO&&a._iO.duration?a._iO.duration:null;a.durationEstimate=null;a.failures=0;a.loaded=false;a.playState=0;a.paused=false;a.readyState=0;a.muted=false;a.isBuffering=false;a.instanceOptions={};a.instanceCount=0;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.eqData=
43 -[];a.eqData.left=[];a.eqData.right=[]};e();this._onTimer=function(b){var c={};if(a._hasTimer||b)return a._a&&(b||(a.playState>0||a.readyState===1)&&!a.paused)?(a.duration=a._get_html5_duration(),a.durationEstimate=a.duration,b=a._a.currentTime?a._a.currentTime*1E3:0,a._whileplaying(b,c,c,c,c),true):false};this._get_html5_duration=function(){var b=a._a?a._a.duration*1E3:a._iO?a._iO.duration:void 0;return b&&!isNaN(b)&&b!==Infinity?b:a._iO?a._iO.duration:null};this._setup_html5=function(b){var b=n(a._iO,
44 -b),d=L?c._global_a:a._a;decodeURI(b.url);var f=d&&d._t?d._t.instanceOptions:null;if(d){if(d._t&&f.url===b.url&&(!a._lastURL||a._lastURL===f.url))return d;L&&d._t&&d._t.playState&&b.url!==f.url&&d._t.stop();e();d.src=b.url;a.url=b.url;a._lastURL=b.url;d._called_load=false}else{d=new Audio(b.url);d._called_load=false;if(Ka)d._called_load=true;if(L)c._global_a=d}a.isHTML5=true;a._a=d;d._t=a;a._add_html5_events();d.loop=b.loops>1?"loop":"";b.autoLoad||b.autoPlay?(d.autobuffer="auto",d.preload="auto",
45 -a.load(),d._called_load=true):(d.autobuffer=false,d.preload="none");d.loop=b.loops>1?"loop":"";return d};this._add_html5_events=function(){if(a._a._added_events)return false;var b;a._a._added_events=true;for(b in r)r.hasOwnProperty(b)&&a._a&&a._a.addEventListener(b,r[b],false);return true};this._remove_html5_events=function(){var b;a._a._added_events=false;for(b in r)r.hasOwnProperty(b)&&a._a&&a._a.removeEventListener(b,r[b],false)};this._onload=function(b){b=!!b;a.loaded=b;a.readyState=b?3:2;a._onbufferchange(0);
46 -a._iO.onload&&a._iO.onload.apply(a,[b]);return true};this._onbufferchange=function(b){if(a.playState===0)return false;if(b&&a.isBuffering||!b&&!a.isBuffering)return false;a.isBuffering=b===1;a._iO.onbufferchange&&a._iO.onbufferchange.apply(a);return true};this._onsuspend=function(){a._iO.onsuspend&&a._iO.onsuspend.apply(a);return true};this._onfailure=function(b,c,d){a.failures++;if(a._iO.onfailure&&a.failures===1)a._iO.onfailure(a,b,c,d)};this._onfinish=function(){var b=a._iO.onfinish;a._onbufferchange(0);
47 -a.resetOnPosition(0);if(a.instanceCount){a.instanceCount--;if(!a.instanceCount)a.playState=0,a.paused=false,a.instanceCount=0,a.instanceOptions={},a._iO={},f();(!a.instanceCount||a._iO.multiShotEvents)&&b&&b.apply(a)}};this._whileloading=function(b,c,d,e){a.bytesLoaded=b;a.bytesTotal=c;a.duration=Math.floor(d);a.bufferLength=e;if(a._iO.isMovieStar)a.durationEstimate=a.duration;else if(a.durationEstimate=a._iO.duration?a.duration>a._iO.duration?a.duration:a._iO.duration:parseInt(a.bytesTotal/a.bytesLoaded*
48 -a.duration,10),a.durationEstimate===void 0)a.durationEstimate=a.duration;a.readyState!==3&&a._iO.whileloading&&a._iO.whileloading.apply(a)};this._whileplaying=function(b,c,d,e,f){if(isNaN(b)||b===null)return false;a.position=b;a.processOnPosition();if(!a.isHTML5&&g>8){if(a._iO.usePeakData&&typeof c!=="undefined"&&c)a.peakData={left:c.leftPeak,right:c.rightPeak};if(a._iO.useWaveformData&&typeof d!=="undefined"&&d)a.waveformData={left:d.split(","),right:e.split(",")};if(a._iO.useEQData&&typeof f!==
49 -"undefined"&&f&&f.leftEQ&&(b=f.leftEQ.split(","),a.eqData=b,a.eqData.left=b,typeof f.rightEQ!=="undefined"&&f.rightEQ))a.eqData.right=f.rightEQ.split(",")}a.playState===1&&(!a.isHTML5&&g===8&&!a.position&&a.isBuffering&&a._onbufferchange(0),a._iO.whileplaying&&a._iO.whileplaying.apply(a));return true};this._onid3=function(b,c){var d=[],e,f;for(e=0,f=b.length;e<f;e++)d[b[e]]=c[e];a.id3=n(a.id3,d);a._iO.onid3&&a._iO.onid3.apply(a)};this._onconnect=function(b){b=b===1;if(a.connected=b)a.failures=0,l(a.sID)&&
50 -(a.getAutoPlay()?a.play(void 0,a.getAutoPlay()):a._iO.autoLoad&&a.load()),a._iO.onconnect&&a._iO.onconnect.apply(a,[b])};this._ondataerror=function(){a.playState>0&&a._iO.ondataerror&&a._iO.ondataerror.apply(a)}};fa=function(){return h.body||h._docElement||h.getElementsByTagName("div")[0]};O=function(b){return h.getElementById(b)};n=function(b,a){var e={},f,d;for(f in b)b.hasOwnProperty(f)&&(e[f]=b[f]);f=typeof a==="undefined"?c.defaultOptions:a;for(d in f)f.hasOwnProperty(d)&&typeof e[d]==="undefined"&&
51 -(e[d]=f[d]);return e};k=function(){function b(a){var a=Ia.call(a),b=a.length;c?(a[1]="on"+a[1],b>3&&a.pop()):b===3&&a.push(false);return a}function a(a,b){var w=a.shift(),h=[f[b]];if(c)w[h](a[0],a[1]);else w[h].apply(w,a)}var c=i.attachEvent,f={add:c?"attachEvent":"addEventListener",remove:c?"detachEvent":"removeEventListener"};return{add:function(){a(b(arguments),"add")},remove:function(){a(b(arguments),"remove")}}}();r={abort:j(function(){}),canplay:j(function(){if(this._t._html5_canplay)return true;
52 -this._t._html5_canplay=true;this._t._onbufferchange(0);var b=!isNaN(this._t.position)?this._t.position/1E3:null;if(this._t.position&&this.currentTime!==b)try{this.currentTime=b}catch(a){}}),load:j(function(){this._t.loaded||(this._t._onbufferchange(0),this._t._whileloading(this._t.bytesTotal,this._t.bytesTotal,this._t._get_html5_duration()),this._t._onload(true))}),emptied:j(function(){}),ended:j(function(){this._t._onfinish()}),error:j(function(){this._t._onload(false)}),loadeddata:j(function(){var b=
53 -this._t,a=b.bytesTotal||1;if(!b._loaded&&!M)b.duration=b._get_html5_duration(),b._whileloading(a,a,b._get_html5_duration()),b._onload(true)}),loadedmetadata:j(function(){}),loadstart:j(function(){this._t._onbufferchange(1)}),play:j(function(){this._t._onbufferchange(0)}),playing:j(function(){this._t._onbufferchange(0)}),progress:j(function(b){if(this._t.loaded)return false;var a,c=0,f=b.target.buffered;a=b.loaded||0;var d=b.total||1;if(f&&f.length){for(a=f.length;a--;)c=f.end(a)-f.start(a);a=c/b.target.duration}isNaN(a)||
54 -(this._t._onbufferchange(0),this._t._whileloading(a,d,this._t._get_html5_duration()),a&&d&&a===d&&r.load.call(this,b))}),ratechange:j(function(){}),suspend:j(function(b){r.progress.call(this,b);this._t._onsuspend()}),stalled:j(function(){}),timeupdate:j(function(){this._t._onTimer()}),waiting:j(function(){this._t._onbufferchange(1)})};X=function(b){return!b.serverURL&&(b.type?K({type:b.type}):K({url:b.url})||c.html5Only)};la=function(b){if(b)b.src=Ja?"":"about:blank"};K=function(b){function a(a){return c.preferFlash&&
55 -p&&!c.ignoreFlash&&typeof c.flash[a]!=="undefined"&&c.flash[a]}if(!c.useHTML5Audio||!c.hasHTML5)return false;var e=b.url||null,b=b.type||null,f=c.audioFormats,d;if(b&&c.html5[b]!=="undefined")return c.html5[b]&&!a(b);if(!u){u=[];for(d in f)f.hasOwnProperty(d)&&(u.push(d),f[d].related&&(u=u.concat(f[d].related)));u=RegExp("\\.("+u.join("|")+")(\\?.*)?$","i")}d=e?e.toLowerCase().match(u):null;if(!d||!d.length)if(b)e=b.indexOf(";"),d=(e!==-1?b.substr(0,e):b).substr(6);else return false;else d=d[1];return d&&
56 -typeof c.html5[d]!=="undefined"?c.html5[d]&&!a(d):(b="audio/"+d,e=c.html5.canPlayType({type:b}),(c.html5[d]=e)&&c.html5[b]&&!a(b))};Aa=function(){function b(b){var d,e,f=false;if(!a||typeof a.canPlayType!=="function")return false;if(b instanceof Array){for(d=0,e=b.length;d<e&&!f;d++)if(c.html5[b[d]]||a.canPlayType(b[d]).match(c.html5Test))f=true,c.html5[b[d]]=true,c.flash[b[d]]=!(!c.preferFlash||!p||!b[d].match(Ea));return f}else return b=a&&typeof a.canPlayType==="function"?a.canPlayType(b):false,
57 -!(!b||!b.match(c.html5Test))}if(!c.useHTML5Audio||typeof Audio==="undefined")return false;var a=typeof Audio!=="undefined"?Ma?new Audio(null):new Audio:null,e,f={},d,h;d=c.audioFormats;for(e in d)if(d.hasOwnProperty(e)&&(f[e]=b(d[e].type),f["audio/"+e]=f[e],c.flash[e]=c.preferFlash&&!c.ignoreFlash&&e.match(Ea)?true:false,d[e]&&d[e].related))for(h=d[e].related.length;h--;)f["audio/"+d[e].related[h]]=f[e],c.html5[d[e].related[h]]=f[e],c.flash[d[e].related[h]]=f[e];f.canPlayType=a?b:null;c.html5=n(c.html5,
58 -f);return true};y=function(){};U=function(b){if(g===8&&b.loops>1&&b.stream)b.stream=false;return b};V=function(b){if(b&&!b.usePolicyFile&&(b.onid3||b.usePeakData||b.useWaveformData||b.useEQData))b.usePolicyFile=true;return b};ja=function(){};ba=function(){return false};va=function(b){for(var a in b)b.hasOwnProperty(a)&&typeof b[a]==="function"&&(b[a]=ba)};T=function(b){typeof b==="undefined"&&(b=false);(t||b)&&c.disable(b)};wa=function(b){var a=null;if(b)if(b.match(/\.swf(\?.*)?$/i)){if(a=b.substr(b.toLowerCase().lastIndexOf(".swf?")+
59 -4))return b}else b.lastIndexOf("/")!==b.length-1&&(b+="/");b=(b&&b.lastIndexOf("/")!==-1?b.substr(0,b.lastIndexOf("/")+1):"./")+c.movieURL;c.noSWFCache&&(b+="?ts="+(new Date).getTime());return b};da=function(){g=parseInt(c.flashVersion,10);if(g!==8&&g!==9)c.flashVersion=g=8;var b=c.debugMode||c.debugFlash?"_debug.swf":".swf";if(c.useHTML5Audio&&!c.html5Only&&c.audioFormats.mp4.required&&g<9)c.flashVersion=g=9;c.version=c.versionNumber+(c.html5Only?" (HTML5-only mode)":g===9?" (AS3/Flash 9)":" (AS2/Flash 8)");
60 -g>8?(c.defaultOptions=n(c.defaultOptions,c.flash9Options),c.features.buffering=true,c.defaultOptions=n(c.defaultOptions,c.movieStarOptions),c.filePatterns.flash9=RegExp("\\.(mp3|"+Ha.join("|")+")(\\?.*)?$","i"),c.features.movieStar=true):c.features.movieStar=false;c.filePattern=c.filePatterns[g!==8?"flash9":"flash8"];c.movieURL=(g===8?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",b);c.features.peakData=c.features.waveformData=c.features.eqData=g>8};ua=function(b,a){if(!c.o)return false;
61 -c.o._setPolling(b,a)};ga=function(){if(c.debugURLParam.test(aa))c.debugMode=true};l=this.getSoundById;D=function(){var b=[];c.debugMode&&b.push(c.swfCSS.sm2Debug);c.debugFlash&&b.push(c.swfCSS.flashDebug);c.useHighPerformance&&b.push(c.swfCSS.highPerf);return b.join(" ")};ia=function(){y("fbHandler");var b=c.getMoviePercent(),a=c.swfCSS,e={type:"FLASHBLOCK"};if(c.html5Only)return false;if(c.ok()){if(c.oMC)c.oMC.className=[D(),a.swfDefault,a.swfLoaded+(c.didFlashBlock?" "+a.swfUnblocked:"")].join(" ")}else{if(q)c.oMC.className=
62 -D()+" "+a.swfDefault+" "+(b===null?a.swfTimedout:a.swfError);c.didFlashBlock=true;z({type:"ontimeout",ignoreInit:true,error:e});C(e)}};ca=function(b,a,c){typeof s[b]==="undefined"&&(s[b]=[]);s[b].push({method:a,scope:c||null,fired:false})};z=function(b){b||(b={type:"onready"});if(!m&&b&&!b.ignoreInit)return false;if(b.type==="ontimeout"&&c.ok())return false;var a={success:b&&b.ignoreInit?c.ok():!t},e=b&&b.type?s[b.type]||[]:[],f=[],d,a=[a],h=q&&c.useFlashBlock&&!c.ok();if(b.error)a[0].error=b.error;
63 -for(b=0,d=e.length;b<d;b++)e[b].fired!==true&&f.push(e[b]);if(f.length)for(b=0,d=f.length;b<d;b++)if(f[b].scope?f[b].method.apply(f[b].scope,a):f[b].method.apply(this,a),!h)f[b].fired=true;return true};A=function(){i.setTimeout(function(){c.useFlashBlock&&ia();z();c.onload instanceof Function&&c.onload.apply(i);c.waitForWindowLoad&&k.add(i,"load",A)},1)};Y=function(){if(p!==void 0)return p;var b=false,a=navigator,c=a.plugins,f,d=i.ActiveXObject;if(c&&c.length)(a=a.mimeTypes)&&a["application/x-shockwave-flash"]&&
64 -a["application/x-shockwave-flash"].enabledPlugin&&a["application/x-shockwave-flash"].enabledPlugin.description&&(b=true);else if(typeof d!=="undefined"){try{f=new d("ShockwaveFlash.ShockwaveFlash")}catch(h){}b=!!f}return p=b};za=function(){var b,a;if(na&&o.match(/os (1|2|3_0|3_1)/i)){c.hasHTML5=false;c.html5Only=true;if(c.oMC)c.oMC.style.display="none";return false}if(c.useHTML5Audio){if(!c.html5||!c.html5.canPlayType)return c.hasHTML5=false,true;else c.hasHTML5=true;if(oa&&Y())return true}else return true;
65 -for(a in c.audioFormats)if(c.audioFormats.hasOwnProperty(a)&&(c.audioFormats[a].required&&!c.html5.canPlayType(c.audioFormats[a].type)||c.flash[a]||c.flash[c.audioFormats[a].type]))b=true;c.ignoreFlash&&(b=false);c.html5Only=c.hasHTML5&&c.useHTML5Audio&&!b;return!c.html5Only};xa=function(b){if(!b._hasTimer)b._hasTimer=true};ya=function(b){if(b._hasTimer)b._hasTimer=false};C=function(b){b=typeof b!=="undefined"?b:{};c.onerror instanceof Function&&c.onerror.apply(i,[{type:typeof b.type!=="undefined"?
66 -b.type:null}]);typeof b.fatal!=="undefined"&&b.fatal&&c.disable()};Ba=function(){if(!oa||!Y())return false;var b=c.audioFormats,a,e;for(e in b)if(b.hasOwnProperty(e)&&(e==="mp3"||e==="mp4"))if(c.html5[e]=false,b[e]&&b[e].related)for(a=b[e].related.length;a--;)c.html5[b[e].related[a]]=false};this._setSandboxType=function(){};this._externalInterfaceOK=function(){if(c.swfLoaded)return false;(new Date).getTime();c.swfLoaded=true;E=false;oa&&Ba();v?setTimeout(P,100):P()};S=function(b,a){function e(a,b){return'<param name="'+
67 -a+'" value="'+b+'" />'}if(G&&H)return false;if(c.html5Only)return da(),c.oMC=O(c.movieID),P(),H=G=true,false;var f=a||c.url,d=c.altURL||f,g;g=fa();var i,l,j=D(),k,m=null,m=(m=h.getElementsByTagName("html")[0])&&m.dir&&m.dir.match(/rtl/i),b=typeof b==="undefined"?c.id:b;da();c.url=wa(qa?f:d);a=c.url;c.wmode=!c.wmode&&c.useHighPerformance?"transparent":c.wmode;if(c.wmode!==null&&(o.match(/msie 8/i)||!v&&!c.useHighPerformance)&&navigator.platform.match(/win32|win64/i))c.specialWmodeCase=true,c.wmode=
68 -null;g={name:b,id:b,src:a,width:"auto",height:"auto",quality:"high",allowScriptAccess:c.allowScriptAccess,bgcolor:c.bgColor,pluginspage:Fa+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:c.wmode,hasPriority:"true"};if(c.debugFlash)g.FlashVars="debug=1";c.wmode||delete g.wmode;if(v)f=h.createElement("div"),l=['<object id="'+b+'" data="'+a+'" type="'+g.type+'" title="'+g.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+
69 -Fa+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="'+g.width+'" height="'+g.height+'">',e("movie",a),e("AllowScriptAccess",c.allowScriptAccess),e("quality",g.quality),c.wmode?e("wmode",c.wmode):"",e("bgcolor",c.bgColor),e("hasPriority","true"),c.debugFlash?e("FlashVars",g.FlashVars):"","</object>"].join("");else for(i in f=h.createElement("embed"),g)g.hasOwnProperty(i)&&f.setAttribute(i,g[i]);ga();j=D();if(g=fa())if(c.oMC=O(c.movieID)||h.createElement("div"),
70 -c.oMC.id){k=c.oMC.className;c.oMC.className=(k?k+" ":c.swfCSS.swfDefault)+(j?" "+j:"");c.oMC.appendChild(f);if(v)i=c.oMC.appendChild(h.createElement("div")),i.className=c.swfCSS.swfBox,i.innerHTML=l;H=true}else{c.oMC.id=c.movieID;c.oMC.className=c.swfCSS.swfDefault+" "+j;i=j=null;if(!c.useFlashBlock)if(c.useHighPerformance)j={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"};else if(j={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},m)j.left=
71 -Math.abs(parseInt(j.left,10))+"px";if(La)c.oMC.style.zIndex=1E4;if(!c.debugFlash)for(k in j)j.hasOwnProperty(k)&&(c.oMC.style[k]=j[k]);try{v||c.oMC.appendChild(f);g.appendChild(c.oMC);if(v)i=c.oMC.appendChild(h.createElement("div")),i.className=c.swfCSS.swfBox,i.innerHTML=l;H=true}catch(n){throw Error(y("domError")+" \n"+n.toString());}}return G=true};R=function(){if(c.html5Only)return S(),false;if(c.o)return false;c.o=c.getMovie(c.id);if(!c.o)J?(v?c.oMC.innerHTML=ha:c.oMC.appendChild(J),J=null,G=
72 -true):S(c.id,c.url),c.o=c.getMovie(c.id);c.oninitmovie instanceof Function&&setTimeout(c.oninitmovie,1);return true};Q=function(){setTimeout(ta,1E3)};ta=function(){if(W)return false;W=true;k.remove(i,"load",Q);if(E&&!pa)return false;var b;m||(b=c.getMoviePercent());setTimeout(function(){b=c.getMoviePercent();!m&&Da&&(b===null?c.useFlashBlock||c.flashLoadTimeout===0?c.useFlashBlock&&ia():T(true):c.flashLoadTimeout!==0&&T(true))},c.flashLoadTimeout)};x=function(){function b(){k.remove(i,"focus",x);
73 -k.remove(i,"load",x)}if(pa||!E)return b(),true;pa=Da=true;M&&E&&k.remove(i,"mousemove",x);W=false;b();return true};Ca=function(){var b,a=[];if(c.useHTML5Audio&&c.hasHTML5)for(b in c.audioFormats)c.audioFormats.hasOwnProperty(b)&&a.push(b+": "+c.html5[b]+(!c.html5[b]&&p&&c.flash[b]?" (using flash)":c.preferFlash&&c.flash[b]&&p?" (preferring flash)":!c.html5[b]?" ("+(c.audioFormats[b].required?"required, ":"")+"and no flash support)":""))};I=function(b){if(m)return false;if(c.html5Only)return m=true,
74 -A(),true;var a;if(!c.useFlashBlock||!c.flashLoadTimeout||c.getMoviePercent())m=true,t&&(a={type:!p&&q?"NO_FLASH":"INIT_TIMEOUT"});if(t||b){if(c.useFlashBlock&&c.oMC)c.oMC.className=D()+" "+(c.getMoviePercent()===null?c.swfCSS.swfTimedout:c.swfCSS.swfError);z({type:"ontimeout",error:a});C(a);return false}if(c.waitForWindowLoad&&!sa)return k.add(i,"load",A),false;else A();return true};P=function(){if(m)return false;if(c.html5Only){if(!m)k.remove(i,"load",c.beginDelayedInit),c.enabled=true,I();return true}R();
75 -try{c.o._externalInterfaceTest(false),ua(true,c.flashPollingInterval||(c.useHighPerformance?10:50)),c.debugMode||c.o._disableDebug(),c.enabled=true,c.html5Only||k.add(i,"unload",ba)}catch(b){return C({type:"JS_TO_FLASH_EXCEPTION",fatal:true}),T(true),I(),false}I();k.remove(i,"load",c.beginDelayedInit);return true};B=function(){if(ea)return false;ea=true;ga();if(!p&&c.hasHTML5)c.useHTML5Audio=true,c.preferFlash=false;Aa();c.html5.usingFlash=za();q=c.html5.usingFlash;Ca();if(!p&&q)c.flashLoadTimeout=
76 -1;h.removeEventListener&&h.removeEventListener("DOMContentLoaded",B,false);R();return true};ma=function(){h.readyState==="complete"&&(B(),h.detachEvent("onreadystatechange",ma));return true};Y();k.add(i,"focus",x);k.add(i,"load",x);k.add(i,"load",Q);M&&E&&k.add(i,"mousemove",x);h.addEventListener?h.addEventListener("DOMContentLoaded",B,false):h.attachEvent?h.attachEvent("onreadystatechange",ma):C({type:"NO_DOM2_EVENTS",fatal:true});h.readyState==="complete"&&setTimeout(B,100)}var Z=null;if(typeof SM2_DEFER===
77 -"undefined"||!SM2_DEFER)Z=new N;$.SoundManager=N;$.soundManager=Z})(window);
\ No newline at end of file
 14+(function(J){function R(R,ea){function l(b){return function(a){var c=this._t;return!c||!c._a?null:b.call(this,a)}}this.flashVersion=8;this.debugFlash=this.debugMode=!1;this.consoleOnly=this.useConsole=!0;this.waitForWindowLoad=!1;this.bgColor="#ffffff";this.useHighPerformance=!1;this.html5PollingInterval=this.flashPollingInterval=null;this.flashLoadTimeout=1E3;this.wmode=null;this.allowScriptAccess="always";this.useFlashBlock=!1;this.useHTML5Audio=!0;this.html5Test=/^(probably|maybe)$/i;this.preferFlash=
 15+!0;this.noSWFCache=!1;this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1}};this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,
 16+onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfailure:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100};this.flash9Options={isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null};this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null};this.movieID="sm2-container";this.id=ea||"sm2movie";
 17+this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.versionNumber="V2.97a.20111220";this.movieURL=this.version=null;this.url=R||null;this.altURL=null;this.enabled=this.swfLoaded=!1;this.oMC=null;this.sounds={};this.soundIDs=[];this.didFlashBlock=this.muted=!1;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1};this.sandbox={};var fa;try{fa="undefined"!==typeof Audio&&
 18+"undefined"!==typeof(new Audio).canPlayType}catch(Xa){fa=!1}this.hasHTML5=fa;this.html5={usingFlash:null};this.flash={};this.ignoreFlash=this.html5Only=!1;var Aa,c=this,h=null,S,p=navigator.userAgent,j=J,ga=j.location.href.toString(),k=document,ha,T,i,v=[],K=!1,L=!1,m=!1,w=!1,ia=!1,M,q,ja,C,D,U,Ba,ka,A,V,E,la,ma,na,W,F,Ca,oa,Da,X,Ea,N=null,pa=null,G,qa,H,Y,Z,ra,o,$=!1,sa=!1,Fa,Ga,Ha,aa=0,O=null,ba,s=null,Ia,ca,P,x,ta,ua,Ja,n,Ra=Array.prototype.slice,B=!1,r,da,Ka,u,La,va=p.match(/(ipad|iphone|ipod)/i),
 19+Sa=p.match(/firefox/i),Ta=p.match(/droid/i),y=p.match(/msie/i),Ua=p.match(/webkit/i),Q=p.match(/safari/i)&&!p.match(/chrome/i),Va=p.match(/opera/i),wa=p.match(/(mobile|pre\/|xoom)/i)||va,xa=!ga.match(/usehtml5audio/i)&&!ga.match(/sm2\-ignorebadua/i)&&Q&&!p.match(/silk/i)&&p.match(/OS X 10_6_([3-7])/i),ya="undefined"!==typeof k.hasFocus?k.hasFocus():null,I=Q&&"undefined"===typeof k.hasFocus,Ma=!I,Na=/(mp3|mp4|mpa)/i,za=k.location?k.location.protocol.match(/http/i):null,Oa=!za?"http://":"",Pa=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|mp4v|3gp|3g2)\s*(?:$|;)/i,
 20+Qa="mpeg4,aac,flv,mov,mp4,m4v,f4v,m4a,mp4v,3gp,3g2".split(","),Wa=RegExp("\\.("+Qa.join("|")+")(\\?.*)?$","i");this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.useAltURL=!za;this._global_a=null;if(wa&&(c.useHTML5Audio=!0,c.preferFlash=!1,va))B=c.ignoreFlash=!0;this.supported=this.ok=function(){return s?m&&!w:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(b){return S(b)||k[b]||j[b]};this.createSound=function(b){function a(){e=Y(e);c.sounds[d.id]=new Aa(d);c.soundIDs.push(d.id);
 21+return c.sounds[d.id]}var e=null,f=null,d=null;if(!m||!c.ok())return ra(void 0),!1;2===arguments.length&&(b={id:arguments[0],url:arguments[1]});e=q(b);e.url=ba(e.url);d=e;if(o(d.id,!0))return c.sounds[d.id];if(ca(d))f=a(),f._setup_html5(d);else{if(8<i){if(null===d.isMovieStar)d.isMovieStar=d.serverURL||(d.type?d.type.match(Pa):!1)||d.url.match(Wa);if(d.isMovieStar&&d.usePeakData)d.usePeakData=!1}d=Z(d,void 0);f=a();if(8===i)h._createSound(d.id,d.loops||1,d.usePolicyFile);else if(h._createSound(d.id,
 22+d.url,d.usePeakData,d.useWaveformData,d.useEQData,d.isMovieStar,d.isMovieStar?d.bufferTime:!1,d.loops||1,d.serverURL,d.duration||null,d.autoPlay,!0,d.autoLoad,d.usePolicyFile),!d.serverURL)f.connected=!0,d.onconnect&&d.onconnect.apply(f);!d.serverURL&&(d.autoLoad||d.autoPlay)&&f.load(d)}!d.serverURL&&d.autoPlay&&f.play();return f};this.destroySound=function(b,a){if(!o(b))return!1;var e=c.sounds[b],f;e._iO={};e.stop();e.unload();for(f=0;f<c.soundIDs.length;f++)if(c.soundIDs[f]===b){c.soundIDs.splice(f,
 23+1);break}a||e.destruct(!0);delete c.sounds[b];return!0};this.load=function(b,a){return!o(b)?!1:c.sounds[b].load(a)};this.unload=function(b){return!o(b)?!1:c.sounds[b].unload()};this.onposition=this.onPosition=function(b,a,e,f){return!o(b)?!1:c.sounds[b].onposition(a,e,f)};this.clearOnPosition=function(b,a,e){return!o(b)?!1:c.sounds[b].clearOnPosition(a,e)};this.start=this.play=function(b,a){if(!m||!c.ok())return ra("soundManager.play(): "+G(!m?"notReady":"notOK")),!1;if(!o(b)){a instanceof Object||
 24+(a={url:a});return a&&a.url?(a.id=b,c.createSound(a).play()):!1}return c.sounds[b].play(a)};this.setPosition=function(b,a){return!o(b)?!1:c.sounds[b].setPosition(a)};this.stop=function(b){return!o(b)?!1:c.sounds[b].stop()};this.stopAll=function(){for(var b in c.sounds)c.sounds.hasOwnProperty(b)&&c.sounds[b].stop()};this.pause=function(b){return!o(b)?!1:c.sounds[b].pause()};this.pauseAll=function(){var b;for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].pause()};this.resume=function(b){return!o(b)?
 25+!1:c.sounds[b].resume()};this.resumeAll=function(){var b;for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].resume()};this.togglePause=function(b){return!o(b)?!1:c.sounds[b].togglePause()};this.setPan=function(b,a){return!o(b)?!1:c.sounds[b].setPan(a)};this.setVolume=function(b,a){return!o(b)?!1:c.sounds[b].setVolume(a)};this.mute=function(b){var a=0;"string"!==typeof b&&(b=null);if(b)return!o(b)?!1:c.sounds[b].mute();for(a=c.soundIDs.length;a--;)c.sounds[c.soundIDs[a]].mute();return c.muted=!0};
 26+this.muteAll=function(){c.mute()};this.unmute=function(b){"string"!==typeof b&&(b=null);if(b)return!o(b)?!1:c.sounds[b].unmute();for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].unmute();c.muted=!1;return!0};this.unmuteAll=function(){c.unmute()};this.toggleMute=function(b){return!o(b)?!1:c.sounds[b].toggleMute()};this.getMemoryUse=function(){var b=0;h&&8!==i&&(b=parseInt(h._getMemoryUse(),10));return b};this.disable=function(b){var a;"undefined"===typeof b&&(b=!1);if(w)return!1;w=!0;for(a=c.soundIDs.length;a--;)Da(c.sounds[c.soundIDs[a]]);
 27+M(b);n.remove(j,"load",D);return!0};this.canPlayMIME=function(b){var a;c.hasHTML5&&(a=P({type:b}));return!s||a?a:b?!!(8<i&&b.match(Pa)||b.match(c.mimePattern)):null};this.canPlayURL=function(b){var a;c.hasHTML5&&(a=P({url:b}));return!s||a?a:b?!!b.match(c.filePattern):null};this.canPlayLink=function(b){return"undefined"!==typeof b.type&&b.type&&c.canPlayMIME(b.type)?!0:c.canPlayURL(b.href)};this.getSoundById=function(b){if(!b)throw Error("soundManager.getSoundById(): sID is null/undefined");return c.sounds[b]};
 28+this.onready=function(b,a){if(b&&b instanceof Function)return a||(a=j),ja("onready",b,a),C(),!0;throw G("needFunction","onready");};this.ontimeout=function(b,a){if(b&&b instanceof Function)return a||(a=j),ja("ontimeout",b,a),C({type:"ontimeout"}),!0;throw G("needFunction","ontimeout");};this._wD=this._writeDebug=function(){return!0};this._debug=function(){};this.reboot=function(){var b,a;for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].destruct();try{if(y)pa=h.innerHTML;N=h.parentNode.removeChild(h)}catch(e){}pa=
 29+N=s=null;c.enabled=ma=m=$=sa=K=L=w=c.swfLoaded=!1;c.soundIDs=c.sounds=[];h=null;for(b in v)if(v.hasOwnProperty(b))for(a=v[b].length;a--;)v[b][a].fired=!1;j.setTimeout(c.beginDelayedInit,20)};this.getMoviePercent=function(){return h&&"undefined"!==typeof h.PercentLoaded?h.PercentLoaded():null};this.beginDelayedInit=function(){ia=!0;E();setTimeout(function(){if(sa)return!1;W();V();return sa=!0},20);U()};this.destruct=function(){c.disable(!0)};Aa=function(b){var a=this,e,f,d,g,z,j,k=!1,t=[],l=0,n,p,
 30+m=null,r=null,s=null;this.sID=b.id;this.url=b.url;this._iO=this.instanceOptions=this.options=q(b);this.pan=this.options.pan;this.volume=this.options.volume;this.isHTML5=!1;this._a=null;this.id3={};this._debug=function(){};this.load=function(b){var c=null;if("undefined"!==typeof b)a._iO=q(b,a.options),a.instanceOptions=a._iO;else if(b=a.options,a._iO=b,a.instanceOptions=a._iO,m&&m!==a.url)a._iO.url=a.url,a.url=null;if(!a._iO.url)a._iO.url=a.url;a._iO.url=ba(a._iO.url);if(a._iO.url===a.url&&0!==a.readyState&&
 31+2!==a.readyState)return 3===a.readyState&&a._iO.onload&&a._iO.onload.apply(a,[!!a.duration]),a;b=a._iO;m=a.url;a.loaded=!1;a.readyState=1;a.playState=0;if(ca(b)){if(c=a._setup_html5(b),!c._called_load)a._html5_canplay=!1,a._a.autobuffer="auto",a._a.preload="auto",c.load(),c._called_load=!0,b.autoPlay&&a.play()}else try{a.isHTML5=!1,a._iO=Z(Y(b)),b=a._iO,8===i?h._load(a.sID,b.url,b.stream,b.autoPlay,b.whileloading?1:0,b.loops||1,b.usePolicyFile):h._load(a.sID,b.url,!!b.stream,!!b.autoPlay,b.loops||
 32+1,!!b.autoLoad,b.usePolicyFile)}catch(d){F({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:!0})}return a};this.unload=function(){0!==a.readyState&&(a.isHTML5?(g(),a._a&&(a._a.pause(),ta(a._a))):8===i?h._unload(a.sID,"about:blank"):h._unload(a.sID),e());return a};this.destruct=function(b){if(a.isHTML5){if(g(),a._a)a._a.pause(),ta(a._a),B||d(),a._a._t=null,a._a=null}else a._iO.onfailure=null,h._destroySound(a.sID);b||c.destroySound(a.sID,!0)};this.start=this.play=function(b,c){var d,c=void 0===c?!0:c;b||(b=
 33+{});a._iO=q(b,a._iO);a._iO=q(a._iO,a.options);a._iO.url=ba(a._iO.url);a.instanceOptions=a._iO;if(a._iO.serverURL&&!a.connected)return a.getAutoPlay()||a.setAutoPlay(!0),a;ca(a._iO)&&(a._setup_html5(a._iO),z());if(1===a.playState&&!a.paused&&(d=a._iO.multiShot,!d))return a;if(!a.loaded)if(0===a.readyState){if(!a.isHTML5)a._iO.autoPlay=!0;a.load(a._iO)}else if(2===a.readyState)return a;if(!a.isHTML5&&9===i&&0<a.position&&a.position===a.duration)b.position=0;if(a.paused&&a.position&&0<a.position)a.resume();
 34+else{a._iO=q(b,a._iO);if(null!==a._iO.from&&null!==a._iO.to&&0===a.instanceCount&&0===a.playState&&!a._iO.serverURL){d=function(){a._iO=q(b,a._iO);a.play(a._iO)};if(a.isHTML5&&!a._html5_canplay)return a.load({_oncanplay:d}),!1;if(!a.isHTML5&&!a.loaded&&(!a.readyState||2!==a.readyState))return a.load({onload:d}),!1;a._iO=p()}(!a.instanceCount||a._iO.multiShotEvents||!a.isHTML5&&8<i&&!a.getAutoPlay())&&a.instanceCount++;0===a.playState&&a._iO.onposition&&j(a);a.playState=1;a.paused=!1;a.position="undefined"!==
 35+typeof a._iO.position&&!isNaN(a._iO.position)?a._iO.position:0;if(!a.isHTML5)a._iO=Z(Y(a._iO));a._iO.onplay&&c&&(a._iO.onplay.apply(a),k=!0);a.setVolume(a._iO.volume,!0);a.setPan(a._iO.pan,!0);a.isHTML5?(z(),d=a._setup_html5(),a.setPosition(a._iO.position),d.play()):h._start(a.sID,a._iO.loops||1,9===i?a._iO.position:a._iO.position/1E3)}return a};this.stop=function(b){var c=a._iO;if(1===a.playState){a._onbufferchange(0);a._resetOnPosition(0);a.paused=!1;if(!a.isHTML5)a.playState=0;n();c.to&&a.clearOnPosition(c.to);
 36+if(a.isHTML5){if(a._a)b=a.position,a.setPosition(0),a.position=b,a._a.pause(),a.playState=0,a._onTimer(),g()}else h._stop(a.sID,b),c.serverURL&&a.unload();a.instanceCount=0;a._iO={};c.onstop&&c.onstop.apply(a)}return a};this.setAutoPlay=function(b){a._iO.autoPlay=b;a.isHTML5||(h._setAutoPlay(a.sID,b),b&&!a.instanceCount&&1===a.readyState&&a.instanceCount++)};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPosition=function(b){void 0===b&&(b=0);var c=a.isHTML5?Math.max(b,0):Math.min(a.duration||
 37+a._iO.duration,Math.max(b,0));a.position=c;b=a.position/1E3;a._resetOnPosition(a.position);a._iO.position=c;if(a.isHTML5){if(a._a&&a._html5_canplay&&a._a.currentTime!==b)try{a._a.currentTime=b,(0===a.playState||a.paused)&&a._a.pause()}catch(d){}}else b=9===i?a.position:b,a.readyState&&2!==a.readyState&&h._setPosition(a.sID,b,a.paused||!a.playState);a.isHTML5&&a.paused&&a._onTimer(!0);return a};this.pause=function(b){if(a.paused||0===a.playState&&1!==a.readyState)return a;a.paused=!0;a.isHTML5?(a._setup_html5().pause(),
 38+g()):(b||void 0===b)&&h._pause(a.sID);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){var b=a._iO;if(!a.paused)return a;a.paused=!1;a.playState=1;a.isHTML5?(a._setup_html5().play(),z()):(b.isMovieStar&&!b.serverURL&&a.setPosition(a.position),h._pause(a.sID));k&&b.onplay?(b.onplay.apply(a),k=!0):b.onresume&&b.onresume.apply(a);return a};this.togglePause=function(){if(0===a.playState)return a.play({position:9===i&&!a.isHTML5?a.position:a.position/1E3}),a;a.paused?a.resume():a.pause();
 39+return a};this.setPan=function(b,c){"undefined"===typeof b&&(b=0);"undefined"===typeof c&&(c=!1);a.isHTML5||h._setPan(a.sID,b);a._iO.pan=b;if(!c)a.pan=b,a.options.pan=b;return a};this.setVolume=function(b,d){"undefined"===typeof b&&(b=100);"undefined"===typeof d&&(d=!1);if(a.isHTML5){if(a._a)a._a.volume=Math.max(0,Math.min(1,b/100))}else h._setVolume(a.sID,c.muted&&!a.muted||a.muted?0:b);a._iO.volume=b;if(!d)a.volume=b,a.options.volume=b;return a};this.mute=function(){a.muted=!0;if(a.isHTML5){if(a._a)a._a.muted=
 40+!0}else h._setVolume(a.sID,0);return a};this.unmute=function(){a.muted=!1;var b="undefined"!==typeof a._iO.volume;if(a.isHTML5){if(a._a)a._a.muted=!1}else h._setVolume(a.sID,b?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=this.onPosition=function(b,c,d){t.push({position:b,method:c,scope:"undefined"!==typeof d?d:a,fired:!1});return a};this.clearOnPosition=function(a,b){var c,a=parseInt(a,10);if(isNaN(a))return!1;for(c=0;c<t.length;c++)if(a===
 41+t[c].position&&(!b||b===t[c].method))t[c].fired&&l--,t.splice(c,1)};this._processOnPosition=function(){var b,c;b=t.length;if(!b||!a.playState||l>=b)return!1;for(;b--;)if(c=t[b],!c.fired&&a.position>=c.position)c.fired=!0,l++,c.method.apply(c.scope,[c.position]);return!0};this._resetOnPosition=function(a){var b,c;b=t.length;if(!b)return!1;for(;b--;)if(c=t[b],c.fired&&a<=c.position)c.fired=!1,l--;return!0};p=function(){var b=a._iO,c=b.from,d=b.to,e,f;f=function(){a.clearOnPosition(d,f);a.stop()};e=
 42+function(){if(null!==d&&!isNaN(d))a.onPosition(d,f)};if(null!==c&&!isNaN(c))b.position=c,b.multiShot=!1,e();return b};j=function(){var b=a._iO.onposition;if(b)for(var c in b)if(b.hasOwnProperty(c))a.onPosition(parseInt(c,10),b[c])};n=function(){var b=a._iO.onposition;if(b)for(var c in b)b.hasOwnProperty(c)&&a.clearOnPosition(parseInt(c,10))};z=function(){a.isHTML5&&Fa(a)};g=function(){a.isHTML5&&Ga(a)};e=function(){t=[];l=0;k=!1;a._hasTimer=null;a._a=null;a._html5_canplay=!1;a.bytesLoaded=null;a.bytesTotal=
 43+null;a.duration=a._iO&&a._iO.duration?a._iO.duration:null;a.durationEstimate=null;a.eqData=[];a.eqData.left=[];a.eqData.right=[];a.failures=0;a.isBuffering=!1;a.instanceOptions={};a.instanceCount=0;a.loaded=!1;a.metadata={};a.readyState=0;a.muted=!1;a.paused=!1;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.playState=0;a.position=null};e();this._onTimer=function(b){var c,d=!1,e={};if(a._hasTimer||b){if(a._a&&(b||(0<a.playState||1===a.readyState)&&!a.paused)){c=a._get_html5_duration();
 44+if(c!==r)r=c,a.duration=c,d=!0;a.durationEstimate=a.duration;c=1E3*a._a.currentTime||0;c!==s&&(s=c,d=!0);(d||b)&&a._whileplaying(c,e,e,e,e);return d}return!1}};this._get_html5_duration=function(){var b=a._iO,c=a._a?1E3*a._a.duration:b?b.duration:void 0;return c&&!isNaN(c)&&Infinity!==c?c:b?b.duration:null};this._setup_html5=function(b){var b=q(a._iO,b),d=decodeURI,g=B?c._global_a:a._a,h=d(b.url),z=g&&g._t?g._t.instanceOptions:null;if(g){if(g._t&&(!B&&h===d(m)||B&&z.url===b.url&&(!m||m===z.url)))return g;
 45+B&&g._t&&g._t.playState&&b.url!==z.url&&g._t.stop();e();g.src=b.url;m=a.url=b.url;g._called_load=!1}else{g=new Audio(b.url);g._called_load=!1;if(Ta)g._called_load=!0;if(B)c._global_a=g}a.isHTML5=!0;a._a=g;g._t=a;f();g.loop=1<b.loops?"loop":"";b.autoLoad||b.autoPlay?a.load():(g.autobuffer=!1,g.preload="none");g.loop=1<b.loops?"loop":"";return g};f=function(){if(a._a._added_events)return!1;var b;a._a._added_events=!0;for(b in u)u.hasOwnProperty(b)&&a._a&&a._a.addEventListener(b,u[b],!1);return!0};d=
 46+function(){var b;a._a._added_events=!1;for(b in u)u.hasOwnProperty(b)&&a._a&&a._a.removeEventListener(b,u[b],!1)};this._onload=function(b){b=!!b;a.loaded=b;a.readyState=b?3:2;a._onbufferchange(0);a._iO.onload&&a._iO.onload.apply(a,[b]);return!0};this._onbufferchange=function(b){if(0===a.playState||b&&a.isBuffering||!b&&!a.isBuffering)return!1;a.isBuffering=1===b;a._iO.onbufferchange&&a._iO.onbufferchange.apply(a);return!0};this._onsuspend=function(){a._iO.onsuspend&&a._iO.onsuspend.apply(a);return!0};
 47+this._onfailure=function(b,c,d){a.failures++;if(a._iO.onfailure&&1===a.failures)a._iO.onfailure(a,b,c,d)};this._onfinish=function(){var b=a._iO.onfinish;a._onbufferchange(0);a._resetOnPosition(0);if(a.instanceCount){a.instanceCount--;if(!a.instanceCount)n(),a.playState=0,a.paused=!1,a.instanceCount=0,a.instanceOptions={},a._iO={},g();(!a.instanceCount||a._iO.multiShotEvents)&&b&&b.apply(a)}};this._whileloading=function(b,c,d,e){var f=a._iO;a.bytesLoaded=b;a.bytesTotal=c;a.duration=Math.floor(d);a.bufferLength=
 48+e;if(f.isMovieStar)a.durationEstimate=a.duration;else if(a.durationEstimate=f.duration?a.duration>f.duration?a.duration:f.duration:parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10),void 0===a.durationEstimate)a.durationEstimate=a.duration;3!==a.readyState&&f.whileloading&&f.whileloading.apply(a)};this._whileplaying=function(b,c,d,e,f){var g=a._iO;if(isNaN(b)||null===b)return!1;a.position=b;a._processOnPosition();if(!a.isHTML5&&8<i){if(g.usePeakData&&"undefined"!==typeof c&&c)a.peakData={left:c.leftPeak,
 49+right:c.rightPeak};if(g.useWaveformData&&"undefined"!==typeof d&&d)a.waveformData={left:d.split(","),right:e.split(",")};if(g.useEQData&&"undefined"!==typeof f&&f&&f.leftEQ&&(b=f.leftEQ.split(","),a.eqData=b,a.eqData.left=b,"undefined"!==typeof f.rightEQ&&f.rightEQ))a.eqData.right=f.rightEQ.split(",")}1===a.playState&&(!a.isHTML5&&8===i&&!a.position&&a.isBuffering&&a._onbufferchange(0),g.whileplaying&&g.whileplaying.apply(a));return!0};this._onmetadata=function(b,c){var d={},e,f;for(e=0,f=b.length;e<
 50+f;e++)d[b[e]]=c[e];a.metadata=d;a._iO.onmetadata&&a._iO.onmetadata.apply(a)};this._onid3=function(b,c){var d=[],e,f;for(e=0,f=b.length;e<f;e++)d[b[e]]=c[e];a.id3=q(a.id3,d);a._iO.onid3&&a._iO.onid3.apply(a)};this._onconnect=function(b){b=1===b;if(a.connected=b)a.failures=0,o(a.sID)&&(a.getAutoPlay()?a.play(void 0,a.getAutoPlay()):a._iO.autoLoad&&a.load()),a._iO.onconnect&&a._iO.onconnect.apply(a,[b])};this._ondataerror=function(){0<a.playState&&a._iO.ondataerror&&a._iO.ondataerror.apply(a)}};na=function(){return k.body||
 51+k._docElement||k.getElementsByTagName("div")[0]};S=function(b){return k.getElementById(b)};q=function(b,a){var e={},f,d;for(f in b)b.hasOwnProperty(f)&&(e[f]=b[f]);f="undefined"===typeof a?c.defaultOptions:a;for(d in f)f.hasOwnProperty(d)&&"undefined"===typeof e[d]&&(e[d]=f[d]);return e};n=function(){function b(a){var a=Ra.call(a),b=a.length;c?(a[1]="on"+a[1],3<b&&a.pop()):3===b&&a.push(!1);return a}function a(a,b){var h=a.shift(),k=[f[b]];if(c)h[k](a[0],a[1]);else h[k].apply(h,a)}var c=j.attachEvent,
 52+f={add:c?"attachEvent":"addEventListener",remove:c?"detachEvent":"removeEventListener"};return{add:function(){a(b(arguments),"add")},remove:function(){a(b(arguments),"remove")}}}();u={abort:l(function(){}),canplay:l(function(){var b=this._t;if(b._html5_canplay)return!0;b._html5_canplay=!0;b._onbufferchange(0);var a=!isNaN(b.position)?b.position/1E3:null;if(b.position&&this.currentTime!==a)try{this.currentTime=a}catch(c){}b._iO._oncanplay&&b._iO._oncanplay()}),load:l(function(){var b=this._t;b.loaded||
 53+(b._onbufferchange(0),b._whileloading(b.bytesTotal,b.bytesTotal,b._get_html5_duration()),b._onload(!0))}),emptied:l(function(){}),ended:l(function(){this._t._onfinish()}),error:l(function(){this._t._onload(!1)}),loadeddata:l(function(){var b=this._t,a=b.bytesTotal||1;if(!b._loaded&&!Q)b.duration=b._get_html5_duration(),b._whileloading(a,a,b._get_html5_duration()),b._onload(!0)}),loadedmetadata:l(function(){}),loadstart:l(function(){this._t._onbufferchange(1)}),play:l(function(){this._t._onbufferchange(0)}),
 54+playing:l(function(){this._t._onbufferchange(0)}),progress:l(function(b){var a=this._t;if(a.loaded)return!1;var c,f=0,d=b.target.buffered;c=b.loaded||0;var g=b.total||1;if(d&&d.length){for(c=d.length;c--;)f=d.end(c)-d.start(c);c=f/b.target.duration}isNaN(c)||(a._onbufferchange(0),a._whileloading(c,g,a._get_html5_duration()),c&&g&&c===g&&u.load.call(this,b))}),ratechange:l(function(){}),suspend:l(function(b){var a=this._t;u.progress.call(this,b);a._onsuspend()}),stalled:l(function(){}),timeupdate:l(function(){this._t._onTimer()}),
 55+waiting:l(function(){this._t._onbufferchange(1)})};ca=function(b){return!b.serverURL&&(b.type?P({type:b.type}):P({url:b.url})||c.html5Only)};ta=function(b){if(b)b.src=Sa?"":"about:blank"};P=function(b){function a(a){return c.preferFlash&&r&&!c.ignoreFlash&&"undefined"!==typeof c.flash[a]&&c.flash[a]}if(!c.useHTML5Audio||!c.hasHTML5)return!1;var e=b.url||null,b=b.type||null,f=c.audioFormats,d;if(b&&"undefined"!==c.html5[b])return c.html5[b]&&!a(b);if(!x){x=[];for(d in f)f.hasOwnProperty(d)&&(x.push(d),
 56+f[d].related&&(x=x.concat(f[d].related)));x=RegExp("\\.("+x.join("|")+")(\\?.*)?$","i")}d=e?e.toLowerCase().match(x):null;if(!d||!d.length)if(b)e=b.indexOf(";"),d=(-1!==e?b.substr(0,e):b).substr(6);else return!1;else d=d[1];if(d&&"undefined"!==typeof c.html5[d])return c.html5[d]&&!a(d);b="audio/"+d;e=c.html5.canPlayType({type:b});return(c.html5[d]=e)&&c.html5[b]&&!a(b)};Ja=function(){function b(b){var d,e,f=!1;if(!a||"function"!==typeof a.canPlayType)return!1;if(b instanceof Array){for(d=0,e=b.length;d<
 57+e&&!f;d++)if(c.html5[b[d]]||a.canPlayType(b[d]).match(c.html5Test))f=!0,c.html5[b[d]]=!0,c.flash[b[d]]=!(!c.preferFlash||!r||!b[d].match(Na));return f}b=a&&"function"===typeof a.canPlayType?a.canPlayType(b):!1;return!(!b||!b.match(c.html5Test))}if(!c.useHTML5Audio||"undefined"===typeof Audio)return!1;var a="undefined"!==typeof Audio?Va?new Audio(null):new Audio:null,e,f={},d,g;d=c.audioFormats;for(e in d)if(d.hasOwnProperty(e)&&(f[e]=b(d[e].type),f["audio/"+e]=f[e],c.flash[e]=c.preferFlash&&!c.ignoreFlash&&
 58+e.match(Na)?!0:!1,d[e]&&d[e].related))for(g=d[e].related.length;g--;)f["audio/"+d[e].related[g]]=f[e],c.html5[d[e].related[g]]=f[e],c.flash[d[e].related[g]]=f[e];f.canPlayType=a?b:null;c.html5=q(c.html5,f);return!0};G=function(){};Y=function(b){if(8===i&&1<b.loops&&b.stream)b.stream=!1;return b};Z=function(b){if(b&&!b.usePolicyFile&&(b.onid3||b.usePeakData||b.useWaveformData||b.useEQData))b.usePolicyFile=!0;return b};ra=function(){};ha=function(){return!1};Da=function(b){for(var a in b)b.hasOwnProperty(a)&&
 59+"function"===typeof b[a]&&(b[a]=ha)};X=function(b){"undefined"===typeof b&&(b=!1);(w||b)&&c.disable(b)};Ea=function(b){var a=null;if(b)if(b.match(/\.swf(\?.*)?$/i)){if(a=b.substr(b.toLowerCase().lastIndexOf(".swf?")+4))return b}else b.lastIndexOf("/")!==b.length-1&&(b+="/");b=(b&&-1!==b.lastIndexOf("/")?b.substr(0,b.lastIndexOf("/")+1):"./")+c.movieURL;c.noSWFCache&&(b+="?ts="+(new Date).getTime());return b};ka=function(){i=parseInt(c.flashVersion,10);if(8!==i&&9!==i)c.flashVersion=i=8;var b=c.debugMode||
 60+c.debugFlash?"_debug.swf":".swf";if(c.useHTML5Audio&&!c.html5Only&&c.audioFormats.mp4.required&&9>i)c.flashVersion=i=9;c.version=c.versionNumber+(c.html5Only?" (HTML5-only mode)":9===i?" (AS3/Flash 9)":" (AS2/Flash 8)");8<i?(c.defaultOptions=q(c.defaultOptions,c.flash9Options),c.features.buffering=!0,c.defaultOptions=q(c.defaultOptions,c.movieStarOptions),c.filePatterns.flash9=RegExp("\\.(mp3|"+Qa.join("|")+")(\\?.*)?$","i"),c.features.movieStar=!0):c.features.movieStar=!1;c.filePattern=c.filePatterns[8!==
 61+i?"flash9":"flash8"];c.movieURL=(8===i?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",b);c.features.peakData=c.features.waveformData=c.features.eqData=8<i};Ca=function(b,a){if(!h)return!1;h._setPolling(b,a)};oa=function(){if(c.debugURLParam.test(ga))c.debugMode=!0};o=this.getSoundById;H=function(){var b=[];c.debugMode&&b.push("sm2_debug");c.debugFlash&&b.push("flash_debug");c.useHighPerformance&&b.push("high_performance");return b.join(" ")};qa=function(){G("fbHandler");var b=c.getMoviePercent(),
 62+a={type:"FLASHBLOCK"};if(c.html5Only)return!1;if(c.ok()){if(c.oMC)c.oMC.className=[H(),"movieContainer","swf_loaded"+(c.didFlashBlock?" swf_unblocked":"")].join(" ")}else{if(s)c.oMC.className=H()+" movieContainer "+(null===b?"swf_timedout":"swf_error");c.didFlashBlock=!0;C({type:"ontimeout",ignoreInit:!0,error:a});F(a)}};ja=function(b,a,c){"undefined"===typeof v[b]&&(v[b]=[]);v[b].push({method:a,scope:c||null,fired:!1})};C=function(b){b||(b={type:"onready"});if(!m&&b&&!b.ignoreInit||"ontimeout"===
 63+b.type&&c.ok())return!1;var a={success:b&&b.ignoreInit?c.ok():!w},e=b&&b.type?v[b.type]||[]:[],f=[],d,a=[a],g=s&&c.useFlashBlock&&!c.ok();if(b.error)a[0].error=b.error;for(b=0,d=e.length;b<d;b++)!0!==e[b].fired&&f.push(e[b]);if(f.length)for(b=0,d=f.length;b<d;b++)if(f[b].scope?f[b].method.apply(f[b].scope,a):f[b].method.apply(this,a),!g)f[b].fired=!0;return!0};D=function(){j.setTimeout(function(){c.useFlashBlock&&qa();C();c.onload instanceof Function&&c.onload.apply(j);c.waitForWindowLoad&&n.add(j,
 64+"load",D)},1)};da=function(){if(void 0!==r)return r;var b=!1,a=navigator,c=a.plugins,f,d=j.ActiveXObject;if(c&&c.length)(a=a.mimeTypes)&&a["application/x-shockwave-flash"]&&a["application/x-shockwave-flash"].enabledPlugin&&a["application/x-shockwave-flash"].enabledPlugin.description&&(b=!0);else if("undefined"!==typeof d){try{f=new d("ShockwaveFlash.ShockwaveFlash")}catch(g){}b=!!f}return r=b};Ia=function(){var b,a;if(va&&p.match(/os (1|2|3_0|3_1)/i)){c.hasHTML5=!1;c.html5Only=!0;if(c.oMC)c.oMC.style.display=
 65+"none";return!1}if(c.useHTML5Audio){if(!c.html5||!c.html5.canPlayType)return c.hasHTML5=!1,!0;c.hasHTML5=!0;if(xa&&da())return!0}else return!0;for(a in c.audioFormats)if(c.audioFormats.hasOwnProperty(a)&&(c.audioFormats[a].required&&!c.html5.canPlayType(c.audioFormats[a].type)||c.flash[a]||c.flash[c.audioFormats[a].type]))b=!0;c.ignoreFlash&&(b=!1);c.html5Only=c.hasHTML5&&c.useHTML5Audio&&!b;return!c.html5Only};ba=function(b){var a,e,f=0;if(b instanceof Array){for(a=0,e=b.length;a<e;a++)if(b[a]instanceof
 66+Object){if(c.canPlayMIME(b[a].type)){f=a;break}}else if(c.canPlayURL(b[a])){f=a;break}if(b[f].url)b[f]=b[f].url;return b[f]}return b};Fa=function(b){if(!b._hasTimer)b._hasTimer=!0,!wa&&c.html5PollingInterval&&(null===O&&0===aa&&(O=J.setInterval(Ha,c.html5PollingInterval)),aa++)};Ga=function(b){if(b._hasTimer)b._hasTimer=!1,!wa&&c.html5PollingInterval&&aa--};Ha=function(){var b;if(null!==O&&!aa)return J.clearInterval(O),O=null,!1;for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].isHTML5&&c.sounds[c.soundIDs[b]]._hasTimer&&
 67+c.sounds[c.soundIDs[b]]._onTimer()};F=function(b){b="undefined"!==typeof b?b:{};c.onerror instanceof Function&&c.onerror.apply(j,[{type:"undefined"!==typeof b.type?b.type:null}]);"undefined"!==typeof b.fatal&&b.fatal&&c.disable()};Ka=function(){if(!xa||!da())return!1;var b=c.audioFormats,a,e;for(e in b)if(b.hasOwnProperty(e)&&("mp3"===e||"mp4"===e))if(c.html5[e]=!1,b[e]&&b[e].related)for(a=b[e].related.length;a--;)c.html5[b[e].related[a]]=!1};this._setSandboxType=function(){};this._externalInterfaceOK=
 68+function(){if(c.swfLoaded)return!1;(new Date).getTime();c.swfLoaded=!0;I=!1;xa&&Ka();y?setTimeout(T,100):T()};W=function(b,a){function e(a,b){return'<param name="'+a+'" value="'+b+'" />'}if(K&&L)return!1;if(c.html5Only)return ka(),c.oMC=S(c.movieID),T(),L=K=!0,!1;var f=a||c.url,d=c.altURL||f,g;g=na();var h,j,i=H(),l,m=null,m=(m=k.getElementsByTagName("html")[0])&&m.dir&&m.dir.match(/rtl/i),b="undefined"===typeof b?c.id:b;ka();c.url=Ea(za?f:d);a=c.url;c.wmode=!c.wmode&&c.useHighPerformance?"transparent":
 69+c.wmode;if(null!==c.wmode&&(p.match(/msie 8/i)||!y&&!c.useHighPerformance)&&navigator.platform.match(/win32|win64/i))c.wmode=null;g={name:b,id:b,src:a,width:"auto",height:"auto",quality:"high",allowScriptAccess:c.allowScriptAccess,bgcolor:c.bgColor,pluginspage:Oa+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:c.wmode,hasPriority:"true"};if(c.debugFlash)g.FlashVars="debug=1";c.wmode||delete g.wmode;if(y)f=k.createElement("div"),
 70+j=['<object id="'+b+'" data="'+a+'" type="'+g.type+'" title="'+g.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+Oa+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="'+g.width+'" height="'+g.height+'">',e("movie",a),e("AllowScriptAccess",c.allowScriptAccess),e("quality",g.quality),c.wmode?e("wmode",c.wmode):"",e("bgcolor",c.bgColor),e("hasPriority","true"),c.debugFlash?e("FlashVars",g.FlashVars):"","</object>"].join("");else for(h in f=
 71+k.createElement("embed"),g)g.hasOwnProperty(h)&&f.setAttribute(h,g[h]);oa();i=H();if(g=na())if(c.oMC=S(c.movieID)||k.createElement("div"),c.oMC.id){l=c.oMC.className;c.oMC.className=(l?l+" ":"movieContainer")+(i?" "+i:"");c.oMC.appendChild(f);if(y)h=c.oMC.appendChild(k.createElement("div")),h.className="sm2-object-box",h.innerHTML=j;L=!0}else{c.oMC.id=c.movieID;c.oMC.className="movieContainer "+i;h=i=null;if(!c.useFlashBlock)if(c.useHighPerformance)i={position:"fixed",width:"8px",height:"8px",bottom:"0px",
 72+left:"0px",overflow:"hidden"};else if(i={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},m)i.left=Math.abs(parseInt(i.left,10))+"px";if(Ua)c.oMC.style.zIndex=1E4;if(!c.debugFlash)for(l in i)i.hasOwnProperty(l)&&(c.oMC.style[l]=i[l]);try{y||c.oMC.appendChild(f);g.appendChild(c.oMC);if(y)h=c.oMC.appendChild(k.createElement("div")),h.className="sm2-object-box",h.innerHTML=j;L=!0}catch(n){throw Error(G("domError")+" \n"+n.toString());}}return K=!0};V=function(){if(c.html5Only)return W(),
 73+!1;if(h)return!1;h=c.getMovie(c.id);if(!h)N?(y?c.oMC.innerHTML=pa:c.oMC.appendChild(N),N=null,K=!0):W(c.id,c.url),h=c.getMovie(c.id);c.oninitmovie instanceof Function&&setTimeout(c.oninitmovie,1);return!0};U=function(){setTimeout(Ba,1E3)};Ba=function(){if($)return!1;$=!0;n.remove(j,"load",U);if(I&&!ya)return!1;var b;m||(b=c.getMoviePercent());setTimeout(function(){b=c.getMoviePercent();!m&&Ma&&(null===b?c.useFlashBlock||0===c.flashLoadTimeout?c.useFlashBlock&&qa():X(!0):0!==c.flashLoadTimeout&&X(!0))},
 74+c.flashLoadTimeout)};A=function(){function b(){n.remove(j,"focus",A);n.remove(j,"load",A)}if(ya||!I)return b(),!0;ya=Ma=!0;Q&&I&&n.remove(j,"mousemove",A);$=!1;b();return!0};La=function(){var b,a=[];if(c.useHTML5Audio&&c.hasHTML5)for(b in c.audioFormats)c.audioFormats.hasOwnProperty(b)&&a.push(b+": "+c.html5[b]+(!c.html5[b]&&r&&c.flash[b]?" (using flash)":c.preferFlash&&c.flash[b]&&r?" (preferring flash)":!c.html5[b]?" ("+(c.audioFormats[b].required?"required, ":"")+"and no flash support)":""))};
 75+M=function(b){if(m)return!1;if(c.html5Only)return m=!0,D(),!0;var a;if(!c.useFlashBlock||!c.flashLoadTimeout||c.getMoviePercent())m=!0,w&&(a={type:!r&&s?"NO_FLASH":"INIT_TIMEOUT"});if(w||b){if(c.useFlashBlock&&c.oMC)c.oMC.className=H()+" "+(null===c.getMoviePercent()?"swf_timedout":"swf_error");C({type:"ontimeout",error:a});F(a);return!1}if(c.waitForWindowLoad&&!ia)return n.add(j,"load",D),!1;D();return!0};T=function(){if(m)return!1;if(c.html5Only){if(!m)n.remove(j,"load",c.beginDelayedInit),c.enabled=
 76+!0,M();return!0}V();try{h._externalInterfaceTest(!1),Ca(!0,c.flashPollingInterval||(c.useHighPerformance?10:50)),c.debugMode||h._disableDebug(),c.enabled=!0,c.html5Only||n.add(j,"unload",ha)}catch(b){return F({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),X(!0),M(),!1}M();n.remove(j,"load",c.beginDelayedInit);return!0};E=function(){if(ma)return!1;ma=!0;oa();if(!r&&c.hasHTML5)c.useHTML5Audio=!0,c.preferFlash=!1;Ja();c.html5.usingFlash=Ia();s=c.html5.usingFlash;La();if(!r&&s)c.flashLoadTimeout=1;k.removeEventListener&&
 77+k.removeEventListener("DOMContentLoaded",E,!1);V();return!0};ua=function(){"complete"===k.readyState&&(E(),k.detachEvent("onreadystatechange",ua));return!0};la=function(){ia=!0;n.remove(j,"load",la)};da();n.add(j,"focus",A);n.add(j,"load",A);n.add(j,"load",U);n.add(j,"load",la);Q&&I&&n.add(j,"mousemove",A);k.addEventListener?k.addEventListener("DOMContentLoaded",E,!1):k.attachEvent?k.attachEvent("onreadystatechange",ua):F({type:"NO_DOM2_EVENTS",fatal:!0});"complete"===k.readyState&&setTimeout(E,100)}
 78+var ea=null;if("undefined"===typeof SM2_DEFER||!SM2_DEFER)ea=new R;J.SoundManager=R;J.soundManager=ea})(window);
\ No newline at end of file
Index: trunk/extensions/SoundManager2Button/script/soundmanager2.js
@@ -8,7 +8,7 @@
99 * Code provided under the BSD License:
1010 * http://schillmania.com/projects/soundmanager2/license.txt
1111 *
12 - * V2.97a.20111030
 12+ * V2.97a.20111220
1313 */
1414
1515 /*global window, SM2_DEFER, sm2Debugger, console, document, navigator, setTimeout, setInterval, clearInterval, Audio */
@@ -26,6 +26,8 @@
2727 *
2828 * You may notice <d> and </d> comments in this source; these are delimiters for
2929 * debug blocks which are removed in the -nodebug builds, further optimizing code size.
 30+ *
 31+ * Also, as you may note: Whoa, reliable cross-platform/device audio support is hard! ;)
3032 */
3133
3234 (function(window) {
@@ -46,18 +48,19 @@
4749
4850 // Top-level configuration options
4951
50 - this.flashVersion = 8; // version of flash to require, either 8 or 9. Some API features require Flash 9.
51 - this.debugMode = true; // enable debugging output (div#soundmanager-debug, OR console if available+configured)
 52+ this.flashVersion = 8; // flash build to use (8 or 9.) Some API features require 9.
 53+ this.debugMode = true; // enable debugging output (console.log() with HTML fallback)
5254 this.debugFlash = false; // enable debugging output inside SWF, troubleshoot Flash/browser issues
53 - this.useConsole = true; // use firebug/safari console.log()-type debug console if available
54 - this.consoleOnly = false; // if console is being used, do not create/write to #soundmanager-debug
 55+ this.useConsole = true; // use console.log() if available (otherwise, writes to #soundmanager-debug element)
 56+ this.consoleOnly = true; // if console is being used, do not create/write to #soundmanager-debug
5557 this.waitForWindowLoad = false; // force SM2 to wait for window.onload() before trying to call soundManager.onload()
56 - this.bgColor = '#ffffff'; // movie (.swf) background color, eg. '#000000'
 58+ this.bgColor = '#ffffff'; // SWF background color. N/A when wmode = 'transparent'
5759 this.useHighPerformance = false; // position:fixed flash movie can help increase js/flash speed, minimize lag
5860 this.flashPollingInterval = null; // msec affecting whileplaying/loading callback frequency. If null, default of 50 msec is used.
 61+ this.html5PollingInterval = null; // msec affecting whileplaying() for HTML5 audio, excluding mobile devices. If null, native HTML5 update events are used.
5962 this.flashLoadTimeout = 1000; // msec to wait for flash movie to load before failing (0 = infinity)
60 - this.wmode = null; // string: flash rendering mode - null, transparent, opaque (last two allow layering of HTML on top)
61 - this.allowScriptAccess = 'always'; // for scripting the SWF (object/embed property), either 'always' or 'sameDomain'
 63+ this.wmode = null; // flash rendering mode - null, 'transparent', or 'opaque' (last two allow z-index to work)
 64+ this.allowScriptAccess = 'always'; // for scripting the SWF (object/embed property), 'always' or 'sameDomain'
6265 this.useFlashBlock = false; // *requires flashblock.css, see demos* - allow recovery from flash blockers. Wait indefinitely and apply timeout CSS to SWF, if applicable.
6366 this.useHTML5Audio = true; // use HTML5 Audio() where API is supported (most Safari, Chrome versions), Firefox (no MP3/MP4.) Ideally, transparent vs. Flash API where possible.
6467 this.html5Test = /^(probably|maybe)$/i; // HTML5 Audio() format support test. Use /^probably$/i; if you want to be more conservative.
@@ -82,7 +85,6 @@
8386 'related': ['aac','m4a'], // additional formats under the MP4 container
8487 'type': ['audio/mp4; codecs="mp4a.40.2"', 'audio/aac', 'audio/x-m4a', 'audio/MP4A-LATM', 'audio/mpeg4-generic'],
8588 'required': false
86 -
8789 },
8890
8991 'ogg': {
@@ -105,8 +107,8 @@
106108 */
107109
108110 '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)
109 - 'stream': true, // allows playing before entire file has loaded (recommended)
110111 'autoPlay': false, // enable playing of file as soon as possible (much faster if "stream" is true)
 112+ 'from': null, // position to start playback within a sound (msec), default = beginning
111113 'loops': 1, // how many times to repeat the sound (position will wrap around to 0, setPosition() will break out of loop when >0)
112114 'onid3': null, // callback function for "ID3 data is added/available"
113115 'onload': null, // callback function for "load finished"
@@ -115,6 +117,7 @@
116118 'onpause': null, // callback for "pause"
117119 'onresume': null, // callback for "resume" (pause toggle)
118120 'whileplaying': null, // callback during play (position update)
 121+ 'onposition': null, // object containing times and function callbacks for positions of interest
119122 'onstop': null, // callback for "user stop"
120123 'onfailure': null, // callback function for when playing fails
121124 'onfinish': null, // callback function for "sound finished playing"
@@ -122,6 +125,8 @@
123126 'multiShotEvents': false, // fire multiple sound events (currently onfinish() only) when multiShot is enabled
124127 'position': null, // offset (milliseconds) to seek to within loaded sound data.
125128 'pan': 0, // "pan" settings, left-to-right, -100 to 100
 129+ 'stream': true, // allows playing before entire file has loaded (recommended)
 130+ 'to': null, // position to end playback within a sound (msec), default = end
126131 'type': null, // MIME-like hint for file pattern / canPlay() tests, eg. audio/mp3
127132 'usePolicyFile': false, // enable crossdomain.xml request for audio on remote domains (for ID3/waveform access)
128133 'volume': 100 // self-explanatory. 0-100, the latter being the max.
@@ -163,38 +168,22 @@
164169 this.movieID = 'sm2-container';
165170 this.id = (smID || 'sm2movie');
166171
167 - this.swfCSS = {
168 -
169 - 'swfBox': 'sm2-object-box',
170 - 'swfDefault': 'movieContainer',
171 - 'swfError': 'swf_error', // SWF loaded, but SM2 couldn't start (other error)
172 - 'swfTimedout': 'swf_timedout',
173 - 'swfLoaded': 'swf_loaded',
174 - 'swfUnblocked': 'swf_unblocked', // or loaded OK
175 - 'sm2Debug': 'sm2_debug',
176 - 'highPerf': 'high_performance',
177 - 'flashDebug': 'flash_debug'
178 -
179 - };
180 -
181172 this.debugID = 'soundmanager-debug';
182173 this.debugURLParam = /([#?&])debug=1/i;
183174
184175 // dynamic attributes
185176
186 - this.versionNumber = 'V2.97a.20111030';
 177+ this.versionNumber = 'V2.97a.20111220';
187178 this.version = null;
188179 this.movieURL = null;
189180 this.url = (smURL || null);
190181 this.altURL = null;
191182 this.swfLoaded = false;
192183 this.enabled = false;
193 - this.o = null;
194184 this.oMC = null;
195185 this.sounds = {};
196186 this.soundIDs = [];
197187 this.muted = false;
198 - this.specialWmodeCase = false;
199188 this.didFlashBlock = false;
200189 this.filePattern = null;
201190
@@ -261,7 +250,7 @@
262251 'usingFlash': null // set if/when flash fallback is needed
263252 };
264253
265 - this.flash = {};
 254+ this.flash = {}; // file type support hash
266255
267256 this.html5Only = false; // determined at init time
268257 this.ignoreFlash = false; // used for special cases (eg. iPad/iPhone/palm OS?)
@@ -271,10 +260,11 @@
272261 */
273262
274263 var SMSound,
275 - _s = this, _sm = 'soundManager', _smc = _sm+'::', _h5 = 'HTML5::', _id, _ua = navigator.userAgent, _win = window, _wl = _win.location.href.toString(), _doc = document, _doNothing, _init, _fV, _on_queue = [], _debugOpen = true, _debugTS, _didAppend = false, _appendSuccess = false, _didInit = false, _disabled = false, _windowLoaded = false, _wDS, _wdCount = 0, _initComplete, _mixin, _addOnEvent, _processOnEvents, _initUserOnload, _delayWaitForEI, _waitForEI, _setVersionInfo, _handleFocus, _strings, _initMovie, _domContentLoaded, _didDCLoaded, _getDocument, _createMovie, _catchError, _setPolling, _initDebug, _debugLevels = ['log', 'info', 'warn', 'error'], _defaultFlashVersion = 8, _disableObject, _failSafely, _normalizeMovieURL, _oRemoved = null, _oRemovedHTML = null, _str, _flashBlockHandler, _getSWFCSS, _toggleDebug, _loopFix, _policyFix, _complain, _idCheck, _waitingForEI = false, _initPending = false, _smTimer, _onTimer, _startTimer, _stopTimer, _needsFlash = null, _featureCheck, _html5OK, _html5CanPlay, _html5Ext, _html5Unload, _domContentLoadedIE, _testHTML5, _event, _slice = Array.prototype.slice, _useGlobalHTML5Audio = false, _hasFlash, _detectFlash, _badSafariFix, _html5_events, _showSupport,
 264+ _s = this, _flash = null, _sm = 'soundManager', _smc = _sm+'::', _h5 = 'HTML5::', _id, _ua = navigator.userAgent, _win = window, _wl = _win.location.href.toString(), _doc = document, _doNothing, _init, _fV, _on_queue = [], _debugOpen = true, _debugTS, _didAppend = false, _appendSuccess = false, _didInit = false, _disabled = false, _windowLoaded = false, _wDS, _wdCount = 0, _initComplete, _mixin, _addOnEvent, _processOnEvents, _initUserOnload, _delayWaitForEI, _waitForEI, _setVersionInfo, _handleFocus, _strings, _initMovie, _domContentLoaded, _winOnLoad, _didDCLoaded, _getDocument, _createMovie, _catchError, _setPolling, _initDebug, _debugLevels = ['log', 'info', 'warn', 'error'], _defaultFlashVersion = 8, _disableObject, _failSafely, _normalizeMovieURL, _oRemoved = null, _oRemovedHTML = null, _str, _flashBlockHandler, _getSWFCSS, _swfCSS, _toggleDebug, _loopFix, _policyFix, _complain, _idCheck, _waitingForEI = false, _initPending = false, _smTimer, _onTimer, _startTimer, _stopTimer, _timerExecute, _h5TimerCount = 0, _h5IntervalTimer = null, _parseURL,
 265+ _needsFlash = null, _featureCheck, _html5OK, _html5CanPlay, _html5Ext, _html5Unload, _domContentLoadedIE, _testHTML5, _event, _slice = Array.prototype.slice, _useGlobalHTML5Audio = false, _hasFlash, _detectFlash, _badSafariFix, _html5_events, _showSupport,
276266 _is_iDevice = _ua.match(/(ipad|iphone|ipod)/i), _is_firefox = _ua.match(/firefox/i), _is_android = _ua.match(/droid/i), _isIE = _ua.match(/msie/i), _isWebkit = _ua.match(/webkit/i), _isSafari = (_ua.match(/safari/i) && !_ua.match(/chrome/i)), _isOpera = (_ua.match(/opera/i)),
277267 _likesHTML5 = (_ua.match(/(mobile|pre\/|xoom)/i) || _is_iDevice),
278 - _isBadSafari = (!_wl.match(/usehtml5audio/i) && !_wl.match(/sm2\-ignorebadua/i) && _isSafari && _ua.match(/OS X 10_6_([3-7])/i)), // Safari 4 and 5 occasionally fail to load/play HTML5 audio on Snow Leopard 10.6.3 through 10.6.7 due to bug(s) in QuickTime X and/or other underlying frameworks. :/ Confirmed bug. https://bugs.webkit.org/show_bug.cgi?id=32159
 268+ _isBadSafari = (!_wl.match(/usehtml5audio/i) && !_wl.match(/sm2\-ignorebadua/i) && _isSafari && !_ua.match(/silk/i) && _ua.match(/OS X 10_6_([3-7])/i)), // Safari 4 and 5 (excluding Kindle Fire, "Silk") occasionally fail to load/play HTML5 audio on Snow Leopard 10.6.3 through 10.6.7 due to bug(s) in QuickTime X and/or other underlying frameworks. :/ Confirmed bug. https://bugs.webkit.org/show_bug.cgi?id=32159
279269 _hasConsole = (typeof console !== 'undefined' && typeof console.log !== 'undefined'), _isFocused = (typeof _doc.hasFocus !== 'undefined'?_doc.hasFocus():null), _tryInitOnFocus = (_isSafari && typeof _doc.hasFocus === 'undefined'), _okToDisable = !_tryInitOnFocus, _flashMIME = /(mp3|mp4|mpa)/i,
280270 _emptyURL = 'about:blank', // safe URL to unload, or load nothing from (flash 8 + most HTML5 UAs)
281271 _overHTTP = (_doc.location?_doc.location.protocol.match(/http/i):null),
@@ -284,12 +274,27 @@
285275 // Flash v9.0r115+ "moviestar" formats
286276 _netStreamTypes = ['mpeg4', 'aac', 'flv', 'mov', 'mp4', 'm4v', 'f4v', 'm4a', 'mp4v', '3gp', '3g2'],
287277 _netStreamPattern = new RegExp('\\.(' + _netStreamTypes.join('|') + ')(\\?.*)?$', 'i');
 278+
288279 this.mimePattern = /^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i; // default mp3 set
289280
290281 // use altURL if not "online"
291282 this.useAltURL = !_overHTTP;
292283 this._global_a = null;
293284
 285+ _swfCSS = {
 286+
 287+ 'swfBox': 'sm2-object-box',
 288+ 'swfDefault': 'movieContainer',
 289+ 'swfError': 'swf_error', // SWF loaded, but SM2 couldn't start (other error)
 290+ 'swfTimedout': 'swf_timedout',
 291+ 'swfLoaded': 'swf_loaded',
 292+ 'swfUnblocked': 'swf_unblocked', // or loaded OK
 293+ 'sm2Debug': 'sm2_debug',
 294+ 'highPerf': 'high_performance',
 295+ 'flashDebug': 'flash_debug'
 296+
 297+ };
 298+
294299 if (_likesHTML5) {
295300
296301 // prefer HTML5 for mobile + tablet-like devices, probably more reliable vs. flash at this point.
@@ -333,11 +338,16 @@
334339
335340 this.createSound = function(oOptions) {
336341
337 - var _cs = _sm+'.createSound(): ',
 342+ var _cs, _cs_string,
338343 thisOptions = null, oSound = null, _tO = null;
339344
 345+ // <d>
 346+ _cs = _sm+'.createSound(): ';
 347+ _cs_string = _cs + _str(!_didInit?'notReady':'notOK');
 348+ // </d>
 349+
340350 if (!_didInit || !_s.ok()) {
341 - _complain(_cs + _str(!_didInit?'notReady':'notOK'));
 351+ _complain(_cs_string);
342352 return false;
343353 }
344354
@@ -352,7 +362,9 @@
353363 // inherit from defaultOptions
354364 thisOptions = _mixin(oOptions);
355365
356 - // alias
 366+ thisOptions.url = _parseURL(thisOptions.url);
 367+
 368+ // local shortcut
357369 _tO = thisOptions;
358370
359371 // <d>
@@ -412,9 +424,9 @@
413425 oSound = make();
414426
415427 if (_fV === 8) {
416 - _s.o._createSound(_tO.id, _tO.loops||1, _tO.usePolicyFile);
 428+ _flash._createSound(_tO.id, _tO.loops||1, _tO.usePolicyFile);
417429 } else {
418 - _s.o._createSound(_tO.id, _tO.url, _tO.usePeakData, _tO.useWaveformData, _tO.useEQData, _tO.isMovieStar, (_tO.isMovieStar?_tO.bufferTime:false), _tO.loops||1, _tO.serverURL, _tO.duration||null, _tO.autoPlay, true, _tO.autoLoad, _tO.usePolicyFile);
 430+ _flash._createSound(_tO.id, _tO.url, _tO.usePeakData, _tO.useWaveformData, _tO.useEQData, _tO.isMovieStar, (_tO.isMovieStar?_tO.bufferTime:false), _tO.loops||1, _tO.serverURL, _tO.duration||null, _tO.autoPlay, true, _tO.autoLoad, _tO.usePolicyFile);
419431 if (!_tO.serverURL) {
420432 // We are connected immediately
421433 oSound.connected = true;
@@ -508,13 +520,12 @@
509521 if (!_idCheck(sID)) {
510522 return false;
511523 }
512 -
513524 return _s.sounds[sID].unload();
514525
515526 };
516527
517528 /**
518 - * Calls the onposition() method of a SMSound object by ID.
 529+ * Calls the onPosition() method of a SMSound object by ID.
519530 *
520531 * @param {string} sID The ID of the sound
521532 * @param {number} nPosition The position to watch for
@@ -523,7 +534,7 @@
524535 * @return {SMSound} The SMSound object
525536 */
526537
527 - this.onposition = function(sID, nPosition, oMethod, oScope) {
 538+ this.onPosition = function(sID, nPosition, oMethod, oScope) {
528539
529540 if (!_idCheck(sID)) {
530541 return false;
@@ -532,7 +543,28 @@
533544
534545 };
535546
 547+ // legacy/backwards-compability: lower-case method name
 548+ this.onposition = this.onPosition;
 549+
536550 /**
 551+ * Calls the clearOnPosition() method of a SMSound object by ID.
 552+ *
 553+ * @param {string} sID The ID of the sound
 554+ * @param {number} nPosition The position to watch for
 555+ * @param {function} oMethod Optional: The relevant callback to fire
 556+ * @return {SMSound} The SMSound object
 557+ */
 558+
 559+ this.clearOnPosition = function(sID, nPosition, oMethod) {
 560+
 561+ if (!_idCheck(sID)) {
 562+ return false;
 563+ }
 564+ return _s.sounds[sID].clearOnPosition(nPosition, oMethod);
 565+
 566+ };
 567+
 568+ /**
537569 * Calls the play() method of a SMSound object by ID.
538570 *
539571 * @param {string} sID The ID of the sound
@@ -542,22 +574,21 @@
543575
544576 this.play = function(sID, oOptions) {
545577
546 - var fN = _sm+'.play(): ';
547 -
548578 if (!_didInit || !_s.ok()) {
549 - _complain(fN + _str(!_didInit?'notReady':'notOK'));
 579+ _complain(_sm+'.play(): ' + _str(!_didInit?'notReady':'notOK'));
550580 return false;
551581 }
552582
553583 if (!_idCheck(sID)) {
554584 if (!(oOptions instanceof Object)) {
 585+ // overloading use case: play('mySound','/path/to/some.mp3');
555586 oOptions = {
556587 url: oOptions
557 - }; // overloading use case: play('mySound','/path/to/some.mp3');
 588+ };
558589 }
559590 if (oOptions && oOptions.url) {
560591 // overloading use case, create+play: .play('someID',{url:'/path/to.mp3'});
561 - _s._wD(fN + 'attempting to create "' + sID + '"', 1);
 592+ _s._wD(_sm+'.play(): attempting to create "' + sID + '"', 1);
562593 oOptions.id = sID;
563594 return _s.createSound(oOptions).play();
564595 } else {
@@ -583,7 +614,6 @@
584615
585616 if (!_idCheck(sID)) {
586617 return false;
587 -
588618 }
589619 return _s.sounds[sID].setPosition(nMsecOffset);
590620
@@ -601,6 +631,7 @@
602632 if (!_idCheck(sID)) {
603633 return false;
604634 }
 635+
605636 _s._wD(_sm+'.stop(' + sID + ')', 1);
606637 return _s.sounds[sID].stop();
607638
@@ -740,15 +771,14 @@
741772
742773 this.mute = function(sID) {
743774
744 - var fN = _sm+'.mute(): ',
745 - i = 0;
 775+ var i = 0;
746776
747777 if (typeof sID !== 'string') {
748778 sID = null;
749779 }
750780
751781 if (!sID) {
752 - _s._wD(fN + 'Muting all sounds');
 782+ _s._wD(_sm+'.mute(): Muting all sounds');
753783 for (i = _s.soundIDs.length; i--;) {
754784 _s.sounds[_s.soundIDs[i]].mute();
755785 }
@@ -757,7 +787,7 @@
758788 if (!_idCheck(sID)) {
759789 return false;
760790 }
761 - _s._wD(fN + 'Muting "' + sID + '"');
 791+ _s._wD(_sm+'.mute(): Muting "' + sID + '"');
762792 return _s.sounds[sID].mute();
763793 }
764794
@@ -783,7 +813,7 @@
784814
785815 this.unmute = function(sID) {
786816
787 - var fN = _sm+'.unmute(): ', i;
 817+ var i;
788818
789819 if (typeof sID !== 'string') {
790820 sID = null;
@@ -791,7 +821,7 @@
792822
793823 if (!sID) {
794824
795 - _s._wD(fN + 'Unmuting all sounds');
 825+ _s._wD(_sm+'.unmute(): Unmuting all sounds');
796826 for (i = _s.soundIDs.length; i--;) {
797827 _s.sounds[_s.soundIDs[i]].unmute();
798828 }
@@ -802,7 +832,7 @@
803833 if (!_idCheck(sID)) {
804834 return false;
805835 }
806 - _s._wD(fN + 'Unmuting "' + sID + '"');
 836+ _s._wD(_sm+'.unmute(): Unmuting "' + sID + '"');
807837 return _s.sounds[sID].unmute();
808838
809839 }
@@ -833,7 +863,6 @@
834864 if (!_idCheck(sID)) {
835865 return false;
836866 }
837 -
838867 return _s.sounds[sID].toggleMute();
839868
840869 };
@@ -849,8 +878,8 @@
850879 // flash-only
851880 var ram = 0;
852881
853 - if (_s.o && _fV !== 8) {
854 - ram = parseInt(_s.o._getMemoryUse(), 10);
 882+ if (_flash && _fV !== 8) {
 883+ ram = parseInt(_flash._getMemoryUse(), 10);
855884 }
856885
857886 return ram;
@@ -1082,7 +1111,7 @@
10831112 } else {
10841113 console.log(sText);
10851114 }
1086 - if (_s.useConsoleOnly) {
 1115+ if (_s.consoleOnly) {
10871116 return true;
10881117 }
10891118 }
@@ -1180,9 +1209,9 @@
11811210
11821211 try {
11831212 if (_isIE) {
1184 - _oRemovedHTML = _s.o.innerHTML;
 1213+ _oRemovedHTML = _flash.innerHTML;
11851214 }
1186 - _oRemoved = _s.o.parentNode.removeChild(_s.o);
 1215+ _oRemoved = _flash.parentNode.removeChild(_flash);
11871216 _s._wD('Flash movie removed.');
11881217 } catch(e) {
11891218 // uh-oh.
@@ -1194,7 +1223,7 @@
11951224
11961225 _s.enabled = _didDCLoaded = _didInit = _waitingForEI = _initPending = _didAppend = _appendSuccess = _disabled = _s.swfLoaded = false;
11971226 _s.soundIDs = _s.sounds = [];
1198 - _s.o = null;
 1227+ _flash = null;
11991228
12001229 for (i in _on_queue) {
12011230 if (_on_queue.hasOwnProperty(i)) {
@@ -1217,7 +1246,7 @@
12181247
12191248 this.getMoviePercent = function() {
12201249
1221 - return (_s.o && typeof _s.o.PercentLoaded !== 'undefined' ? _s.o.PercentLoaded() : null);
 1250+ return (_flash && typeof _flash.PercentLoaded !== 'undefined' ? _flash.PercentLoaded() : null);
12221251
12231252 };
12241253
@@ -1269,7 +1298,14 @@
12701299
12711300 SMSound = function(oOptions) {
12721301
1273 - var _t = this, _resetProperties, _stop_html5_timer, _start_html5_timer;
 1302+ var _t = this, _resetProperties, _add_html5_events, _remove_html5_events, _stop_html5_timer, _start_html5_timer, _attachOnPosition, _onplay_called = false, _onPositionItems = [], _onPositionFired = 0, _detachOnPosition, _applyFromTo, _lastURL = null;
 1303+
 1304+ var _lastHTML5State = {
 1305+ // tracks duration + position (time)
 1306+ duration: null,
 1307+ time: null
 1308+ };
 1309+
12741310 this.sID = oOptions.id;
12751311 this.url = oOptions.url;
12761312 this.options = _mixin(oOptions);
@@ -1283,7 +1319,6 @@
12841320 // assign property defaults
12851321 this.pan = this.options.pan;
12861322 this.volume = this.options.volume;
1287 - this._lastURL = null;
12881323 this.isHTML5 = false;
12891324 this._a = null;
12901325
@@ -1342,7 +1377,7 @@
13431378
13441379 this.load = function(oOptions) {
13451380
1346 - var oS = null;
 1381+ var oS = null, _iO;
13471382
13481383 if (typeof oOptions !== 'undefined') {
13491384 _t._iO = _mixin(oOptions, _t.options);
@@ -1351,7 +1386,7 @@
13521387 oOptions = _t.options;
13531388 _t._iO = oOptions;
13541389 _t.instanceOptions = _t._iO;
1355 - if (_t._lastURL && _t._lastURL !== _t.url) {
 1390+ if (_lastURL && _lastURL !== _t.url) {
13561391 _wDS('manURL');
13571392 _t._iO.url = _t.url;
13581393 _t.url = null;
@@ -1362,31 +1397,52 @@
13631398 _t._iO.url = _t.url;
13641399 }
13651400
 1401+ _t._iO.url = _parseURL(_t._iO.url);
 1402+
13661403 _s._wD('SMSound.load(): ' + _t._iO.url, 1);
13671404
13681405 if (_t._iO.url === _t.url && _t.readyState !== 0 && _t.readyState !== 2) {
13691406 _wDS('onURL', 1);
 1407+ // if loaded and an onload() exists, fire immediately.
 1408+ if (_t.readyState === 3 && _t._iO.onload) {
 1409+ // assume success based on truthy duration.
 1410+ _t._iO.onload.apply(_t, [(!!_t.duration)]);
 1411+ }
13701412 return _t;
13711413 }
13721414
1373 - _t._lastURL = _t.url;
 1415+ // local shortcut
 1416+ _iO = _t._iO;
 1417+
 1418+ _lastURL = _t.url;
13741419 _t.loaded = false;
13751420 _t.readyState = 1;
13761421 _t.playState = 0;
13771422
13781423 // TODO: If switching from HTML5 -> flash (or vice versa), stop currently-playing audio.
13791424
1380 - if (_html5OK(_t._iO)) {
 1425+ if (_html5OK(_iO)) {
13811426
1382 - oS = _t._setup_html5(_t._iO);
 1427+ oS = _t._setup_html5(_iO);
 1428+
13831429 if (!oS._called_load) {
 1430+
13841431 _s._wD(_h5+'load: '+_t.sID);
13851432 _t._html5_canplay = false;
 1433+
 1434+ // given explicit load call, try to get whole file.
 1435+ // early HTML5 implementation (non-standard)
 1436+ _t._a.autobuffer = 'auto';
 1437+ // standard
 1438+ _t._a.preload = 'auto';
 1439+
13861440 oS.load();
13871441 oS._called_load = true;
1388 - if (_t._iO.autoPlay) {
 1442+
 1443+ if (_iO.autoPlay) {
13891444 _t.play();
13901445 }
 1446+
13911447 } else {
13921448 _s._wD(_h5+'ignoring request to load again: '+_t.sID);
13931449 }
@@ -1395,11 +1451,13 @@
13961452
13971453 try {
13981454 _t.isHTML5 = false;
1399 - _t._iO = _policyFix(_loopFix(_t._iO));
 1455+ _t._iO = _policyFix(_loopFix(_iO));
 1456+ // re-assign local shortcut
 1457+ _iO = _t._iO;
14001458 if (_fV === 8) {
1401 - _s.o._load(_t.sID, _t._iO.url, _t._iO.stream, _t._iO.autoPlay, (_t._iO.whileloading?1:0), _t._iO.loops||1, _t._iO.usePolicyFile);
 1459+ _flash._load(_t.sID, _iO.url, _iO.stream, _iO.autoPlay, (_iO.whileloading?1:0), _iO.loops||1, _iO.usePolicyFile);
14021460 } else {
1403 - _s.o._load(_t.sID, _t._iO.url, !!(_t._iO.stream), !!(_t._iO.autoPlay), _t._iO.loops||1, !!(_t._iO.autoLoad), _t._iO.usePolicyFile);
 1461+ _flash._load(_t.sID, _iO.url, !!(_iO.stream), !!(_iO.autoPlay), _iO.loops||1, !!(_iO.autoLoad), _iO.usePolicyFile);
14041462 }
14051463 } catch(e) {
14061464 _wDS('smError', 2);
@@ -1432,9 +1490,9 @@
14331491
14341492 if (!_t.isHTML5) {
14351493 if (_fV === 8) {
1436 - _s.o._unload(_t.sID, _emptyURL);
 1494+ _flash._unload(_t.sID, _emptyURL);
14371495 } else {
1438 - _s.o._unload(_t.sID);
 1496+ _flash._unload(_t.sID);
14391497 }
14401498 } else {
14411499 _stop_html5_timer();
@@ -1466,7 +1524,7 @@
14671525 // kill sound within Flash
14681526 // Disable the onfailure handler
14691527 _t._iO.onfailure = null;
1470 - _s.o._destroySound(_t.sID);
 1528+ _flash._destroySound(_t.sID);
14711529
14721530 } else {
14731531
@@ -1476,7 +1534,7 @@
14771535 _t._a.pause();
14781536 _html5Unload(_t._a);
14791537 if (!_useGlobalHTML5Audio) {
1480 - _t._remove_html5_events();
 1538+ _remove_html5_events();
14811539 }
14821540 // break obvious circular reference
14831541 _t._a._t = null;
@@ -1502,8 +1560,12 @@
15031561
15041562 this.play = function(oOptions, _updatePlayState) {
15051563
1506 - var fN = 'SMSound.play(): ', allowMulti, a;
 1564+ var fN, allowMulti, a, onready;
15071565
 1566+ // <d>
 1567+ fN = 'SMSound.play(): ';
 1568+ // </d>
 1569+
15081570 _updatePlayState = _updatePlayState === undefined ? true : _updatePlayState; // default to true
15091571
15101572 if (!oOptions) {
@@ -1512,6 +1574,7 @@
15131575
15141576 _t._iO = _mixin(oOptions, _t._iO);
15151577 _t._iO = _mixin(_t._iO, _t.options);
 1578+ _t._iO.url = _parseURL(_t._iO.url);
15161579 _t.instanceOptions = _t._iO;
15171580
15181581 // RTMP-only
@@ -1544,11 +1607,13 @@
15451608 if (_t.readyState === 0) {
15461609
15471610 _s._wD(fN + 'Attempting to load "' + _t.sID + '"', 1);
 1611+
15481612 // try to get this sound playing ASAP
15491613 if (!_t.isHTML5) {
15501614 // assign directly because setAutoPlay() increments the instanceCount
15511615 _t._iO.autoPlay = true;
15521616 }
 1617+
15531618 _t.load(_t._iO);
15541619
15551620 } else if (_t.readyState === 2) {
@@ -1571,7 +1636,7 @@
15721637 if (!_t.isHTML5 && _fV === 9 && _t.position > 0 && _t.position === _t.duration) {
15731638 // flash 9 needs a position reset if play() is called while at the end of a sound.
15741639 _s._wD(fN + '"' + _t.sID + '": Sound at end, resetting to position:0');
1575 - _t._iO.position = 0;
 1640+ oOptions.position = 0;
15761641 }
15771642
15781643 /**
@@ -1590,35 +1655,89 @@
15911656
15921657 } else {
15931658
 1659+ _t._iO = _mixin(oOptions, _t._iO);
 1660+
 1661+ // apply from/to parameters, if they exist (and not using RTMP)
 1662+ if (_t._iO.from !== null && _t._iO.to !== null && _t.instanceCount === 0 && _t.playState === 0 && !_t._iO.serverURL) {
 1663+
 1664+ onready = function() {
 1665+ // sound "canplay" or onload()
 1666+ // re-apply from/to to instance options, and start playback
 1667+ _t._iO = _mixin(oOptions, _t._iO);
 1668+ _t.play(_t._iO);
 1669+ };
 1670+
 1671+ // HTML5 needs to at least have "canplay" fired before seeking.
 1672+ if (_t.isHTML5 && !_t._html5_canplay) {
 1673+
 1674+ // this hasn't been loaded yet. load it first, and then do this again.
 1675+ _s._wD(fN+'Beginning load of "'+ _t.sID+'" for from/to case');
 1676+
 1677+ _t.load({
 1678+ _oncanplay: onready
 1679+ });
 1680+
 1681+ return false;
 1682+
 1683+ } else if (!_t.isHTML5 && !_t.loaded && (!_t.readyState || _t.readyState !== 2)) {
 1684+
 1685+ // to be safe, preload the whole thing in Flash.
 1686+
 1687+ _s._wD(fN+'Preloading "'+ _t.sID+'" for from/to case');
 1688+
 1689+ _t.load({
 1690+ onload: onready
 1691+ });
 1692+
 1693+ return false;
 1694+
 1695+ }
 1696+
 1697+ // otherwise, we're ready to go. re-apply local options, and continue
 1698+
 1699+ _t._iO = _applyFromTo();
 1700+
 1701+ }
 1702+
15941703 _s._wD(fN+'"'+ _t.sID+'" is starting to play');
1595 - _t.playState = 1;
1596 - _t.paused = false;
15971704
15981705 if (!_t.instanceCount || _t._iO.multiShotEvents || (!_t.isHTML5 && _fV > 8 && !_t.getAutoPlay())) {
15991706 _t.instanceCount++;
16001707 }
16011708
1602 - _t.position = (typeof _t._iO.position !== 'undefined' && !isNaN(_t._iO.position)?_t._iO.position:0);
 1709+ // if first play and onposition parameters exist, apply them now
 1710+ if (_t.playState === 0 && _t._iO.onposition) {
 1711+ _attachOnPosition(_t);
 1712+ }
16031713
 1714+ _t.playState = 1;
 1715+ _t.paused = false;
 1716+
 1717+ _t.position = (typeof _t._iO.position !== 'undefined' && !isNaN(_t._iO.position) ? _t._iO.position : 0);
 1718+
16041719 if (!_t.isHTML5) {
16051720 _t._iO = _policyFix(_loopFix(_t._iO));
16061721 }
16071722
16081723 if (_t._iO.onplay && _updatePlayState) {
16091724 _t._iO.onplay.apply(_t);
1610 - _t._onplay_called = true;
 1725+ _onplay_called = true;
16111726 }
16121727
16131728 _t.setVolume(_t._iO.volume, true);
16141729 _t.setPan(_t._iO.pan, true);
16151730
16161731 if (!_t.isHTML5) {
1617 - _s.o._start(_t.sID, _t._iO.loops || 1, (_fV === 9?_t._iO.position:_t._iO.position / 1000));
 1732+
 1733+ _flash._start(_t.sID, _t._iO.loops || 1, (_fV === 9?_t._iO.position:_t._iO.position / 1000));
 1734+
16181735 } else {
 1736+
16191737 _start_html5_timer();
16201738 a = _t._setup_html5();
16211739 _t.setPosition(_t._iO.position);
16221740 a.play();
 1741+
16231742 }
16241743
16251744 }
@@ -1639,25 +1758,32 @@
16401759
16411760 this.stop = function(bAll) {
16421761
 1762+ var _iO = _t._iO, _oP;
 1763+
16431764 if (_t.playState === 1) {
16441765
16451766 _t._onbufferchange(0);
1646 - _t.resetOnPosition(0);
 1767+ _t._resetOnPosition(0);
16471768 _t.paused = false;
16481769
16491770 if (!_t.isHTML5) {
16501771 _t.playState = 0;
16511772 }
16521773
1653 - if (_t._iO.onstop) {
1654 - _t._iO.onstop.apply(_t);
 1774+ // remove onPosition listeners, if any
 1775+ _detachOnPosition();
 1776+
 1777+ // and "to" position, if set
 1778+ if (_iO.to) {
 1779+ _t.clearOnPosition(_iO.to);
16551780 }
16561781
16571782 if (!_t.isHTML5) {
16581783
1659 - _s.o._stop(_t.sID, bAll);
 1784+ _flash._stop(_t.sID, bAll);
 1785+
16601786 // hack for netStream: just unload
1661 - if (_t._iO.serverURL) {
 1787+ if (_iO.serverURL) {
16621788 _t.unload();
16631789 }
16641790
@@ -1665,10 +1791,16 @@
16661792
16671793 if (_t._a) {
16681794
 1795+ _oP = _t.position;
 1796+
16691797 // act like Flash, though
16701798 _t.setPosition(0);
16711799
 1800+ // hack: reflect old position for onstop() (also like Flash)
 1801+ _t.position = _oP;
 1802+
16721803 // html5 has no stop()
 1804+ // NOTE: pausing means iOS requires interaction to resume.
16731805 _t._a.pause();
16741806
16751807 _t.playState = 0;
@@ -1685,6 +1817,10 @@
16861818 _t.instanceCount = 0;
16871819 _t._iO = {};
16881820
 1821+ if (_iO.onstop) {
 1822+ _iO.onstop.apply(_t);
 1823+ }
 1824+
16891825 }
16901826
16911827 return _t;
@@ -1703,7 +1839,7 @@
17041840 _t._iO.autoPlay = autoPlay;
17051841
17061842 if (!_t.isHTML5) {
1707 - _s.o._setAutoPlay(_t.sID, autoPlay);
 1843+ _flash._setAutoPlay(_t.sID, autoPlay);
17081844 if (autoPlay) {
17091845 // only increment the instanceCount if the sound isn't loaded (TODO: verify RTMP)
17101846 if (!_t.instanceCount && _t.readyState === 1) {
@@ -1749,7 +1885,7 @@
17501886 original_pos = _t.position;
17511887 _t.position = offset;
17521888 position1K = _t.position/1000;
1753 - _t.resetOnPosition(_t.position);
 1889+ _t._resetOnPosition(_t.position);
17541890 _t._iO.position = offset;
17551891
17561892 if (!_t.isHTML5) {
@@ -1757,7 +1893,7 @@
17581894 position = (_fV === 9 ? _t.position : position1K);
17591895 if (_t.readyState && _t.readyState !== 2) {
17601896 // if paused or not playing, will not resume (by playing)
1761 - _s.o._setPosition(_t.sID, position, (_t.paused || !_t.playState));
 1897+ _flash._setPosition(_t.sID, position, (_t.paused || !_t.playState));
17621898 }
17631899
17641900 } else if (_t._a) {
@@ -1765,7 +1901,7 @@
17661902 // Set the position in the canplay handler if the sound is not ready yet
17671903 if (_t._html5_canplay) {
17681904 if (_t._a.currentTime !== position1K) {
1769 - /*
 1905+ /**
17701906 * DOM/JS errors/exceptions to watch out for:
17711907 * if seek is beyond (loaded?) position, "DOM exception 11"
17721908 * "INDEX_SIZE_ERR": DOM exception 1
@@ -1816,7 +1952,7 @@
18171953
18181954 if (!_t.isHTML5) {
18191955 if (_bCallFlash || _bCallFlash === undefined) {
1820 - _s.o._pause(_t.sID);
 1956+ _flash._pause(_t.sID);
18211957 }
18221958 } else {
18231959 _t._setup_html5().pause();
@@ -1847,6 +1983,8 @@
18481984
18491985 this.resume = function() {
18501986
 1987+ var _iO = _t._iO;
 1988+
18511989 if (!_t.paused) {
18521990 return _t;
18531991 }
@@ -1856,22 +1994,22 @@
18571995 _t.playState = 1;
18581996
18591997 if (!_t.isHTML5) {
1860 - if (_t._iO.isMovieStar) {
 1998+ if (_iO.isMovieStar && !_iO.serverURL) {
18611999 // Bizarre Webkit bug (Chrome reported via 8tracks.com dudes): AAC content paused for 30+ seconds(?) will not resume without a reposition.
18622000 _t.setPosition(_t.position);
18632001 }
18642002 // flash method is toggle-based (pause/resume)
1865 - _s.o._pause(_t.sID);
 2003+ _flash._pause(_t.sID);
18662004 } else {
18672005 _t._setup_html5().play();
18682006 _start_html5_timer();
18692007 }
18702008
1871 - if (!_t._onplay_called && _t._iO.onplay) {
1872 - _t._iO.onplay.apply(_t);
1873 - _t._onplay_called = true;
1874 - } else if (_t._iO.onresume) {
1875 - _t._iO.onresume.apply(_t);
 2009+ if (_onplay_called && _iO.onplay) {
 2010+ _iO.onplay.apply(_t);
 2011+ _onplay_called = true;
 2012+ } else if (_iO.onresume) {
 2013+ _iO.onresume.apply(_t);
18762014 }
18772015
18782016 return _t;
@@ -1923,7 +2061,7 @@
19242062 }
19252063
19262064 if (!_t.isHTML5) {
1927 - _s.o._setPan(_t.sID, nPan);
 2065+ _flash._setPan(_t.sID, nPan);
19282066 } // else { no HTML5 pan? }
19292067
19302068 _t._iO.pan = nPan;
@@ -1946,6 +2084,13 @@
19472085
19482086 this.setVolume = function(nVol, _bInstanceOnly) {
19492087
 2088+ /**
 2089+ * Note: Setting volume has no effect on iOS "special snowflake" devices.
 2090+ * Hardware volume control overrides software, and volume
 2091+ * will always return 1 per Apple docs. (iOS 4 + 5.)
 2092+ * http://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/HTML-canvas-guide/AddingSoundtoCanvasAnimations/AddingSoundtoCanvasAnimations.html
 2093+ */
 2094+
19502095 if (typeof nVol === 'undefined') {
19512096 nVol = 100;
19522097 }
@@ -1955,9 +2100,10 @@
19562101 }
19572102
19582103 if (!_t.isHTML5) {
1959 - _s.o._setVolume(_t.sID, (_s.muted && !_t.muted) || _t.muted?0:nVol);
 2104+ _flash._setVolume(_t.sID, (_s.muted && !_t.muted) || _t.muted?0:nVol);
19602105 } else if (_t._a) {
1961 - _t._a.volume = Math.max(0, Math.min(1, nVol/100)); // valid range: 0-1
 2106+ // valid range: 0-1
 2107+ _t._a.volume = Math.max(0, Math.min(1, nVol/100));
19622108 }
19632109
19642110 _t._iO.volume = nVol;
@@ -1982,7 +2128,7 @@
19832129 _t.muted = true;
19842130
19852131 if (!_t.isHTML5) {
1986 - _s.o._setVolume(_t.sID, 0);
 2132+ _flash._setVolume(_t.sID, 0);
19872133 } else if (_t._a) {
19882134 _t._a.muted = true;
19892135 }
@@ -2003,7 +2149,7 @@
20042150 var hasIO = typeof _t._iO.volume !== 'undefined';
20052151
20062152 if (!_t.isHTML5) {
2007 - _s.o._setVolume(_t.sID, hasIO?_t._iO.volume:_t.options.volume);
 2153+ _flash._setVolume(_t.sID, hasIO?_t._iO.volume:_t.options.volume);
20082154 } else if (_t._a) {
20092155 _t._a.muted = false;
20102156 }
@@ -2025,7 +2171,7 @@
20262172 };
20272173
20282174 /**
2029 - * Calls the onposition() method of a SMSound object.
 2175+ * Registers a callback to be fired when a sound reaches a given position during playback.
20302176 *
20312177 * @param {number} nPosition The position to watch for
20322178 * @param {function} oMethod The relevant callback to fire
@@ -2033,14 +2179,14 @@
20342180 * @return {SMSound} The SMSound object
20352181 */
20362182
2037 - this.onposition = function(nPosition, oMethod, oScope) {
 2183+ this.onPosition = function(nPosition, oMethod, oScope) {
20382184
2039 - // TODO: allow for ranges, too? eg. (nPosition instanceof Array)
 2185+ // TODO: basic dupe checking?
20402186
2041 - _t._onPositionItems.push({
 2187+ _onPositionItems.push({
20422188 position: nPosition,
20432189 method: oMethod,
2044 - scope: (typeof oScope !== 'undefined'?oScope:_t),
 2190+ scope: (typeof oScope !== 'undefined' ? oScope : _t),
20452191 fired: false
20462192 });
20472193
@@ -2048,24 +2194,59 @@
20492195
20502196 };
20512197
 2198+ // legacy/backwards-compability: lower-case method name
 2199+ this.onposition = this.onPosition;
 2200+
20522201 /**
2053 - * TODO: This should be marked as pseudo-private.
 2202+ * Removes registered callback(s) from a sound, by position and/or callback.
 2203+ *
 2204+ * @param {number} nPosition The position to clear callback(s) for
 2205+ * @param {function} oMethod Optional: Identify one callback to be removed when multiple listeners exist for one position
 2206+ * @return {SMSound} The SMSound object
20542207 */
20552208
2056 - this.processOnPosition = function() {
 2209+ this.clearOnPosition = function(nPosition, oMethod) {
20572210
2058 - var i, item, j = _t._onPositionItems.length;
 2211+ var i;
20592212
2060 - if (!j || !_t.playState || _t._onPositionFired >= j) {
 2213+ nPosition = parseInt(nPosition, 10);
 2214+
 2215+ if (isNaN(nPosition)) {
 2216+ // safety check
20612217 return false;
20622218 }
20632219
 2220+ for (i=0; i < _onPositionItems.length; i++) {
 2221+
 2222+ if (nPosition === _onPositionItems[i].position) {
 2223+ // remove this item if no method was specified, or, if the method matches
 2224+ if (!oMethod || (oMethod === _onPositionItems[i].method)) {
 2225+ if (_onPositionItems[i].fired) {
 2226+ // decrement "fired" counter, too
 2227+ _onPositionFired--;
 2228+ }
 2229+ _onPositionItems.splice(i, 1);
 2230+ }
 2231+ }
 2232+
 2233+ }
 2234+
 2235+ };
 2236+
 2237+ this._processOnPosition = function() {
 2238+
 2239+ var i, item, j = _onPositionItems.length;
 2240+
 2241+ if (!j || !_t.playState || _onPositionFired >= j) {
 2242+ return false;
 2243+ }
 2244+
20642245 for (i=j; i--;) {
2065 - item = _t._onPositionItems[i];
 2246+ item = _onPositionItems[i];
20662247 if (!item.fired && _t.position >= item.position) {
20672248 item.fired = true;
2068 - _s._onPositionFired++;
2069 - item.method.apply(item.scope,[item.position]);
 2249+ _onPositionFired++;
 2250+ item.method.apply(item.scope, [item.position]);
20702251 }
20712252 }
20722253
@@ -2073,20 +2254,20 @@
20742255
20752256 };
20762257
2077 - this.resetOnPosition = function(nPosition) {
 2258+ this._resetOnPosition = function(nPosition) {
20782259
20792260 // reset "fired" for items interested in this position
2080 - var i, item, j = _t._onPositionItems.length;
 2261+ var i, item, j = _onPositionItems.length;
20812262
20822263 if (!j) {
20832264 return false;
20842265 }
20852266
20862267 for (i=j; i--;) {
2087 - item = _t._onPositionItems[i];
 2268+ item = _onPositionItems[i];
20882269 if (item.fired && nPosition <= item.position) {
20892270 item.fired = false;
2090 - _s._onPositionFired--;
 2271+ _onPositionFired--;
20912272 }
20922273 }
20932274
@@ -2095,10 +2276,98 @@
20962277 };
20972278
20982279 /**
2099 - * SoundManager() private internals
 2280+ * SMSound() private internals
21002281 * --------------------------------
21012282 */
21022283
 2284+ _applyFromTo = function() {
 2285+
 2286+ var _iO = _t._iO,
 2287+ f = _iO.from,
 2288+ t = _iO.to,
 2289+ start, end;
 2290+
 2291+ end = function() {
 2292+
 2293+ // end has been reached.
 2294+ _s._wD(_t.sID + ': "to" time of ' + t + ' reached.');
 2295+
 2296+ // detach listener
 2297+ _t.clearOnPosition(t, end);
 2298+
 2299+ // stop should clear this, too
 2300+ _t.stop();
 2301+
 2302+ };
 2303+
 2304+ start = function() {
 2305+
 2306+ _s._wD(_t.sID + ': playing "from" ' + f);
 2307+
 2308+ // add listener for end
 2309+ if (t !== null && !isNaN(t)) {
 2310+ _t.onPosition(t, end);
 2311+ }
 2312+
 2313+ };
 2314+
 2315+ if (f !== null && !isNaN(f)) {
 2316+
 2317+ // apply to instance options, guaranteeing correct start position.
 2318+ _iO.position = f;
 2319+
 2320+ // multiShot timing can't be tracked, so prevent that.
 2321+ _iO.multiShot = false;
 2322+
 2323+ start();
 2324+
 2325+ }
 2326+
 2327+ // return updated instanceOptions including starting position
 2328+ return _iO;
 2329+
 2330+ };
 2331+
 2332+ _attachOnPosition = function() {
 2333+
 2334+ var op = _t._iO.onposition;
 2335+
 2336+ // attach onposition things, if any, now.
 2337+
 2338+ if (op) {
 2339+
 2340+ var item;
 2341+
 2342+ for (item in op) {
 2343+ if (op.hasOwnProperty(item)) {
 2344+ _t.onPosition(parseInt(item, 10), op[item]);
 2345+ }
 2346+ }
 2347+
 2348+ }
 2349+
 2350+ };
 2351+
 2352+ _detachOnPosition = function() {
 2353+
 2354+ var op = _t._iO.onposition;
 2355+
 2356+ // detach any onposition()-style listeners.
 2357+
 2358+ if (op) {
 2359+
 2360+ var item;
 2361+
 2362+ for (item in op) {
 2363+ if (op.hasOwnProperty(item)) {
 2364+ _t.clearOnPosition(parseInt(item, 10));
 2365+ }
 2366+ }
 2367+
 2368+ }
 2369+
 2370+ };
 2371+
21032372 _start_html5_timer = function() {
21042373
21052374 if (_t.isHTML5) {
@@ -2117,29 +2386,36 @@
21182387
21192388 _resetProperties = function() {
21202389
2121 - _t._onPositionItems = [];
2122 - _t._onPositionFired = 0;
 2390+ _onPositionItems = [];
 2391+ _onPositionFired = 0;
 2392+ _onplay_called = false;
 2393+
21232394 _t._hasTimer = null;
2124 - _t._onplay_called = false;
21252395 _t._a = null;
21262396 _t._html5_canplay = false;
21272397 _t.bytesLoaded = null;
21282398 _t.bytesTotal = null;
2129 - _t.position = null;
2130 - _t.duration = (_t._iO && _t._iO.duration?_t._iO.duration:null);
 2399+ _t.duration = (_t._iO && _t._iO.duration ? _t._iO.duration : null);
21312400 _t.durationEstimate = null;
 2401+
 2402+ // legacy: 1D array
 2403+ _t.eqData = [];
 2404+
 2405+ _t.eqData.left = [];
 2406+ _t.eqData.right = [];
 2407+
21322408 _t.failures = 0;
 2409+ _t.isBuffering = false;
 2410+ _t.instanceOptions = {};
 2411+ _t.instanceCount = 0;
21332412 _t.loaded = false;
2134 - _t.playState = 0;
2135 - _t.paused = false;
 2413+ _t.metadata = {};
21362414
21372415 // 0 = uninitialised, 1 = loading, 2 = failed/error, 3 = loaded/success
21382416 _t.readyState = 0;
21392417
21402418 _t.muted = false;
2141 - _t.isBuffering = false;
2142 - _t.instanceOptions = {};
2143 - _t.instanceCount = 0;
 2419+ _t.paused = false;
21442420
21452421 _t.peakData = {
21462422 left: 0,
@@ -2151,12 +2427,9 @@
21522428 right: []
21532429 };
21542430
2155 - // legacy: 1D array
2156 - _t.eqData = [];
 2431+ _t.playState = 0;
 2432+ _t.position = null;
21572433
2158 - _t.eqData.left = [];
2159 - _t.eqData.right = [];
2160 -
21612434 };
21622435
21632436 _resetProperties();
@@ -2168,9 +2441,13 @@
21692442
21702443 this._onTimer = function(bForce) {
21712444
2172 - // HTML5-only _whileplaying() etc.
 2445+ /**
 2446+ * HTML5-only _whileplaying() etc.
 2447+ * called from both HTML5 native events, and polling/interval-based timers
 2448+ * mimics flash and fires only when time/duration change, so as to be polling-friendly
 2449+ */
21732450
2174 - var time, x = {};
 2451+ var duration, isNew = false, time, x = {};
21752452
21762453 if (_t._hasTimer || bForce) {
21772454
@@ -2178,15 +2455,40 @@
21792456
21802457 if (_t._a && (bForce || ((_t.playState > 0 || _t.readyState === 1) && !_t.paused))) {
21812458
2182 - _t.duration = _t._get_html5_duration();
 2459+ duration = _t._get_html5_duration();
 2460+
 2461+ if (duration !== _lastHTML5State.duration) {
 2462+
 2463+ _lastHTML5State.duration = duration;
 2464+ _t.duration = duration;
 2465+ isNew = true;
 2466+
 2467+ }
 2468+
 2469+ // TODO: investigate why this goes wack if not set/re-set each time.
21832470 _t.durationEstimate = _t.duration;
2184 - time = _t._a.currentTime?_t._a.currentTime*1000:0;
2185 - _t._whileplaying(time,x,x,x,x);
2186 - return true;
21872471
 2472+ time = (_t._a.currentTime * 1000 || 0);
 2473+
 2474+ if (time !== _lastHTML5State.time) {
 2475+
 2476+ _lastHTML5State.time = time;
 2477+ isNew = true;
 2478+
 2479+ }
 2480+
 2481+ if (isNew || bForce) {
 2482+
 2483+ _t._whileplaying(time,x,x,x,x);
 2484+
 2485+ }
 2486+
 2487+ return isNew;
 2488+
21882489 } else {
21892490
2190 - _s._wD('_onTimer: Warn for "'+_t.sID+'": '+(!_t._a?'Could not find element. ':'')+(_t.playState === 0?'playState bad, 0?':'playState = '+_t.playState+', OK'));
 2491+ // _s._wD('_onTimer: Warn for "'+_t.sID+'": '+(!_t._a?'Could not find element. ':'')+(_t.playState === 0?'playState bad, 0?':'playState = '+_t.playState+', OK'));
 2492+
21912493 return false;
21922494
21932495 }
@@ -2197,8 +2499,9 @@
21982500
21992501 this._get_html5_duration = function() {
22002502
2201 - var d = (_t._a ? _t._a.duration*1000 : (_t._iO ? _t._iO.duration : undefined)),
2202 - result = (d && !isNaN(d) && d !== Infinity ? d : (_t._iO ? _t._iO.duration : null));
 2503+ var _iO = _t._iO,
 2504+ d = (_t._a ? _t._a.duration*1000 : (_iO ? _iO.duration : undefined)),
 2505+ result = (d && !isNaN(d) && d !== Infinity ? d : (_iO ? _iO.duration : null));
22032506
22042507 return result;
22052508
@@ -2213,12 +2516,19 @@
22142517
22152518 if (_a) {
22162519
2217 - if (_a._t && _oldIO.url === _iO.url && (!_t._lastURL || (_t._lastURL === _oldIO.url))) {
2218 - // same url, ignore request
2219 - return _a;
 2520+ if (_a._t) {
 2521+
 2522+ if (!_useGlobalHTML5Audio && _dURL === d(_lastURL)) {
 2523+ // same url, ignore request
 2524+ return _a;
 2525+ } else if (_useGlobalHTML5Audio && _oldIO.url === _iO.url && (!_lastURL || (_lastURL === _oldIO.url))) {
 2526+ // iOS-type reuse case
 2527+ return _a;
 2528+ }
 2529+
22202530 }
22212531
2222 - _s._wD('setting new URL on existing object: ' + _dURL + (_t._lastURL ? ', old URL: ' + _t._lastURL : ''));
 2532+ _s._wD('setting new URL on existing object: ' + _dURL + (_lastURL ? ', old URL: ' + _lastURL : ''));
22232533
22242534 /**
22252535 * "First things first, I, Poppa.." (reset the previous state of the old sound, if playing)
@@ -2235,7 +2545,7 @@
22362546
22372547 _a.src = _iO.url;
22382548 _t.url = _iO.url;
2239 - _t._lastURL = _iO.url;
 2549+ _lastURL = _iO.url;
22402550 _a._called_load = false;
22412551
22422552 } else {
@@ -2255,6 +2565,7 @@
22562566 }
22572567
22582568 }
 2569+
22592570 _t.isHTML5 = true;
22602571
22612572 // store a ref on the track
@@ -2263,19 +2574,12 @@
22642575 // store a ref on the audio
22652576 _a._t = _t;
22662577
2267 - _t._add_html5_events();
 2578+ _add_html5_events();
22682579 _a.loop = (_iO.loops>1?'loop':'');
22692580
22702581 if (_iO.autoLoad || _iO.autoPlay) {
22712582
2272 - // early HTML5 implementation (non-standard)
2273 - _a.autobuffer = 'auto';
2274 -
2275 - // standard
2276 - _a.preload = 'auto';
2277 -
22782583 _t.load();
2279 - _a._called_load = true;
22802584
22812585 } else {
22822586
@@ -2288,13 +2592,13 @@
22892593 }
22902594
22912595 // boolean instead of "loop", for webkit? - spec says string. http://www.w3.org/TR/html-markup/audio.html#audio.attrs.loop
2292 - _a.loop = (_iO.loops>1?'loop':'');
 2596+ _a.loop = (_iO.loops > 1 ? 'loop' : '');
22932597
22942598 return _a;
22952599
22962600 };
22972601
2298 - this._add_html5_events = function() {
 2602+ _add_html5_events = function() {
22992603
23002604 if (_t._a._added_events) {
23012605 return false;
@@ -2319,7 +2623,7 @@
23202624
23212625 };
23222626
2323 - this._remove_html5_events = function() {
 2627+ _remove_html5_events = function() {
23242628
23252629 // Remove event listeners
23262630
@@ -2348,10 +2652,11 @@
23492653 this._onload = function(nSuccess) {
23502654
23512655
2352 - var fN = 'SMSound._onload(): ', loadOK = !!(nSuccess);
 2656+ var fN, loadOK = !!(nSuccess);
23532657 _s._wD(fN + '"' + _t.sID + '"' + (loadOK?' loaded.':' failed to load? - ' + _t.url), (loadOK?1:2));
 2658+
23542659 // <d>
2355 -
 2660+ fN = 'SMSound._onload(): ';
23562661 if (!loadOK && !_t.isHTML5) {
23572662 if (_s.sandbox.noRemote === true) {
23582663 _s._wD(fN + _str('noNet'), 1);
@@ -2376,8 +2681,6 @@
23772682
23782683 this._onbufferchange = function(nIsBuffering) {
23792684
2380 - var fN = 'SMSound._onbufferchange()';
2381 -
23822685 if (_t.playState === 0) {
23832686 // ignore if not playing
23842687 return false;
@@ -2389,7 +2692,7 @@
23902693
23912694 _t.isBuffering = (nIsBuffering === 1);
23922695 if (_t._iO.onbufferchange) {
2393 - _s._wD(fN + ': ' + nIsBuffering);
 2696+ _s._wD('SMSound._onbufferchange(): ' + nIsBuffering);
23942697 _t._iO.onbufferchange.apply(_t);
23952698 }
23962699
@@ -2402,7 +2705,7 @@
24032706 * to continue playing / loading the audio file.
24042707 */
24052708
2406 - this._onsuspend = function () {
 2709+ this._onsuspend = function() {
24072710
24082711 if (_t._iO.onsuspend) {
24092712 _s._wD('SMSound._onsuspend()');
@@ -2435,14 +2738,20 @@
24362739
24372740 // store local copy before it gets trashed..
24382741 var _io_onfinish = _t._iO.onfinish;
 2742+
24392743 _t._onbufferchange(0);
2440 - _t.resetOnPosition(0);
 2744+ _t._resetOnPosition(0);
24412745
24422746 // reset some state items
24432747 if (_t.instanceCount) {
24442748
24452749 _t.instanceCount--;
 2750+
24462751 if (!_t.instanceCount) {
 2752+
 2753+ // remove onPosition listeners, if any
 2754+ _detachOnPosition();
 2755+
24472756 // reset instance options
24482757 _t.playState = 0;
24492758 _t.paused = false;
@@ -2450,6 +2759,7 @@
24512760 _t.instanceOptions = {};
24522761 _t._iO = {};
24532762 _stop_html5_timer();
 2763+
24542764 }
24552765
24562766 if (!_t.instanceCount || _t._iO.multiShotEvents) {
@@ -2466,16 +2776,18 @@
24672777
24682778 this._whileloading = function(nBytesLoaded, nBytesTotal, nDuration, nBufferLength) {
24692779
 2780+ var _iO = _t._iO;
 2781+
24702782 _t.bytesLoaded = nBytesLoaded;
24712783 _t.bytesTotal = nBytesTotal;
24722784 _t.duration = Math.floor(nDuration);
24732785 _t.bufferLength = nBufferLength;
24742786
2475 - if (!_t._iO.isMovieStar) {
 2787+ if (!_iO.isMovieStar) {
24762788
2477 - if (_t._iO.duration) {
 2789+ if (_iO.duration) {
24782790 // use options, if specified and larger
2479 - _t.durationEstimate = (_t.duration > _t._iO.duration) ? _t.duration : _t._iO.duration;
 2791+ _t.durationEstimate = (_t.duration > _iO.duration) ? _t.duration : _iO.duration;
24802792 } else {
24812793 _t.durationEstimate = parseInt((_t.bytesTotal / _t.bytesLoaded) * _t.duration, 10);
24822794
@@ -2485,15 +2797,15 @@
24862798 _t.durationEstimate = _t.duration;
24872799 }
24882800
2489 - if (_t.readyState !== 3 && _t._iO.whileloading) {
2490 - _t._iO.whileloading.apply(_t);
 2801+ if (_t.readyState !== 3 && _iO.whileloading) {
 2802+ _iO.whileloading.apply(_t);
24912803 }
24922804
24932805 } else {
24942806
24952807 _t.durationEstimate = _t.duration;
2496 - if (_t.readyState !== 3 && _t._iO.whileloading) {
2497 - _t._iO.whileloading.apply(_t);
 2808+ if (_t.readyState !== 3 && _iO.whileloading) {
 2809+ _iO.whileloading.apply(_t);
24982810 }
24992811
25002812 }
@@ -2502,31 +2814,33 @@
25032815
25042816 this._whileplaying = function(nPosition, oPeakData, oWaveformDataLeft, oWaveformDataRight, oEQData) {
25052817
 2818+ var _iO = _t._iO;
 2819+
25062820 if (isNaN(nPosition) || nPosition === null) {
25072821 // flash safety net
25082822 return false;
25092823 }
25102824
25112825 _t.position = nPosition;
2512 - _t.processOnPosition();
 2826+ _t._processOnPosition();
25132827
25142828 if (!_t.isHTML5 && _fV > 8) {
25152829
2516 - if (_t._iO.usePeakData && typeof oPeakData !== 'undefined' && oPeakData) {
 2830+ if (_iO.usePeakData && typeof oPeakData !== 'undefined' && oPeakData) {
25172831 _t.peakData = {
25182832 left: oPeakData.leftPeak,
25192833 right: oPeakData.rightPeak
25202834 };
25212835 }
25222836
2523 - if (_t._iO.useWaveformData && typeof oWaveformDataLeft !== 'undefined' && oWaveformDataLeft) {
 2837+ if (_iO.useWaveformData && typeof oWaveformDataLeft !== 'undefined' && oWaveformDataLeft) {
25242838 _t.waveformData = {
25252839 left: oWaveformDataLeft.split(','),
25262840 right: oWaveformDataRight.split(',')
25272841 };
25282842 }
25292843
2530 - if (_t._iO.useEQData) {
 2844+ if (_iO.useEQData) {
25312845 if (typeof oEQData !== 'undefined' && oEQData && oEQData.leftEQ) {
25322846 var eqLeft = oEQData.leftEQ.split(',');
25332847 _t.eqData = eqLeft;
@@ -2546,9 +2860,9 @@
25472861 _t._onbufferchange(0);
25482862 }
25492863
2550 - if (_t._iO.whileplaying) {
 2864+ if (_iO.whileplaying) {
25512865 // flash may call after actual finish
2552 - _t._iO.whileplaying.apply(_t);
 2866+ _iO.whileplaying.apply(_t);
25532867 }
25542868
25552869 }
@@ -2557,16 +2871,47 @@
25582872
25592873 };
25602874
2561 - this._onid3 = function(oID3PropNames, oID3Data) {
 2875+ this._onmetadata = function(oMDProps, oMDData) {
25622876
2563 - // oID3PropNames: string array (names)
2564 - // ID3Data: string array (data)
 2877+ /**
 2878+ * internal: flash 9 + NetStream (MovieStar/RTMP-only) feature
 2879+ * RTMP may include song title, MovieStar content may include encoding info
 2880+ *
 2881+ * @param {array} oMDProps (names)
 2882+ * @param {array} oMDData (values)
 2883+ */
 2884+
 2885+ _s._wD('SMSound._onmetadata(): "' + this.sID + '" metadata received.');
 2886+
 2887+ var oData = {}, i, j;
 2888+
 2889+ for (i = 0, j = oMDProps.length; i < j; i++) {
 2890+ oData[oMDProps[i]] = oMDData[i];
 2891+ }
 2892+ _t.metadata = oData;
 2893+
 2894+ if (_t._iO.onmetadata) {
 2895+ _t._iO.onmetadata.apply(_t);
 2896+ }
 2897+
 2898+ };
 2899+
 2900+ this._onid3 = function(oID3Props, oID3Data) {
 2901+
 2902+ /**
 2903+ * internal: flash 8 + flash 9 ID3 feature
 2904+ * may include artist, song title etc.
 2905+ *
 2906+ * @param {array} oID3Props (names)
 2907+ * @param {array} oID3Data (values)
 2908+ */
 2909+
25652910 _s._wD('SMSound._onid3(): "' + this.sID + '" ID3 data received.');
25662911
25672912 var oData = [], i, j;
25682913
2569 - for (i = 0, j = oID3PropNames.length; i < j; i++) {
2570 - oData[oID3PropNames[i]] = oID3Data[i];
 2914+ for (i = 0, j = oID3Props.length; i < j; i++) {
 2915+ oData[oID3Props[i]] = oID3Data[i];
25712916 }
25722917 _t.id3 = _mixin(_t.id3, oData);
25732918
@@ -2580,9 +2925,8 @@
25812926
25822927 this._onconnect = function(bSuccess) {
25832928
2584 - var fN = 'SMSound._onconnect(): ';
25852929 bSuccess = (bSuccess === 1);
2586 - _s._wD(fN+'"'+_t.sID+'"'+(bSuccess?' connected.':' failed to connect? - '+_t.url), (bSuccess?1:2));
 2930+ _s._wD('SMSound._onconnect(): "'+_t.sID+'"'+(bSuccess?' connected.':' failed to connect? - '+_t.url), (bSuccess?1:2));
25872931 _t.connected = bSuccess;
25882932
25892933 if (bSuccess) {
@@ -2599,7 +2943,7 @@
26002944 }
26012945
26022946 if (_t._iO.onconnect) {
2603 - _t._iO.onconnect.apply(_t,[bSuccess]);
 2947+ _t._iO.onconnect.apply(_t, [bSuccess]);
26042948 }
26052949
26062950 }
@@ -2682,6 +3026,7 @@
26833027 } else if (len === 3) {
26843028 args.push(false);
26853029 }
 3030+
26863031 return args;
26873032
26883033 }
@@ -2729,10 +3074,12 @@
27303075
27313076 return function(e) {
27323077
2733 - if (!this._t || !this._t._a) {
 3078+ var t = this._t;
 3079+
 3080+ if (!t || !t._a) {
27343081 // <d>
2735 - if (this._t && this._t.sID) {
2736 - _s._wD(_h5+'ignoring '+e.type+': '+this._t.sID);
 3082+ if (t && t.sID) {
 3083+ _s._wD(_h5+'ignoring '+e.type+': '+t.sID);
27373084 } else {
27383085 _s._wD(_h5+'ignoring '+e.type);
27393086 }
@@ -2760,18 +3107,20 @@
27613108
27623109 canplay: _html5_event(function(e) {
27633110
2764 - if (this._t._html5_canplay) {
 3111+ var t = this._t;
 3112+
 3113+ if (t._html5_canplay) {
27653114 // this event has already fired. ignore.
27663115 return true;
27673116 }
27683117
2769 - this._t._html5_canplay = true;
2770 - _s._wD(_h5+'canplay: '+this._t.sID+', '+this._t.url);
2771 - this._t._onbufferchange(0);
2772 - var position1K = (!isNaN(this._t.position)?this._t.position/1000:null);
 3118+ t._html5_canplay = true;
 3119+ _s._wD(_h5+'canplay: '+t.sID+', '+t.url);
 3120+ t._onbufferchange(0);
 3121+ var position1K = (!isNaN(t.position)?t.position/1000:null);
27733122
27743123 // set the position if position was set before the sound loaded
2775 - if (this._t.position && this.currentTime !== position1K) {
 3124+ if (t.position && this.currentTime !== position1K) {
27763125 _s._wD(_h5+'canplay: setting position to '+position1K);
27773126 try {
27783127 this.currentTime = position1K;
@@ -2780,15 +3129,22 @@
27813130 }
27823131 }
27833132
 3133+ // hack for HTML5 from/to case
 3134+ if (t._iO._oncanplay) {
 3135+ t._iO._oncanplay();
 3136+ }
 3137+
27843138 }),
27853139
27863140 load: _html5_event(function(e) {
27873141
2788 - if (!this._t.loaded) {
2789 - this._t._onbufferchange(0);
 3142+ var t = this._t;
 3143+
 3144+ if (!t.loaded) {
 3145+ t._onbufferchange(0);
27903146 // should be 1, and the same
2791 - this._t._whileloading(this._t.bytesTotal, this._t.bytesTotal, this._t._get_html5_duration());
2792 - this._t._onload(true);
 3147+ t._whileloading(t.bytesTotal, t.bytesTotal, t._get_html5_duration());
 3148+ t._onload(true);
27933149 }
27943150
27953151 }),
@@ -2801,9 +3157,11 @@
28023158
28033159 ended: _html5_event(function(e) {
28043160
2805 - _s._wD(_h5+'ended: '+this._t.sID);
2806 - this._t._onfinish();
 3161+ var t = this._t;
28073162
 3163+ _s._wD(_h5+'ended: '+t.sID);
 3164+ t._onfinish();
 3165+
28083166 }),
28093167
28103168 error: _html5_event(function(e) {
@@ -2854,10 +3212,9 @@
28553213
28563214 }),
28573215
2858 - // TODO: verify if this is actually implemented anywhere yet.
28593216 playing: _html5_event(function(e) {
28603217
2861 - _s._wD(_h5+'playing: '+this._t.sID+', '+this._t.url);
 3218+ _s._wD(_h5+'playing: '+this._t.sID);
28623219
28633220 // once play starts, no buffering
28643221 this._t._onbufferchange(0);
@@ -2866,7 +3223,9 @@
28673224
28683225 progress: _html5_event(function(e) {
28693226
2870 - if (this._t.loaded) {
 3227+ var t = this._t;
 3228+
 3229+ if (t.loaded) {
28713230 return false;
28723231 }
28733232
@@ -2902,7 +3261,7 @@
29033262 }
29043263
29053264 if (isProgress && !isNaN(loaded)) {
2906 - _s._wD(_h5+'progress: '+this._t.sID+': ' + Math.floor(loaded*100)+'% loaded');
 3265+ _s._wD(_h5+'progress: '+t.sID+': ' + Math.floor(loaded*100)+'% loaded');
29073266 }
29083267 // </d>
29093268
@@ -2911,8 +3270,8 @@
29123271 if (!isNaN(loaded)) {
29133272
29143273 // if progress, likely not buffering
2915 - this._t._onbufferchange(0);
2916 - this._t._whileloading(loaded, total, this._t._get_html5_duration());
 3274+ t._onbufferchange(0);
 3275+ t._whileloading(loaded, total, t._get_html5_duration());
29173276 if (loaded && total && loaded === total) {
29183277 // in case "onload" doesn't fire (eg. gecko 1.9.2)
29193278 _html5_events.load.call(this, e);
@@ -2931,10 +3290,11 @@
29323291 suspend: _html5_event(function(e) {
29333292
29343293 // download paused/stopped, may have finished (eg. onload)
 3294+ var t = this._t;
29353295
2936 - _s._wD(_h5+'suspend: '+this._t.sID);
 3296+ _s._wD(_h5+'suspend: '+t.sID);
29373297 _html5_events.progress.call(this, e);
2938 - this._t._onsuspend();
 3298+ t._onsuspend();
29393299
29403300 }),
29413301
@@ -2952,11 +3312,13 @@
29533313
29543314 waiting: _html5_event(function(e) {
29553315
 3316+ var t = this._t;
 3317+
29563318 // see also: seeking
2957 - _s._wD(_h5+'waiting: '+this._t.sID);
 3319+ _s._wD(_h5+'waiting: '+t.sID);
29583320
29593321 // playback faster than download rate, etc.
2960 - this._t._onbufferchange(1);
 3322+ t._onbufferchange(1);
29613323
29623324 })
29633325
@@ -3126,7 +3488,6 @@
31273489 support['audio/'+aF[item].related[i]] = support[item];
31283490 _s.html5[aF[item].related[i]] = support[item];
31293491 _s.flash[aF[item].related[i]] = support[item];
3130 -
31313492 }
31323493 }
31333494 }
@@ -3171,7 +3532,7 @@
31723533 queue: _sm + ': Queueing %s handler',
31733534 smFail: _sm + ': Failed to initialise.',
31743535 smError: 'SMSound.load(): Exception: JS-Flash communication failed, or JS error.',
3175 - fbTimeout: 'No flash response, applying .'+_s.swfCSS.swfTimedout+' CSS..',
 3536+ fbTimeout: 'No flash response, applying .'+_swfCSS.swfTimedout+' CSS..',
31763537 fbLoaded: 'Flash loaded',
31773538 fbHandler: _smc+'flashBlockHandler()',
31783539 manURL: 'SMSound.load(): Using manually-assigned URL',
@@ -3355,11 +3716,11 @@
33563717
33573718 _setPolling = function(bPolling, bHighPerformance) {
33583719
3359 - if (!_s.o) {
 3720+ if (!_flash) {
33603721 return false;
33613722 }
33623723
3363 - _s.o._setPolling(bPolling, bHighPerformance);
 3724+ _flash._setPolling(bPolling, bHighPerformance);
33643725
33653726 };
33663727
@@ -3379,7 +3740,7 @@
33803741
33813742 var oD, oDebug, oTarget, oToggle, tmp;
33823743
3383 - if (_s.debugMode && !_id(_s.debugID) && ((!_hasConsole || !_s.useConsole) || (_s.useConsole && _hasConsole && !_s.consoleOnly))) {
 3744+ if (_s.debugMode && !_id(_s.debugID) && (!_hasConsole || !_s.useConsole || !_s.consoleOnly)) {
33843745
33853746 oD = _doc.createElement('div');
33863747 oD.id = _s.debugID + '-toggle';
@@ -3499,15 +3860,15 @@
35003861 var css = [];
35013862
35023863 if (_s.debugMode) {
3503 - css.push(_s.swfCSS.sm2Debug);
 3864+ css.push(_swfCSS.sm2Debug);
35043865 }
35053866
35063867 if (_s.debugFlash) {
3507 - css.push(_s.swfCSS.flashDebug);
 3868+ css.push(_swfCSS.flashDebug);
35083869 }
35093870
35103871 if (_s.useHighPerformance) {
3511 - css.push(_s.swfCSS.highPerf);
 3872+ css.push(_swfCSS.highPerf);
35123873 }
35133874
35143875 return css.join(' ');
@@ -3520,7 +3881,7 @@
35213882
35223883 var name = _str('fbHandler'),
35233884 p = _s.getMoviePercent(),
3524 - css = _s.swfCSS,
 3885+ css = _swfCSS,
35253886 error = {type:'FLASHBLOCK'};
35263887
35273888 if (_s.html5Only) {
@@ -3545,9 +3906,11 @@
35463907
35473908 // SM2 loaded OK (or recovered)
35483909
 3910+ // <d>
35493911 if (_s.didFlashBlock) {
35503912 _s._wD(name+': Unblocked');
35513913 }
 3914+ // </d>
35523915
35533916 if (_s.oMC) {
35543917 _s.oMC.className = [_getSWFCSS(), css.swfDefault, css.swfLoaded + (_s.didFlashBlock?' '+css.swfUnblocked:'')].join(' ');
@@ -3754,22 +4117,134 @@
37554118
37564119 };
37574120
 4121+ _parseURL = function(url) {
 4122+
 4123+ /**
 4124+ * Internal: Finds and returns the first playable URL (or failing that, the first URL.)
 4125+ * @param {string or array} url A single URL string, OR, an array of URL strings or {url:'/path/to/resource', type:'audio/mp3'} objects.
 4126+ */
 4127+
 4128+ var i, j, result = 0;
 4129+
 4130+ if (url instanceof Array) {
 4131+
 4132+ // find the first good one
 4133+ for (i=0, j=url.length; i<j; i++) {
 4134+
 4135+ if (url[i] instanceof Object) {
 4136+ // MIME check
 4137+ if (_s.canPlayMIME(url[i].type)) {
 4138+ result = i;
 4139+ break;
 4140+ }
 4141+
 4142+ } else if (_s.canPlayURL(url[i])) {
 4143+ // URL string check
 4144+ result = i;
 4145+ break;
 4146+ }
 4147+
 4148+ }
 4149+
 4150+ // normalize to string
 4151+ if (url[result].url) {
 4152+ url[result] = url[result].url;
 4153+ }
 4154+
 4155+ return url[result];
 4156+
 4157+ } else {
 4158+
 4159+ // single URL case
 4160+ return url;
 4161+
 4162+ }
 4163+
 4164+ };
 4165+
 4166+
37584167 _startTimer = function(oSound) {
37594168
 4169+ /**
 4170+ * attach a timer to this sound, and start an interval if needed
 4171+ */
 4172+
37604173 if (!oSound._hasTimer) {
 4174+
37614175 oSound._hasTimer = true;
 4176+
 4177+ if (!_likesHTML5 && _s.html5PollingInterval) {
 4178+
 4179+ if (_h5IntervalTimer === null && _h5TimerCount === 0) {
 4180+
 4181+ _h5IntervalTimer = window.setInterval(_timerExecute, _s.html5PollingInterval);
 4182+
 4183+ }
 4184+
 4185+ _h5TimerCount++;
 4186+
 4187+ }
 4188+
37624189 }
37634190
37644191 };
37654192
37664193 _stopTimer = function(oSound) {
37674194
 4195+ /**
 4196+ * detach a timer
 4197+ */
 4198+
37684199 if (oSound._hasTimer) {
 4200+
37694201 oSound._hasTimer = false;
 4202+
 4203+ if (!_likesHTML5 && _s.html5PollingInterval) {
 4204+
 4205+ // interval will stop itself at next execution.
 4206+
 4207+ _h5TimerCount--;
 4208+
 4209+ }
 4210+
37704211 }
37714212
37724213 };
37734214
 4215+ _timerExecute = function() {
 4216+
 4217+ /**
 4218+ * manual polling for HTML5 progress events, ie., whileplaying() (can achieve greater precision than conservative default HTML5 interval)
 4219+ */
 4220+
 4221+ var i, j;
 4222+
 4223+ if (_h5IntervalTimer !== null && !_h5TimerCount) {
 4224+
 4225+ // no active timers, stop polling interval.
 4226+
 4227+ window.clearInterval(_h5IntervalTimer);
 4228+
 4229+ _h5IntervalTimer = null;
 4230+
 4231+ return false;
 4232+
 4233+ }
 4234+
 4235+ // check all HTML5 sounds with timers
 4236+
 4237+ for (i = _s.soundIDs.length; i--;) {
 4238+
 4239+ if (_s.sounds[_s.soundIDs[i]].isHTML5 && _s.sounds[_s.soundIDs[i]]._hasTimer) {
 4240+
 4241+ _s.sounds[_s.soundIDs[i]]._onTimer();
 4242+
 4243+ }
 4244+
 4245+ }
 4246+
 4247+ };
 4248+
37744249 _catchError = function(options) {
37754250
37764251 options = (typeof options !== 'undefined' ? options : {});
@@ -3847,16 +4322,17 @@
38484323
38494324 };
38504325
3851 - this._externalInterfaceOK = function(flashDate) {
 4326+ this._externalInterfaceOK = function(flashDate, swfVersion) {
38524327
38534328 // flash callback confirming flash loaded, EI working etc.
38544329 // flashDate = approx. timing/delay info for JS/flash bridge
 4330+ // swfVersion: SWF build string
38554331
38564332 if (_s.swfLoaded) {
38574333 return false;
38584334 }
38594335
3860 - var eiTime = new Date().getTime();
 4336+ var e, eiTime = new Date().getTime();
38614337
38624338 _s._wD(_smc+'externalInterfaceOK()' + (flashDate?' (~' + (eiTime - flashDate) + ' ms)':''));
38634339 _debugTS('swf', true);
@@ -3868,6 +4344,23 @@
38694345 _badSafariFix();
38704346 }
38714347
 4348+ // complain if JS + SWF build/version strings don't match, excluding +DEV builds
 4349+ // <d>
 4350+ if (!swfVersion || swfVersion.replace(/\+dev/i,'') !== _s.versionNumber.replace(/\+dev/i, '')) {
 4351+
 4352+ e = _sm + ': Fatal: JavaScript file build "' + _s.versionNumber + '" does not match Flash SWF build "' + swfVersion + '" at ' + _s.url + '. Ensure both are up-to-date.';
 4353+
 4354+ // escape flash -> JS stack so this error fires in window.
 4355+ setTimeout(function versionMismatch() {
 4356+ throw new Error(e);
 4357+ }, 0);
 4358+
 4359+ // exit, init will fail with timeout
 4360+ return false;
 4361+
 4362+ }
 4363+ // </d>
 4364+
38724365 if (_isIE) {
38734366 // IE needs a timeout OR delay until window.onload - may need TODO: investigating
38744367 setTimeout(_init, 100);
@@ -3939,7 +4432,6 @@
39404433 * does not apply when using high performance (position:fixed means on-screen), OR infinite flash load timeout
39414434 * wmode breaks IE 8 on Vista + Win7 too in some cases, as of January 2011 (?)
39424435 */
3943 - _s.specialWmodeCase = true;
39444436 _wDS('spcWmode');
39454437 _s.wmode = null;
39464438 }
@@ -4008,7 +4500,7 @@
40094501 if (!_s.oMC.id) {
40104502
40114503 _s.oMC.id = _s.movieID;
4012 - _s.oMC.className = _s.swfCSS.swfDefault + ' ' + extraClass;
 4504+ _s.oMC.className = _swfCSS.swfDefault + ' ' + extraClass;
40134505 s = null;
40144506 oEl = null;
40154507
@@ -4059,7 +4551,7 @@
40604552 oTarget.appendChild(_s.oMC);
40614553 if (_isIE) {
40624554 oEl = _s.oMC.appendChild(_doc.createElement('div'));
4063 - oEl.className = _s.swfCSS.swfBox;
 4555+ oEl.className = _swfCSS.swfBox;
40644556 oEl.innerHTML = movieHTML;
40654557 }
40664558 _appendSuccess = true;
@@ -4071,11 +4563,11 @@
40724564
40734565 // SM2 container is already in the document (eg. flashblock use case)
40744566 sClass = _s.oMC.className;
4075 - _s.oMC.className = (sClass?sClass+' ':_s.swfCSS.swfDefault) + (extraClass?' '+extraClass:'');
 4567+ _s.oMC.className = (sClass?sClass+' ':_swfCSS.swfDefault) + (extraClass?' '+extraClass:'');
40764568 _s.oMC.appendChild(oMovie);
40774569 if (_isIE) {
40784570 oEl = _s.oMC.appendChild(_doc.createElement('div'));
4079 - oEl.className = _s.swfCSS.swfBox;
 4571+ oEl.className = _swfCSS.swfBox;
40804572 oEl.innerHTML = movieHTML;
40814573 }
40824574 _appendSuccess = true;
@@ -4101,14 +4593,14 @@
41024594
41034595 // attempt to get, or create, movie
41044596 // may already exist
4105 - if (_s.o) {
 4597+ if (_flash) {
41064598 return false;
41074599 }
41084600
41094601 // inline markup case
4110 - _s.o = _s.getMovie(_s.id);
 4602+ _flash = _s.getMovie(_s.id);
41114603
4112 - if (!_s.o) {
 4604+ if (!_flash) {
41134605 if (!_oRemoved) {
41144606 // try to create
41154607 _createMovie(_s.id, _s.url);
@@ -4122,11 +4614,11 @@
41234615 _oRemoved = null;
41244616 _didAppend = true;
41254617 }
4126 - _s.o = _s.getMovie(_s.id);
 4618+ _flash = _s.getMovie(_s.id);
41274619 }
41284620
41294621 // <d>
4130 - if (_s.o) {
 4622+ if (_flash) {
41314623 _wDS('waitEI');
41324624 }
41334625 // </d>
@@ -4287,7 +4779,7 @@
42884780
42894781 if (_disabled || bNoDisable) {
42904782 if (_s.useFlashBlock && _s.oMC) {
4291 - _s.oMC.className = _getSWFCSS() + ' ' + (_s.getMoviePercent() === null?_s.swfCSS.swfTimedout:_s.swfCSS.swfError);
 4783+ _s.oMC.className = _getSWFCSS() + ' ' + (_s.getMoviePercent() === null?_swfCSS.swfTimedout:_swfCSS.swfError);
42924784 }
42934785 _processOnEvents({type:'ontimeout', error:error});
42944786 _debugTS('onload', false);
@@ -4347,7 +4839,7 @@
43484840 _wDS('flashJS');
43494841
43504842 // attempt to talk to Flash
4351 - _s.o._externalInterfaceTest(false);
 4843+ _flash._externalInterfaceTest(false);
43524844
43534845 // apply user-specified polling interval, OR, if "high performance" set, faster vs. default polling
43544846 // (determines frequency of whileloading/whileplaying callbacks, effectively driving UI framerates)
@@ -4355,7 +4847,7 @@
43564848
43574849 if (!_s.debugMode) {
43584850 // stop the SWF from making debug output calls to JS
4359 - _s.o._disableDebug();
 4851+ _flash._disableDebug();
43604852 }
43614853
43624854 _s.enabled = true;
@@ -4467,6 +4959,12 @@
44684960
44694961 };
44704962
 4963+ _winOnLoad = function() {
 4964+ // catch edge case of _initComplete() firing after window.load()
 4965+ _windowLoaded = true;
 4966+ _event.remove(_win, 'load', _winOnLoad);
 4967+ };
 4968+
44714969 // sniff up-front
44724970 _detectFlash();
44734971
@@ -4474,7 +4972,9 @@
44754973 _event.add(_win, 'focus', _handleFocus);
44764974 _event.add(_win, 'load', _handleFocus);
44774975 _event.add(_win, 'load', _delayWaitForEI);
 4976+ _event.add(_win, 'load', _winOnLoad);
44784977
 4978+
44794979 if (_isSafari && _tryInitOnFocus) {
44804980 // massive Safari 3.1 focus detection hack
44814981 _event.add(_win, 'mousemove', _handleFocus);
Index: trunk/extensions/SoundManager2Button/script/soundmanager2-nodebug.js
@@ -8,7 +8,7 @@
99 * Code provided under the BSD License:
1010 * http://schillmania.com/projects/soundmanager2/license.txt
1111 *
12 - * V2.97a.20111030
 12+ * V2.97a.20111220
1313 */
1414
1515 /*global window, SM2_DEFER, sm2Debugger, console, document, navigator, setTimeout, setInterval, clearInterval, Audio */
@@ -21,11 +21,12 @@
2222 this.debugMode = false;
2323 this.debugFlash = false;
2424 this.useConsole = true;
25 - this.consoleOnly = false;
 25+ this.consoleOnly = true;
2626 this.waitForWindowLoad = false;
2727 this.bgColor = '#ffffff';
2828 this.useHighPerformance = false;
2929 this.flashPollingInterval = null;
 30+ this.html5PollingInterval = null;
3031 this.flashLoadTimeout = 1000;
3132 this.wmode = null;
3233 this.allowScriptAccess = 'always';
@@ -55,8 +56,8 @@
5657 };
5758 this.defaultOptions = {
5859 'autoLoad': false,
59 - 'stream': true,
6060 'autoPlay': false,
 61+ 'from': null,
6162 'loops': 1,
6263 'onid3': null,
6364 'onload': null,
@@ -65,6 +66,7 @@
6667 'onpause': null,
6768 'onresume': null,
6869 'whileplaying': null,
 70+ 'onposition': null,
6971 'onstop': null,
7072 'onfailure': null,
7173 'onfinish': null,
@@ -72,6 +74,8 @@
7375 'multiShotEvents': false,
7476 'position': null,
7577 'pan': 0,
 78+ 'stream': true,
 79+ 'to': null,
7680 'type': null,
7781 'usePolicyFile': false,
7882 'volume': 100
@@ -92,32 +96,19 @@
9397 };
9498 this.movieID = 'sm2-container';
9599 this.id = (smID || 'sm2movie');
96 - this.swfCSS = {
97 - 'swfBox': 'sm2-object-box',
98 - 'swfDefault': 'movieContainer',
99 - 'swfError': 'swf_error',
100 - 'swfTimedout': 'swf_timedout',
101 - 'swfLoaded': 'swf_loaded',
102 - 'swfUnblocked': 'swf_unblocked',
103 - 'sm2Debug': 'sm2_debug',
104 - 'highPerf': 'high_performance',
105 - 'flashDebug': 'flash_debug'
106 - };
107100 this.debugID = 'soundmanager-debug';
108101 this.debugURLParam = /([#?&])debug=1/i;
109 - this.versionNumber = 'V2.97a.20111030';
 102+ this.versionNumber = 'V2.97a.20111220';
110103 this.version = null;
111104 this.movieURL = null;
112105 this.url = (smURL || null);
113106 this.altURL = null;
114107 this.swfLoaded = false;
115108 this.enabled = false;
116 - this.o = null;
117109 this.oMC = null;
118110 this.sounds = {};
119111 this.soundIDs = [];
120112 this.muted = false;
121 - this.specialWmodeCase = false;
122113 this.didFlashBlock = false;
123114 this.filePattern = null;
124115 this.filePatterns = {
@@ -147,10 +138,11 @@
148139 this.html5Only = false;
149140 this.ignoreFlash = false;
150141 var SMSound,
151 - _s = this, _sm = 'soundManager', _smc = _sm+'::', _h5 = 'HTML5::', _id, _ua = navigator.userAgent, _win = window, _wl = _win.location.href.toString(), _doc = document, _doNothing, _init, _fV, _on_queue = [], _debugOpen = true, _debugTS, _didAppend = false, _appendSuccess = false, _didInit = false, _disabled = false, _windowLoaded = false, _wDS, _wdCount = 0, _initComplete, _mixin, _addOnEvent, _processOnEvents, _initUserOnload, _delayWaitForEI, _waitForEI, _setVersionInfo, _handleFocus, _strings, _initMovie, _domContentLoaded, _didDCLoaded, _getDocument, _createMovie, _catchError, _setPolling, _initDebug, _debugLevels = ['log', 'info', 'warn', 'error'], _defaultFlashVersion = 8, _disableObject, _failSafely, _normalizeMovieURL, _oRemoved = null, _oRemovedHTML = null, _str, _flashBlockHandler, _getSWFCSS, _toggleDebug, _loopFix, _policyFix, _complain, _idCheck, _waitingForEI = false, _initPending = false, _smTimer, _onTimer, _startTimer, _stopTimer, _needsFlash = null, _featureCheck, _html5OK, _html5CanPlay, _html5Ext, _html5Unload, _domContentLoadedIE, _testHTML5, _event, _slice = Array.prototype.slice, _useGlobalHTML5Audio = false, _hasFlash, _detectFlash, _badSafariFix, _html5_events, _showSupport,
 142+ _s = this, _flash = null, _sm = 'soundManager', _smc = _sm+'::', _h5 = 'HTML5::', _id, _ua = navigator.userAgent, _win = window, _wl = _win.location.href.toString(), _doc = document, _doNothing, _init, _fV, _on_queue = [], _debugOpen = true, _debugTS, _didAppend = false, _appendSuccess = false, _didInit = false, _disabled = false, _windowLoaded = false, _wDS, _wdCount = 0, _initComplete, _mixin, _addOnEvent, _processOnEvents, _initUserOnload, _delayWaitForEI, _waitForEI, _setVersionInfo, _handleFocus, _strings, _initMovie, _domContentLoaded, _winOnLoad, _didDCLoaded, _getDocument, _createMovie, _catchError, _setPolling, _initDebug, _debugLevels = ['log', 'info', 'warn', 'error'], _defaultFlashVersion = 8, _disableObject, _failSafely, _normalizeMovieURL, _oRemoved = null, _oRemovedHTML = null, _str, _flashBlockHandler, _getSWFCSS, _swfCSS, _toggleDebug, _loopFix, _policyFix, _complain, _idCheck, _waitingForEI = false, _initPending = false, _smTimer, _onTimer, _startTimer, _stopTimer, _timerExecute, _h5TimerCount = 0, _h5IntervalTimer = null, _parseURL,
 143+ _needsFlash = null, _featureCheck, _html5OK, _html5CanPlay, _html5Ext, _html5Unload, _domContentLoadedIE, _testHTML5, _event, _slice = Array.prototype.slice, _useGlobalHTML5Audio = false, _hasFlash, _detectFlash, _badSafariFix, _html5_events, _showSupport,
152144 _is_iDevice = _ua.match(/(ipad|iphone|ipod)/i), _is_firefox = _ua.match(/firefox/i), _is_android = _ua.match(/droid/i), _isIE = _ua.match(/msie/i), _isWebkit = _ua.match(/webkit/i), _isSafari = (_ua.match(/safari/i) && !_ua.match(/chrome/i)), _isOpera = (_ua.match(/opera/i)),
153145 _likesHTML5 = (_ua.match(/(mobile|pre\/|xoom)/i) || _is_iDevice),
154 - _isBadSafari = (!_wl.match(/usehtml5audio/i) && !_wl.match(/sm2\-ignorebadua/i) && _isSafari && _ua.match(/OS X 10_6_([3-7])/i)),
 146+ _isBadSafari = (!_wl.match(/usehtml5audio/i) && !_wl.match(/sm2\-ignorebadua/i) && _isSafari && !_ua.match(/silk/i) && _ua.match(/OS X 10_6_([3-7])/i)),
155147 _hasConsole = (typeof console !== 'undefined' && typeof console.log !== 'undefined'), _isFocused = (typeof _doc.hasFocus !== 'undefined'?_doc.hasFocus():null), _tryInitOnFocus = (_isSafari && typeof _doc.hasFocus === 'undefined'), _okToDisable = !_tryInitOnFocus, _flashMIME = /(mp3|mp4|mpa)/i,
156148 _emptyURL = 'about:blank',
157149 _overHTTP = (_doc.location?_doc.location.protocol.match(/http/i):null),
@@ -161,6 +153,17 @@
162154 this.mimePattern = /^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;
163155 this.useAltURL = !_overHTTP;
164156 this._global_a = null;
 157+ _swfCSS = {
 158+ 'swfBox': 'sm2-object-box',
 159+ 'swfDefault': 'movieContainer',
 160+ 'swfError': 'swf_error',
 161+ 'swfTimedout': 'swf_timedout',
 162+ 'swfLoaded': 'swf_loaded',
 163+ 'swfUnblocked': 'swf_unblocked',
 164+ 'sm2Debug': 'sm2_debug',
 165+ 'highPerf': 'high_performance',
 166+ 'flashDebug': 'flash_debug'
 167+ };
165168 if (_likesHTML5) {
166169 _s.useHTML5Audio = true;
167170 _s.preferFlash = false;
@@ -177,10 +180,10 @@
178181 return _id(smID) || _doc[smID] || _win[smID];
179182 };
180183 this.createSound = function(oOptions) {
181 - var _cs = _sm+'.createSound(): ',
 184+ var _cs, _cs_string,
182185 thisOptions = null, oSound = null, _tO = null;
183186 if (!_didInit || !_s.ok()) {
184 - _complain(_cs + _str(!_didInit?'notReady':'notOK'));
 187+ _complain(_cs_string);
185188 return false;
186189 }
187190 if (arguments.length === 2) {
@@ -190,6 +193,7 @@
191194 };
192195 }
193196 thisOptions = _mixin(oOptions);
 197+ thisOptions.url = _parseURL(thisOptions.url);
194198 _tO = thisOptions;
195199 if (_idCheck(_tO.id, true)) {
196200 return _s.sounds[_tO.id];
@@ -217,9 +221,9 @@
218222 _tO = _policyFix(_tO, _cs);
219223 oSound = make();
220224 if (_fV === 8) {
221 - _s.o._createSound(_tO.id, _tO.loops||1, _tO.usePolicyFile);
 225+ _flash._createSound(_tO.id, _tO.loops||1, _tO.usePolicyFile);
222226 } else {
223 - _s.o._createSound(_tO.id, _tO.url, _tO.usePeakData, _tO.useWaveformData, _tO.useEQData, _tO.isMovieStar, (_tO.isMovieStar?_tO.bufferTime:false), _tO.loops||1, _tO.serverURL, _tO.duration||null, _tO.autoPlay, true, _tO.autoLoad, _tO.usePolicyFile);
 227+ _flash._createSound(_tO.id, _tO.url, _tO.usePeakData, _tO.useWaveformData, _tO.useEQData, _tO.isMovieStar, (_tO.isMovieStar?_tO.bufferTime:false), _tO.loops||1, _tO.serverURL, _tO.duration||null, _tO.autoPlay, true, _tO.autoLoad, _tO.usePolicyFile);
224228 if (!_tO.serverURL) {
225229 oSound.connected = true;
226230 if (_tO.onconnect) {
@@ -269,16 +273,22 @@
270274 }
271275 return _s.sounds[sID].unload();
272276 };
273 - this.onposition = function(sID, nPosition, oMethod, oScope) {
 277+ this.onPosition = function(sID, nPosition, oMethod, oScope) {
274278 if (!_idCheck(sID)) {
275279 return false;
276280 }
277281 return _s.sounds[sID].onposition(nPosition, oMethod, oScope);
278282 };
 283+ this.onposition = this.onPosition;
 284+ this.clearOnPosition = function(sID, nPosition, oMethod) {
 285+ if (!_idCheck(sID)) {
 286+ return false;
 287+ }
 288+ return _s.sounds[sID].clearOnPosition(nPosition, oMethod);
 289+ };
279290 this.play = function(sID, oOptions) {
280 - var fN = _sm+'.play(): ';
281291 if (!_didInit || !_s.ok()) {
282 - _complain(fN + _str(!_didInit?'notReady':'notOK'));
 292+ _complain(_sm+'.play(): ' + _str(!_didInit?'notReady':'notOK'));
283293 return false;
284294 }
285295 if (!_idCheck(sID)) {
@@ -360,8 +370,7 @@
361371 return _s.sounds[sID].setVolume(nVol);
362372 };
363373 this.mute = function(sID) {
364 - var fN = _sm+'.mute(): ',
365 - i = 0;
 374+ var i = 0;
366375 if (typeof sID !== 'string') {
367376 sID = null;
368377 }
@@ -382,7 +391,7 @@
383392 _s.mute();
384393 };
385394 this.unmute = function(sID) {
386 - var fN = _sm+'.unmute(): ', i;
 395+ var i;
387396 if (typeof sID !== 'string') {
388397 sID = null;
389398 }
@@ -410,8 +419,8 @@
411420 };
412421 this.getMemoryUse = function() {
413422 var ram = 0;
414 - if (_s.o && _fV !== 8) {
415 - ram = parseInt(_s.o._getMemoryUse(), 10);
 423+ if (_flash && _fV !== 8) {
 424+ ram = parseInt(_flash._getMemoryUse(), 10);
416425 }
417426 return ram;
418427 };
@@ -507,15 +516,15 @@
508517 }
509518 try {
510519 if (_isIE) {
511 - _oRemovedHTML = _s.o.innerHTML;
 520+ _oRemovedHTML = _flash.innerHTML;
512521 }
513 - _oRemoved = _s.o.parentNode.removeChild(_s.o);
 522+ _oRemoved = _flash.parentNode.removeChild(_flash);
514523 } catch(e) {
515524 }
516525 _oRemovedHTML = _oRemoved = _needsFlash = null;
517526 _s.enabled = _didDCLoaded = _didInit = _waitingForEI = _initPending = _didAppend = _appendSuccess = _disabled = _s.swfLoaded = false;
518527 _s.soundIDs = _s.sounds = [];
519 - _s.o = null;
 528+ _flash = null;
520529 for (i in _on_queue) {
521530 if (_on_queue.hasOwnProperty(i)) {
522531 for (j = _on_queue[i].length; j--;) {
@@ -526,7 +535,7 @@
527536 _win.setTimeout(_s.beginDelayedInit, 20);
528537 };
529538 this.getMoviePercent = function() {
530 - return (_s.o && typeof _s.o.PercentLoaded !== 'undefined' ? _s.o.PercentLoaded() : null);
 539+ return (_flash && typeof _flash.PercentLoaded !== 'undefined' ? _flash.PercentLoaded() : null);
531540 };
532541 this.beginDelayedInit = function() {
533542 _windowLoaded = true;
@@ -546,7 +555,11 @@
547556 _s.disable(true);
548557 };
549558 SMSound = function(oOptions) {
550 - var _t = this, _resetProperties, _stop_html5_timer, _start_html5_timer;
 559+ var _t = this, _resetProperties, _add_html5_events, _remove_html5_events, _stop_html5_timer, _start_html5_timer, _attachOnPosition, _onplay_called = false, _onPositionItems = [], _onPositionFired = 0, _detachOnPosition, _applyFromTo, _lastURL = null;
 560+ var _lastHTML5State = {
 561+ duration: null,
 562+ time: null
 563+ };
551564 this.sID = oOptions.id;
552565 this.url = oOptions.url;
553566 this.options = _mixin(oOptions);
@@ -554,14 +567,13 @@
555568 this._iO = this.instanceOptions;
556569 this.pan = this.options.pan;
557570 this.volume = this.options.volume;
558 - this._lastURL = null;
559571 this.isHTML5 = false;
560572 this._a = null;
561573 this.id3 = {};
562574 this._debug = function() {
563575 };
564576 this.load = function(oOptions) {
565 - var oS = null;
 577+ var oS = null, _iO;
566578 if (typeof oOptions !== 'undefined') {
567579 _t._iO = _mixin(oOptions, _t.options);
568580 _t.instanceOptions = _t._iO;
@@ -569,7 +581,7 @@
570582 oOptions = _t.options;
571583 _t._iO = oOptions;
572584 _t.instanceOptions = _t._iO;
573 - if (_t._lastURL && _t._lastURL !== _t.url) {
 585+ if (_lastURL && _lastURL !== _t.url) {
574586 _t._iO.url = _t.url;
575587 _t.url = null;
576588 }
@@ -577,20 +589,27 @@
578590 if (!_t._iO.url) {
579591 _t._iO.url = _t.url;
580592 }
 593+ _t._iO.url = _parseURL(_t._iO.url);
581594 if (_t._iO.url === _t.url && _t.readyState !== 0 && _t.readyState !== 2) {
 595+ if (_t.readyState === 3 && _t._iO.onload) {
 596+ _t._iO.onload.apply(_t, [(!!_t.duration)]);
 597+ }
582598 return _t;
583599 }
584 - _t._lastURL = _t.url;
 600+ _iO = _t._iO;
 601+ _lastURL = _t.url;
585602 _t.loaded = false;
586603 _t.readyState = 1;
587604 _t.playState = 0;
588 - if (_html5OK(_t._iO)) {
589 - oS = _t._setup_html5(_t._iO);
 605+ if (_html5OK(_iO)) {
 606+ oS = _t._setup_html5(_iO);
590607 if (!oS._called_load) {
591608 _t._html5_canplay = false;
 609+ _t._a.autobuffer = 'auto';
 610+ _t._a.preload = 'auto';
592611 oS.load();
593612 oS._called_load = true;
594 - if (_t._iO.autoPlay) {
 613+ if (_iO.autoPlay) {
595614 _t.play();
596615 }
597616 } else {
@@ -598,11 +617,12 @@
599618 } else {
600619 try {
601620 _t.isHTML5 = false;
602 - _t._iO = _policyFix(_loopFix(_t._iO));
 621+ _t._iO = _policyFix(_loopFix(_iO));
 622+ _iO = _t._iO;
603623 if (_fV === 8) {
604 - _s.o._load(_t.sID, _t._iO.url, _t._iO.stream, _t._iO.autoPlay, (_t._iO.whileloading?1:0), _t._iO.loops||1, _t._iO.usePolicyFile);
 624+ _flash._load(_t.sID, _iO.url, _iO.stream, _iO.autoPlay, (_iO.whileloading?1:0), _iO.loops||1, _iO.usePolicyFile);
605625 } else {
606 - _s.o._load(_t.sID, _t._iO.url, !!(_t._iO.stream), !!(_t._iO.autoPlay), _t._iO.loops||1, !!(_t._iO.autoLoad), _t._iO.usePolicyFile);
 626+ _flash._load(_t.sID, _iO.url, !!(_iO.stream), !!(_iO.autoPlay), _iO.loops||1, !!(_iO.autoLoad), _iO.usePolicyFile);
607627 }
608628 } catch(e) {
609629 _catchError({type:'SMSOUND_LOAD_JS_EXCEPTION', fatal:true});
@@ -614,9 +634,9 @@
615635 if (_t.readyState !== 0) {
616636 if (!_t.isHTML5) {
617637 if (_fV === 8) {
618 - _s.o._unload(_t.sID, _emptyURL);
 638+ _flash._unload(_t.sID, _emptyURL);
619639 } else {
620 - _s.o._unload(_t.sID);
 640+ _flash._unload(_t.sID);
621641 }
622642 } else {
623643 _stop_html5_timer();
@@ -632,14 +652,14 @@
633653 this.destruct = function(_bFromSM) {
634654 if (!_t.isHTML5) {
635655 _t._iO.onfailure = null;
636 - _s.o._destroySound(_t.sID);
 656+ _flash._destroySound(_t.sID);
637657 } else {
638658 _stop_html5_timer();
639659 if (_t._a) {
640660 _t._a.pause();
641661 _html5Unload(_t._a);
642662 if (!_useGlobalHTML5Audio) {
643 - _t._remove_html5_events();
 663+ _remove_html5_events();
644664 }
645665 _t._a._t = null;
646666 _t._a = null;
@@ -650,13 +670,14 @@
651671 }
652672 };
653673 this.play = function(oOptions, _updatePlayState) {
654 - var fN = 'SMSound.play(): ', allowMulti, a;
 674+ var fN, allowMulti, a, onready;
655675 _updatePlayState = _updatePlayState === undefined ? true : _updatePlayState;
656676 if (!oOptions) {
657677 oOptions = {};
658678 }
659679 _t._iO = _mixin(oOptions, _t._iO);
660680 _t._iO = _mixin(_t._iO, _t.options);
 681+ _t._iO.url = _parseURL(_t._iO.url);
661682 _t.instanceOptions = _t._iO;
662683 if (_t._iO.serverURL && !_t.connected) {
663684 if (!_t.getAutoPlay()) {
@@ -688,28 +709,50 @@
689710 } else {
690711 }
691712 if (!_t.isHTML5 && _fV === 9 && _t.position > 0 && _t.position === _t.duration) {
692 - _t._iO.position = 0;
 713+ oOptions.position = 0;
693714 }
694715 if (_t.paused && _t.position && _t.position > 0) {
695716 _t.resume();
696717 } else {
697 - _t.playState = 1;
698 - _t.paused = false;
 718+ _t._iO = _mixin(oOptions, _t._iO);
 719+ if (_t._iO.from !== null && _t._iO.to !== null && _t.instanceCount === 0 && _t.playState === 0 && !_t._iO.serverURL) {
 720+ onready = function() {
 721+ _t._iO = _mixin(oOptions, _t._iO);
 722+ _t.play(_t._iO);
 723+ };
 724+ if (_t.isHTML5 && !_t._html5_canplay) {
 725+ _t.load({
 726+ _oncanplay: onready
 727+ });
 728+ return false;
 729+ } else if (!_t.isHTML5 && !_t.loaded && (!_t.readyState || _t.readyState !== 2)) {
 730+ _t.load({
 731+ onload: onready
 732+ });
 733+ return false;
 734+ }
 735+ _t._iO = _applyFromTo();
 736+ }
699737 if (!_t.instanceCount || _t._iO.multiShotEvents || (!_t.isHTML5 && _fV > 8 && !_t.getAutoPlay())) {
700738 _t.instanceCount++;
701739 }
702 - _t.position = (typeof _t._iO.position !== 'undefined' && !isNaN(_t._iO.position)?_t._iO.position:0);
 740+ if (_t.playState === 0 && _t._iO.onposition) {
 741+ _attachOnPosition(_t);
 742+ }
 743+ _t.playState = 1;
 744+ _t.paused = false;
 745+ _t.position = (typeof _t._iO.position !== 'undefined' && !isNaN(_t._iO.position) ? _t._iO.position : 0);
703746 if (!_t.isHTML5) {
704747 _t._iO = _policyFix(_loopFix(_t._iO));
705748 }
706749 if (_t._iO.onplay && _updatePlayState) {
707750 _t._iO.onplay.apply(_t);
708 - _t._onplay_called = true;
 751+ _onplay_called = true;
709752 }
710753 _t.setVolume(_t._iO.volume, true);
711754 _t.setPan(_t._iO.pan, true);
712755 if (!_t.isHTML5) {
713 - _s.o._start(_t.sID, _t._iO.loops || 1, (_fV === 9?_t._iO.position:_t._iO.position / 1000));
 756+ _flash._start(_t.sID, _t._iO.loops || 1, (_fV === 9?_t._iO.position:_t._iO.position / 1000));
714757 } else {
715758 _start_html5_timer();
716759 a = _t._setup_html5();
@@ -721,24 +764,28 @@
722765 };
723766 this.start = this.play;
724767 this.stop = function(bAll) {
 768+ var _iO = _t._iO, _oP;
725769 if (_t.playState === 1) {
726770 _t._onbufferchange(0);
727 - _t.resetOnPosition(0);
 771+ _t._resetOnPosition(0);
728772 _t.paused = false;
729773 if (!_t.isHTML5) {
730774 _t.playState = 0;
731775 }
732 - if (_t._iO.onstop) {
733 - _t._iO.onstop.apply(_t);
 776+ _detachOnPosition();
 777+ if (_iO.to) {
 778+ _t.clearOnPosition(_iO.to);
734779 }
735780 if (!_t.isHTML5) {
736 - _s.o._stop(_t.sID, bAll);
737 - if (_t._iO.serverURL) {
 781+ _flash._stop(_t.sID, bAll);
 782+ if (_iO.serverURL) {
738783 _t.unload();
739784 }
740785 } else {
741786 if (_t._a) {
 787+ _oP = _t.position;
742788 _t.setPosition(0);
 789+ _t.position = _oP;
743790 _t._a.pause();
744791 _t.playState = 0;
745792 _t._onTimer();
@@ -747,13 +794,16 @@
748795 }
749796 _t.instanceCount = 0;
750797 _t._iO = {};
 798+ if (_iO.onstop) {
 799+ _iO.onstop.apply(_t);
 800+ }
751801 }
752802 return _t;
753803 };
754804 this.setAutoPlay = function(autoPlay) {
755805 _t._iO.autoPlay = autoPlay;
756806 if (!_t.isHTML5) {
757 - _s.o._setAutoPlay(_t.sID, autoPlay);
 807+ _flash._setAutoPlay(_t.sID, autoPlay);
758808 if (autoPlay) {
759809 if (!_t.instanceCount && _t.readyState === 1) {
760810 _t.instanceCount++;
@@ -774,12 +824,12 @@
775825 original_pos = _t.position;
776826 _t.position = offset;
777827 position1K = _t.position/1000;
778 - _t.resetOnPosition(_t.position);
 828+ _t._resetOnPosition(_t.position);
779829 _t._iO.position = offset;
780830 if (!_t.isHTML5) {
781831 position = (_fV === 9 ? _t.position : position1K);
782832 if (_t.readyState && _t.readyState !== 2) {
783 - _s.o._setPosition(_t.sID, position, (_t.paused || !_t.playState));
 833+ _flash._setPosition(_t.sID, position, (_t.paused || !_t.playState));
784834 }
785835 } else if (_t._a) {
786836 if (_t._html5_canplay) {
@@ -809,7 +859,7 @@
810860 _t.paused = true;
811861 if (!_t.isHTML5) {
812862 if (_bCallFlash || _bCallFlash === undefined) {
813 - _s.o._pause(_t.sID);
 863+ _flash._pause(_t.sID);
814864 }
815865 } else {
816866 _t._setup_html5().pause();
@@ -821,25 +871,26 @@
822872 return _t;
823873 };
824874 this.resume = function() {
 875+ var _iO = _t._iO;
825876 if (!_t.paused) {
826877 return _t;
827878 }
828879 _t.paused = false;
829880 _t.playState = 1;
830881 if (!_t.isHTML5) {
831 - if (_t._iO.isMovieStar) {
 882+ if (_iO.isMovieStar && !_iO.serverURL) {
832883 _t.setPosition(_t.position);
833884 }
834 - _s.o._pause(_t.sID);
 885+ _flash._pause(_t.sID);
835886 } else {
836887 _t._setup_html5().play();
837888 _start_html5_timer();
838889 }
839 - if (!_t._onplay_called && _t._iO.onplay) {
840 - _t._iO.onplay.apply(_t);
841 - _t._onplay_called = true;
842 - } else if (_t._iO.onresume) {
843 - _t._iO.onresume.apply(_t);
 890+ if (_onplay_called && _iO.onplay) {
 891+ _iO.onplay.apply(_t);
 892+ _onplay_called = true;
 893+ } else if (_iO.onresume) {
 894+ _iO.onresume.apply(_t);
844895 }
845896 return _t;
846897 };
@@ -865,7 +916,7 @@
866917 bInstanceOnly = false;
867918 }
868919 if (!_t.isHTML5) {
869 - _s.o._setPan(_t.sID, nPan);
 920+ _flash._setPan(_t.sID, nPan);
870921 }
871922 _t._iO.pan = nPan;
872923 if (!bInstanceOnly) {
@@ -882,7 +933,7 @@
883934 _bInstanceOnly = false;
884935 }
885936 if (!_t.isHTML5) {
886 - _s.o._setVolume(_t.sID, (_s.muted && !_t.muted) || _t.muted?0:nVol);
 937+ _flash._setVolume(_t.sID, (_s.muted && !_t.muted) || _t.muted?0:nVol);
887938 } else if (_t._a) {
888939 _t._a.volume = Math.max(0, Math.min(1, nVol/100));
889940 }
@@ -896,7 +947,7 @@
897948 this.mute = function() {
898949 _t.muted = true;
899950 if (!_t.isHTML5) {
900 - _s.o._setVolume(_t.sID, 0);
 951+ _flash._setVolume(_t.sID, 0);
901952 } else if (_t._a) {
902953 _t._a.muted = true;
903954 }
@@ -906,7 +957,7 @@
907958 _t.muted = false;
908959 var hasIO = typeof _t._iO.volume !== 'undefined';
909960 if (!_t.isHTML5) {
910 - _s.o._setVolume(_t.sID, hasIO?_t._iO.volume:_t.options.volume);
 961+ _flash._setVolume(_t.sID, hasIO?_t._iO.volume:_t.options.volume);
911962 } else if (_t._a) {
912963 _t._a.muted = false;
913964 }
@@ -915,44 +966,105 @@
916967 this.toggleMute = function() {
917968 return (_t.muted?_t.unmute():_t.mute());
918969 };
919 - this.onposition = function(nPosition, oMethod, oScope) {
920 - _t._onPositionItems.push({
 970+ this.onPosition = function(nPosition, oMethod, oScope) {
 971+ _onPositionItems.push({
921972 position: nPosition,
922973 method: oMethod,
923 - scope: (typeof oScope !== 'undefined'?oScope:_t),
 974+ scope: (typeof oScope !== 'undefined' ? oScope : _t),
924975 fired: false
925976 });
926977 return _t;
927978 };
928 - this.processOnPosition = function() {
929 - var i, item, j = _t._onPositionItems.length;
930 - if (!j || !_t.playState || _t._onPositionFired >= j) {
 979+ this.onposition = this.onPosition;
 980+ this.clearOnPosition = function(nPosition, oMethod) {
 981+ var i;
 982+ nPosition = parseInt(nPosition, 10);
 983+ if (isNaN(nPosition)) {
931984 return false;
932985 }
 986+ for (i=0; i < _onPositionItems.length; i++) {
 987+ if (nPosition === _onPositionItems[i].position) {
 988+ if (!oMethod || (oMethod === _onPositionItems[i].method)) {
 989+ if (_onPositionItems[i].fired) {
 990+ _onPositionFired--;
 991+ }
 992+ _onPositionItems.splice(i, 1);
 993+ }
 994+ }
 995+ }
 996+ };
 997+ this._processOnPosition = function() {
 998+ var i, item, j = _onPositionItems.length;
 999+ if (!j || !_t.playState || _onPositionFired >= j) {
 1000+ return false;
 1001+ }
9331002 for (i=j; i--;) {
934 - item = _t._onPositionItems[i];
 1003+ item = _onPositionItems[i];
9351004 if (!item.fired && _t.position >= item.position) {
9361005 item.fired = true;
937 - _s._onPositionFired++;
938 - item.method.apply(item.scope,[item.position]);
 1006+ _onPositionFired++;
 1007+ item.method.apply(item.scope, [item.position]);
9391008 }
9401009 }
9411010 return true;
9421011 };
943 - this.resetOnPosition = function(nPosition) {
944 - var i, item, j = _t._onPositionItems.length;
 1012+ this._resetOnPosition = function(nPosition) {
 1013+ var i, item, j = _onPositionItems.length;
9451014 if (!j) {
9461015 return false;
9471016 }
9481017 for (i=j; i--;) {
949 - item = _t._onPositionItems[i];
 1018+ item = _onPositionItems[i];
9501019 if (item.fired && nPosition <= item.position) {
9511020 item.fired = false;
952 - _s._onPositionFired--;
 1021+ _onPositionFired--;
9531022 }
9541023 }
9551024 return true;
9561025 };
 1026+ _applyFromTo = function() {
 1027+ var _iO = _t._iO,
 1028+ f = _iO.from,
 1029+ t = _iO.to,
 1030+ start, end;
 1031+ end = function() {
 1032+ _t.clearOnPosition(t, end);
 1033+ _t.stop();
 1034+ };
 1035+ start = function() {
 1036+ if (t !== null && !isNaN(t)) {
 1037+ _t.onPosition(t, end);
 1038+ }
 1039+ };
 1040+ if (f !== null && !isNaN(f)) {
 1041+ _iO.position = f;
 1042+ _iO.multiShot = false;
 1043+ start();
 1044+ }
 1045+ return _iO;
 1046+ };
 1047+ _attachOnPosition = function() {
 1048+ var op = _t._iO.onposition;
 1049+ if (op) {
 1050+ var item;
 1051+ for (item in op) {
 1052+ if (op.hasOwnProperty(item)) {
 1053+ _t.onPosition(parseInt(item, 10), op[item]);
 1054+ }
 1055+ }
 1056+ }
 1057+ };
 1058+ _detachOnPosition = function() {
 1059+ var op = _t._iO.onposition;
 1060+ if (op) {
 1061+ var item;
 1062+ for (item in op) {
 1063+ if (op.hasOwnProperty(item)) {
 1064+ _t.clearOnPosition(parseInt(item, 10));
 1065+ }
 1066+ }
 1067+ }
 1068+ };
9571069 _start_html5_timer = function() {
9581070 if (_t.isHTML5) {
9591071 _startTimer(_t);
@@ -964,26 +1076,28 @@
9651077 }
9661078 };
9671079 _resetProperties = function() {
968 - _t._onPositionItems = [];
969 - _t._onPositionFired = 0;
 1080+ _onPositionItems = [];
 1081+ _onPositionFired = 0;
 1082+ _onplay_called = false;
9701083 _t._hasTimer = null;
971 - _t._onplay_called = false;
9721084 _t._a = null;
9731085 _t._html5_canplay = false;
9741086 _t.bytesLoaded = null;
9751087 _t.bytesTotal = null;
976 - _t.position = null;
977 - _t.duration = (_t._iO && _t._iO.duration?_t._iO.duration:null);
 1088+ _t.duration = (_t._iO && _t._iO.duration ? _t._iO.duration : null);
9781089 _t.durationEstimate = null;
 1090+ _t.eqData = [];
 1091+ _t.eqData.left = [];
 1092+ _t.eqData.right = [];
9791093 _t.failures = 0;
 1094+ _t.isBuffering = false;
 1095+ _t.instanceOptions = {};
 1096+ _t.instanceCount = 0;
9801097 _t.loaded = false;
981 - _t.playState = 0;
982 - _t.paused = false;
 1098+ _t.metadata = {};
9831099 _t.readyState = 0;
9841100 _t.muted = false;
985 - _t.isBuffering = false;
986 - _t.instanceOptions = {};
987 - _t.instanceCount = 0;
 1101+ _t.paused = false;
9881102 _t.peakData = {
9891103 left: 0,
9901104 right: 0
@@ -992,28 +1106,39 @@
9931107 left: [],
9941108 right: []
9951109 };
996 - _t.eqData = [];
997 - _t.eqData.left = [];
998 - _t.eqData.right = [];
 1110+ _t.playState = 0;
 1111+ _t.position = null;
9991112 };
10001113 _resetProperties();
10011114 this._onTimer = function(bForce) {
1002 - var time, x = {};
 1115+ var duration, isNew = false, time, x = {};
10031116 if (_t._hasTimer || bForce) {
10041117 if (_t._a && (bForce || ((_t.playState > 0 || _t.readyState === 1) && !_t.paused))) {
1005 - _t.duration = _t._get_html5_duration();
 1118+ duration = _t._get_html5_duration();
 1119+ if (duration !== _lastHTML5State.duration) {
 1120+ _lastHTML5State.duration = duration;
 1121+ _t.duration = duration;
 1122+ isNew = true;
 1123+ }
10061124 _t.durationEstimate = _t.duration;
1007 - time = _t._a.currentTime?_t._a.currentTime*1000:0;
1008 - _t._whileplaying(time,x,x,x,x);
1009 - return true;
 1125+ time = (_t._a.currentTime * 1000 || 0);
 1126+ if (time !== _lastHTML5State.time) {
 1127+ _lastHTML5State.time = time;
 1128+ isNew = true;
 1129+ }
 1130+ if (isNew || bForce) {
 1131+ _t._whileplaying(time,x,x,x,x);
 1132+ }
 1133+ return isNew;
10101134 } else {
10111135 return false;
10121136 }
10131137 }
10141138 };
10151139 this._get_html5_duration = function() {
1016 - var d = (_t._a ? _t._a.duration*1000 : (_t._iO ? _t._iO.duration : undefined)),
1017 - result = (d && !isNaN(d) && d !== Infinity ? d : (_t._iO ? _t._iO.duration : null));
 1140+ var _iO = _t._iO,
 1141+ d = (_t._a ? _t._a.duration*1000 : (_iO ? _iO.duration : undefined)),
 1142+ result = (d && !isNaN(d) && d !== Infinity ? d : (_iO ? _iO.duration : null));
10181143 return result;
10191144 };
10201145 this._setup_html5 = function(oOptions) {
@@ -1022,8 +1147,12 @@
10231148 _dURL = d(_iO.url),
10241149 _oldIO = (_a && _a._t ? _a._t.instanceOptions : null);
10251150 if (_a) {
1026 - if (_a._t && _oldIO.url === _iO.url && (!_t._lastURL || (_t._lastURL === _oldIO.url))) {
1027 - return _a;
 1151+ if (_a._t) {
 1152+ if (!_useGlobalHTML5Audio && _dURL === d(_lastURL)) {
 1153+ return _a;
 1154+ } else if (_useGlobalHTML5Audio && _oldIO.url === _iO.url && (!_lastURL || (_lastURL === _oldIO.url))) {
 1155+ return _a;
 1156+ }
10281157 }
10291158 if (_useGlobalHTML5Audio && _a._t && _a._t.playState && _iO.url !== _oldIO.url) {
10301159 _a._t.stop();
@@ -1031,7 +1160,7 @@
10321161 _resetProperties();
10331162 _a.src = _iO.url;
10341163 _t.url = _iO.url;
1035 - _t._lastURL = _iO.url;
 1164+ _lastURL = _iO.url;
10361165 _a._called_load = false;
10371166 } else {
10381167 _a = new Audio(_iO.url);
@@ -1046,21 +1175,18 @@
10471176 _t.isHTML5 = true;
10481177 _t._a = _a;
10491178 _a._t = _t;
1050 - _t._add_html5_events();
 1179+ _add_html5_events();
10511180 _a.loop = (_iO.loops>1?'loop':'');
10521181 if (_iO.autoLoad || _iO.autoPlay) {
1053 - _a.autobuffer = 'auto';
1054 - _a.preload = 'auto';
10551182 _t.load();
1056 - _a._called_load = true;
10571183 } else {
10581184 _a.autobuffer = false;
10591185 _a.preload = 'none';
10601186 }
1061 - _a.loop = (_iO.loops>1?'loop':'');
 1187+ _a.loop = (_iO.loops > 1 ? 'loop' : '');
10621188 return _a;
10631189 };
1064 - this._add_html5_events = function() {
 1190+ _add_html5_events = function() {
10651191 if (_t._a._added_events) {
10661192 return false;
10671193 }
@@ -1076,7 +1202,7 @@
10771203 }
10781204 return true;
10791205 };
1080 - this._remove_html5_events = function() {
 1206+ _remove_html5_events = function() {
10811207 var f;
10821208 function remove(oEvt, oFn, bCapture) {
10831209 return (_t._a ? _t._a.removeEventListener(oEvt, oFn, bCapture||false) : null);
@@ -1089,7 +1215,7 @@
10901216 }
10911217 };
10921218 this._onload = function(nSuccess) {
1093 - var fN = 'SMSound._onload(): ', loadOK = !!(nSuccess);
 1219+ var fN, loadOK = !!(nSuccess);
10941220 _t.loaded = loadOK;
10951221 _t.readyState = loadOK?3:2;
10961222 _t._onbufferchange(0);
@@ -1099,7 +1225,6 @@
11001226 return true;
11011227 };
11021228 this._onbufferchange = function(nIsBuffering) {
1103 - var fN = 'SMSound._onbufferchange()';
11041229 if (_t.playState === 0) {
11051230 return false;
11061231 }
@@ -1112,7 +1237,7 @@
11131238 }
11141239 return true;
11151240 };
1116 - this._onsuspend = function () {
 1241+ this._onsuspend = function() {
11171242 if (_t._iO.onsuspend) {
11181243 _t._iO.onsuspend.apply(_t);
11191244 }
@@ -1128,10 +1253,11 @@
11291254 this._onfinish = function() {
11301255 var _io_onfinish = _t._iO.onfinish;
11311256 _t._onbufferchange(0);
1132 - _t.resetOnPosition(0);
 1257+ _t._resetOnPosition(0);
11331258 if (_t.instanceCount) {
11341259 _t.instanceCount--;
11351260 if (!_t.instanceCount) {
 1261+ _detachOnPosition();
11361262 _t.playState = 0;
11371263 _t.paused = false;
11381264 _t.instanceCount = 0;
@@ -1147,49 +1273,51 @@
11481274 }
11491275 };
11501276 this._whileloading = function(nBytesLoaded, nBytesTotal, nDuration, nBufferLength) {
 1277+ var _iO = _t._iO;
11511278 _t.bytesLoaded = nBytesLoaded;
11521279 _t.bytesTotal = nBytesTotal;
11531280 _t.duration = Math.floor(nDuration);
11541281 _t.bufferLength = nBufferLength;
1155 - if (!_t._iO.isMovieStar) {
1156 - if (_t._iO.duration) {
1157 - _t.durationEstimate = (_t.duration > _t._iO.duration) ? _t.duration : _t._iO.duration;
 1282+ if (!_iO.isMovieStar) {
 1283+ if (_iO.duration) {
 1284+ _t.durationEstimate = (_t.duration > _iO.duration) ? _t.duration : _iO.duration;
11581285 } else {
11591286 _t.durationEstimate = parseInt((_t.bytesTotal / _t.bytesLoaded) * _t.duration, 10);
11601287 }
11611288 if (_t.durationEstimate === undefined) {
11621289 _t.durationEstimate = _t.duration;
11631290 }
1164 - if (_t.readyState !== 3 && _t._iO.whileloading) {
1165 - _t._iO.whileloading.apply(_t);
 1291+ if (_t.readyState !== 3 && _iO.whileloading) {
 1292+ _iO.whileloading.apply(_t);
11661293 }
11671294 } else {
11681295 _t.durationEstimate = _t.duration;
1169 - if (_t.readyState !== 3 && _t._iO.whileloading) {
1170 - _t._iO.whileloading.apply(_t);
 1296+ if (_t.readyState !== 3 && _iO.whileloading) {
 1297+ _iO.whileloading.apply(_t);
11711298 }
11721299 }
11731300 };
11741301 this._whileplaying = function(nPosition, oPeakData, oWaveformDataLeft, oWaveformDataRight, oEQData) {
 1302+ var _iO = _t._iO;
11751303 if (isNaN(nPosition) || nPosition === null) {
11761304 return false;
11771305 }
11781306 _t.position = nPosition;
1179 - _t.processOnPosition();
 1307+ _t._processOnPosition();
11801308 if (!_t.isHTML5 && _fV > 8) {
1181 - if (_t._iO.usePeakData && typeof oPeakData !== 'undefined' && oPeakData) {
 1309+ if (_iO.usePeakData && typeof oPeakData !== 'undefined' && oPeakData) {
11821310 _t.peakData = {
11831311 left: oPeakData.leftPeak,
11841312 right: oPeakData.rightPeak
11851313 };
11861314 }
1187 - if (_t._iO.useWaveformData && typeof oWaveformDataLeft !== 'undefined' && oWaveformDataLeft) {
 1315+ if (_iO.useWaveformData && typeof oWaveformDataLeft !== 'undefined' && oWaveformDataLeft) {
11881316 _t.waveformData = {
11891317 left: oWaveformDataLeft.split(','),
11901318 right: oWaveformDataRight.split(',')
11911319 };
11921320 }
1193 - if (_t._iO.useEQData) {
 1321+ if (_iO.useEQData) {
11941322 if (typeof oEQData !== 'undefined' && oEQData && oEQData.leftEQ) {
11951323 var eqLeft = oEQData.leftEQ.split(',');
11961324 _t.eqData = eqLeft;
@@ -1204,16 +1332,26 @@
12051333 if (!_t.isHTML5 && _fV === 8 && !_t.position && _t.isBuffering) {
12061334 _t._onbufferchange(0);
12071335 }
1208 - if (_t._iO.whileplaying) {
1209 - _t._iO.whileplaying.apply(_t);
 1336+ if (_iO.whileplaying) {
 1337+ _iO.whileplaying.apply(_t);
12101338 }
12111339 }
12121340 return true;
12131341 };
1214 - this._onid3 = function(oID3PropNames, oID3Data) {
 1342+ this._onmetadata = function(oMDProps, oMDData) {
 1343+ var oData = {}, i, j;
 1344+ for (i = 0, j = oMDProps.length; i < j; i++) {
 1345+ oData[oMDProps[i]] = oMDData[i];
 1346+ }
 1347+ _t.metadata = oData;
 1348+ if (_t._iO.onmetadata) {
 1349+ _t._iO.onmetadata.apply(_t);
 1350+ }
 1351+ };
 1352+ this._onid3 = function(oID3Props, oID3Data) {
12151353 var oData = [], i, j;
1216 - for (i = 0, j = oID3PropNames.length; i < j; i++) {
1217 - oData[oID3PropNames[i]] = oID3Data[i];
 1354+ for (i = 0, j = oID3Props.length; i < j; i++) {
 1355+ oData[oID3Props[i]] = oID3Data[i];
12181356 }
12191357 _t.id3 = _mixin(_t.id3, oData);
12201358 if (_t._iO.onid3) {
@@ -1221,7 +1359,6 @@
12221360 }
12231361 };
12241362 this._onconnect = function(bSuccess) {
1225 - var fN = 'SMSound._onconnect(): ';
12261363 bSuccess = (bSuccess === 1);
12271364 _t.connected = bSuccess;
12281365 if (bSuccess) {
@@ -1234,7 +1371,7 @@
12351372 }
12361373 }
12371374 if (_t._iO.onconnect) {
1238 - _t._iO.onconnect.apply(_t,[bSuccess]);
 1375+ _t._iO.onconnect.apply(_t, [bSuccess]);
12391376 }
12401377 }
12411378 };
@@ -1307,7 +1444,8 @@
13081445 }());
13091446 function _html5_event(oFn) {
13101447 return function(e) {
1311 - if (!this._t || !this._t._a) {
 1448+ var t = this._t;
 1449+ if (!t || !t._a) {
13121450 return null;
13131451 } else {
13141452 return oFn.call(this, e);
@@ -1318,30 +1456,36 @@
13191457 abort: _html5_event(function(e) {
13201458 }),
13211459 canplay: _html5_event(function(e) {
1322 - if (this._t._html5_canplay) {
 1460+ var t = this._t;
 1461+ if (t._html5_canplay) {
13231462 return true;
13241463 }
1325 - this._t._html5_canplay = true;
1326 - this._t._onbufferchange(0);
1327 - var position1K = (!isNaN(this._t.position)?this._t.position/1000:null);
1328 - if (this._t.position && this.currentTime !== position1K) {
 1464+ t._html5_canplay = true;
 1465+ t._onbufferchange(0);
 1466+ var position1K = (!isNaN(t.position)?t.position/1000:null);
 1467+ if (t.position && this.currentTime !== position1K) {
13291468 try {
13301469 this.currentTime = position1K;
13311470 } catch(ee) {
13321471 }
13331472 }
 1473+ if (t._iO._oncanplay) {
 1474+ t._iO._oncanplay();
 1475+ }
13341476 }),
13351477 load: _html5_event(function(e) {
1336 - if (!this._t.loaded) {
1337 - this._t._onbufferchange(0);
1338 - this._t._whileloading(this._t.bytesTotal, this._t.bytesTotal, this._t._get_html5_duration());
1339 - this._t._onload(true);
 1478+ var t = this._t;
 1479+ if (!t.loaded) {
 1480+ t._onbufferchange(0);
 1481+ t._whileloading(t.bytesTotal, t.bytesTotal, t._get_html5_duration());
 1482+ t._onload(true);
13401483 }
13411484 }),
13421485 emptied: _html5_event(function(e) {
13431486 }),
13441487 ended: _html5_event(function(e) {
1345 - this._t._onfinish();
 1488+ var t = this._t;
 1489+ t._onfinish();
13461490 }),
13471491 error: _html5_event(function(e) {
13481492 this._t._onload(false);
@@ -1367,7 +1511,8 @@
13681512 this._t._onbufferchange(0);
13691513 }),
13701514 progress: _html5_event(function(e) {
1371 - if (this._t.loaded) {
 1515+ var t = this._t;
 1516+ if (t.loaded) {
13721517 return false;
13731518 }
13741519 var i, j, str, buffered = 0,
@@ -1382,8 +1527,8 @@
13831528 loaded = buffered/e.target.duration;
13841529 }
13851530 if (!isNaN(loaded)) {
1386 - this._t._onbufferchange(0);
1387 - this._t._whileloading(loaded, total, this._t._get_html5_duration());
 1531+ t._onbufferchange(0);
 1532+ t._whileloading(loaded, total, t._get_html5_duration());
13881533 if (loaded && total && loaded === total) {
13891534 _html5_events.load.call(this, e);
13901535 }
@@ -1392,8 +1537,9 @@
13931538 ratechange: _html5_event(function(e) {
13941539 }),
13951540 suspend: _html5_event(function(e) {
 1541+ var t = this._t;
13961542 _html5_events.progress.call(this, e);
1397 - this._t._onsuspend();
 1543+ t._onsuspend();
13981544 }),
13991545 stalled: _html5_event(function(e) {
14001546 }),
@@ -1401,7 +1547,8 @@
14021548 this._t._onTimer();
14031549 }),
14041550 waiting: _html5_event(function(e) {
1405 - this._t._onbufferchange(1);
 1551+ var t = this._t;
 1552+ t._onbufferchange(1);
14061553 })
14071554 };
14081555 _html5OK = function(iO) {
@@ -1589,10 +1736,10 @@
15901737 _s.features.peakData = _s.features.waveformData = _s.features.eqData = (_fV > 8);
15911738 };
15921739 _setPolling = function(bPolling, bHighPerformance) {
1593 - if (!_s.o) {
 1740+ if (!_flash) {
15941741 return false;
15951742 }
1596 - _s.o._setPolling(bPolling, bHighPerformance);
 1743+ _flash._setPolling(bPolling, bHighPerformance);
15971744 };
15981745 _initDebug = function() {
15991746 if (_s.debugURLParam.test(_wl)) {
@@ -1603,20 +1750,20 @@
16041751 _getSWFCSS = function() {
16051752 var css = [];
16061753 if (_s.debugMode) {
1607 - css.push(_s.swfCSS.sm2Debug);
 1754+ css.push(_swfCSS.sm2Debug);
16081755 }
16091756 if (_s.debugFlash) {
1610 - css.push(_s.swfCSS.flashDebug);
 1757+ css.push(_swfCSS.flashDebug);
16111758 }
16121759 if (_s.useHighPerformance) {
1613 - css.push(_s.swfCSS.highPerf);
 1760+ css.push(_swfCSS.highPerf);
16141761 }
16151762 return css.join(' ');
16161763 };
16171764 _flashBlockHandler = function() {
16181765 var name = _str('fbHandler'),
16191766 p = _s.getMoviePercent(),
1620 - css = _s.swfCSS,
 1767+ css = _swfCSS,
16211768 error = {type:'FLASHBLOCK'};
16221769 if (_s.html5Only) {
16231770 return false;
@@ -1629,8 +1776,6 @@
16301777 _processOnEvents({type:'ontimeout', ignoreInit:true, error:error});
16311778 _catchError(error);
16321779 } else {
1633 - if (_s.didFlashBlock) {
1634 - }
16351780 if (_s.oMC) {
16361781 _s.oMC.className = [_getSWFCSS(), css.swfDefault, css.swfLoaded + (_s.didFlashBlock?' '+css.swfUnblocked:'')].join(' ');
16371782 }
@@ -1761,16 +1906,60 @@
17621907 _s.html5Only = (_s.hasHTML5 && _s.useHTML5Audio && !needsFlash);
17631908 return (!_s.html5Only);
17641909 };
 1910+ _parseURL = function(url) {
 1911+ var i, j, result = 0;
 1912+ if (url instanceof Array) {
 1913+ for (i=0, j=url.length; i<j; i++) {
 1914+ if (url[i] instanceof Object) {
 1915+ if (_s.canPlayMIME(url[i].type)) {
 1916+ result = i;
 1917+ break;
 1918+ }
 1919+ } else if (_s.canPlayURL(url[i])) {
 1920+ result = i;
 1921+ break;
 1922+ }
 1923+ }
 1924+ if (url[result].url) {
 1925+ url[result] = url[result].url;
 1926+ }
 1927+ return url[result];
 1928+ } else {
 1929+ return url;
 1930+ }
 1931+ };
17651932 _startTimer = function(oSound) {
17661933 if (!oSound._hasTimer) {
17671934 oSound._hasTimer = true;
 1935+ if (!_likesHTML5 && _s.html5PollingInterval) {
 1936+ if (_h5IntervalTimer === null && _h5TimerCount === 0) {
 1937+ _h5IntervalTimer = window.setInterval(_timerExecute, _s.html5PollingInterval);
 1938+ }
 1939+ _h5TimerCount++;
 1940+ }
17681941 }
17691942 };
17701943 _stopTimer = function(oSound) {
17711944 if (oSound._hasTimer) {
17721945 oSound._hasTimer = false;
 1946+ if (!_likesHTML5 && _s.html5PollingInterval) {
 1947+ _h5TimerCount--;
 1948+ }
17731949 }
17741950 };
 1951+ _timerExecute = function() {
 1952+ var i, j;
 1953+ if (_h5IntervalTimer !== null && !_h5TimerCount) {
 1954+ window.clearInterval(_h5IntervalTimer);
 1955+ _h5IntervalTimer = null;
 1956+ return false;
 1957+ }
 1958+ for (i = _s.soundIDs.length; i--;) {
 1959+ if (_s.sounds[_s.soundIDs[i]].isHTML5 && _s.sounds[_s.soundIDs[i]]._hasTimer) {
 1960+ _s.sounds[_s.soundIDs[i]]._onTimer();
 1961+ }
 1962+ }
 1963+ };
17751964 _catchError = function(options) {
17761965 options = (typeof options !== 'undefined' ? options : {});
17771966 if (_s.onerror instanceof Function) {
@@ -1800,11 +1989,11 @@
18011990 };
18021991 this._setSandboxType = function(sandboxType) {
18031992 };
1804 - this._externalInterfaceOK = function(flashDate) {
 1993+ this._externalInterfaceOK = function(flashDate, swfVersion) {
18051994 if (_s.swfLoaded) {
18061995 return false;
18071996 }
1808 - var eiTime = new Date().getTime();
 1997+ var e, eiTime = new Date().getTime();
18091998 _s.swfLoaded = true;
18101999 _tryInitOnFocus = false;
18112000 if (_isBadSafari) {
@@ -1847,7 +2036,6 @@
18482037 smURL = _s.url;
18492038 _s.wmode = (!_s.wmode && _s.useHighPerformance ? 'transparent' : _s.wmode);
18502039 if (_s.wmode !== null && (_ua.match(/msie 8/i) || (!_isIE && !_s.useHighPerformance)) && navigator.platform.match(/win32|win64/i)) {
1851 - _s.specialWmodeCase = true;
18522040 _s.wmode = null;
18532041 }
18542042 oEmbed = {
@@ -1899,7 +2087,7 @@
19002088 _s.oMC = (_id(_s.movieID) || _doc.createElement('div'));
19012089 if (!_s.oMC.id) {
19022090 _s.oMC.id = _s.movieID;
1903 - _s.oMC.className = _s.swfCSS.swfDefault + ' ' + extraClass;
 2091+ _s.oMC.className = _swfCSS.swfDefault + ' ' + extraClass;
19042092 s = null;
19052093 oEl = null;
19062094 if (!_s.useFlashBlock) {
@@ -1942,7 +2130,7 @@
19432131 oTarget.appendChild(_s.oMC);
19442132 if (_isIE) {
19452133 oEl = _s.oMC.appendChild(_doc.createElement('div'));
1946 - oEl.className = _s.swfCSS.swfBox;
 2134+ oEl.className = _swfCSS.swfBox;
19472135 oEl.innerHTML = movieHTML;
19482136 }
19492137 _appendSuccess = true;
@@ -1951,11 +2139,11 @@
19522140 }
19532141 } else {
19542142 sClass = _s.oMC.className;
1955 - _s.oMC.className = (sClass?sClass+' ':_s.swfCSS.swfDefault) + (extraClass?' '+extraClass:'');
 2143+ _s.oMC.className = (sClass?sClass+' ':_swfCSS.swfDefault) + (extraClass?' '+extraClass:'');
19562144 _s.oMC.appendChild(oMovie);
19572145 if (_isIE) {
19582146 oEl = _s.oMC.appendChild(_doc.createElement('div'));
1959 - oEl.className = _s.swfCSS.swfBox;
 2147+ oEl.className = _swfCSS.swfBox;
19602148 oEl.innerHTML = movieHTML;
19612149 }
19622150 _appendSuccess = true;
@@ -1970,11 +2158,11 @@
19712159 _createMovie();
19722160 return false;
19732161 }
1974 - if (_s.o) {
 2162+ if (_flash) {
19752163 return false;
19762164 }
1977 - _s.o = _s.getMovie(_s.id);
1978 - if (!_s.o) {
 2165+ _flash = _s.getMovie(_s.id);
 2166+ if (!_flash) {
19792167 if (!_oRemoved) {
19802168 _createMovie(_s.id, _s.url);
19812169 } else {
@@ -1986,7 +2174,7 @@
19872175 _oRemoved = null;
19882176 _didAppend = true;
19892177 }
1990 - _s.o = _s.getMovie(_s.id);
 2178+ _flash = _s.getMovie(_s.id);
19912179 }
19922180 if (_s.oninitmovie instanceof Function) {
19932181 setTimeout(_s.oninitmovie, 1);
@@ -2076,7 +2264,7 @@
20772265 }
20782266 if (_disabled || bNoDisable) {
20792267 if (_s.useFlashBlock && _s.oMC) {
2080 - _s.oMC.className = _getSWFCSS() + ' ' + (_s.getMoviePercent() === null?_s.swfCSS.swfTimedout:_s.swfCSS.swfError);
 2268+ _s.oMC.className = _getSWFCSS() + ' ' + (_s.getMoviePercent() === null?_swfCSS.swfTimedout:_swfCSS.swfError);
20812269 }
20822270 _processOnEvents({type:'ontimeout', error:error});
20832271 _catchError(error);
@@ -2108,10 +2296,10 @@
21092297 }
21102298 _initMovie();
21112299 try {
2112 - _s.o._externalInterfaceTest(false);
 2300+ _flash._externalInterfaceTest(false);
21132301 _setPolling(true, (_s.flashPollingInterval || (_s.useHighPerformance ? 10 : 50)));
21142302 if (!_s.debugMode) {
2115 - _s.o._disableDebug();
 2303+ _flash._disableDebug();
21162304 }
21172305 _s.enabled = true;
21182306 if (!_s.html5Only) {
@@ -2157,10 +2345,15 @@
21582346 }
21592347 return true;
21602348 };
 2349+ _winOnLoad = function() {
 2350+ _windowLoaded = true;
 2351+ _event.remove(_win, 'load', _winOnLoad);
 2352+ };
21612353 _detectFlash();
21622354 _event.add(_win, 'focus', _handleFocus);
21632355 _event.add(_win, 'load', _handleFocus);
21642356 _event.add(_win, 'load', _delayWaitForEI);
 2357+ _event.add(_win, 'load', _winOnLoad);
21652358 if (_isSafari && _tryInitOnFocus) {
21662359 _event.add(_win, 'mousemove', _handleFocus);
21672360 }
Index: trunk/extensions/SoundManager2Button/script/mp3-player-button.js
@@ -135,7 +135,7 @@
136136 this.stopEvent = function(e) {
137137 if (typeof e !== 'undefined' && typeof e.preventDefault !== 'undefined') {
138138 e.preventDefault();
139 - } else if (typeof window.event !== 'undefined' && typeof window.event.returnValue !== 'undefined') {
 139+ } else if (typeof window.event !== 'undefined') {
140140 window.event.returnValue = false;
141141 }
142142 return false;
@@ -212,8 +212,7 @@
213213 thisSound.play();
214214 }
215215 self.lastSound = thisSound; // reference for next call
216 - self.stopEvent(e);
217 - return false;
 216+ return self.stopEvent(e);
218217 };
219218
220219 this.stopSound = function(oSound) {
Index: trunk/extensions/SoundManager2Button/script/soundmanager2-jsmin.js
@@ -9,95 +9,96 @@
1010 Code provided under the BSD License:
1111 http://schillmania.com/projects/soundmanager2/license.txt
1212
13 - V2.97a.20111030
 13+ V2.97a.20111220
1414 */
15 -(function(S){function T(T,fa){function k(b){return function(a){return!this._t||!this._t._a?(this._t&&this._t.sID?c._wD(h+"ignoring "+a.type+": "+this._t.sID):c._wD(h+"ignoring "+a.type),null):b.call(this,a)}}this.flashVersion=8;this.debugMode=true;this.debugFlash=false;this.useConsole=true;this.waitForWindowLoad=this.consoleOnly=false;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashPollingInterval=null;this.flashLoadTimeout=1E3;this.wmode=null;this.allowScriptAccess="always";this.useFlashBlock=
16 -false;this.useHTML5Audio=true;this.html5Test=/^(probably|maybe)$/i;this.preferFlash=true;this.noSWFCache=false;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:false},ogg:{type:["audio/ogg; codecs=vorbis"],required:false},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave",
17 -"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,onfailure:null,onfinish:null,multiShot:true,multiShotEvents:false,position:null,pan:0,type:null,usePolicyFile:false,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions={bufferTime:3,
18 -serverURL:null,onconnect:null,duration:null};this.movieID="sm2-container";this.id=fa||"sm2movie";this.swfCSS={swfBox:"sm2-object-box",swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfLoaded:"swf_loaded",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"};this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.versionNumber="V2.97a.20111030";this.movieURL=this.version=null;this.url=T||null;this.altURL=
19 -null;this.enabled=this.swfLoaded=false;this.oMC=this.o=null;this.sounds={};this.soundIDs=[];this.didFlashBlock=this.specialWmodeCase=this.muted=false;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};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)",
20 -localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null};var J;try{J=typeof Audio!=="undefined"&&typeof(new Audio).canPlayType!=="undefined"}catch(Xa){J=false}this.hasHTML5=J;this.html5={usingFlash:null};this.flash={};this.ignoreFlash=this.html5Only=false;var ya,c=this,h="HTML5::",u,q=navigator.userAgent,i=S,K=i.location.href.toString(),g=document,ga,U,j,y=[],ha=true,r,L=false,M=false,m=false,v=false,ia=false,l,Qa=0,N,s,ja,C,D,V,za,ka,B,W,X,E,la,Y,Z,F,Aa,
21 -ma,Ra=["log","info","warn","error"],Ba,$,Ca,O=null,na=null,n,oa,G,Da,aa,ba,pa,o,ca=false,qa=false,Ea,Fa,w=null,Ga,da,P,z,ra,sa,Ha,p,Ia=Array.prototype.slice,Q=false,t,ea,Ja,x,Ka,ta=q.match(/(ipad|iphone|ipod)/i),Sa=q.match(/firefox/i),Ta=q.match(/droid/i),A=q.match(/msie/i),Ua=q.match(/webkit/i),R=q.match(/safari/i)&&!q.match(/chrome/i),Va=q.match(/opera/i);J=q.match(/(mobile|pre\/|xoom)/i)||ta;var ua=!K.match(/usehtml5audio/i)&&!K.match(/sm2\-ignorebadua/i)&&R&&q.match(/OS X 10_6_([3-7])/i),va=typeof console!==
22 -"undefined"&&typeof console.log!=="undefined",wa=typeof g.hasFocus!=="undefined"?g.hasFocus():null,H=R&&typeof g.hasFocus==="undefined",La=!H,Ma=/(mp3|mp4|mpa)/i,I=g.location?g.location.protocol.match(/http/i):null,Na=!I?"http://":"",Oa=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|mp4v|3gp|3g2)\s*(?:$|;)/i,Pa="mpeg4,aac,flv,mov,mp4,m4v,f4v,m4a,mp4v,3gp,3g2".split(","),Wa=RegExp("\\.("+Pa.join("|")+")(\\?.*)?$","i");this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.useAltURL=
23 -!I;this._global_a=null;if(J&&(c.useHTML5Audio=true,c.preferFlash=false,ta))Q=c.ignoreFlash=true;this.supported=this.ok=function(){return w?m&&!v:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(c){return u(c)||g[c]||i[c]};this.createSound=function(b){function a(){e=aa(e);c.sounds[d.id]=new ya(d);c.soundIDs.push(d.id);return c.sounds[d.id]}var e=null,f=null,d=null;if(!m||!c.ok())return pa("soundManager.createSound(): "+n(!m?"notReady":"notOK")),false;arguments.length===2&&(b={id:arguments[0],url:arguments[1]});
24 -d=e=s(b);d.id.toString().charAt(0).match(/^[0-9]$/)&&c._wD("soundManager.createSound(): "+n("badID",d.id),2);c._wD("soundManager.createSound(): "+d.id+" ("+d.url+")",1);if(o(d.id,true))return c._wD("soundManager.createSound(): "+d.id+" exists",1),c.sounds[d.id];if(da(d))f=a(),c._wD("Loading sound "+d.id+" via HTML5"),f._setup_html5(d);else{if(j>8){if(d.isMovieStar===null)d.isMovieStar=d.serverURL||(d.type?d.type.match(Oa):false)||d.url.match(Wa);d.isMovieStar&&c._wD("soundManager.createSound(): using MovieStar handling");
25 -if(d.isMovieStar){if(d.usePeakData)l("noPeak"),d.usePeakData=false;d.loops>1&&l("noNSLoop")}}d=ba(d,"soundManager.createSound(): ");f=a();if(j===8)c.o._createSound(d.id,d.loops||1,d.usePolicyFile);else if(c.o._createSound(d.id,d.url,d.usePeakData,d.useWaveformData,d.useEQData,d.isMovieStar,d.isMovieStar?d.bufferTime:false,d.loops||1,d.serverURL,d.duration||null,d.autoPlay,true,d.autoLoad,d.usePolicyFile),!d.serverURL)f.connected=true,d.onconnect&&d.onconnect.apply(f);!d.serverURL&&(d.autoLoad||d.autoPlay)&&
26 -f.load(d)}!d.serverURL&&d.autoPlay&&f.play();return f};this.destroySound=function(b,a){if(!o(b))return false;var e=c.sounds[b],f;e._iO={};e.stop();e.unload();for(f=0;f<c.soundIDs.length;f++)if(c.soundIDs[f]===b){c.soundIDs.splice(f,1);break}a||e.destruct(true);delete c.sounds[b];return true};this.load=function(b,a){return!o(b)?false:c.sounds[b].load(a)};this.unload=function(b){return!o(b)?false:c.sounds[b].unload()};this.onposition=function(b,a,e,f){return!o(b)?false:c.sounds[b].onposition(a,e,f)};
27 -this.start=this.play=function(b,a){if(!m||!c.ok())return pa("soundManager.play(): "+n(!m?"notReady":"notOK")),false;return!o(b)?(a instanceof Object||(a={url:a}),a&&a.url?(c._wD('soundManager.play(): attempting to create "'+b+'"',1),a.id=b,c.createSound(a).play()):false):c.sounds[b].play(a)};this.setPosition=function(b,a){return!o(b)?false:c.sounds[b].setPosition(a)};this.stop=function(b){if(!o(b))return false;c._wD("soundManager.stop("+b+")",1);return c.sounds[b].stop()};this.stopAll=function(){var b;
28 -c._wD("soundManager.stopAll()",1);for(b in c.sounds)c.sounds.hasOwnProperty(b)&&c.sounds[b].stop()};this.pause=function(b){return!o(b)?false:c.sounds[b].pause()};this.pauseAll=function(){var b;for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].pause()};this.resume=function(b){return!o(b)?false:c.sounds[b].resume()};this.resumeAll=function(){var b;for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].resume()};this.togglePause=function(b){return!o(b)?false:c.sounds[b].togglePause()};this.setPan=function(b,
29 -a){return!o(b)?false:c.sounds[b].setPan(a)};this.setVolume=function(b,a){return!o(b)?false:c.sounds[b].setVolume(a)};this.mute=function(b){var a=0;typeof b!=="string"&&(b=null);if(b){if(!o(b))return false;c._wD('soundManager.mute(): Muting "'+b+'"');return c.sounds[b].mute()}else{c._wD("soundManager.mute(): Muting all sounds");for(a=c.soundIDs.length;a--;)c.sounds[c.soundIDs[a]].mute();c.muted=true}return true};this.muteAll=function(){c.mute()};this.unmute=function(b){typeof b!=="string"&&(b=null);
30 -if(b){if(!o(b))return false;c._wD('soundManager.unmute(): Unmuting "'+b+'"');return c.sounds[b].unmute()}else{c._wD("soundManager.unmute(): Unmuting all sounds");for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].unmute();c.muted=false}return true};this.unmuteAll=function(){c.unmute()};this.toggleMute=function(b){return!o(b)?false:c.sounds[b].toggleMute()};this.getMemoryUse=function(){var b=0;c.o&&j!==8&&(b=parseInt(c.o._getMemoryUse(),10));return b};this.disable=function(b){var a;typeof b==="undefined"&&
31 -(b=false);if(v)return false;v=true;l("shutdown",1);for(a=c.soundIDs.length;a--;)Ba(c.sounds[c.soundIDs[a]]);N(b);p.remove(i,"load",D);return true};this.canPlayMIME=function(b){var a;c.hasHTML5&&(a=P({type:b}));return!w||a?a:b?!!(j>8&&b.match(Oa)||b.match(c.mimePattern)):null};this.canPlayURL=function(b){var a;c.hasHTML5&&(a=P({url:b}));return!w||a?a:b?!!b.match(c.filePattern):null};this.canPlayLink=function(b){return typeof b.type!=="undefined"&&b.type&&c.canPlayMIME(b.type)?true:c.canPlayURL(b.href)};
32 -this.getSoundById=function(b,a){if(!b)throw Error("soundManager.getSoundById(): sID is null/undefined");var e=c.sounds[b];!e&&!a&&c._wD('"'+b+'" is an invalid sound ID.',2);return e};this.onready=function(b,a){if(b&&b instanceof Function)return m&&c._wD(n("queue","onready")),a||(a=i),ja("onready",b,a),C(),true;else throw n("needFunction","onready");};this.ontimeout=function(b,a){if(b&&b instanceof Function)return m&&c._wD(n("queue","ontimeout")),a||(a=i),ja("ontimeout",b,a),C({type:"ontimeout"}),
33 -true;else throw n("needFunction","ontimeout");};this._wD=this._writeDebug=function(b,a,e){var f,d;if(!c.debugMode)return false;typeof e!=="undefined"&&e&&(b=b+" | "+(new Date).getTime());if(va&&c.useConsole){e=Ra[a];if(typeof console[e]!=="undefined")console[e](b);else console.log(b);if(c.useConsoleOnly)return true}try{f=u("soundmanager-debug");if(!f)return false;d=g.createElement("div");if(++Qa%2===0)d.className="sm2-alt";a=typeof a==="undefined"?0:parseInt(a,10);d.appendChild(g.createTextNode(b));
34 -if(a){if(a>=2)d.style.fontWeight="bold";if(a===3)d.style.color="#ff3333"}f.insertBefore(d,f.firstChild)}catch(Ya){}return true};this._debug=function(){var b,a;l("currentObj",1);for(b=0,a=c.soundIDs.length;b<a;b++)c.sounds[c.soundIDs[b]]._debug()};this.reboot=function(){c._wD("soundManager.reboot()");c.soundIDs.length&&c._wD("Destroying "+c.soundIDs.length+" SMSound objects...");var b,a;for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].destruct();try{if(A)na=c.o.innerHTML;O=c.o.parentNode.removeChild(c.o);
35 -c._wD("Flash movie removed.")}catch(e){l("badRemove",2)}na=O=w=null;c.enabled=la=m=ca=qa=L=M=v=c.swfLoaded=false;c.soundIDs=c.sounds=[];c.o=null;for(b in y)if(y.hasOwnProperty(b))for(a=y[b].length;a--;)y[b][a].fired=false;c._wD("soundManager: Rebooting...");i.setTimeout(c.beginDelayedInit,20)};this.getMoviePercent=function(){return c.o&&typeof c.o.PercentLoaded!=="undefined"?c.o.PercentLoaded():null};this.beginDelayedInit=function(){ia=true;E();setTimeout(function(){if(qa)return false;Z();X();return qa=
36 -true},20);V()};this.destruct=function(){c._wD("soundManager.destruct()");c.disable(true)};ya=function(b){var a=this,e,f,d;this.sID=b.id;this.url=b.url;this._iO=this.instanceOptions=this.options=s(b);this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this.isHTML5=false;this._a=null;this.id3={};this._debug=function(){if(c.debugMode){var b=null,d=[],e,f;for(b in a.options)a.options[b]!==null&&(a.options[b]instanceof Function?(e=a.options[b].toString(),e=e.replace(/\s\s+/g," "),
37 -f=e.indexOf("{"),d.push(" "+b+": {"+e.substr(f+1,Math.min(Math.max(e.indexOf("\n")-1,64),64)).replace(/\n/g,"")+"... }")):d.push(" "+b+": "+a.options[b]));c._wD("SMSound() merged options: {\n"+d.join(", \n")+"\n}")}};this._debug();this.load=function(b){var d=null;if(typeof b!=="undefined")a._iO=s(b,a.options),a.instanceOptions=a._iO;else if(b=a.options,a._iO=b,a.instanceOptions=a._iO,a._lastURL&&a._lastURL!==a.url)l("manURL"),a._iO.url=a.url,a.url=null;if(!a._iO.url)a._iO.url=a.url;c._wD("SMSound.load(): "+
38 -a._iO.url,1);if(a._iO.url===a.url&&a.readyState!==0&&a.readyState!==2)return l("onURL",1),a;a._lastURL=a.url;a.loaded=false;a.readyState=1;a.playState=0;if(da(a._iO))d=a._setup_html5(a._iO),d._called_load?c._wD(h+"ignoring request to load again: "+a.sID):(c._wD(h+"load: "+a.sID),a._html5_canplay=false,d.load(),d._called_load=true,a._iO.autoPlay&&a.play());else try{a.isHTML5=false,a._iO=ba(aa(a._iO)),j===8?c.o._load(a.sID,a._iO.url,a._iO.stream,a._iO.autoPlay,a._iO.whileloading?1:0,a._iO.loops||1,
39 -a._iO.usePolicyFile):c.o._load(a.sID,a._iO.url,!!a._iO.stream,!!a._iO.autoPlay,a._iO.loops||1,!!a._iO.autoLoad,a._iO.usePolicyFile)}catch(e){l("smError",2),r("onload",false),F({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:true})}return a};this.unload=function(){a.readyState!==0&&(c._wD('SMSound.unload(): "'+a.sID+'"'),a.isHTML5?(f(),a._a&&(a._a.pause(),ra(a._a))):j===8?c.o._unload(a.sID,"about:blank"):c.o._unload(a.sID),e());return a};this.destruct=function(b){c._wD('SMSound.destruct(): "'+a.sID+'"');if(a.isHTML5){if(f(),
40 -a._a)a._a.pause(),ra(a._a),Q||a._remove_html5_events(),a._a._t=null,a._a=null}else a._iO.onfailure=null,c.o._destroySound(a.sID);b||c.destroySound(a.sID,true)};this.start=this.play=function(b,e){var f,e=e===void 0?true:e;b||(b={});a._iO=s(b,a._iO);a._iO=s(a._iO,a.options);a.instanceOptions=a._iO;if(a._iO.serverURL&&!a.connected)return a.getAutoPlay()||(c._wD("SMSound.play(): Netstream not connected yet - setting autoPlay"),a.setAutoPlay(true)),a;da(a._iO)&&(a._setup_html5(a._iO),d());if(a.playState===
41 -1&&!a.paused)if(f=a._iO.multiShot)c._wD('SMSound.play(): "'+a.sID+'" already playing (multi-shot)',1);else return c._wD('SMSound.play(): "'+a.sID+'" already playing (one-shot)',1),a;if(a.loaded)c._wD('SMSound.play(): "'+a.sID+'"');else if(a.readyState===0){c._wD('SMSound.play(): Attempting to load "'+a.sID+'"',1);if(!a.isHTML5)a._iO.autoPlay=true;a.load(a._iO)}else if(a.readyState===2)return c._wD('SMSound.play(): Could not load "'+a.sID+'" - exiting',2),a;else c._wD('SMSound.play(): "'+a.sID+'" is loading - attempting to play..',
42 -1);if(!a.isHTML5&&j===9&&a.position>0&&a.position===a.duration)c._wD('SMSound.play(): "'+a.sID+'": Sound at end, resetting to position:0'),a._iO.position=0;if(a.paused&&a.position&&a.position>0)c._wD('SMSound.play(): "'+a.sID+'" is resuming from paused state',1),a.resume();else{c._wD('SMSound.play(): "'+a.sID+'" is starting to play');a.playState=1;a.paused=false;(!a.instanceCount||a._iO.multiShotEvents||!a.isHTML5&&j>8&&!a.getAutoPlay())&&a.instanceCount++;a.position=typeof a._iO.position!=="undefined"&&
43 -!isNaN(a._iO.position)?a._iO.position:0;if(!a.isHTML5)a._iO=ba(aa(a._iO));if(a._iO.onplay&&e)a._iO.onplay.apply(a),a._onplay_called=true;a.setVolume(a._iO.volume,true);a.setPan(a._iO.pan,true);a.isHTML5?(d(),f=a._setup_html5(),a.setPosition(a._iO.position),f.play()):c.o._start(a.sID,a._iO.loops||1,j===9?a._iO.position:a._iO.position/1E3)}return a};this.stop=function(b){if(a.playState===1){a._onbufferchange(0);a.resetOnPosition(0);a.paused=false;if(!a.isHTML5)a.playState=0;a._iO.onstop&&a._iO.onstop.apply(a);
44 -if(a.isHTML5){if(a._a)a.setPosition(0),a._a.pause(),a.playState=0,a._onTimer(),f()}else c.o._stop(a.sID,b),a._iO.serverURL&&a.unload();a.instanceCount=0;a._iO={}}return a};this.setAutoPlay=function(b){c._wD("sound "+a.sID+" turned autoplay "+(b?"on":"off"));a._iO.autoPlay=b;a.isHTML5||(c.o._setAutoPlay(a.sID,b),b&&!a.instanceCount&&a.readyState===1&&(a.instanceCount++,c._wD("sound "+a.sID+" incremented instance count to "+a.instanceCount)))};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPosition=
45 -function(b){b===void 0&&(b=0);var d=a.isHTML5?Math.max(b,0):Math.min(a.duration||a._iO.duration,Math.max(b,0));a.position=d;b=a.position/1E3;a.resetOnPosition(a.position);a._iO.position=d;if(a.isHTML5){if(a._a)if(a._html5_canplay){if(a._a.currentTime!==b){c._wD("setPosition("+b+"): setting position");try{a._a.currentTime=b,(a.playState===0||a.paused)&&a._a.pause()}catch(e){c._wD("setPosition("+b+"): setting position failed: "+e.message,2)}}}else c._wD("setPosition("+b+"): delaying, sound not ready")}else b=
46 -j===9?a.position:b,a.readyState&&a.readyState!==2&&c.o._setPosition(a.sID,b,a.paused||!a.playState);a.isHTML5&&a.paused&&a._onTimer(true);return a};this.pause=function(b){if(a.paused||a.playState===0&&a.readyState!==1)return a;c._wD("SMSound.pause()");a.paused=true;a.isHTML5?(a._setup_html5().pause(),f()):(b||b===void 0)&&c.o._pause(a.sID);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){if(!a.paused)return a;c._wD("SMSound.resume()");a.paused=false;a.playState=1;a.isHTML5?(a._setup_html5().play(),
47 -d()):(a._iO.isMovieStar&&a.setPosition(a.position),c.o._pause(a.sID));!a._onplay_called&&a._iO.onplay?(a._iO.onplay.apply(a),a._onplay_called=true):a._iO.onresume&&a._iO.onresume.apply(a);return a};this.togglePause=function(){c._wD("SMSound.togglePause()");if(a.playState===0)return a.play({position:j===9&&!a.isHTML5?a.position:a.position/1E3}),a;a.paused?a.resume():a.pause();return a};this.setPan=function(b,d){typeof b==="undefined"&&(b=0);typeof d==="undefined"&&(d=false);a.isHTML5||c.o._setPan(a.sID,
48 -b);a._iO.pan=b;if(!d)a.pan=b,a.options.pan=b;return a};this.setVolume=function(b,d){typeof b==="undefined"&&(b=100);typeof d==="undefined"&&(d=false);if(a.isHTML5){if(a._a)a._a.volume=Math.max(0,Math.min(1,b/100))}else c.o._setVolume(a.sID,c.muted&&!a.muted||a.muted?0:b);a._iO.volume=b;if(!d)a.volume=b,a.options.volume=b;return a};this.mute=function(){a.muted=true;if(a.isHTML5){if(a._a)a._a.muted=true}else c.o._setVolume(a.sID,0);return a};this.unmute=function(){a.muted=false;var b=typeof a._iO.volume!==
49 -"undefined";if(a.isHTML5){if(a._a)a._a.muted=false}else c.o._setVolume(a.sID,b?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=function(c,b,d){a._onPositionItems.push({position:c,method:b,scope:typeof d!=="undefined"?d:a,fired:false});return a};this.processOnPosition=function(){var b,d;b=a._onPositionItems.length;if(!b||!a.playState||a._onPositionFired>=b)return false;for(;b--;)if(d=a._onPositionItems[b],!d.fired&&a.position>=
50 -d.position)d.fired=true,c._onPositionFired++,d.method.apply(d.scope,[d.position]);return true};this.resetOnPosition=function(b){var d,e;d=a._onPositionItems.length;if(!d)return false;for(;d--;)if(e=a._onPositionItems[d],e.fired&&b<=e.position)e.fired=false,c._onPositionFired--;return true};d=function(){a.isHTML5&&Ea(a)};f=function(){a.isHTML5&&Fa(a)};e=function(){a._onPositionItems=[];a._onPositionFired=0;a._hasTimer=null;a._onplay_called=false;a._a=null;a._html5_canplay=false;a.bytesLoaded=null;
51 -a.bytesTotal=null;a.position=null;a.duration=a._iO&&a._iO.duration?a._iO.duration:null;a.durationEstimate=null;a.failures=0;a.loaded=false;a.playState=0;a.paused=false;a.readyState=0;a.muted=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=[]};e();this._onTimer=function(b){var d={};if(a._hasTimer||b)return a._a&&(b||(a.playState>0||a.readyState===1)&&!a.paused)?(a.duration=a._get_html5_duration(),
52 -a.durationEstimate=a.duration,b=a._a.currentTime?a._a.currentTime*1E3:0,a._whileplaying(b,d,d,d,d),true):(c._wD('_onTimer: Warn for "'+a.sID+'": '+(!a._a?"Could not find element. ":"")+(a.playState===0?"playState bad, 0?":"playState = "+a.playState+", OK")),false)};this._get_html5_duration=function(){var c=a._a?a._a.duration*1E3:a._iO?a._iO.duration:void 0;return c&&!isNaN(c)&&c!==Infinity?c:a._iO?a._iO.duration:null};this._setup_html5=function(b){var b=s(a._iO,b),d=Q?c._global_a:a._a,f=decodeURI(b.url),
53 -g=d&&d._t?d._t.instanceOptions:null;if(d){if(d._t&&g.url===b.url&&(!a._lastURL||a._lastURL===g.url))return d;c._wD("setting new URL on existing object: "+f+(a._lastURL?", old URL: "+a._lastURL:""));Q&&d._t&&d._t.playState&&b.url!==g.url&&d._t.stop();e();d.src=b.url;a.url=b.url;a._lastURL=b.url;d._called_load=false}else{c._wD("creating HTML5 Audio() element with URL: "+f);d=new Audio(b.url);d._called_load=false;if(Ta)d._called_load=true;if(Q)c._global_a=d}a.isHTML5=true;a._a=d;d._t=a;a._add_html5_events();
54 -d.loop=b.loops>1?"loop":"";b.autoLoad||b.autoPlay?(d.autobuffer="auto",d.preload="auto",a.load(),d._called_load=true):(d.autobuffer=false,d.preload="none");d.loop=b.loops>1?"loop":"";return d};this._add_html5_events=function(){if(a._a._added_events)return false;var b;c._wD(h+"adding event listeners: "+a.sID);a._a._added_events=true;for(b in x)x.hasOwnProperty(b)&&a._a&&a._a.addEventListener(b,x[b],false);return true};this._remove_html5_events=function(){var b;c._wD(h+"removing event listeners: "+
55 -a.sID);a._a._added_events=false;for(b in x)x.hasOwnProperty(b)&&a._a&&a._a.removeEventListener(b,x[b],false)};this._onload=function(b){b=!!b;c._wD('SMSound._onload(): "'+a.sID+'"'+(b?" loaded.":" failed to load? - "+a.url),b?1:2);!b&&!a.isHTML5&&(c.sandbox.noRemote===true&&c._wD("SMSound._onload(): "+n("noNet"),1),c.sandbox.noLocal===true&&c._wD("SMSound._onload(): "+n("noLocal"),1));a.loaded=b;a.readyState=b?3:2;a._onbufferchange(0);a._iO.onload&&a._iO.onload.apply(a,[b]);return true};this._onbufferchange=
56 -function(b){if(a.playState===0)return false;if(b&&a.isBuffering||!b&&!a.isBuffering)return false;a.isBuffering=b===1;a._iO.onbufferchange&&(c._wD("SMSound._onbufferchange(): "+b),a._iO.onbufferchange.apply(a));return true};this._onsuspend=function(){a._iO.onsuspend&&(c._wD("SMSound._onsuspend()"),a._iO.onsuspend.apply(a));return true};this._onfailure=function(b,d,e){a.failures++;c._wD('SMSound._onfailure(): "'+a.sID+'" count '+a.failures);if(a._iO.onfailure&&a.failures===1)a._iO.onfailure(a,b,d,e);
57 -else c._wD("SMSound._onfailure(): ignoring")};this._onfinish=function(){var b=a._iO.onfinish;a._onbufferchange(0);a.resetOnPosition(0);if(a.instanceCount){a.instanceCount--;if(!a.instanceCount)a.playState=0,a.paused=false,a.instanceCount=0,a.instanceOptions={},a._iO={},f();if((!a.instanceCount||a._iO.multiShotEvents)&&b)c._wD('SMSound._onfinish(): "'+a.sID+'"'),b.apply(a)}};this._whileloading=function(c,b,d,e){a.bytesLoaded=c;a.bytesTotal=b;a.duration=Math.floor(d);a.bufferLength=e;if(a._iO.isMovieStar)a.durationEstimate=
58 -a.duration;else if(a.durationEstimate=a._iO.duration?a.duration>a._iO.duration?a.duration:a._iO.duration:parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10),a.durationEstimate===void 0)a.durationEstimate=a.duration;a.readyState!==3&&a._iO.whileloading&&a._iO.whileloading.apply(a)};this._whileplaying=function(c,b,d,e,f){if(isNaN(c)||c===null)return false;a.position=c;a.processOnPosition();if(!a.isHTML5&&j>8){if(a._iO.usePeakData&&typeof b!=="undefined"&&b)a.peakData={left:b.leftPeak,right:b.rightPeak};
59 -if(a._iO.useWaveformData&&typeof d!=="undefined"&&d)a.waveformData={left:d.split(","),right:e.split(",")};if(a._iO.useEQData&&typeof f!=="undefined"&&f&&f.leftEQ&&(c=f.leftEQ.split(","),a.eqData=c,a.eqData.left=c,typeof f.rightEQ!=="undefined"&&f.rightEQ))a.eqData.right=f.rightEQ.split(",")}a.playState===1&&(!a.isHTML5&&j===8&&!a.position&&a.isBuffering&&a._onbufferchange(0),a._iO.whileplaying&&a._iO.whileplaying.apply(a));return true};this._onid3=function(b,d){c._wD('SMSound._onid3(): "'+this.sID+
60 -'" ID3 data received.');var e=[],f,g;for(f=0,g=b.length;f<g;f++)e[b[f]]=d[f];a.id3=s(a.id3,e);a._iO.onid3&&a._iO.onid3.apply(a)};this._onconnect=function(b){b=b===1;c._wD('SMSound._onconnect(): "'+a.sID+'"'+(b?" connected.":" failed to connect? - "+a.url),b?1:2);if(a.connected=b)a.failures=0,o(a.sID)&&(a.getAutoPlay()?a.play(void 0,a.getAutoPlay()):a._iO.autoLoad&&a.load()),a._iO.onconnect&&a._iO.onconnect.apply(a,[b])};this._ondataerror=function(b){a.playState>0&&(c._wD("SMSound._ondataerror(): "+
61 -b),a._iO.ondataerror&&a._iO.ondataerror.apply(a))}};Y=function(){return g.body||g._docElement||g.getElementsByTagName("div")[0]};u=function(b){return g.getElementById(b)};s=function(b,a){var e={},f,d;for(f in b)b.hasOwnProperty(f)&&(e[f]=b[f]);f=typeof a==="undefined"?c.defaultOptions:a;for(d in f)f.hasOwnProperty(d)&&typeof e[d]==="undefined"&&(e[d]=f[d]);return e};p=function(){function b(a){var a=Ia.call(a),b=a.length;c?(a[1]="on"+a[1],b>3&&a.pop()):b===3&&a.push(false);return a}function a(a,b){var g=
62 -a.shift(),j=[f[b]];if(c)g[j](a[0],a[1]);else g[j].apply(g,a)}var c=i.attachEvent,f={add:c?"attachEvent":"addEventListener",remove:c?"detachEvent":"removeEventListener"};return{add:function(){a(b(arguments),"add")},remove:function(){a(b(arguments),"remove")}}}();x={abort:k(function(){c._wD(h+"abort: "+this._t.sID)}),canplay:k(function(){if(this._t._html5_canplay)return true;this._t._html5_canplay=true;c._wD(h+"canplay: "+this._t.sID+", "+this._t.url);this._t._onbufferchange(0);var b=!isNaN(this._t.position)?
63 -this._t.position/1E3:null;if(this._t.position&&this.currentTime!==b){c._wD(h+"canplay: setting position to "+b);try{this.currentTime=b}catch(a){c._wD(h+"setting position failed: "+a.message,2)}}}),load:k(function(){this._t.loaded||(this._t._onbufferchange(0),this._t._whileloading(this._t.bytesTotal,this._t.bytesTotal,this._t._get_html5_duration()),this._t._onload(true))}),emptied:k(function(){c._wD(h+"emptied: "+this._t.sID)}),ended:k(function(){c._wD(h+"ended: "+this._t.sID);this._t._onfinish()}),
64 -error:k(function(){c._wD(h+"error: "+this.error.code);this._t._onload(false)}),loadeddata:k(function(){var b=this._t,a=b.bytesTotal||1;c._wD(h+"loadeddata: "+this._t.sID);if(!b._loaded&&!R)b.duration=b._get_html5_duration(),b._whileloading(a,a,b._get_html5_duration()),b._onload(true)}),loadedmetadata:k(function(){c._wD(h+"loadedmetadata: "+this._t.sID)}),loadstart:k(function(){c._wD(h+"loadstart: "+this._t.sID);this._t._onbufferchange(1)}),play:k(function(){c._wD(h+"play: "+this._t.sID+", "+this._t.url);
65 -this._t._onbufferchange(0)}),playing:k(function(){c._wD(h+"playing: "+this._t.sID+", "+this._t.url);this._t._onbufferchange(0)}),progress:k(function(b){if(this._t.loaded)return false;var a,e,f;f=0;var d=b.type==="progress";e=b.target.buffered;var g=b.loaded||0,xa=b.total||1;if(e&&e.length){for(a=e.length;a--;)f=e.end(a)-e.start(a);g=f/b.target.duration;if(d&&e.length>1){f=[];e=e.length;for(a=0;a<e;a++)f.push(b.target.buffered.start(a)+"-"+b.target.buffered.end(a));c._wD(h+"progress: timeRanges: "+
66 -f.join(", "))}d&&!isNaN(g)&&c._wD(h+"progress: "+this._t.sID+": "+Math.floor(g*100)+"% loaded")}isNaN(g)||(this._t._onbufferchange(0),this._t._whileloading(g,xa,this._t._get_html5_duration()),g&&xa&&g===xa&&x.load.call(this,b))}),ratechange:k(function(){c._wD(h+"ratechange: "+this._t.sID)}),suspend:k(function(b){c._wD(h+"suspend: "+this._t.sID);x.progress.call(this,b);this._t._onsuspend()}),stalled:k(function(){c._wD(h+"stalled: "+this._t.sID)}),timeupdate:k(function(){this._t._onTimer()}),waiting:k(function(){c._wD(h+
67 -"waiting: "+this._t.sID);this._t._onbufferchange(1)})};da=function(b){return!b.serverURL&&(b.type?P({type:b.type}):P({url:b.url})||c.html5Only)};ra=function(b){if(b)b.src=Sa?"":"about:blank"};P=function(b){function a(a){return c.preferFlash&&t&&!c.ignoreFlash&&typeof c.flash[a]!=="undefined"&&c.flash[a]}if(!c.useHTML5Audio||!c.hasHTML5)return false;var e=b.url||null,b=b.type||null,f=c.audioFormats,d;if(b&&c.html5[b]!=="undefined")return c.html5[b]&&!a(b);if(!z){z=[];for(d in f)f.hasOwnProperty(d)&&
68 -(z.push(d),f[d].related&&(z=z.concat(f[d].related)));z=RegExp("\\.("+z.join("|")+")(\\?.*)?$","i")}d=e?e.toLowerCase().match(z):null;if(!d||!d.length)if(b)e=b.indexOf(";"),d=(e!==-1?b.substr(0,e):b).substr(6);else return false;else d=d[1];return d&&typeof c.html5[d]!=="undefined"?c.html5[d]&&!a(d):(b="audio/"+d,e=c.html5.canPlayType({type:b}),(c.html5[d]=e)&&c.html5[b]&&!a(b))};Ha=function(){function b(b){var d,e,f=false;if(!a||typeof a.canPlayType!=="function")return false;if(b instanceof Array){for(d=
69 -0,e=b.length;d<e&&!f;d++)if(c.html5[b[d]]||a.canPlayType(b[d]).match(c.html5Test))f=true,c.html5[b[d]]=true,c.flash[b[d]]=!(!c.preferFlash||!t||!b[d].match(Ma));return f}else return b=a&&typeof a.canPlayType==="function"?a.canPlayType(b):false,!(!b||!b.match(c.html5Test))}if(!c.useHTML5Audio||typeof Audio==="undefined")return false;var a=typeof Audio!=="undefined"?Va?new Audio(null):new Audio:null,e,f={},d,g;d=c.audioFormats;for(e in d)if(d.hasOwnProperty(e)&&(f[e]=b(d[e].type),f["audio/"+e]=f[e],
70 -c.flash[e]=c.preferFlash&&!c.ignoreFlash&&e.match(Ma)?true:false,d[e]&&d[e].related))for(g=d[e].related.length;g--;)f["audio/"+d[e].related[g]]=f[e],c.html5[d[e].related[g]]=f[e],c.flash[d[e].related[g]]=f[e];f.canPlayType=a?b:null;c.html5=s(c.html5,f);return true};W={notReady:"Not loaded yet - wait for soundManager.onload()/onready()",notOK:"Audio support is not available.",domError:"soundManager::createMovie(): appendChild/innerHTML call failed. DOM not ready or other error.",spcWmode:"soundManager::createMovie(): Removing wmode, preventing known SWF loading issue(s)",
71 -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 ("+g.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..",
72 -waitImpatient:"soundManager: Getting impatient, still waiting for Flash%s...",waitForever:"soundManager: Waiting indefinitely for Flash (will recover if unblocked)...",needFunction:"soundManager: Function object expected for %s",badID:'Warning: Sound ID "%s" should be a string, starting with a non-numeric character',currentObj:"--- soundManager._debug(): Current sound objects ---",waitEI:"soundManager::initMovie(): Waiting for ExternalInterface call from Flash..",waitOnload:"soundManager: Waiting for window.onload()",
73 -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..",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",
74 -badRemove:"Warning: Failed to remove flash movie.",noPeak:"Warning: peakData features unsupported for movieStar formats",shutdown:"soundManager.disable(): Shutting down",queue:"soundManager: Queueing %s handler",smFail:"soundManager: Failed to initialise.",smError:"SMSound.load(): Exception: JS-Flash communication failed, or JS error.",fbTimeout:"No flash response, applying ."+c.swfCSS.swfTimedout+" CSS..",fbLoaded:"Flash loaded",fbHandler:"soundManager::flashBlockHandler()",manURL:"SMSound.load(): Using manually-assigned URL",
 15+(function(G){function W(W,la){function l(b){return function(a){var d=this._t;return!d||!d._a?(d&&d.sID?c._wD(k+"ignoring "+a.type+": "+d.sID):c._wD(k+"ignoring "+a.type),null):b.call(this,a)}}this.flashVersion=8;this.debugMode=!0;this.debugFlash=!1;this.consoleOnly=this.useConsole=!0;this.waitForWindowLoad=!1;this.bgColor="#ffffff";this.useHighPerformance=!1;this.html5PollingInterval=this.flashPollingInterval=null;this.flashLoadTimeout=1E3;this.wmode=null;this.allowScriptAccess="always";this.useFlashBlock=
 16+!1;this.useHTML5Audio=!0;this.html5Test=/^(probably|maybe)$/i;this.preferFlash=!0;this.noSWFCache=!1;this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1}};
 17+this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfailure:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100};this.flash9Options={isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null};this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,
 18+duration:null};this.movieID="sm2-container";this.id=la||"sm2movie";this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.versionNumber="V2.97a.20111220";this.movieURL=this.version=null;this.url=W||null;this.altURL=null;this.enabled=this.swfLoaded=!1;this.oMC=null;this.sounds={};this.soundIDs=[];this.didFlashBlock=this.muted=!1;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,
 19+movieStar:!1};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};var ma;try{ma="undefined"!==typeof Audio&&"undefined"!==typeof(new Audio).canPlayType}catch(fb){ma=!1}this.hasHTML5=ma;this.html5={usingFlash:null};this.flash={};this.ignoreFlash=this.html5Only=
 20+!1;var Ea,c=this,i=null,k="HTML5::",u,p=navigator.userAgent,j=G,O=j.location.href.toString(),h=document,na,X,m,B=[],oa=!0,w,P=!1,Q=!1,n=!1,y=!1,Y=!1,o,Za=0,R,v,pa,H,I,Z,Fa,qa,E,$,aa,J,ra,sa,ba,ca,K,Ga,ta,$a=["log","info","warn","error"],Ha,da,Ia,S=null,ua=null,q,va,L,Ja,ea,fa,wa,s,ga=!1,xa=!1,Ka,La,Ma,ha=0,T=null,ia,z=null,Na,ja,U,C,ya,za,Oa,r,Pa=Array.prototype.slice,F=!1,t,ka,Qa,A,Ra,Aa=p.match(/(ipad|iphone|ipod)/i),ab=p.match(/firefox/i),bb=p.match(/droid/i),D=p.match(/msie/i),cb=p.match(/webkit/i),
 21+V=p.match(/safari/i)&&!p.match(/chrome/i),db=p.match(/opera/i),Ba=p.match(/(mobile|pre\/|xoom)/i)||Aa,Ca=!O.match(/usehtml5audio/i)&&!O.match(/sm2\-ignorebadua/i)&&V&&!p.match(/silk/i)&&p.match(/OS X 10_6_([3-7])/i),Sa="undefined"!==typeof console&&"undefined"!==typeof console.log,Da="undefined"!==typeof h.hasFocus?h.hasFocus():null,M=V&&"undefined"===typeof h.hasFocus,Ta=!M,Ua=/(mp3|mp4|mpa)/i,N=h.location?h.location.protocol.match(/http/i):null,Va=!N?"http://":"",Wa=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|mp4v|3gp|3g2)\s*(?:$|;)/i,
 22+Xa="mpeg4,aac,flv,mov,mp4,m4v,f4v,m4a,mp4v,3gp,3g2".split(","),eb=RegExp("\\.("+Xa.join("|")+")(\\?.*)?$","i");this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.useAltURL=!N;this._global_a=null;if(Ba&&(c.useHTML5Audio=!0,c.preferFlash=!1,Aa))F=c.ignoreFlash=!0;this.supported=this.ok=function(){return z?n&&!y:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(c){return u(c)||h[c]||j[c]};this.createSound=function(b){function a(){f=ea(f);c.sounds[e.id]=new Ea(e);c.soundIDs.push(e.id);
 23+return c.sounds[e.id]}var d,f=null,e=d=null;d="soundManager.createSound(): "+q(!n?"notReady":"notOK");if(!n||!c.ok())return wa(d),!1;2===arguments.length&&(b={id:arguments[0],url:arguments[1]});f=v(b);f.url=ia(f.url);e=f;e.id.toString().charAt(0).match(/^[0-9]$/)&&c._wD("soundManager.createSound(): "+q("badID",e.id),2);c._wD("soundManager.createSound(): "+e.id+" ("+e.url+")",1);if(s(e.id,!0))return c._wD("soundManager.createSound(): "+e.id+" exists",1),c.sounds[e.id];if(ja(e))d=a(),c._wD("Loading sound "+
 24+e.id+" via HTML5"),d._setup_html5(e);else{if(8<m){if(null===e.isMovieStar)e.isMovieStar=e.serverURL||(e.type?e.type.match(Wa):!1)||e.url.match(eb);e.isMovieStar&&c._wD("soundManager.createSound(): using MovieStar handling");if(e.isMovieStar){if(e.usePeakData)o("noPeak"),e.usePeakData=!1;1<e.loops&&o("noNSLoop")}}e=fa(e,"soundManager.createSound(): ");d=a();if(8===m)i._createSound(e.id,e.loops||1,e.usePolicyFile);else if(i._createSound(e.id,e.url,e.usePeakData,e.useWaveformData,e.useEQData,e.isMovieStar,
 25+e.isMovieStar?e.bufferTime:!1,e.loops||1,e.serverURL,e.duration||null,e.autoPlay,!0,e.autoLoad,e.usePolicyFile),!e.serverURL)d.connected=!0,e.onconnect&&e.onconnect.apply(d);!e.serverURL&&(e.autoLoad||e.autoPlay)&&d.load(e)}!e.serverURL&&e.autoPlay&&d.play();return d};this.destroySound=function(b,a){if(!s(b))return!1;var d=c.sounds[b],f;d._iO={};d.stop();d.unload();for(f=0;f<c.soundIDs.length;f++)if(c.soundIDs[f]===b){c.soundIDs.splice(f,1);break}a||d.destruct(!0);delete c.sounds[b];return!0};this.load=
 26+function(b,a){return!s(b)?!1:c.sounds[b].load(a)};this.unload=function(b){return!s(b)?!1:c.sounds[b].unload()};this.onposition=this.onPosition=function(b,a,d,f){return!s(b)?!1:c.sounds[b].onposition(a,d,f)};this.clearOnPosition=function(b,a,d){return!s(b)?!1:c.sounds[b].clearOnPosition(a,d)};this.start=this.play=function(b,a){if(!n||!c.ok())return wa("soundManager.play(): "+q(!n?"notReady":"notOK")),!1;if(!s(b)){a instanceof Object||(a={url:a});return a&&a.url?(c._wD('soundManager.play(): attempting to create "'+
 27+b+'"',1),a.id=b,c.createSound(a).play()):!1}return c.sounds[b].play(a)};this.setPosition=function(b,a){return!s(b)?!1:c.sounds[b].setPosition(a)};this.stop=function(b){if(!s(b))return!1;c._wD("soundManager.stop("+b+")",1);return c.sounds[b].stop()};this.stopAll=function(){var b;c._wD("soundManager.stopAll()",1);for(b in c.sounds)c.sounds.hasOwnProperty(b)&&c.sounds[b].stop()};this.pause=function(b){return!s(b)?!1:c.sounds[b].pause()};this.pauseAll=function(){var b;for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].pause()};
 28+this.resume=function(b){return!s(b)?!1:c.sounds[b].resume()};this.resumeAll=function(){var b;for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].resume()};this.togglePause=function(b){return!s(b)?!1:c.sounds[b].togglePause()};this.setPan=function(b,a){return!s(b)?!1:c.sounds[b].setPan(a)};this.setVolume=function(b,a){return!s(b)?!1:c.sounds[b].setVolume(a)};this.mute=function(b){var a=0;"string"!==typeof b&&(b=null);if(b){if(!s(b))return!1;c._wD('soundManager.mute(): Muting "'+b+'"');return c.sounds[b].mute()}c._wD("soundManager.mute(): Muting all sounds");
 29+for(a=c.soundIDs.length;a--;)c.sounds[c.soundIDs[a]].mute();return c.muted=!0};this.muteAll=function(){c.mute()};this.unmute=function(b){"string"!==typeof b&&(b=null);if(b){if(!s(b))return!1;c._wD('soundManager.unmute(): Unmuting "'+b+'"');return c.sounds[b].unmute()}c._wD("soundManager.unmute(): Unmuting all sounds");for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].unmute();c.muted=!1;return!0};this.unmuteAll=function(){c.unmute()};this.toggleMute=function(b){return!s(b)?!1:c.sounds[b].toggleMute()};
 30+this.getMemoryUse=function(){var c=0;i&&8!==m&&(c=parseInt(i._getMemoryUse(),10));return c};this.disable=function(b){var a;"undefined"===typeof b&&(b=!1);if(y)return!1;y=!0;o("shutdown",1);for(a=c.soundIDs.length;a--;)Ha(c.sounds[c.soundIDs[a]]);R(b);r.remove(j,"load",I);return!0};this.canPlayMIME=function(b){var a;c.hasHTML5&&(a=U({type:b}));return!z||a?a:b?!!(8<m&&b.match(Wa)||b.match(c.mimePattern)):null};this.canPlayURL=function(b){var a;c.hasHTML5&&(a=U({url:b}));return!z||a?a:b?!!b.match(c.filePattern):
 31+null};this.canPlayLink=function(b){return"undefined"!==typeof b.type&&b.type&&c.canPlayMIME(b.type)?!0:c.canPlayURL(b.href)};this.getSoundById=function(b,a){if(!b)throw Error("soundManager.getSoundById(): sID is null/undefined");var d=c.sounds[b];!d&&!a&&c._wD('"'+b+'" is an invalid sound ID.',2);return d};this.onready=function(b,a){if(b&&b instanceof Function)return n&&c._wD(q("queue","onready")),a||(a=j),pa("onready",b,a),H(),!0;throw q("needFunction","onready");};this.ontimeout=function(b,a){if(b&&
 32+b instanceof Function)return n&&c._wD(q("queue","ontimeout")),a||(a=j),pa("ontimeout",b,a),H({type:"ontimeout"}),!0;throw q("needFunction","ontimeout");};this._wD=this._writeDebug=function(b,a,d){var f,e;if(!c.debugMode)return!1;"undefined"!==typeof d&&d&&(b=b+" | "+(new Date).getTime());if(Sa&&c.useConsole){d=$a[a];if("undefined"!==typeof console[d])console[d](b);else console.log(b);if(c.consoleOnly)return!0}try{f=u("soundmanager-debug");if(!f)return!1;e=h.createElement("div");if(0===++Za%2)e.className=
 33+"sm2-alt";a="undefined"===typeof a?0:parseInt(a,10);e.appendChild(h.createTextNode(b));if(a){if(2<=a)e.style.fontWeight="bold";if(3===a)e.style.color="#ff3333"}f.insertBefore(e,f.firstChild)}catch(i){}return!0};this._debug=function(){var b,a;o("currentObj",1);for(b=0,a=c.soundIDs.length;b<a;b++)c.sounds[c.soundIDs[b]]._debug()};this.reboot=function(){c._wD("soundManager.reboot()");c.soundIDs.length&&c._wD("Destroying "+c.soundIDs.length+" SMSound objects...");var b,a;for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].destruct();
 34+try{if(D)ua=i.innerHTML;S=i.parentNode.removeChild(i);c._wD("Flash movie removed.")}catch(d){o("badRemove",2)}ua=S=z=null;c.enabled=sa=n=ga=xa=P=Q=y=c.swfLoaded=!1;c.soundIDs=c.sounds=[];i=null;for(b in B)if(B.hasOwnProperty(b))for(a=B[b].length;a--;)B[b][a].fired=!1;c._wD("soundManager: Rebooting...");j.setTimeout(c.beginDelayedInit,20)};this.getMoviePercent=function(){return i&&"undefined"!==typeof i.PercentLoaded?i.PercentLoaded():null};this.beginDelayedInit=function(){Y=!0;J();setTimeout(function(){if(xa)return!1;
 35+ca();aa();return xa=!0},20);Z()};this.destruct=function(){c._wD("soundManager.destruct()");c.disable(!0)};Ea=function(b){var a=this,d,f,e,h,g,Ya,j=!1,x=[],l=0,n,r,p=null,t=null,u=null;this.sID=b.id;this.url=b.url;this._iO=this.instanceOptions=this.options=v(b);this.pan=this.options.pan;this.volume=this.options.volume;this.isHTML5=!1;this._a=null;this.id3={};this._debug=function(){if(c.debugMode){var b=null,e=[],d,f;for(b in a.options)null!==a.options[b]&&(a.options[b]instanceof Function?(d=a.options[b].toString(),
 36+d=d.replace(/\s\s+/g," "),f=d.indexOf("{"),e.push(" "+b+": {"+d.substr(f+1,Math.min(Math.max(d.indexOf("\n")-1,64),64)).replace(/\n/g,"")+"... }")):e.push(" "+b+": "+a.options[b]));c._wD("SMSound() merged options: {\n"+e.join(", \n")+"\n}")}};this._debug();this.load=function(b){var d=null;if("undefined"!==typeof b)a._iO=v(b,a.options),a.instanceOptions=a._iO;else if(b=a.options,a._iO=b,a.instanceOptions=a._iO,p&&p!==a.url)o("manURL"),a._iO.url=a.url,a.url=null;if(!a._iO.url)a._iO.url=a.url;a._iO.url=
 37+ia(a._iO.url);c._wD("SMSound.load(): "+a._iO.url,1);if(a._iO.url===a.url&&0!==a.readyState&&2!==a.readyState)return o("onURL",1),3===a.readyState&&a._iO.onload&&a._iO.onload.apply(a,[!!a.duration]),a;b=a._iO;p=a.url;a.loaded=!1;a.readyState=1;a.playState=0;if(ja(b))d=a._setup_html5(b),d._called_load?c._wD(k+"ignoring request to load again: "+a.sID):(c._wD(k+"load: "+a.sID),a._html5_canplay=!1,a._a.autobuffer="auto",a._a.preload="auto",d.load(),d._called_load=!0,b.autoPlay&&a.play());else try{a.isHTML5=
 38+!1,a._iO=fa(ea(b)),b=a._iO,8===m?i._load(a.sID,b.url,b.stream,b.autoPlay,b.whileloading?1:0,b.loops||1,b.usePolicyFile):i._load(a.sID,b.url,!!b.stream,!!b.autoPlay,b.loops||1,!!b.autoLoad,b.usePolicyFile)}catch(e){o("smError",2),w("onload",!1),K({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:!0})}return a};this.unload=function(){0!==a.readyState&&(c._wD('SMSound.unload(): "'+a.sID+'"'),a.isHTML5?(h(),a._a&&(a._a.pause(),ya(a._a))):8===m?i._unload(a.sID,"about:blank"):i._unload(a.sID),d());return a};this.destruct=
 39+function(b){c._wD('SMSound.destruct(): "'+a.sID+'"');if(a.isHTML5){if(h(),a._a)a._a.pause(),ya(a._a),F||e(),a._a._t=null,a._a=null}else a._iO.onfailure=null,i._destroySound(a.sID);b||c.destroySound(a.sID,!0)};this.start=this.play=function(b,d){var e,d=void 0===d?!0:d;b||(b={});a._iO=v(b,a._iO);a._iO=v(a._iO,a.options);a._iO.url=ia(a._iO.url);a.instanceOptions=a._iO;if(a._iO.serverURL&&!a.connected)return a.getAutoPlay()||(c._wD("SMSound.play(): Netstream not connected yet - setting autoPlay"),a.setAutoPlay(!0)),
 40+a;ja(a._iO)&&(a._setup_html5(a._iO),g());if(1===a.playState&&!a.paused)if(e=a._iO.multiShot)c._wD('SMSound.play(): "'+a.sID+'" already playing (multi-shot)',1);else return c._wD('SMSound.play(): "'+a.sID+'" already playing (one-shot)',1),a;if(a.loaded)c._wD('SMSound.play(): "'+a.sID+'"');else if(0===a.readyState){c._wD('SMSound.play(): Attempting to load "'+a.sID+'"',1);if(!a.isHTML5)a._iO.autoPlay=!0;a.load(a._iO)}else{if(2===a.readyState)return c._wD('SMSound.play(): Could not load "'+a.sID+'" - exiting',
 41+2),a;c._wD('SMSound.play(): "'+a.sID+'" is loading - attempting to play..',1)}if(!a.isHTML5&&9===m&&0<a.position&&a.position===a.duration)c._wD('SMSound.play(): "'+a.sID+'": Sound at end, resetting to position:0'),b.position=0;if(a.paused&&a.position&&0<a.position)c._wD('SMSound.play(): "'+a.sID+'" is resuming from paused state',1),a.resume();else{a._iO=v(b,a._iO);if(null!==a._iO.from&&null!==a._iO.to&&0===a.instanceCount&&0===a.playState&&!a._iO.serverURL){e=function(){a._iO=v(b,a._iO);a.play(a._iO)};
 42+if(a.isHTML5&&!a._html5_canplay)return c._wD('SMSound.play(): Beginning load of "'+a.sID+'" for from/to case'),a.load({_oncanplay:e}),!1;if(!a.isHTML5&&!a.loaded&&(!a.readyState||2!==a.readyState))return c._wD('SMSound.play(): Preloading "'+a.sID+'" for from/to case'),a.load({onload:e}),!1;a._iO=r()}c._wD('SMSound.play(): "'+a.sID+'" is starting to play');(!a.instanceCount||a._iO.multiShotEvents||!a.isHTML5&&8<m&&!a.getAutoPlay())&&a.instanceCount++;0===a.playState&&a._iO.onposition&&Ya(a);a.playState=
 43+1;a.paused=!1;a.position="undefined"!==typeof a._iO.position&&!isNaN(a._iO.position)?a._iO.position:0;if(!a.isHTML5)a._iO=fa(ea(a._iO));a._iO.onplay&&d&&(a._iO.onplay.apply(a),j=!0);a.setVolume(a._iO.volume,!0);a.setPan(a._iO.pan,!0);a.isHTML5?(g(),e=a._setup_html5(),a.setPosition(a._iO.position),e.play()):i._start(a.sID,a._iO.loops||1,9===m?a._iO.position:a._iO.position/1E3)}return a};this.stop=function(c){var b=a._iO;if(1===a.playState){a._onbufferchange(0);a._resetOnPosition(0);a.paused=!1;if(!a.isHTML5)a.playState=
 44+0;n();b.to&&a.clearOnPosition(b.to);if(a.isHTML5){if(a._a)c=a.position,a.setPosition(0),a.position=c,a._a.pause(),a.playState=0,a._onTimer(),h()}else i._stop(a.sID,c),b.serverURL&&a.unload();a.instanceCount=0;a._iO={};b.onstop&&b.onstop.apply(a)}return a};this.setAutoPlay=function(b){c._wD("sound "+a.sID+" turned autoplay "+(b?"on":"off"));a._iO.autoPlay=b;a.isHTML5||(i._setAutoPlay(a.sID,b),b&&!a.instanceCount&&1===a.readyState&&(a.instanceCount++,c._wD("sound "+a.sID+" incremented instance count to "+
 45+a.instanceCount)))};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPosition=function(b){void 0===b&&(b=0);var d=a.isHTML5?Math.max(b,0):Math.min(a.duration||a._iO.duration,Math.max(b,0));a.position=d;b=a.position/1E3;a._resetOnPosition(a.position);a._iO.position=d;if(a.isHTML5){if(a._a)if(a._html5_canplay){if(a._a.currentTime!==b){c._wD("setPosition("+b+"): setting position");try{a._a.currentTime=b,(0===a.playState||a.paused)&&a._a.pause()}catch(e){c._wD("setPosition("+b+"): setting position failed: "+
 46+e.message,2)}}}else c._wD("setPosition("+b+"): delaying, sound not ready")}else b=9===m?a.position:b,a.readyState&&2!==a.readyState&&i._setPosition(a.sID,b,a.paused||!a.playState);a.isHTML5&&a.paused&&a._onTimer(!0);return a};this.pause=function(b){if(a.paused||0===a.playState&&1!==a.readyState)return a;c._wD("SMSound.pause()");a.paused=!0;a.isHTML5?(a._setup_html5().pause(),h()):(b||void 0===b)&&i._pause(a.sID);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){var b=a._iO;if(!a.paused)return a;
 47+c._wD("SMSound.resume()");a.paused=!1;a.playState=1;a.isHTML5?(a._setup_html5().play(),g()):(b.isMovieStar&&!b.serverURL&&a.setPosition(a.position),i._pause(a.sID));j&&b.onplay?(b.onplay.apply(a),j=!0):b.onresume&&b.onresume.apply(a);return a};this.togglePause=function(){c._wD("SMSound.togglePause()");if(0===a.playState)return a.play({position:9===m&&!a.isHTML5?a.position:a.position/1E3}),a;a.paused?a.resume():a.pause();return a};this.setPan=function(b,c){"undefined"===typeof b&&(b=0);"undefined"===
 48+typeof c&&(c=!1);a.isHTML5||i._setPan(a.sID,b);a._iO.pan=b;if(!c)a.pan=b,a.options.pan=b;return a};this.setVolume=function(b,d){"undefined"===typeof b&&(b=100);"undefined"===typeof d&&(d=!1);if(a.isHTML5){if(a._a)a._a.volume=Math.max(0,Math.min(1,b/100))}else i._setVolume(a.sID,c.muted&&!a.muted||a.muted?0:b);a._iO.volume=b;if(!d)a.volume=b,a.options.volume=b;return a};this.mute=function(){a.muted=!0;if(a.isHTML5){if(a._a)a._a.muted=!0}else i._setVolume(a.sID,0);return a};this.unmute=function(){a.muted=
 49+!1;var b="undefined"!==typeof a._iO.volume;if(a.isHTML5){if(a._a)a._a.muted=!1}else i._setVolume(a.sID,b?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=this.onPosition=function(b,c,d){x.push({position:b,method:c,scope:"undefined"!==typeof d?d:a,fired:!1});return a};this.clearOnPosition=function(a,b){var c,a=parseInt(a,10);if(isNaN(a))return!1;for(c=0;c<x.length;c++)if(a===x[c].position&&(!b||b===x[c].method))x[c].fired&&l--,
 50+x.splice(c,1)};this._processOnPosition=function(){var b,c;b=x.length;if(!b||!a.playState||l>=b)return!1;for(;b--;)if(c=x[b],!c.fired&&a.position>=c.position)c.fired=!0,l++,c.method.apply(c.scope,[c.position]);return!0};this._resetOnPosition=function(a){var b,c;b=x.length;if(!b)return!1;for(;b--;)if(c=x[b],c.fired&&a<=c.position)c.fired=!1,l--;return!0};r=function(){var b=a._iO,d=b.from,e=b.to,f,g;g=function(){c._wD(a.sID+': "to" time of '+e+" reached.");a.clearOnPosition(e,g);a.stop()};f=function(){c._wD(a.sID+
 51+': playing "from" '+d);if(null!==e&&!isNaN(e))a.onPosition(e,g)};if(null!==d&&!isNaN(d))b.position=d,b.multiShot=!1,f();return b};Ya=function(){var b=a._iO.onposition;if(b)for(var c in b)if(b.hasOwnProperty(c))a.onPosition(parseInt(c,10),b[c])};n=function(){var b=a._iO.onposition;if(b)for(var c in b)b.hasOwnProperty(c)&&a.clearOnPosition(parseInt(c,10))};g=function(){a.isHTML5&&Ka(a)};h=function(){a.isHTML5&&La(a)};d=function(){x=[];l=0;j=!1;a._hasTimer=null;a._a=null;a._html5_canplay=!1;a.bytesLoaded=
 52+null;a.bytesTotal=null;a.duration=a._iO&&a._iO.duration?a._iO.duration:null;a.durationEstimate=null;a.eqData=[];a.eqData.left=[];a.eqData.right=[];a.failures=0;a.isBuffering=!1;a.instanceOptions={};a.instanceCount=0;a.loaded=!1;a.metadata={};a.readyState=0;a.muted=!1;a.paused=!1;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.playState=0;a.position=null};d();this._onTimer=function(b){var c,d=!1,e={};if(a._hasTimer||b){if(a._a&&(b||(0<a.playState||1===a.readyState)&&!a.paused)){c=a._get_html5_duration();
 53+if(c!==t)t=c,a.duration=c,d=!0;a.durationEstimate=a.duration;c=1E3*a._a.currentTime||0;c!==u&&(u=c,d=!0);(d||b)&&a._whileplaying(c,e,e,e,e);return d}return!1}};this._get_html5_duration=function(){var b=a._iO,c=a._a?1E3*a._a.duration:b?b.duration:void 0;return c&&!isNaN(c)&&Infinity!==c?c:b?b.duration:null};this._setup_html5=function(b){var b=v(a._iO,b),e=decodeURI,g=F?c._global_a:a._a,h=e(b.url),i=g&&g._t?g._t.instanceOptions:null;if(g){if(g._t&&(!F&&h===e(p)||F&&i.url===b.url&&(!p||p===i.url)))return g;
 54+c._wD("setting new URL on existing object: "+h+(p?", old URL: "+p:""));F&&g._t&&g._t.playState&&b.url!==i.url&&g._t.stop();d();g.src=b.url;p=a.url=b.url;g._called_load=!1}else{c._wD("creating HTML5 Audio() element with URL: "+h);g=new Audio(b.url);g._called_load=!1;if(bb)g._called_load=!0;if(F)c._global_a=g}a.isHTML5=!0;a._a=g;g._t=a;f();g.loop=1<b.loops?"loop":"";b.autoLoad||b.autoPlay?a.load():(g.autobuffer=!1,g.preload="none");g.loop=1<b.loops?"loop":"";return g};f=function(){if(a._a._added_events)return!1;
 55+var b;c._wD(k+"adding event listeners: "+a.sID);a._a._added_events=!0;for(b in A)A.hasOwnProperty(b)&&a._a&&a._a.addEventListener(b,A[b],!1);return!0};e=function(){var b;c._wD(k+"removing event listeners: "+a.sID);a._a._added_events=!1;for(b in A)A.hasOwnProperty(b)&&a._a&&a._a.removeEventListener(b,A[b],!1)};this._onload=function(b){var d,b=!!b;c._wD(d+'"'+a.sID+'"'+(b?" loaded.":" failed to load? - "+a.url),b?1:2);d="SMSound._onload(): ";!b&&!a.isHTML5&&(!0===c.sandbox.noRemote&&c._wD(d+q("noNet"),
 56+1),!0===c.sandbox.noLocal&&c._wD(d+q("noLocal"),1));a.loaded=b;a.readyState=b?3:2;a._onbufferchange(0);a._iO.onload&&a._iO.onload.apply(a,[b]);return!0};this._onbufferchange=function(b){if(0===a.playState||b&&a.isBuffering||!b&&!a.isBuffering)return!1;a.isBuffering=1===b;a._iO.onbufferchange&&(c._wD("SMSound._onbufferchange(): "+b),a._iO.onbufferchange.apply(a));return!0};this._onsuspend=function(){a._iO.onsuspend&&(c._wD("SMSound._onsuspend()"),a._iO.onsuspend.apply(a));return!0};this._onfailure=
 57+function(b,d,e){a.failures++;c._wD('SMSound._onfailure(): "'+a.sID+'" count '+a.failures);if(a._iO.onfailure&&1===a.failures)a._iO.onfailure(a,b,d,e);else c._wD("SMSound._onfailure(): ignoring")};this._onfinish=function(){var b=a._iO.onfinish;a._onbufferchange(0);a._resetOnPosition(0);if(a.instanceCount){a.instanceCount--;if(!a.instanceCount)n(),a.playState=0,a.paused=!1,a.instanceCount=0,a.instanceOptions={},a._iO={},h();if((!a.instanceCount||a._iO.multiShotEvents)&&b)c._wD('SMSound._onfinish(): "'+
 58+a.sID+'"'),b.apply(a)}};this._whileloading=function(b,c,d,e){var f=a._iO;a.bytesLoaded=b;a.bytesTotal=c;a.duration=Math.floor(d);a.bufferLength=e;if(f.isMovieStar)a.durationEstimate=a.duration;else if(a.durationEstimate=f.duration?a.duration>f.duration?a.duration:f.duration:parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10),void 0===a.durationEstimate)a.durationEstimate=a.duration;3!==a.readyState&&f.whileloading&&f.whileloading.apply(a)};this._whileplaying=function(b,c,d,e,f){var g=a._iO;if(isNaN(b)||
 59+null===b)return!1;a.position=b;a._processOnPosition();if(!a.isHTML5&&8<m){if(g.usePeakData&&"undefined"!==typeof c&&c)a.peakData={left:c.leftPeak,right:c.rightPeak};if(g.useWaveformData&&"undefined"!==typeof d&&d)a.waveformData={left:d.split(","),right:e.split(",")};if(g.useEQData&&"undefined"!==typeof f&&f&&f.leftEQ&&(b=f.leftEQ.split(","),a.eqData=b,a.eqData.left=b,"undefined"!==typeof f.rightEQ&&f.rightEQ))a.eqData.right=f.rightEQ.split(",")}1===a.playState&&(!a.isHTML5&&8===m&&!a.position&&a.isBuffering&&
 60+a._onbufferchange(0),g.whileplaying&&g.whileplaying.apply(a));return!0};this._onmetadata=function(b,d){c._wD('SMSound._onmetadata(): "'+this.sID+'" metadata received.');var e={},f,g;for(f=0,g=b.length;f<g;f++)e[b[f]]=d[f];a.metadata=e;a._iO.onmetadata&&a._iO.onmetadata.apply(a)};this._onid3=function(b,d){c._wD('SMSound._onid3(): "'+this.sID+'" ID3 data received.');var e=[],f,g;for(f=0,g=b.length;f<g;f++)e[b[f]]=d[f];a.id3=v(a.id3,e);a._iO.onid3&&a._iO.onid3.apply(a)};this._onconnect=function(b){b=
 61+1===b;c._wD('SMSound._onconnect(): "'+a.sID+'"'+(b?" connected.":" failed to connect? - "+a.url),b?1:2);if(a.connected=b)a.failures=0,s(a.sID)&&(a.getAutoPlay()?a.play(void 0,a.getAutoPlay()):a._iO.autoLoad&&a.load()),a._iO.onconnect&&a._iO.onconnect.apply(a,[b])};this._ondataerror=function(b){0<a.playState&&(c._wD("SMSound._ondataerror(): "+b),a._iO.ondataerror&&a._iO.ondataerror.apply(a))}};ba=function(){return h.body||h._docElement||h.getElementsByTagName("div")[0]};u=function(b){return h.getElementById(b)};
 62+v=function(b,a){var d={},f,e;for(f in b)b.hasOwnProperty(f)&&(d[f]=b[f]);f="undefined"===typeof a?c.defaultOptions:a;for(e in f)f.hasOwnProperty(e)&&"undefined"===typeof d[e]&&(d[e]=f[e]);return d};r=function(){function b(a){var a=Pa.call(a),b=a.length;c?(a[1]="on"+a[1],3<b&&a.pop()):3===b&&a.push(!1);return a}function a(a,b){var g=a.shift(),h=[f[b]];if(c)g[h](a[0],a[1]);else g[h].apply(g,a)}var c=j.attachEvent,f={add:c?"attachEvent":"addEventListener",remove:c?"detachEvent":"removeEventListener"};
 63+return{add:function(){a(b(arguments),"add")},remove:function(){a(b(arguments),"remove")}}}();A={abort:l(function(){c._wD(k+"abort: "+this._t.sID)}),canplay:l(function(){var b=this._t;if(b._html5_canplay)return!0;b._html5_canplay=!0;c._wD(k+"canplay: "+b.sID+", "+b.url);b._onbufferchange(0);var a=!isNaN(b.position)?b.position/1E3:null;if(b.position&&this.currentTime!==a){c._wD(k+"canplay: setting position to "+a);try{this.currentTime=a}catch(d){c._wD(k+"setting position failed: "+d.message,2)}}b._iO._oncanplay&&
 64+b._iO._oncanplay()}),load:l(function(){var b=this._t;b.loaded||(b._onbufferchange(0),b._whileloading(b.bytesTotal,b.bytesTotal,b._get_html5_duration()),b._onload(!0))}),emptied:l(function(){c._wD(k+"emptied: "+this._t.sID)}),ended:l(function(){var b=this._t;c._wD(k+"ended: "+b.sID);b._onfinish()}),error:l(function(){c._wD(k+"error: "+this.error.code);this._t._onload(!1)}),loadeddata:l(function(){var b=this._t,a=b.bytesTotal||1;c._wD(k+"loadeddata: "+this._t.sID);if(!b._loaded&&!V)b.duration=b._get_html5_duration(),
 65+b._whileloading(a,a,b._get_html5_duration()),b._onload(!0)}),loadedmetadata:l(function(){c._wD(k+"loadedmetadata: "+this._t.sID)}),loadstart:l(function(){c._wD(k+"loadstart: "+this._t.sID);this._t._onbufferchange(1)}),play:l(function(){c._wD(k+"play: "+this._t.sID+", "+this._t.url);this._t._onbufferchange(0)}),playing:l(function(){c._wD(k+"playing: "+this._t.sID);this._t._onbufferchange(0)}),progress:l(function(b){var a=this._t;if(a.loaded)return!1;var d,f,e;e=0;var h="progress"===b.type;f=b.target.buffered;
 66+var g=b.loaded||0,i=b.total||1;if(f&&f.length){for(d=f.length;d--;)e=f.end(d)-f.start(d);g=e/b.target.duration;if(h&&1<f.length){e=[];f=f.length;for(d=0;d<f;d++)e.push(b.target.buffered.start(d)+"-"+b.target.buffered.end(d));c._wD(k+"progress: timeRanges: "+e.join(", "))}h&&!isNaN(g)&&c._wD(k+"progress: "+a.sID+": "+Math.floor(100*g)+"% loaded")}isNaN(g)||(a._onbufferchange(0),a._whileloading(g,i,a._get_html5_duration()),g&&i&&g===i&&A.load.call(this,b))}),ratechange:l(function(){c._wD(k+"ratechange: "+
 67+this._t.sID)}),suspend:l(function(b){var a=this._t;c._wD(k+"suspend: "+a.sID);A.progress.call(this,b);a._onsuspend()}),stalled:l(function(){c._wD(k+"stalled: "+this._t.sID)}),timeupdate:l(function(){this._t._onTimer()}),waiting:l(function(){var b=this._t;c._wD(k+"waiting: "+b.sID);b._onbufferchange(1)})};ja=function(b){return!b.serverURL&&(b.type?U({type:b.type}):U({url:b.url})||c.html5Only)};ya=function(b){if(b)b.src=ab?"":"about:blank"};U=function(b){function a(a){return c.preferFlash&&t&&!c.ignoreFlash&&
 68+"undefined"!==typeof c.flash[a]&&c.flash[a]}if(!c.useHTML5Audio||!c.hasHTML5)return!1;var d=b.url||null,b=b.type||null,f=c.audioFormats,e;if(b&&"undefined"!==c.html5[b])return c.html5[b]&&!a(b);if(!C){C=[];for(e in f)f.hasOwnProperty(e)&&(C.push(e),f[e].related&&(C=C.concat(f[e].related)));C=RegExp("\\.("+C.join("|")+")(\\?.*)?$","i")}e=d?d.toLowerCase().match(C):null;if(!e||!e.length)if(b)d=b.indexOf(";"),e=(-1!==d?b.substr(0,d):b).substr(6);else return!1;else e=e[1];if(e&&"undefined"!==typeof c.html5[e])return c.html5[e]&&
 69+!a(e);b="audio/"+e;d=c.html5.canPlayType({type:b});return(c.html5[e]=d)&&c.html5[b]&&!a(b)};Oa=function(){function b(b){var d,e,f=!1;if(!a||"function"!==typeof a.canPlayType)return!1;if(b instanceof Array){for(d=0,e=b.length;d<e&&!f;d++)if(c.html5[b[d]]||a.canPlayType(b[d]).match(c.html5Test))f=!0,c.html5[b[d]]=!0,c.flash[b[d]]=!(!c.preferFlash||!t||!b[d].match(Ua));return f}b=a&&"function"===typeof a.canPlayType?a.canPlayType(b):!1;return!(!b||!b.match(c.html5Test))}if(!c.useHTML5Audio||"undefined"===
 70+typeof Audio)return!1;var a="undefined"!==typeof Audio?db?new Audio(null):new Audio:null,d,f={},e,h;e=c.audioFormats;for(d in e)if(e.hasOwnProperty(d)&&(f[d]=b(e[d].type),f["audio/"+d]=f[d],c.flash[d]=c.preferFlash&&!c.ignoreFlash&&d.match(Ua)?!0:!1,e[d]&&e[d].related))for(h=e[d].related.length;h--;)f["audio/"+e[d].related[h]]=f[d],c.html5[e[d].related[h]]=f[d],c.flash[e[d].related[h]]=f[d];f.canPlayType=a?b:null;c.html5=v(c.html5,f);return!0};$={notReady:"Not loaded yet - wait for soundManager.onload()/onready()",
 71+notOK:"Audio support is not available.",domError:"soundManager::createMovie(): appendChild/innerHTML call failed. DOM not ready or other error.",spcWmode:"soundManager::createMovie(): Removing wmode, preventing known SWF loading issue(s)",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 ("+h.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/",
 72+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: Function object expected for %s",badID:'Warning: Sound ID "%s" should be a string, starting with a non-numeric character',currentObj:"--- soundManager._debug(): Current sound objects ---",waitEI:"soundManager::initMovie(): Waiting for ExternalInterface call from Flash..",
 73+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..",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",
 74+badRemove:"Warning: Failed to remove flash movie.",noPeak:"Warning: peakData features unsupported for movieStar formats",shutdown:"soundManager.disable(): Shutting down",queue:"soundManager: Queueing %s handler",smFail:"soundManager: Failed to initialise.",smError:"SMSound.load(): Exception: JS-Flash communication failed, or JS error.",fbTimeout:"No flash response, applying .swf_timedout CSS..",fbLoaded:"Flash loaded",fbHandler:"soundManager::flashBlockHandler()",manURL:"SMSound.load(): Using manually-assigned URL",
7575 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.",mfTimeout:"Setting flashLoadTimeout = 0 (infinite) for off-screen, mobile flash case",mfOn:"mobileFlash::enabling on-screen flash repositioning",policy:"Enabling usePolicyFile for data access"};
76 -n=function(){var b=Ia.call(arguments),a=b.shift(),a=W&&W[a]?W[a]:"",c,f;if(a&&b&&b.length)for(c=0,f=b.length;c<f;c++)a=a.replace("%s",b[c]);return a};aa=function(b){if(j===8&&b.loops>1&&b.stream)l("as2loop"),b.stream=false;return b};ba=function(b,a){if(b&&!b.usePolicyFile&&(b.onid3||b.usePeakData||b.useWaveformData||b.useEQData))c._wD((a||"")+n("policy")),b.usePolicyFile=true;return b};pa=function(b){typeof console!=="undefined"&&typeof console.warn!=="undefined"?console.warn(b):c._wD(b)};ga=function(){return false};
77 -Ba=function(b){for(var a in b)b.hasOwnProperty(a)&&typeof b[a]==="function"&&(b[a]=ga)};$=function(b){typeof b==="undefined"&&(b=false);if(v||b)l("smFail",2),c.disable(b)};Ca=function(b){var a=null;if(b)if(b.match(/\.swf(\?.*)?$/i)){if(a=b.substr(b.toLowerCase().lastIndexOf(".swf?")+4))return b}else b.lastIndexOf("/")!==b.length-1&&(b+="/");b=(b&&b.lastIndexOf("/")!==-1?b.substr(0,b.lastIndexOf("/")+1):"./")+c.movieURL;c.noSWFCache&&(b+="?ts="+(new Date).getTime());return b};ka=function(){j=parseInt(c.flashVersion,
78 -10);if(j!==8&&j!==9)c._wD(n("badFV",j,8)),c.flashVersion=j=8;var b=c.debugMode||c.debugFlash?"_debug.swf":".swf";if(c.useHTML5Audio&&!c.html5Only&&c.audioFormats.mp4.required&&j<9)c._wD(n("needfl9")),c.flashVersion=j=9;c.version=c.versionNumber+(c.html5Only?" (HTML5-only mode)":j===9?" (AS3/Flash 9)":" (AS2/Flash 8)");j>8?(c.defaultOptions=s(c.defaultOptions,c.flash9Options),c.features.buffering=true,c.defaultOptions=s(c.defaultOptions,c.movieStarOptions),c.filePatterns.flash9=RegExp("\\.(mp3|"+Pa.join("|")+
79 -")(\\?.*)?$","i"),c.features.movieStar=true):c.features.movieStar=false;c.filePattern=c.filePatterns[j!==8?"flash9":"flash8"];c.movieURL=(j===8?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",b);c.features.peakData=c.features.waveformData=c.features.eqData=j>8};Aa=function(b,a){if(!c.o)return false;c.o._setPolling(b,a)};ma=function(){if(c.debugURLParam.test(K))c.debugMode=true;if(u(c.debugID))return false;var b,a,e,f;if(c.debugMode&&!u(c.debugID)&&(!va||!c.useConsole||c.useConsole&&
80 -va&&!c.consoleOnly)){b=g.createElement("div");b.id=c.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};b.appendChild(g.createTextNode("-"));b.onclick=Da;b.title="Toggle SM2 debug console";if(q.match(/msie 6/i))b.style.position="absolute",b.style.cursor="hand";for(f in a)a.hasOwnProperty(f)&&(b.style[f]=a[f]);a=g.createElement("div");
81 -a.id=c.debugID;a.style.display=c.debugMode?"block":"none";if(c.debugMode&&!u(b.id)){try{e=Y(),e.appendChild(b)}catch(d){throw Error(n("domError")+" \n"+d.toString());}e.appendChild(a)}}};o=this.getSoundById;l=function(b,a){return b?c._wD(n(b),a):""};if(K.indexOf("sm2-debug=alert")+1&&c.debugMode)c._wD=function(b){S.alert(b)};Da=function(){var b=u(c.debugID),a=u(c.debugID+"-toggle");if(!b)return false;ha?(a.innerHTML="+",b.style.display="none"):(a.innerHTML="-",b.style.display="block");ha=!ha};r=function(b,
82 -a,c){if(typeof sm2Debugger!=="undefined")try{sm2Debugger.handleEvent(b,a,c)}catch(f){}return true};G=function(){var b=[];c.debugMode&&b.push(c.swfCSS.sm2Debug);c.debugFlash&&b.push(c.swfCSS.flashDebug);c.useHighPerformance&&b.push(c.swfCSS.highPerf);return b.join(" ")};oa=function(){var b=n("fbHandler"),a=c.getMoviePercent(),e=c.swfCSS,f={type:"FLASHBLOCK"};if(c.html5Only)return false;if(c.ok()){if(c.didFlashBlock&&c._wD(b+": Unblocked"),c.oMC)c.oMC.className=[G(),e.swfDefault,e.swfLoaded+(c.didFlashBlock?
83 -" "+e.swfUnblocked:"")].join(" ")}else{if(w)c.oMC.className=G()+" "+e.swfDefault+" "+(a===null?e.swfTimedout:e.swfError),c._wD(b+": "+n("fbTimeout")+(a?" ("+n("fbLoaded")+")":""));c.didFlashBlock=true;C({type:"ontimeout",ignoreInit:true,error:f});F(f)}};ja=function(b,a,c){typeof y[b]==="undefined"&&(y[b]=[]);y[b].push({method:a,scope:c||null,fired:false})};C=function(b){b||(b={type:"onready"});if(!m&&b&&!b.ignoreInit)return false;if(b.type==="ontimeout"&&c.ok())return false;var a={success:b&&b.ignoreInit?
84 -c.ok():!v},e=b&&b.type?y[b.type]||[]:[],f=[],d,g=[a],j=w&&c.useFlashBlock&&!c.ok();if(b.error)g[0].error=b.error;for(a=0,d=e.length;a<d;a++)e[a].fired!==true&&f.push(e[a]);if(f.length){c._wD("soundManager: Firing "+f.length+" "+b.type+"() item"+(f.length===1?"":"s"));for(a=0,d=f.length;a<d;a++)if(f[a].scope?f[a].method.apply(f[a].scope,g):f[a].method.apply(this,g),!j)f[a].fired=true}return true};D=function(){i.setTimeout(function(){c.useFlashBlock&&oa();C();c.onload instanceof Function&&(l("onload",
85 -1),c.onload.apply(i),l("onloadOK",1));c.waitForWindowLoad&&p.add(i,"load",D)},1)};ea=function(){if(t!==void 0)return t;var b=false,a=navigator,c=a.plugins,f,d=i.ActiveXObject;if(c&&c.length)(a=a.mimeTypes)&&a["application/x-shockwave-flash"]&&a["application/x-shockwave-flash"].enabledPlugin&&a["application/x-shockwave-flash"].enabledPlugin.description&&(b=true);else if(typeof d!=="undefined"){try{f=new d("ShockwaveFlash.ShockwaveFlash")}catch(g){}b=!!f}return t=b};Ga=function(){var b,a;if(ta&&q.match(/os (1|2|3_0|3_1)/i)){c.hasHTML5=
86 -false;c.html5Only=true;if(c.oMC)c.oMC.style.display="none";return false}if(c.useHTML5Audio){if(!c.html5||!c.html5.canPlayType)return c._wD("SoundManager: No HTML5 Audio() support detected."),c.hasHTML5=false,true;else c.hasHTML5=true;if(ua&&(c._wD("soundManager::Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - "+(!t?" would use flash fallback for MP3/MP4, but none detected.":"will use flash fallback for MP3/MP4, if available"),1),ea()))return true}else return true;
87 -for(a in c.audioFormats)if(c.audioFormats.hasOwnProperty(a)&&(c.audioFormats[a].required&&!c.html5.canPlayType(c.audioFormats[a].type)||c.flash[a]||c.flash[c.audioFormats[a].type]))b=true;c.ignoreFlash&&(b=false);c.html5Only=c.hasHTML5&&c.useHTML5Audio&&!b;return!c.html5Only};Ea=function(b){if(!b._hasTimer)b._hasTimer=true};Fa=function(b){if(b._hasTimer)b._hasTimer=false};F=function(b){b=typeof b!=="undefined"?b:{};c.onerror instanceof Function&&c.onerror.apply(i,[{type:typeof b.type!=="undefined"?
88 -b.type:null}]);typeof b.fatal!=="undefined"&&b.fatal&&c.disable()};Ja=function(){if(!ua||!ea())return false;var b=c.audioFormats,a,e;for(e in b)if(b.hasOwnProperty(e)&&(e==="mp3"||e==="mp4"))if(c._wD("soundManager: Using flash fallback for "+e+" format"),c.html5[e]=false,b[e]&&b[e].related)for(a=b[e].related.length;a--;)c.html5[b[e].related[a]]=false};this._setSandboxType=function(b){var a=c.sandbox;a.type=b;a.description=a.types[typeof a.types[b]!=="undefined"?b:"unknown"];c._wD("Flash security sandbox type: "+
89 -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(b){if(c.swfLoaded)return false;var a=(new Date).getTime();c._wD("soundManager::externalInterfaceOK()"+(b?" (~"+(a-b)+" ms)":""));r("swf",true);r("flashtojs",true);c.swfLoaded=true;H=false;ua&&Ja();A?setTimeout(U,100):U()};Z=function(b,a){function e(){c._wD("-- SoundManager 2 "+
90 -c.version+(!c.html5Only&&c.useHTML5Audio?c.hasHTML5?" + HTML5 audio":", no HTML5 audio support":"")+(!c.html5Only?(c.useHighPerformance?", high performance mode, ":", ")+((c.flashPollingInterval?"custom ("+c.flashPollingInterval+"ms)":"normal")+" polling")+(c.wmode?", wmode: "+c.wmode:"")+(c.debugFlash?", flash debug mode":"")+(c.useFlashBlock?", flashBlock mode":""):"")+" --",1)}function f(a,b){return'<param name="'+a+'" value="'+b+'" />'}if(L&&M)return false;if(c.html5Only)return ka(),e(),c.oMC=
91 -u(c.movieID),U(),M=L=true,false;var d=a||c.url,j=c.altURL||d,h;h=Y();var i,o,k=G(),m,p=null,p=(p=g.getElementsByTagName("html")[0])&&p.dir&&p.dir.match(/rtl/i),b=typeof b==="undefined"?c.id:b;ka();c.url=Ca(I?d:j);a=c.url;c.wmode=!c.wmode&&c.useHighPerformance?"transparent":c.wmode;if(c.wmode!==null&&(q.match(/msie 8/i)||!A&&!c.useHighPerformance)&&navigator.platform.match(/win32|win64/i))c.specialWmodeCase=true,l("spcWmode"),c.wmode=null;h={name:b,id:b,src:a,width:"auto",height:"auto",quality:"high",
92 -allowScriptAccess:c.allowScriptAccess,bgcolor:c.bgColor,pluginspage:Na+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:c.wmode,hasPriority:"true"};if(c.debugFlash)h.FlashVars="debug=1";c.wmode||delete h.wmode;if(A)d=g.createElement("div"),o=['<object id="'+b+'" data="'+a+'" type="'+h.type+'" title="'+h.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+Na+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="'+
93 -h.width+'" height="'+h.height+'">',f("movie",a),f("AllowScriptAccess",c.allowScriptAccess),f("quality",h.quality),c.wmode?f("wmode",c.wmode):"",f("bgcolor",c.bgColor),f("hasPriority","true"),c.debugFlash?f("FlashVars",h.FlashVars):"","</object>"].join("");else for(i in d=g.createElement("embed"),h)h.hasOwnProperty(i)&&d.setAttribute(i,h[i]);ma();k=G();if(h=Y())if(c.oMC=u(c.movieID)||g.createElement("div"),c.oMC.id){m=c.oMC.className;c.oMC.className=(m?m+" ":c.swfCSS.swfDefault)+(k?" "+k:"");c.oMC.appendChild(d);
94 -if(A)i=c.oMC.appendChild(g.createElement("div")),i.className=c.swfCSS.swfBox,i.innerHTML=o;M=true}else{c.oMC.id=c.movieID;c.oMC.className=c.swfCSS.swfDefault+" "+k;i=k=null;if(!c.useFlashBlock)if(c.useHighPerformance)k={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"};else if(k={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},p)k.left=Math.abs(parseInt(k.left,10))+"px";if(Ua)c.oMC.style.zIndex=1E4;if(!c.debugFlash)for(m in k)k.hasOwnProperty(m)&&
95 -(c.oMC.style[m]=k[m]);try{A||c.oMC.appendChild(d);h.appendChild(c.oMC);if(A)i=c.oMC.appendChild(g.createElement("div")),i.className=c.swfCSS.swfBox,i.innerHTML=o;M=true}catch(r){throw Error(n("domError")+" \n"+r.toString());}}L=true;e();c._wD("soundManager::createMovie(): Trying to load "+a+(!I&&c.altURL?" (alternate URL)":""),1);return true};X=function(){if(c.html5Only)return Z(),false;if(c.o)return false;c.o=c.getMovie(c.id);if(!c.o)O?(A?c.oMC.innerHTML=na:c.oMC.appendChild(O),O=null,L=true):Z(c.id,
96 -c.url),c.o=c.getMovie(c.id);c.o&&l("waitEI");c.oninitmovie instanceof Function&&setTimeout(c.oninitmovie,1);return true};V=function(){setTimeout(za,1E3)};za=function(){if(ca)return false;ca=true;p.remove(i,"load",V);if(H&&!wa)return l("waitFocus"),false;var b;m||(b=c.getMoviePercent(),c._wD(n("waitImpatient",b===100?" (SWF loaded)":b>0?" (SWF "+b+"% loaded)":"")));setTimeout(function(){b=c.getMoviePercent();m||(c._wD("soundManager: No Flash response within expected time.\nLikely causes: "+(b===0?
97 -"Loading "+c.movieURL+" may have failed (and/or Flash "+j+"+ not present?), ":"")+"Flash blocked or JS-Flash security error."+(c.debugFlash?" "+n("checkSWF"):""),2),!I&&b&&(l("localFail",2),c.debugFlash||l("tryDebug",2)),b===0&&c._wD(n("swf404",c.url)),r("flashtojs",false,": Timed out"+I?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)"));!m&&La&&(b===null?c.useFlashBlock||c.flashLoadTimeout===0?(c.useFlashBlock&&oa(),l("waitForever")):$(true):c.flashLoadTimeout===0?l("waitForever"):
98 -$(true))},c.flashLoadTimeout)};B=function(){function b(){p.remove(i,"focus",B);p.remove(i,"load",B)}if(wa||!H)return b(),true;wa=La=true;c._wD("soundManager::handleFocus()");R&&H&&p.remove(i,"mousemove",B);ca=false;b();return true};Ka=function(){var b,a=[];if(c.useHTML5Audio&&c.hasHTML5){for(b in c.audioFormats)c.audioFormats.hasOwnProperty(b)&&a.push(b+": "+c.html5[b]+(!c.html5[b]&&t&&c.flash[b]?" (using flash)":c.preferFlash&&c.flash[b]&&t?" (preferring flash)":!c.html5[b]?" ("+(c.audioFormats[b].required?
99 -"required, ":"")+"and no flash support)":""));c._wD("-- SoundManager 2: HTML5 support tests ("+c.html5Test+"): "+a.join(", ")+" --",1)}};N=function(b){if(m)return false;if(c.html5Only)return c._wD("-- SoundManager 2: loaded --"),m=true,D(),r("onload",true),true;var a;if(!c.useFlashBlock||!c.flashLoadTimeout||c.getMoviePercent())m=true,v&&(a={type:!t&&w?"NO_FLASH":"INIT_TIMEOUT"});c._wD("-- SoundManager 2 "+(v?"failed to load":"loaded")+" ("+(v?"security/load error":"OK")+") --",1);if(v||b){if(c.useFlashBlock&&
100 -c.oMC)c.oMC.className=G()+" "+(c.getMoviePercent()===null?c.swfCSS.swfTimedout:c.swfCSS.swfError);C({type:"ontimeout",error:a});r("onload",false);F(a);return false}else r("onload",true);if(c.waitForWindowLoad&&!ia)return l("waitOnload"),p.add(i,"load",D),false;else c.waitForWindowLoad&&ia&&l("docLoaded"),D();return true};U=function(){l("init");if(m)return l("didInit"),false;if(c.html5Only){if(!m)p.remove(i,"load",c.beginDelayedInit),c.enabled=true,N();return true}X();try{l("flashJS"),c.o._externalInterfaceTest(false),
101 -Aa(true,c.flashPollingInterval||(c.useHighPerformance?10:50)),c.debugMode||c.o._disableDebug(),c.enabled=true,r("jstoflash",true),c.html5Only||p.add(i,"unload",ga)}catch(b){return c._wD("js/flash exception: "+b.toString()),r("jstoflash",false),F({type:"JS_TO_FLASH_EXCEPTION",fatal:true}),$(true),N(),false}N();p.remove(i,"load",c.beginDelayedInit);return true};E=function(){if(la)return false;la=true;ma();var b=K.toLowerCase(),a=null,a=null,e=typeof console!=="undefined"&&typeof console.log!=="undefined";
102 -if(b.indexOf("sm2-usehtml5audio=")!==-1)a=b.charAt(b.indexOf("sm2-usehtml5audio=")+18)==="1",e&&console.log((a?"Enabling ":"Disabling ")+"useHTML5Audio via URL parameter"),c.useHTML5Audio=a;if(b.indexOf("sm2-preferflash=")!==-1)a=b.charAt(b.indexOf("sm2-preferflash=")+16)==="1",e&&console.log((a?"Enabling ":"Disabling ")+"preferFlash via URL parameter"),c.preferFlash=a;if(!t&&c.hasHTML5)c._wD("SoundManager: No Flash detected"+(!c.useHTML5Audio?", enabling HTML5.":". Trying HTML5-only mode.")),c.useHTML5Audio=
103 -true,c.preferFlash=false;Ha();c.html5.usingFlash=Ga();w=c.html5.usingFlash;Ka();if(!t&&w)c._wD("SoundManager: Fatal error: Flash is needed to play some required formats, but is not available."),c.flashLoadTimeout=1;g.removeEventListener&&g.removeEventListener("DOMContentLoaded",E,false);X();return true};sa=function(){g.readyState==="complete"&&(E(),g.detachEvent("onreadystatechange",sa));return true};ea();p.add(i,"focus",B);p.add(i,"load",B);p.add(i,"load",V);R&&H&&p.add(i,"mousemove",B);g.addEventListener?
104 -g.addEventListener("DOMContentLoaded",E,false):g.attachEvent?g.attachEvent("onreadystatechange",sa):(r("onload",false),F({type:"NO_DOM2_EVENTS",fatal:true}));g.readyState==="complete"&&setTimeout(E,100)}var fa=null;if(typeof SM2_DEFER==="undefined"||!SM2_DEFER)fa=new T;S.SoundManager=T;S.soundManager=fa})(window);
\ No newline at end of file
 76+q=function(){var b=Pa.call(arguments),a=b.shift(),a=$&&$[a]?$[a]:"",c,f;if(a&&b&&b.length)for(c=0,f=b.length;c<f;c++)a=a.replace("%s",b[c]);return a};ea=function(b){if(8===m&&1<b.loops&&b.stream)o("as2loop"),b.stream=!1;return b};fa=function(b,a){if(b&&!b.usePolicyFile&&(b.onid3||b.usePeakData||b.useWaveformData||b.useEQData))c._wD((a||"")+q("policy")),b.usePolicyFile=!0;return b};wa=function(b){"undefined"!==typeof console&&"undefined"!==typeof console.warn?console.warn(b):c._wD(b)};na=function(){return!1};
 77+Ha=function(b){for(var a in b)b.hasOwnProperty(a)&&"function"===typeof b[a]&&(b[a]=na)};da=function(b){"undefined"===typeof b&&(b=!1);if(y||b)o("smFail",2),c.disable(b)};Ia=function(b){var a=null;if(b)if(b.match(/\.swf(\?.*)?$/i)){if(a=b.substr(b.toLowerCase().lastIndexOf(".swf?")+4))return b}else b.lastIndexOf("/")!==b.length-1&&(b+="/");b=(b&&-1!==b.lastIndexOf("/")?b.substr(0,b.lastIndexOf("/")+1):"./")+c.movieURL;c.noSWFCache&&(b+="?ts="+(new Date).getTime());return b};qa=function(){m=parseInt(c.flashVersion,
 78+10);if(8!==m&&9!==m)c._wD(q("badFV",m,8)),c.flashVersion=m=8;var b=c.debugMode||c.debugFlash?"_debug.swf":".swf";if(c.useHTML5Audio&&!c.html5Only&&c.audioFormats.mp4.required&&9>m)c._wD(q("needfl9")),c.flashVersion=m=9;c.version=c.versionNumber+(c.html5Only?" (HTML5-only mode)":9===m?" (AS3/Flash 9)":" (AS2/Flash 8)");8<m?(c.defaultOptions=v(c.defaultOptions,c.flash9Options),c.features.buffering=!0,c.defaultOptions=v(c.defaultOptions,c.movieStarOptions),c.filePatterns.flash9=RegExp("\\.(mp3|"+Xa.join("|")+
 79+")(\\?.*)?$","i"),c.features.movieStar=!0):c.features.movieStar=!1;c.filePattern=c.filePatterns[8!==m?"flash9":"flash8"];c.movieURL=(8===m?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",b);c.features.peakData=c.features.waveformData=c.features.eqData=8<m};Ga=function(b,a){if(!i)return!1;i._setPolling(b,a)};ta=function(){if(c.debugURLParam.test(O))c.debugMode=!0;if(u(c.debugID))return!1;var b,a,d,f;if(c.debugMode&&!u(c.debugID)&&(!Sa||!c.useConsole||!c.consoleOnly)){b=h.createElement("div");
 80+b.id=c.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};b.appendChild(h.createTextNode("-"));b.onclick=Ja;b.title="Toggle SM2 debug console";if(p.match(/msie 6/i))b.style.position="absolute",b.style.cursor="hand";for(f in a)a.hasOwnProperty(f)&&(b.style[f]=a[f]);a=h.createElement("div");a.id=c.debugID;a.style.display=c.debugMode?
 81+"block":"none";if(c.debugMode&&!u(b.id)){try{d=ba(),d.appendChild(b)}catch(e){throw Error(q("domError")+" \n"+e.toString());}d.appendChild(a)}}};s=this.getSoundById;o=function(b,a){return b?c._wD(q(b),a):""};if(O.indexOf("sm2-debug=alert")+1&&c.debugMode)c._wD=function(b){G.alert(b)};Ja=function(){var b=u(c.debugID),a=u(c.debugID+"-toggle");if(!b)return!1;oa?(a.innerHTML="+",b.style.display="none"):(a.innerHTML="-",b.style.display="block");oa=!oa};w=function(b,a,c){if("undefined"!==typeof sm2Debugger)try{sm2Debugger.handleEvent(b,
 82+a,c)}catch(f){}return!0};L=function(){var b=[];c.debugMode&&b.push("sm2_debug");c.debugFlash&&b.push("flash_debug");c.useHighPerformance&&b.push("high_performance");return b.join(" ")};va=function(){var b=q("fbHandler"),a=c.getMoviePercent(),d={type:"FLASHBLOCK"};if(c.html5Only)return!1;if(c.ok()){if(c.didFlashBlock&&c._wD(b+": Unblocked"),c.oMC)c.oMC.className=[L(),"movieContainer","swf_loaded"+(c.didFlashBlock?" swf_unblocked":"")].join(" ")}else{if(z)c.oMC.className=L()+" movieContainer "+(null===
 83+a?"swf_timedout":"swf_error"),c._wD(b+": "+q("fbTimeout")+(a?" ("+q("fbLoaded")+")":""));c.didFlashBlock=!0;H({type:"ontimeout",ignoreInit:!0,error:d});K(d)}};pa=function(b,a,c){"undefined"===typeof B[b]&&(B[b]=[]);B[b].push({method:a,scope:c||null,fired:!1})};H=function(b){b||(b={type:"onready"});if(!n&&b&&!b.ignoreInit||"ontimeout"===b.type&&c.ok())return!1;var a={success:b&&b.ignoreInit?c.ok():!y},d=b&&b.type?B[b.type]||[]:[],f=[],e,h=[a],g=z&&c.useFlashBlock&&!c.ok();if(b.error)h[0].error=b.error;
 84+for(a=0,e=d.length;a<e;a++)!0!==d[a].fired&&f.push(d[a]);if(f.length){c._wD("soundManager: Firing "+f.length+" "+b.type+"() item"+(1===f.length?"":"s"));for(a=0,e=f.length;a<e;a++)if(f[a].scope?f[a].method.apply(f[a].scope,h):f[a].method.apply(this,h),!g)f[a].fired=!0}return!0};I=function(){j.setTimeout(function(){c.useFlashBlock&&va();H();c.onload instanceof Function&&(o("onload",1),c.onload.apply(j),o("onloadOK",1));c.waitForWindowLoad&&r.add(j,"load",I)},1)};ka=function(){if(void 0!==t)return t;
 85+var b=!1,a=navigator,c=a.plugins,f,e=j.ActiveXObject;if(c&&c.length)(a=a.mimeTypes)&&a["application/x-shockwave-flash"]&&a["application/x-shockwave-flash"].enabledPlugin&&a["application/x-shockwave-flash"].enabledPlugin.description&&(b=!0);else if("undefined"!==typeof e){try{f=new e("ShockwaveFlash.ShockwaveFlash")}catch(h){}b=!!f}return t=b};Na=function(){var b,a;if(Aa&&p.match(/os (1|2|3_0|3_1)/i)){c.hasHTML5=!1;c.html5Only=!0;if(c.oMC)c.oMC.style.display="none";return!1}if(c.useHTML5Audio){if(!c.html5||
 86+!c.html5.canPlayType)return c._wD("SoundManager: No HTML5 Audio() support detected."),c.hasHTML5=!1,!0;c.hasHTML5=!0;if(Ca&&(c._wD("soundManager::Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - "+(!t?" would use flash fallback for MP3/MP4, but none detected.":"will use flash fallback for MP3/MP4, if available"),1),ka()))return!0}else return!0;for(a in c.audioFormats)if(c.audioFormats.hasOwnProperty(a)&&(c.audioFormats[a].required&&!c.html5.canPlayType(c.audioFormats[a].type)||
 87+c.flash[a]||c.flash[c.audioFormats[a].type]))b=!0;c.ignoreFlash&&(b=!1);c.html5Only=c.hasHTML5&&c.useHTML5Audio&&!b;return!c.html5Only};ia=function(b){var a,d,f=0;if(b instanceof Array){for(a=0,d=b.length;a<d;a++)if(b[a]instanceof Object){if(c.canPlayMIME(b[a].type)){f=a;break}}else if(c.canPlayURL(b[a])){f=a;break}if(b[f].url)b[f]=b[f].url;return b[f]}return b};Ka=function(b){if(!b._hasTimer)b._hasTimer=!0,!Ba&&c.html5PollingInterval&&(null===T&&0===ha&&(T=G.setInterval(Ma,c.html5PollingInterval)),
 88+ha++)};La=function(b){if(b._hasTimer)b._hasTimer=!1,!Ba&&c.html5PollingInterval&&ha--};Ma=function(){var b;if(null!==T&&!ha)return G.clearInterval(T),T=null,!1;for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].isHTML5&&c.sounds[c.soundIDs[b]]._hasTimer&&c.sounds[c.soundIDs[b]]._onTimer()};K=function(b){b="undefined"!==typeof b?b:{};c.onerror instanceof Function&&c.onerror.apply(j,[{type:"undefined"!==typeof b.type?b.type:null}]);"undefined"!==typeof b.fatal&&b.fatal&&c.disable()};Qa=function(){if(!Ca||
 89+!ka())return!1;var b=c.audioFormats,a,d;for(d in b)if(b.hasOwnProperty(d)&&("mp3"===d||"mp4"===d))if(c._wD("soundManager: Using flash fallback for "+d+" format"),c.html5[d]=!1,b[d]&&b[d].related)for(a=b[d].related.length;a--;)c.html5[b[d].related[a]]=!1};this._setSandboxType=function(b){var a=c.sandbox;a.type=b;a.description=a.types["undefined"!==typeof a.types[b]?b:"unknown"];c._wD("Flash security sandbox type: "+a.type);if("localWithFile"===a.type)a.noRemote=!0,a.noLocal=!1,o("secNote",2);else if("localWithNetwork"===
 90+a.type)a.noRemote=!1,a.noLocal=!0;else if("localTrusted"===a.type)a.noRemote=!1,a.noLocal=!1};this._externalInterfaceOK=function(b,a){if(c.swfLoaded)return!1;var d,f=(new Date).getTime();c._wD("soundManager::externalInterfaceOK()"+(b?" (~"+(f-b)+" ms)":""));w("swf",!0);w("flashtojs",!0);c.swfLoaded=!0;M=!1;Ca&&Qa();if(!a||a.replace(/\+dev/i,"")!==c.versionNumber.replace(/\+dev/i,""))return d='soundManager: Fatal: JavaScript file build "'+c.versionNumber+'" does not match Flash SWF build "'+a+'" at '+
 91+c.url+". Ensure both are up-to-date.",setTimeout(function(){throw Error(d);},0),!1;D?setTimeout(X,100):X()};ca=function(b,a){function d(){c._wD("-- SoundManager 2 "+c.version+(!c.html5Only&&c.useHTML5Audio?c.hasHTML5?" + HTML5 audio":", no HTML5 audio support":"")+(!c.html5Only?(c.useHighPerformance?", high performance mode, ":", ")+((c.flashPollingInterval?"custom ("+c.flashPollingInterval+"ms)":"normal")+" polling")+(c.wmode?", wmode: "+c.wmode:"")+(c.debugFlash?", flash debug mode":"")+(c.useFlashBlock?
 92+", flashBlock mode":""):"")+" --",1)}function f(a,b){return'<param name="'+a+'" value="'+b+'" />'}if(P&&Q)return!1;if(c.html5Only)return qa(),d(),c.oMC=u(c.movieID),X(),Q=P=!0,!1;var e=a||c.url,i=c.altURL||e,g;g=ba();var j,m,k=L(),l,n=null,n=(n=h.getElementsByTagName("html")[0])&&n.dir&&n.dir.match(/rtl/i),b="undefined"===typeof b?c.id:b;qa();c.url=Ia(N?e:i);a=c.url;c.wmode=!c.wmode&&c.useHighPerformance?"transparent":c.wmode;if(null!==c.wmode&&(p.match(/msie 8/i)||!D&&!c.useHighPerformance)&&navigator.platform.match(/win32|win64/i))o("spcWmode"),
 93+c.wmode=null;g={name:b,id:b,src:a,width:"auto",height:"auto",quality:"high",allowScriptAccess:c.allowScriptAccess,bgcolor:c.bgColor,pluginspage:Va+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:c.wmode,hasPriority:"true"};if(c.debugFlash)g.FlashVars="debug=1";c.wmode||delete g.wmode;if(D)e=h.createElement("div"),m=['<object id="'+b+'" data="'+a+'" type="'+g.type+'" title="'+g.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+
 94+Va+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="'+g.width+'" height="'+g.height+'">',f("movie",a),f("AllowScriptAccess",c.allowScriptAccess),f("quality",g.quality),c.wmode?f("wmode",c.wmode):"",f("bgcolor",c.bgColor),f("hasPriority","true"),c.debugFlash?f("FlashVars",g.FlashVars):"","</object>"].join("");else for(j in e=h.createElement("embed"),g)g.hasOwnProperty(j)&&e.setAttribute(j,g[j]);ta();k=L();if(g=ba())if(c.oMC=u(c.movieID)||h.createElement("div"),
 95+c.oMC.id){l=c.oMC.className;c.oMC.className=(l?l+" ":"movieContainer")+(k?" "+k:"");c.oMC.appendChild(e);if(D)j=c.oMC.appendChild(h.createElement("div")),j.className="sm2-object-box",j.innerHTML=m;Q=!0}else{c.oMC.id=c.movieID;c.oMC.className="movieContainer "+k;j=k=null;if(!c.useFlashBlock)if(c.useHighPerformance)k={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"};else if(k={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},n)k.left=Math.abs(parseInt(k.left,
 96+10))+"px";if(cb)c.oMC.style.zIndex=1E4;if(!c.debugFlash)for(l in k)k.hasOwnProperty(l)&&(c.oMC.style[l]=k[l]);try{D||c.oMC.appendChild(e);g.appendChild(c.oMC);if(D)j=c.oMC.appendChild(h.createElement("div")),j.className="sm2-object-box",j.innerHTML=m;Q=!0}catch(r){throw Error(q("domError")+" \n"+r.toString());}}P=!0;d();c._wD("soundManager::createMovie(): Trying to load "+a+(!N&&c.altURL?" (alternate URL)":""),1);return!0};aa=function(){if(c.html5Only)return ca(),!1;if(i)return!1;i=c.getMovie(c.id);
 97+if(!i)S?(D?c.oMC.innerHTML=ua:c.oMC.appendChild(S),S=null,P=!0):ca(c.id,c.url),i=c.getMovie(c.id);i&&o("waitEI");c.oninitmovie instanceof Function&&setTimeout(c.oninitmovie,1);return!0};Z=function(){setTimeout(Fa,1E3)};Fa=function(){if(ga)return!1;ga=!0;r.remove(j,"load",Z);if(M&&!Da)return o("waitFocus"),!1;var b;n||(b=c.getMoviePercent(),c._wD(q("waitImpatient",100===b?" (SWF loaded)":0<b?" (SWF "+b+"% loaded)":"")));setTimeout(function(){b=c.getMoviePercent();n||(c._wD("soundManager: No Flash response within expected time.\nLikely causes: "+
 98+(0===b?"Loading "+c.movieURL+" may have failed (and/or Flash "+m+"+ not present?), ":"")+"Flash blocked or JS-Flash security error."+(c.debugFlash?" "+q("checkSWF"):""),2),!N&&b&&(o("localFail",2),c.debugFlash||o("tryDebug",2)),0===b&&c._wD(q("swf404",c.url)),w("flashtojs",!1,": Timed out"+N?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)"));!n&&Ta&&(null===b?c.useFlashBlock||0===c.flashLoadTimeout?(c.useFlashBlock&&va(),o("waitForever")):da(!0):0===c.flashLoadTimeout?o("waitForever"):
 99+da(!0))},c.flashLoadTimeout)};E=function(){function b(){r.remove(j,"focus",E);r.remove(j,"load",E)}if(Da||!M)return b(),!0;Da=Ta=!0;c._wD("soundManager::handleFocus()");V&&M&&r.remove(j,"mousemove",E);ga=!1;b();return!0};Ra=function(){var b,a=[];if(c.useHTML5Audio&&c.hasHTML5){for(b in c.audioFormats)c.audioFormats.hasOwnProperty(b)&&a.push(b+": "+c.html5[b]+(!c.html5[b]&&t&&c.flash[b]?" (using flash)":c.preferFlash&&c.flash[b]&&t?" (preferring flash)":!c.html5[b]?" ("+(c.audioFormats[b].required?
 100+"required, ":"")+"and no flash support)":""));c._wD("-- SoundManager 2: HTML5 support tests ("+c.html5Test+"): "+a.join(", ")+" --",1)}};R=function(b){if(n)return!1;if(c.html5Only)return c._wD("-- SoundManager 2: loaded --"),n=!0,I(),w("onload",!0),!0;var a;if(!c.useFlashBlock||!c.flashLoadTimeout||c.getMoviePercent())n=!0,y&&(a={type:!t&&z?"NO_FLASH":"INIT_TIMEOUT"});c._wD("-- SoundManager 2 "+(y?"failed to load":"loaded")+" ("+(y?"security/load error":"OK")+") --",1);if(y||b){if(c.useFlashBlock&&
 101+c.oMC)c.oMC.className=L()+" "+(null===c.getMoviePercent()?"swf_timedout":"swf_error");H({type:"ontimeout",error:a});w("onload",!1);K(a);return!1}w("onload",!0);if(c.waitForWindowLoad&&!Y)return o("waitOnload"),r.add(j,"load",I),!1;c.waitForWindowLoad&&Y&&o("docLoaded");I();return!0};X=function(){o("init");if(n)return o("didInit"),!1;if(c.html5Only){if(!n)r.remove(j,"load",c.beginDelayedInit),c.enabled=!0,R();return!0}aa();try{o("flashJS"),i._externalInterfaceTest(!1),Ga(!0,c.flashPollingInterval||
 102+(c.useHighPerformance?10:50)),c.debugMode||i._disableDebug(),c.enabled=!0,w("jstoflash",!0),c.html5Only||r.add(j,"unload",na)}catch(b){return c._wD("js/flash exception: "+b.toString()),w("jstoflash",!1),K({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),da(!0),R(),!1}R();r.remove(j,"load",c.beginDelayedInit);return!0};J=function(){if(sa)return!1;sa=!0;ta();var b=O.toLowerCase(),a=null,a=null,d="undefined"!==typeof console&&"undefined"!==typeof console.log;if(-1!==b.indexOf("sm2-usehtml5audio="))a="1"===b.charAt(b.indexOf("sm2-usehtml5audio=")+
 103+18),d&&console.log((a?"Enabling ":"Disabling ")+"useHTML5Audio via URL parameter"),c.useHTML5Audio=a;if(-1!==b.indexOf("sm2-preferflash="))a="1"===b.charAt(b.indexOf("sm2-preferflash=")+16),d&&console.log((a?"Enabling ":"Disabling ")+"preferFlash via URL parameter"),c.preferFlash=a;if(!t&&c.hasHTML5)c._wD("SoundManager: No Flash detected"+(!c.useHTML5Audio?", enabling HTML5.":". Trying HTML5-only mode.")),c.useHTML5Audio=!0,c.preferFlash=!1;Oa();c.html5.usingFlash=Na();z=c.html5.usingFlash;Ra();if(!t&&
 104+z)c._wD("SoundManager: Fatal error: Flash is needed to play some required formats, but is not available."),c.flashLoadTimeout=1;h.removeEventListener&&h.removeEventListener("DOMContentLoaded",J,!1);aa();return!0};za=function(){"complete"===h.readyState&&(J(),h.detachEvent("onreadystatechange",za));return!0};ra=function(){Y=!0;r.remove(j,"load",ra)};ka();r.add(j,"focus",E);r.add(j,"load",E);r.add(j,"load",Z);r.add(j,"load",ra);V&&M&&r.add(j,"mousemove",E);h.addEventListener?h.addEventListener("DOMContentLoaded",
 105+J,!1):h.attachEvent?h.attachEvent("onreadystatechange",za):(w("onload",!1),K({type:"NO_DOM2_EVENTS",fatal:!0}));"complete"===h.readyState&&setTimeout(J,100)}var la=null;if("undefined"===typeof SM2_DEFER||!SM2_DEFER)la=new W;G.SoundManager=W;G.soundManager=la})(window);
\ No newline at end of file

Status & tagging log