source: gs3-extensions/audioDB/trunk/src/interface/script/soundmanager2-jsmin.js@ 26291

Last change on this file since 26291 was 26291, checked in by davidb, 12 years ago

files that need to added into the 'web/ext/XX' area to support the new interface elements

File size: 45.7 KB
Line 
1/** @license
2
3 SoundManager 2: JavaScript Sound for the Web
4 ----------------------------------------------
5 http://schillmania.com/projects/soundmanager2/
6
7 Copyright (c) 2007, Scott Schiller. All rights reserved.
8 Code provided under the BSD License:
9 http://schillmania.com/projects/soundmanager2/license.txt
10
11 V2.97a.20110801
12*/
13(function(S){function T(T,fa){function o(c){return function(a){return!this._t||!this._t._a?(this._t&&this._t.sID?b._wD(l+"ignoring "+a.type+": "+this._t.sID):b._wD(l+"ignoring "+a.type),null):c.call(this,a)}}this.flashVersion=8;this.debugMode=!0;this.debugFlash=!1;this.useConsole=!0;this.waitForWindowLoad=this.consoleOnly=!1;this.nullURL="about:blank";this.allowPolling=!0;this.useFastPolling=!1;this.useMovieStar=!0;this.bgColor="#ffffff";this.useHighPerformance=!1;this.flashPollingInterval=null;this.flashLoadTimeout=
141E3;this.wmode=null;this.allowScriptAccess="always";this.useFlashBlock=!1;this.useHTML5Audio=!0;this.html5Test=/^(probably|maybe)$/i;this.preferFlash=!0;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"',
15"audio/wav","audio/wave","audio/x-wav"],required:!1}};this.defaultOptions={autoLoad:!1,stream:!0,autoPlay:!1,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfailure:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5E3,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:!0,multiShotEvents:!1,position:null,pan:0,type:null,usePolicyFile:!1,volume:100};this.flash9Options={isMovieStar:null,
16usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null};this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null};this.version=null;this.versionNumber="V2.97a.20110801";this.movieURL=null;this.url=T||null;this.altURL=null;this.enabled=this.swfLoaded=!1;this.o=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",
17swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"};this.oMC=null;this.sounds={};this.soundIDs=[];this.muted=!1;this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.didFlashBlock=this.specialWmodeCase=!1;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.baseMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;
18this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.mimePattern=this.baseMimeTypes;this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,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)"},
19description:null,noRemote:null,noLocal:null};this.hasHTML5=typeof Audio!=="undefined"&&typeof(new Audio).canPlayType!=="undefined";this.html5={usingFlash:null};this.flash={};this.ignoreFlash=this.html5Only=!1;var wa,b=this,l="HTML5::",r,s=navigator.userAgent,h=S,L=h.location.href.toString(),i=this.flashVersion,g=document,ga,U,z=[],ha=!0,q,M=!1,N=!1,j=!1,v=!1,ia=!1,k,Na=0,O,t,ja,D,E,V,xa,ka,C,W,X,F,la,Y,Z,G,ya,ma,Oa=["log","info","warn","error"],za,$,Aa,P=null,na=null,n,oa,H,Ba,aa,ba,pa,m,ca=!1,qa=
20!1,Ca,Da,w=null,Ea,da,Q,A,ra,Fa,p,Ga=Array.prototype.slice,R=!1,u,ea,Ha,x,Ia,Ja=s.match(/(ipad|iphone|ipod)/i),Pa=s.match(/(mobile|pre\/|xoom)/i)||Ja,y=s.match(/msie/i),Qa=s.match(/webkit/i),I=s.match(/safari/i)&&!s.match(/chrome/i),Ra=s.match(/opera/i),sa=!L.match(/usehtml5audio/i)&&!L.match(/sm2\-ignorebadua/i)&&I&&s.match(/OS X 10_6_([3-7])/i),ta=typeof console!=="undefined"&&typeof console.log!=="undefined",ua=typeof g.hasFocus!=="undefined"?g.hasFocus():null,J=I&&typeof g.hasFocus==="undefined",
21Ka=!J,La=/(mp3|mp4|mpa)/i,K=g.location?g.location.protocol.match(/http/i):null,Ma=!K?"http:":"";this.useAltURL=!K;this._global_a=null;if(Pa&&(b.useHTML5Audio=!0,b.preferFlash=!1,Ja))R=b.ignoreFlash=!0;this.supported=this.ok=function(){return w?j&&!v:b.useHTML5Audio&&b.hasHTML5};this.getMovie=function(b){return y?h[b]:I?r(b)||g[b]:r(b)};this.createSound=function(c){function a(){e=aa(e);b.sounds[d.id]=new wa(d);b.soundIDs.push(d.id);return b.sounds[d.id]}var e=null,f=null,d=null;if(!j||!b.ok())return pa("soundManager.createSound(): "+
22n(!j?"notReady":"notOK")),!1;arguments.length===2&&(c={id:arguments[0],url:arguments[1]});d=e=t(c);d.id.toString().charAt(0).match(/^[0-9]$/)&&b._wD("soundManager.createSound(): "+n("badID",d.id),2);b._wD("soundManager.createSound(): "+d.id+" ("+d.url+")",1);if(m(d.id,!0))return b._wD("soundManager.createSound(): "+d.id+" exists",1),b.sounds[d.id];if(da(d))f=a(),b._wD("Loading sound "+d.id+" via HTML5"),f._setup_html5(d);else{if(i>8&&b.useMovieStar){if(d.isMovieStar===null)d.isMovieStar=d.serverURL||
23d.type&&d.type.match(b.netStreamPattern)||d.url.match(b.netStreamPattern)?!0:!1;d.isMovieStar&&b._wD("soundManager.createSound(): using MovieStar handling");if(d.isMovieStar){if(d.usePeakData)k("noPeak"),d.usePeakData=!1;d.loops>1&&k("noNSLoop")}}d=ba(d,"soundManager.createSound(): ");f=a();if(i===8)b.o._createSound(d.id,d.onjustbeforefinishtime,d.loops||1,d.usePolicyFile);else if(b.o._createSound(d.id,d.url,d.onjustbeforefinishtime,d.usePeakData,d.useWaveformData,d.useEQData,d.isMovieStar,d.isMovieStar?
24d.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(c,a){if(!m(c))return!1;var e=b.sounds[c],f;e._iO={};e.stop();e.unload();for(f=0;f<b.soundIDs.length;f++)if(b.soundIDs[f]===c){b.soundIDs.splice(f,1);break}a||e.destruct(!0);delete b.sounds[c];return!0};this.load=function(c,
25a){return!m(c)?!1:b.sounds[c].load(a)};this.unload=function(c){return!m(c)?!1:b.sounds[c].unload()};this.start=this.play=function(c,a){return!j||!b.ok()?(pa("soundManager.play(): "+n(!j?"notReady":"notOK")),!1):!m(c)?(a instanceof Object||(a={url:a}),a&&a.url?(b._wD('soundManager.play(): attempting to create "'+c+'"',1),a.id=c,b.createSound(a).play()):!1):b.sounds[c].play(a)};this.setPosition=function(c,a){return!m(c)?!1:b.sounds[c].setPosition(a)};this.stop=function(c){if(!m(c))return!1;b._wD("soundManager.stop("+
26c+")",1);return b.sounds[c].stop()};this.stopAll=function(){var c;b._wD("soundManager.stopAll()",1);for(c in b.sounds)b.sounds.hasOwnProperty(c)&&b.sounds[c].stop()};this.pause=function(c){return!m(c)?!1:b.sounds[c].pause()};this.pauseAll=function(){var c;for(c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].pause()};this.resume=function(c){return!m(c)?!1:b.sounds[c].resume()};this.resumeAll=function(){var c;for(c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].resume()};this.togglePause=function(c){return!m(c)?
27!1:b.sounds[c].togglePause()};this.setPan=function(c,a){return!m(c)?!1:b.sounds[c].setPan(a)};this.setVolume=function(c,a){return!m(c)?!1:b.sounds[c].setVolume(a)};this.mute=function(c){var a=0;typeof c!=="string"&&(c=null);if(c){if(!m(c))return!1;b._wD('soundManager.mute(): Muting "'+c+'"');return b.sounds[c].mute()}else{b._wD("soundManager.mute(): Muting all sounds");for(a=b.soundIDs.length;a--;)b.sounds[b.soundIDs[a]].mute();b.muted=!0}return!0};this.muteAll=function(){b.mute()};this.unmute=function(c){typeof c!==
28"string"&&(c=null);if(c){if(!m(c))return!1;b._wD('soundManager.unmute(): Unmuting "'+c+'"');return b.sounds[c].unmute()}else{b._wD("soundManager.unmute(): Unmuting all sounds");for(c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].unmute();b.muted=!1}return!0};this.unmuteAll=function(){b.unmute()};this.toggleMute=function(c){return!m(c)?!1:b.sounds[c].toggleMute()};this.getMemoryUse=function(){var c=0;b.o&&i!==8&&(c=parseInt(b.o._getMemoryUse(),10));return c};this.disable=function(c){var a;typeof c===
29"undefined"&&(c=!1);if(v)return!1;v=!0;k("shutdown",1);for(a=b.soundIDs.length;a--;)za(b.sounds[b.soundIDs[a]]);O(c);p.remove(h,"load",E);return!0};this.canPlayMIME=function(c){var a;b.hasHTML5&&(a=Q({type:c}));return!w||a?a:c?c.match(b.mimePattern)?!0:!1:null};this.canPlayURL=function(c){var a;b.hasHTML5&&(a=Q({url:c}));return!w||a?a:c?c.match(b.filePattern)?!0:!1:null};this.canPlayLink=function(c){return typeof c.type!=="undefined"&&c.type&&b.canPlayMIME(c.type)?!0:b.canPlayURL(c.href)};this.getSoundById=
30function(c,a){if(!c)throw Error("soundManager.getSoundById(): sID is null/undefined");var e=b.sounds[c];!e&&!a&&b._wD('"'+c+'" is an invalid sound ID.',2);return e};this.onready=function(c,a){if(c&&c instanceof Function)return j&&b._wD(n("queue","onready")),a||(a=h),ja("onready",c,a),D(),!0;else throw n("needFunction","onready");};this.ontimeout=function(c,a){if(c&&c instanceof Function)return j&&b._wD(n("queue","ontimeout")),a||(a=h),ja("ontimeout",c,a),D({type:"ontimeout"}),!0;else throw n("needFunction",
31"ontimeout");};this._wD=this._writeDebug=function(c,a,e){var f,d;if(!b.debugMode)return!1;typeof e!=="undefined"&&e&&(c=c+" | "+(new Date).getTime());if(ta&&b.useConsole){e=Oa[a];if(typeof console[e]!=="undefined")console[e](c);else console.log(c);if(b.useConsoleOnly)return!0}try{f=r("soundmanager-debug");if(!f)return!1;d=g.createElement("div");if(++Na%2===0)d.className="sm2-alt";a=typeof a==="undefined"?0:parseInt(a,10);d.appendChild(g.createTextNode(c));if(a){if(a>=2)d.style.fontWeight="bold";if(a===
323)d.style.color="#ff3333"}f.insertBefore(d,f.firstChild)}catch(B){}return!0};this._debug=function(){var c,a;k("currentObj",1);c=0;for(a=b.soundIDs.length;c<a;c++)b.sounds[b.soundIDs[c]]._debug()};this.reboot=function(){b._wD("soundManager.reboot()");b.soundIDs.length&&b._wD("Destroying "+b.soundIDs.length+" SMSound objects...");var c,a;for(c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].destruct();try{if(y)na=b.o.innerHTML;P=b.o.parentNode.removeChild(b.o);b._wD("Flash movie removed.")}catch(e){k("badRemove",
332)}na=P=w=null;b.enabled=la=j=ca=qa=M=N=v=b.swfLoaded=!1;b.soundIDs=b.sounds=[];b.o=null;for(c in z)if(z.hasOwnProperty(c))for(a=z[c].length;a--;)z[c][a].fired=!1;b._wD("soundManager: Rebooting...");h.setTimeout(b.beginDelayedInit,20)};this.getMoviePercent=function(){return b.o&&typeof b.o.PercentLoaded!=="undefined"?b.o.PercentLoaded():null};this.beginDelayedInit=function(){ia=!0;F();setTimeout(function(){if(qa)return!1;Z();X();return qa=!0},20);V()};this.destruct=function(){b._wD("soundManager.destruct()");
34b.disable(!0)};x={abort:o(function(){b._wD(l+"abort: "+this._t.sID)}),canplay:o(function(){if(this._t._html5_canplay)return!0;this._t._html5_canplay=!0;b._wD(l+"canplay: "+this._t.sID+", "+this._t.url);this._t._onbufferchange(0);var c=!isNaN(this._t.position)?this._t.position/1E3:null;if(this._t.position&&this.currentTime!==c){b._wD(l+"canplay: setting position to "+c);try{this.currentTime=c}catch(a){b._wD(l+"setting position failed: "+a.message,2)}}}),load:o(function(){this._t.loaded||(this._t._onbufferchange(0),
35this._t._whileloading(this._t.bytesTotal,this._t.bytesTotal,this._t._get_html5_duration()),this._t._onload(!0))}),emptied:o(function(){b._wD(l+"emptied: "+this._t.sID)}),ended:o(function(){b._wD(l+"ended: "+this._t.sID);this._t._onfinish()}),error:o(function(){b._wD(l+"error: "+this.error.code);this._t._onload(!1)}),loadeddata:o(function(){var c=this._t,a=c.bytesTotal||1;b._wD(l+"loadeddata: "+this._t.sID);if(!c._loaded&&!I)c.duration=c._get_html5_duration(),c._whileloading(a,a,c._get_html5_duration()),
36c._onload(!0)}),loadedmetadata:o(function(){b._wD(l+"loadedmetadata: "+this._t.sID)}),loadstart:o(function(){b._wD(l+"loadstart: "+this._t.sID);this._t._onbufferchange(1)}),play:o(function(){b._wD(l+"play: "+this._t.sID+", "+this._t.url);this._t._onbufferchange(0)}),playing:o(function(){b._wD(l+"playing: "+this._t.sID+", "+this._t.url);this._t._onbufferchange(0)}),progress:o(function(c){if(this._t.loaded)return!1;var a,e,f;f=0;var d=c.type==="progress";e=c.target.buffered;var B=c.loaded||0,va=c.total||
371;if(e&&e.length){for(a=e.length;a--;)f=e.end(a)-e.start(a);B=f/c.target.duration;if(d&&e.length>1){f=[];e=e.length;for(a=0;a<e;a++)f.push(c.target.buffered.start(a)+"-"+c.target.buffered.end(a));b._wD(l+"progress: timeRanges: "+f.join(", "))}d&&!isNaN(B)&&b._wD(l+"progress: "+this._t.sID+": "+Math.floor(B*100)+"% loaded")}isNaN(B)||(this._t._onbufferchange(0),this._t._whileloading(B,va,this._t._get_html5_duration()),B&&va&&B===va&&x.load.call(this,c))}),ratechange:o(function(){b._wD(l+"ratechange: "+
38this._t.sID)}),suspend:o(function(c){b._wD(l+"suspend: "+this._t.sID);x.progress.call(this,c)}),stalled:o(function(){b._wD(l+"stalled: "+this._t.sID)}),timeupdate:o(function(){this._t._onTimer()}),waiting:o(function(){b._wD(l+"waiting: "+this._t.sID);this._t._onbufferchange(1)})};wa=function(c){var a=this,e,f,d;this.sID=c.id;this.url=c.url;this._iO=this.instanceOptions=this.options=t(c);this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this.isHTML5=!1;this._a=null;this.id3=
39{};this._debug=function(){if(b.debugMode){var c=null,d=[],e,f;for(c in a.options)a.options[c]!==null&&(a.options[c]instanceof Function?(e=a.options[c].toString(),e=e.replace(/\s\s+/g," "),f=e.indexOf("{"),d.push(" "+c+": {"+e.substr(f+1,Math.min(Math.max(e.indexOf("\n")-1,64),64)).replace(/\n/g,"")+"... }")):d.push(" "+c+": "+a.options[c]));b._wD("SMSound() merged options: {\n"+d.join(", \n")+"\n}")}};this._debug();this.load=function(c){var d=null;if(typeof c!=="undefined")a._iO=t(c,a.options),a.instanceOptions=
40a._iO;else if(c=a.options,a._iO=c,a.instanceOptions=a._iO,a._lastURL&&a._lastURL!==a.url)k("manURL"),a._iO.url=a.url,a.url=null;if(!a._iO.url)a._iO.url=a.url;b._wD("SMSound.load(): "+a._iO.url,1);if(a._iO.url===a.url&&a.readyState!==0&&a.readyState!==2)return k("onURL",1),a;a._lastURL=a.url;a.loaded=!1;a.readyState=1;a.playState=0;if(da(a._iO))d=a._setup_html5(a._iO),d._called_load?b._wD(l+"ignoring request to load again: "+a.sID):(b._wD(l+"load: "+a.sID),a._html5_canplay=!1,d.load(),d._called_load=
41!0,a._iO.autoPlay&&a.play());else try{a.isHTML5=!1,a._iO=ba(aa(a._iO)),i===8?b.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):b.o._load(a.sID,a._iO.url,a._iO.stream?!0:!1,a._iO.autoPlay?!0:!1,a._iO.loops||1,a._iO.autoLoad?!0:!1,a._iO.usePolicyFile)}catch(e){k("smError",2),q("onload",!1),G({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:!0})}return a};this.unload=function(){if(a.readyState!==0){b._wD('SMSound.unload(): "'+a.sID+'"');if(a.isHTML5){if(f(),
42a._a)a._a.pause(),a._a.src=""}else i===8?b.o._unload(a.sID,b.nullURL):b.o._unload(a.sID);e()}return a};this.destruct=function(c){b._wD('SMSound.destruct(): "'+a.sID+'"');if(a.isHTML5){if(f(),a._a)a._a.pause(),a._a.src="",R||a._remove_html5_events(),a._a._t=null,a._a=null}else a._iO.onfailure=null,b.o._destroySound(a.sID);c||b.destroySound(a.sID,!0)};this.start=this.play=function(c,e){var f,e=e===void 0?!0:e;c||(c={});a._iO=t(c,a._iO);a._iO=t(a._iO,a.options);a.instanceOptions=a._iO;if(a._iO.serverURL&&
43!a.connected)return a.getAutoPlay()||(b._wD("SMSound.play(): Netstream not connected yet - setting autoPlay"),a.setAutoPlay(!0)),a;da(a._iO)&&(a._setup_html5(a._iO),d());if(a.playState===1&&!a.paused)if(f=a._iO.multiShot)b._wD('SMSound.play(): "'+a.sID+'" already playing (multi-shot)',1);else return b._wD('SMSound.play(): "'+a.sID+'" already playing (one-shot)',1),a;if(a.loaded)b._wD('SMSound.play(): "'+a.sID+'"');else if(a.readyState===0){b._wD('SMSound.play(): Attempting to load "'+a.sID+'"',1);
44if(!a.isHTML5)a._iO.autoPlay=!0;a.load(a._iO)}else if(a.readyState===2)return b._wD('SMSound.play(): Could not load "'+a.sID+'" - exiting',2),a;else b._wD('SMSound.play(): "'+a.sID+'" is loading - attempting to play..',1);if(!a.isHTML5&&i===9&&a.position>0&&a.position===a.duration)b._wD('SMSound.play(): "'+a.sID+'": Sound at end, resetting to position:0'),a._iO.position=0;if(a.paused&&a.position&&a.position>0)b._wD('SMSound.play(): "'+a.sID+'" is resuming from paused state',1),a.resume();else{b._wD('SMSound.play(): "'+
45a.sID+'" is starting to play');a.playState=1;a.paused=!1;(!a.instanceCount||a._iO.multiShotEvents||!a.isHTML5&&i>8&&!a.getAutoPlay())&&a.instanceCount++;a.position=typeof a._iO.position!=="undefined"&&!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=!0;a.setVolume(a._iO.volume,!0);a.setPan(a._iO.pan,!0);a.isHTML5?(d(),f=a._setup_html5(),a.setPosition(a._iO.position),f.play()):b.o._start(a.sID,a._iO.loops||1,i===9?a._iO.position:
46a._iO.position/1E3)}return a};this.stop=function(c){if(a.playState===1){a._onbufferchange(0);a.resetOnPosition(0);if(!a.isHTML5)a.playState=0;a.paused=!1;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(),a.unload()}else b.o._stop(a.sID,c),a._iO.serverURL&&a.unload();a.instanceCount=0;a._iO={}}return a};this.setAutoPlay=function(c){b._wD("sound "+a.sID+" turned autoplay "+(c?"on":"off"));a._iO.autoPlay=c;a.isHTML5||(b.o._setAutoPlay(a.sID,
47c),c&&!a.instanceCount&&a.readyState===1&&(a.instanceCount++,b._wD("sound "+a.sID+" incremented instance count to "+a.instanceCount)))};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPosition=function(c){c===void 0&&(c=0);var d=a.isHTML5?Math.max(c,0):Math.min(a.duration||a._iO.duration,Math.max(c,0));a.position=d;c=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!==c){b._wD("setPosition("+c+"): setting position");
48try{a._a.currentTime=c,(a.playState===0||a.paused)&&a._a.pause()}catch(e){b._wD("setPosition("+c+"): setting position failed: "+e.message,2)}}}else b._wD("setPosition("+c+"): delaying, sound not ready")}else c=i===9?a.position:c,a.readyState&&a.readyState!==2&&b.o._setPosition(a.sID,c,a.paused||!a.playState);a.isHTML5&&a.paused&&a._onTimer(!0);return a};this.pause=function(c){if(a.paused||a.playState===0&&a.readyState!==1)return a;b._wD("SMSound.pause()");a.paused=!0;a.isHTML5?(a._setup_html5().pause(),
49f()):(c||c===void 0)&&b.o._pause(a.sID);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){if(!a.paused)return a;b._wD("SMSound.resume()");a.paused=!1;a.playState=1;a.isHTML5?(a._setup_html5().play(),d()):(a._iO.isMovieStar&&a.setPosition(a.position),b.o._pause(a.sID));!a._onplay_called&&a._iO.onplay?(a._iO.onplay.apply(a),a._onplay_called=!0):a._iO.onresume&&a._iO.onresume.apply(a);return a};this.togglePause=function(){b._wD("SMSound.togglePause()");if(a.playState===0)return a.play({position:i===
509&&!a.isHTML5?a.position:a.position/1E3}),a;a.paused?a.resume():a.pause();return a};this.setPan=function(c,d){typeof c==="undefined"&&(c=0);typeof d==="undefined"&&(d=!1);a.isHTML5||b.o._setPan(a.sID,c);a._iO.pan=c;if(!d)a.pan=c,a.options.pan=c;return a};this.setVolume=function(c,d){typeof c==="undefined"&&(c=100);typeof d==="undefined"&&(d=!1);if(a.isHTML5){if(a._a)a._a.volume=Math.max(0,Math.min(1,c/100))}else b.o._setVolume(a.sID,b.muted&&!a.muted||a.muted?0:c);a._iO.volume=c;if(!d)a.volume=c,
51a.options.volume=c;return a};this.mute=function(){a.muted=!0;if(a.isHTML5){if(a._a)a._a.muted=!0}else b.o._setVolume(a.sID,0);return a};this.unmute=function(){a.muted=!1;var c=typeof a._iO.volume!=="undefined";if(a.isHTML5){if(a._a)a._a.muted=!1}else b.o._setVolume(a.sID,c?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:!1});return a};
52this.processOnPosition=function(){var c,d;c=a._onPositionItems.length;if(!c||!a.playState||a._onPositionFired>=c)return!1;for(;c--;)if(d=a._onPositionItems[c],!d.fired&&a.position>=d.position)d.method.apply(d.scope,[d.position]),d.fired=!0,b._onPositionFired++;return!0};this.resetOnPosition=function(c){var d,e;d=a._onPositionItems.length;if(!d)return!1;for(;d--;)if(e=a._onPositionItems[d],e.fired&&c<=e.position)e.fired=!1,b._onPositionFired--;return!0};d=function(){a.isHTML5&&Ca(a)};f=function(){a.isHTML5&&
53Da(a)};e=function(){a._onPositionItems=[];a._onPositionFired=0;a._hasTimer=null;a._onplay_called=!1;a._a=null;a._html5_canplay=!1;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=!1;a.playState=0;a.paused=!1;a.readyState=0;a.muted=!1;a.didBeforeFinish=!1;a.didJustBeforeFinish=!1;a.isBuffering=!1;a.instanceOptions={};a.instanceCount=0;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};
54a.eqData=[];a.eqData.left=[];a.eqData.right=[]};e();this._onTimer=function(c){var d={};if(a._hasTimer||c)return a._a&&(c||(a.playState>0||a.readyState===1)&&!a.paused)?(a.duration=a._get_html5_duration(),a.durationEstimate=a.duration,c=a._a.currentTime?a._a.currentTime*1E3:0,a._whileplaying(c,d,d,d,d),!0):(b._wD('_onTimer: Warn for "'+a.sID+'": '+(!a._a?"Could not find element. ":"")+(a.playState===0?"playState bad, 0?":"playState = "+a.playState+", OK")),!1)};this._get_html5_duration=function(){var b=
55a._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(c){var c=t(a._iO,c),d=R?b._global_a:a._a,f=decodeURI(c.url),g=d&&d._t?d._t.instanceOptions:null;if(d){if(d._t&&g.url===c.url&&(!a._lastURL||a._lastURL===g.url))return d;b._wD("setting new URL on existing object: "+f+(a._lastURL?", old URL: "+a._lastURL:""));R&&d._t&&d._t.playState&&c.url!==g.url&&d._t.stop();e();d.src=c.url;a.url=c.url;a._lastURL=c.url;d._called_load=
56!1}else if(b._wD("creating HTML5 Audio() element with URL: "+f),d=new Audio(c.url),d._called_load=!1,R)b._global_a=d;a.isHTML5=!0;a._a=d;d._t=a;a._add_html5_events();d.loop=c.loops>1?"loop":"";c.autoLoad||c.autoPlay?(d.autobuffer="auto",d.preload="auto",a.load(),d._called_load=!0):(d.autobuffer=!1,d.preload="none");d.loop=c.loops>1?"loop":"";return d};this._add_html5_events=function(){if(a._a._added_events)return!1;var c;b._wD(l+"adding event listeners: "+a.sID);a._a._added_events=!0;for(c in x)x.hasOwnProperty(c)&&
57a._a&&a._a.addEventListener(c,x[c],!1);return!0};this._remove_html5_events=function(){var c;b._wD(l+"removing event listeners: "+a.sID);a._a._added_events=!1;for(c in x)x.hasOwnProperty(c)&&a._a&&a._a.removeEventListener(c,x[c],!1)};this._onload=function(c){c=c?!0:!1;b._wD('SMSound._onload(): "'+a.sID+'"'+(c?" loaded.":" failed to load? - "+a.url),c?1:2);!c&&!a.isHTML5&&(b.sandbox.noRemote===!0&&b._wD("SMSound._onload(): "+n("noNet"),1),b.sandbox.noLocal===!0&&b._wD("SMSound._onload(): "+n("noLocal"),
581));a.loaded=c;a.readyState=c?3:2;a._onbufferchange(0);a._iO.onload&&a._iO.onload.apply(a,[c]);return!0};this._onbufferchange=function(c){if(a.playState===0)return!1;if(c&&a.isBuffering||!c&&!a.isBuffering)return!1;a.isBuffering=c===1;a._iO.onbufferchange&&(b._wD("SMSound._onbufferchange(): "+c),a._iO.onbufferchange.apply(a));return!0};this._onfailure=function(c,d,e){a.failures++;b._wD('SMSound._onfailure(): "'+a.sID+'" count '+a.failures);if(a._iO.onfailure&&a.failures===1)a._iO.onfailure(a,c,d,
59e);else b._wD("SMSound._onfailure(): ignoring")};this._onbeforefinish=function(){if(!a.didBeforeFinish)a.didBeforeFinish=!0,a._iO.onbeforefinish&&(b._wD('SMSound._onbeforefinish(): "'+a.sID+'"'),a._iO.onbeforefinish.apply(a))};this._onjustbeforefinish=function(){if(!a.didJustBeforeFinish)a.didJustBeforeFinish=!0,a._iO.onjustbeforefinish&&(b._wD('SMSound._onjustbeforefinish(): "'+a.sID+'"'),a._iO.onjustbeforefinish.apply(a))};this._onfinish=function(){var c=a._iO.onfinish;a._onbufferchange(0);a.resetOnPosition(0);
60a._iO.onbeforefinishcomplete&&a._iO.onbeforefinishcomplete.apply(a);a.didBeforeFinish=!1;a.didJustBeforeFinish=!1;if(a.instanceCount){a.instanceCount--;if(!a.instanceCount)a.playState=0,a.paused=!1,a.instanceCount=0,a.instanceOptions={},a._iO={},f();if((!a.instanceCount||a._iO.multiShotEvents)&&c)b._wD('SMSound._onfinish(): "'+a.sID+'"'),c.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=
61a.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,d,e,f,g){if(isNaN(c)||c===null)return!1;a.position=c;a.processOnPosition();if(!a.isHTML5&&i>8){if(a._iO.usePeakData&&typeof d!=="undefined"&&d)a.peakData={left:d.leftPeak,right:d.rightPeak};
62if(a._iO.useWaveformData&&typeof e!=="undefined"&&e)a.waveformData={left:e.split(","),right:f.split(",")};if(a._iO.useEQData&&typeof g!=="undefined"&&g&&g.leftEQ&&(c=g.leftEQ.split(","),a.eqData=c,a.eqData.left=c,typeof g.rightEQ!=="undefined"&&g.rightEQ))a.eqData.right=g.rightEQ.split(",")}a.playState===1&&(!a.isHTML5&&b.flashVersion===8&&!a.position&&a.isBuffering&&a._onbufferchange(0),a._iO.whileplaying&&a._iO.whileplaying.apply(a),(a.loaded||!a.loaded&&a._iO.isMovieStar)&&a._iO.onbeforefinish&&
63a._iO.onbeforefinishtime&&!a.didBeforeFinish&&a.duration-a.position<=a._iO.onbeforefinishtime&&a._onbeforefinish());return!0};this._onid3=function(c,d){b._wD('SMSound._onid3(): "'+this.sID+'" ID3 data received.');var e=[],f,g;f=0;for(g=c.length;f<g;f++)e[c[f]]=d[f];a.id3=t(a.id3,e);a._iO.onid3&&a._iO.onid3.apply(a)};this._onconnect=function(c){c=c===1;b._wD('SMSound._onconnect(): "'+a.sID+'"'+(c?" connected.":" failed to connect? - "+a.url),c?1:2);if(a.connected=c)a.failures=0,m(a.sID)&&(a.getAutoPlay()?
64a.play(void 0,a.getAutoPlay()):a._iO.autoLoad&&a.load()),a._iO.onconnect&&a._iO.onconnect.apply(a,[c])};this._ondataerror=function(c){a.playState>0&&(b._wD("SMSound._ondataerror(): "+c),a._iO.ondataerror&&a._iO.ondataerror.apply(a))}};Y=function(){return g.body||g._docElement||g.getElementsByTagName("div")[0]};r=function(b){return g.getElementById(b)};t=function(c,a){var e={},f,d;for(f in c)c.hasOwnProperty(f)&&(e[f]=c[f]);f=typeof a==="undefined"?b.defaultOptions:a;for(d in f)f.hasOwnProperty(d)&&
65typeof e[d]==="undefined"&&(e[d]=f[d]);return e};p=function(){function b(a){var a=Ga.call(a),c=a.length;e?(a[1]="on"+a[1],c>3&&a.pop()):c===3&&a.push(!1);return a}function a(a,b){var c=a.shift(),g=[f[b]];if(e)c[g](a[0],a[1]);else c[g].apply(c,a)}var e=h.attachEvent,f={add:e?"attachEvent":"addEventListener",remove:e?"detachEvent":"removeEventListener"};return{add:function(){a(b(arguments),"add")},remove:function(){a(b(arguments),"remove")}}}();da=function(c){return!c.serverURL&&(c.type?Q({type:c.type}):
66Q({url:c.url})||b.html5Only)};Q=function(c){function a(a){return b.preferFlash&&u&&!b.ignoreFlash&&typeof b.flash[a]!=="undefined"&&b.flash[a]}if(!b.useHTML5Audio||!b.hasHTML5)return!1;var e=c.url||null,c=c.type||null,f=b.audioFormats,d;if(c&&b.html5[c]!=="undefined")return b.html5[c]&&!a(c);if(!A){A=[];for(d in f)f.hasOwnProperty(d)&&(A.push(d),f[d].related&&(A=A.concat(f[d].related)));A=RegExp("\\.("+A.join("|")+")(\\?.*)?$","i")}d=e?e.toLowerCase().match(A):null;if(!d||!d.length)if(c)e=c.indexOf(";"),
67d=(e!==-1?c.substr(0,e):c).substr(6);else return!1;else d=d[1];return d&&typeof b.html5[d]!=="undefined"?b.html5[d]&&!a(d):(c="audio/"+d,e=b.html5.canPlayType({type:c}),(b.html5[d]=e)&&b.html5[c]&&!a(c))};Fa=function(){function c(c){var d,e,f=!1;if(!a||typeof a.canPlayType!=="function")return!1;if(c instanceof Array){d=0;for(e=c.length;d<e&&!f;d++)if(b.html5[c[d]]||a.canPlayType(c[d]).match(b.html5Test))f=!0,b.html5[c[d]]=!0,b.flash[c[d]]=!(!b.preferFlash||!u||!c[d].match(La));return f}else return c=
68a&&typeof a.canPlayType==="function"?a.canPlayType(c):!1,!(!c||!c.match(b.html5Test))}if(!b.useHTML5Audio||typeof Audio==="undefined")return!1;var a=typeof Audio!=="undefined"?Ra?new Audio(null):new Audio:null,e,f={},d,g;d=b.audioFormats;for(e in d)if(d.hasOwnProperty(e)&&(f[e]=c(d[e].type),f["audio/"+e]=f[e],b.flash[e]=b.preferFlash&&!b.ignoreFlash&&e.match(La)?!0:!1,d[e]&&d[e].related))for(g=d[e].related.length;g--;)f["audio/"+d[e].related[g]]=f[e],b.html5[d[e].related[g]]=f[e],b.flash[d[e].related[g]]=
69f[e];f.canPlayType=a?c:null;b.html5=t(b.html5,f);return!0};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)",swf404:"soundManager: Verify that %s is a valid path.",tryDebug:"Try soundManager.debugFlash = true for more security details (output goes to SWF.)",
70checkSWF:"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..",waitImpatient:"soundManager: Getting impatient, still waiting for Flash%s...",waitForever:"soundManager: Waiting indefinitely for Flash (will recover if unblocked)...",
71needFunction:"soundManager: Function object expected for %s",badID:'Warning: Sound ID "%s" should be a string, starting with a non-numeric character',noMS:"MovieStar mode not enabled. Exiting.",currentObj:"--- soundManager._debug(): Current sound objects ---",waitEI:"soundManager::initMovie(): Waiting for ExternalInterface call from Flash..",waitOnload:"soundManager: Waiting for window.onload()",docLoaded:"soundManager: Document already loaded",onload:"soundManager::initComplete(): calling soundManager.onload()",
72onloadOK:"soundManager.onload() complete",init:"soundManager::init()",didInit:"soundManager::init(): Already called?",flashJS:"soundManager: Attempting to call Flash from JS..",noPolling:"soundManager: Polling (whileloading()/whileplaying() support) is disabled.",secNote:"Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html",
73badRemove:"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 ."+b.swfCSS.swfTimedout+" CSS..",fbLoaded:"Flash loaded",fbHandler:"soundManager::flashBlockHandler()",manURL:"SMSound.load(): Using manually-assigned URL",
74onURL:"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"};
75n=function(){var b=Ga.call(arguments),a=b.shift(),a=W&&W[a]?W[a]:"",e,f;if(a&&b&&b.length){e=0;for(f=b.length;e<f;e++)a=a.replace("%s",b[e])}return a};aa=function(b){if(i===8&&b.loops>1&&b.stream)k("as2loop"),b.stream=!1;return b};ba=function(c,a){if(c&&!c.usePolicyFile&&(c.onid3||c.usePeakData||c.useWaveformData||c.useEQData))b._wD((a||"")+n("policy")),c.usePolicyFile=!0;return c};pa=function(c){typeof console!=="undefined"&&typeof console.warn!=="undefined"?console.warn(c):b._wD(c)};ga=function(){return!1};
76za=function(b){for(var a in b)b.hasOwnProperty(a)&&typeof b[a]==="function"&&(b[a]=ga)};$=function(c){typeof c==="undefined"&&(c=!1);if(v||c)k("smFail",2),b.disable(c)};Aa=function(c){var a=null;if(c)if(c.match(/\.swf(\?.*)?$/i)){if(a=c.substr(c.toLowerCase().lastIndexOf(".swf?")+4))return c}else c.lastIndexOf("/")!==c.length-1&&(c+="/");return(c&&c.lastIndexOf("/")!==-1?c.substr(0,c.lastIndexOf("/")+1):"./")+b.movieURL};ka=function(){if(i!==8&&i!==9)b._wD(n("badFV",i,8)),b.flashVersion=8;var c=b.debugMode||
77b.debugFlash?"_debug.swf":".swf";if(b.useHTML5Audio&&!b.html5Only&&b.audioFormats.mp4.required&&b.flashVersion<9)b._wD(n("needfl9")),b.flashVersion=9;i=b.flashVersion;b.version=b.versionNumber+(b.html5Only?" (HTML5-only mode)":i===9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(i>8)b.defaultOptions=t(b.defaultOptions,b.flash9Options),b.features.buffering=!0;i>8&&b.useMovieStar?(b.defaultOptions=t(b.defaultOptions,b.movieStarOptions),b.filePatterns.flash9=RegExp("\\.(mp3|"+b.netStreamTypes.join("|")+")(\\?.*)?$",
78"i"),b.mimePattern=b.netStreamMimeTypes,b.features.movieStar=!0):(b.useMovieStar=!1,b.features.movieStar=!1);b.filePattern=b.filePatterns[i!==8?"flash9":"flash8"];b.movieURL=(i===8?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",c);b.features.peakData=b.features.waveformData=b.features.eqData=i>8};ya=function(c,a){if(!b.o||!b.allowPolling)return!1;b.o._setPolling(c,a)};ma=function(){if(b.debugURLParam.test(L))b.debugMode=!0;if(r(b.debugID))return!1;var c,a,e,f;if(b.debugMode&&!r(b.debugID)&&
79(!ta||!b.useConsole||b.useConsole&&ta&&!b.consoleOnly)){c=g.createElement("div");c.id=b.debugID+"-toggle";a={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001};c.appendChild(g.createTextNode("-"));c.onclick=Ba;c.title="Toggle SM2 debug console";if(s.match(/msie 6/i))c.style.position="absolute",c.style.cursor="hand";for(f in a)a.hasOwnProperty(f)&&
80(c.style[f]=a[f]);a=g.createElement("div");a.id=b.debugID;a.style.display=b.debugMode?"block":"none";if(b.debugMode&&!r(c.id)){try{e=Y(),e.appendChild(c)}catch(d){throw Error(n("domError")+" \n"+d.toString());}e.appendChild(a)}}};m=this.getSoundById;k=function(c,a){return c?b._wD(n(c),a):""};if(L.indexOf("sm2-debug=alert")+1&&b.debugMode)b._wD=function(b){S.alert(b)};Ba=function(){var c=r(b.debugID),a=r(b.debugID+"-toggle");if(!c)return!1;ha?(a.innerHTML="+",c.style.display="none"):(a.innerHTML="-",
81c.style.display="block");ha=!ha};q=function(b,a,e){if(typeof sm2Debugger!=="undefined")try{sm2Debugger.handleEvent(b,a,e)}catch(f){}return!0};H=function(){var c=[];b.debugMode&&c.push(b.swfCSS.sm2Debug);b.debugFlash&&c.push(b.swfCSS.flashDebug);b.useHighPerformance&&c.push(b.swfCSS.highPerf);return c.join(" ")};oa=function(){var c=n("fbHandler"),a=b.getMoviePercent(),e=b.swfCSS,f={type:"FLASHBLOCK"};if(b.html5Only)return!1;if(b.ok()){if(b.didFlashBlock&&b._wD(c+": Unblocked"),b.oMC)b.oMC.className=
82[H(),e.swfDefault,e.swfLoaded+(b.didFlashBlock?" "+e.swfUnblocked:"")].join(" ")}else{if(w)b.oMC.className=H()+" "+e.swfDefault+" "+(a===null?e.swfTimedout:e.swfError),b._wD(c+": "+n("fbTimeout")+(a?" ("+n("fbLoaded")+")":""));b.didFlashBlock=!0;D({type:"ontimeout",ignoreInit:!0,error:f});G(f)}};ja=function(b,a,e){typeof z[b]==="undefined"&&(z[b]=[]);z[b].push({method:a,scope:e||null,fired:!1})};D=function(c){c||(c={type:"onready"});if(!j&&c&&!c.ignoreInit)return!1;if(c.type==="ontimeout"&&b.ok())return!1;
83var a={success:c&&c.ignoreInit?b.ok():!v},e=c&&c.type?z[c.type]||[]:[],f=[],d,g=[a],k=w&&b.useFlashBlock&&!b.ok();if(c.error)g[0].error=c.error;a=0;for(d=e.length;a<d;a++)e[a].fired!==!0&&f.push(e[a]);if(f.length){b._wD("soundManager: Firing "+f.length+" "+c.type+"() item"+(f.length===1?"":"s"));a=0;for(d=f.length;a<d;a++)if(f[a].scope?f[a].method.apply(f[a].scope,g):f[a].method.apply(this,g),!k)f[a].fired=!0}return!0};E=function(){h.setTimeout(function(){b.useFlashBlock&&oa();D();b.onload instanceof
84Function&&(k("onload",1),b.onload.apply(h),k("onloadOK",1));b.waitForWindowLoad&&p.add(h,"load",E)},1)};ea=function(){if(u!==void 0)return u;var b=!1,a=navigator,e=a.plugins,f,d=h.ActiveXObject;if(e&&e.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(typeof d!=="undefined"){try{f=new d("ShockwaveFlash.ShockwaveFlash")}catch(g){}b=!!f}return u=b};Ea=function(){var c,
85a;if(s.match(/iphone os (1|2|3_0|3_1)/i)){b.hasHTML5=!1;b.html5Only=!0;if(b.oMC)b.oMC.style.display="none";return!1}if(b.useHTML5Audio){if(!b.html5||!b.html5.canPlayType)return b._wD("SoundManager: No HTML5 Audio() support detected."),b.hasHTML5=!1,!0;else b.hasHTML5=!0;if(sa&&(b._wD("soundManager::Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - "+(!u?" would use flash fallback for MP3/MP4, but none detected.":"will use flash fallback for MP3/MP4, if available"),
861),ea()))return!0}else return!0;for(a in b.audioFormats)if(b.audioFormats.hasOwnProperty(a)&&(b.audioFormats[a].required&&!b.html5.canPlayType(b.audioFormats[a].type)||b.flash[a]||b.flash[b.audioFormats[a].type]))c=!0;b.ignoreFlash&&(c=!1);b.html5Only=b.hasHTML5&&b.useHTML5Audio&&!c;return!b.html5Only};Ca=function(b){if(!b._hasTimer)b._hasTimer=!0};Da=function(b){if(b._hasTimer)b._hasTimer=!1};G=function(c){c=typeof c!=="undefined"?c:{};b.onerror instanceof Function&&b.onerror.apply(h,[{type:typeof c.type!==
87"undefined"?c.type:null}]);typeof c.fatal!=="undefined"&&c.fatal&&b.disable()};Ha=function(){if(!sa||!ea())return!1;var c=b.audioFormats,a,e;for(e in c)if(c.hasOwnProperty(e)&&(e==="mp3"||e==="mp4"))if(b._wD("soundManager: Using flash fallback for "+e+" format"),b.html5[e]=!1,c[e]&&c[e].related)for(a=c[e].related.length;a--;)b.html5[c[e].related[a]]=!1};this._setSandboxType=function(c){var a=b.sandbox;a.type=c;a.description=a.types[typeof a.types[c]!=="undefined"?c:"unknown"];b._wD("Flash security sandbox type: "+
88a.type);if(a.type==="localWithFile")a.noRemote=!0,a.noLocal=!1,k("secNote",2);else if(a.type==="localWithNetwork")a.noRemote=!1,a.noLocal=!0;else if(a.type==="localTrusted")a.noRemote=!1,a.noLocal=!1};this._externalInterfaceOK=function(c){if(b.swfLoaded)return!1;var a=(new Date).getTime();b._wD("soundManager::externalInterfaceOK()"+(c?" (~"+(a-c)+" ms)":""));q("swf",!0);q("flashtojs",!0);b.swfLoaded=!0;J=!1;sa&&Ha();y?setTimeout(U,100):U()};Z=function(c,a){function e(){b._wD("-- SoundManager 2 "+
89b.version+(!b.html5Only&&b.useHTML5Audio?b.hasHTML5?" + HTML5 audio":", no HTML5 audio support":"")+(!b.html5Only?(b.useMovieStar?", MovieStar mode":"")+(b.useHighPerformance?", high performance mode, ":", ")+((b.flashPollingInterval?"custom ("+b.flashPollingInterval+"ms)":b.useFastPolling?"fast":"normal")+" polling")+(b.wmode?", wmode: "+b.wmode:"")+(b.debugFlash?", flash debug mode":"")+(b.useFlashBlock?", flashBlock mode":""):"")+" --",1)}function f(a,b){return'<param name="'+a+'" value="'+b+'" />'}
90if(M&&N)return!1;if(b.html5Only)return ka(),e(),b.oMC=r(b.movieID),U(),N=M=!0,!1;var d=a||b.url,l=b.altURL||d,h;h=Y();var i,o,j=H(),m,p=null,p=(p=g.getElementsByTagName("html")[0])&&p.dir&&p.dir.match(/rtl/i),c=typeof c==="undefined"?b.id:c;ka();b.url=Aa(K?d:l);a=b.url;b.wmode=!b.wmode&&b.useHighPerformance&&!b.useMovieStar?"transparent":b.wmode;if(b.wmode!==null&&(s.match(/msie 8/i)||!y&&!b.useHighPerformance)&&navigator.platform.match(/win32|win64/i))b.specialWmodeCase=!0,k("spcWmode"),b.wmode=
91null;h={name:c,id:c,src:a,width:"auto",height:"auto",quality:"high",allowScriptAccess:b.allowScriptAccess,bgcolor:b.bgColor,pluginspage:Ma+"//www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:b.wmode,hasPriority:"true"};if(b.debugFlash)h.FlashVars="debug=1";b.wmode||delete h.wmode;if(y)d=g.createElement("div"),o=['<object id="'+c+'" data="'+a+'" type="'+h.type+'" title="'+h.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+
92Ma+'//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="'+h.width+'" height="'+h.height+'">',f("movie",a),f("AllowScriptAccess",b.allowScriptAccess),f("quality",h.quality),b.wmode?f("wmode",b.wmode):"",f("bgcolor",b.bgColor),f("hasPriority","true"),b.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();j=H();if(h=Y())if(b.oMC=r(b.movieID)||g.createElement("div"),
93b.oMC.id){m=b.oMC.className;b.oMC.className=(m?m+" ":b.swfCSS.swfDefault)+(j?" "+j:"");b.oMC.appendChild(d);if(y)i=b.oMC.appendChild(g.createElement("div")),i.className=b.swfCSS.swfBox,i.innerHTML=o;N=!0}else{b.oMC.id=b.movieID;b.oMC.className=b.swfCSS.swfDefault+" "+j;i=j=null;if(!b.useFlashBlock)if(b.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"},p)j.left=
94Math.abs(parseInt(j.left,10))+"px";if(Qa)b.oMC.style.zIndex=1E4;if(!b.debugFlash)for(m in j)j.hasOwnProperty(m)&&(b.oMC.style[m]=j[m]);try{y||b.oMC.appendChild(d);h.appendChild(b.oMC);if(y)i=b.oMC.appendChild(g.createElement("div")),i.className=b.swfCSS.swfBox,i.innerHTML=o;N=!0}catch(q){throw Error(n("domError")+" \n"+q.toString());}}M=!0;e();b._wD("soundManager::createMovie(): Trying to load "+a+(!K&&b.altURL?" (alternate URL)":""),1);return!0};X=function(){if(b.html5Only)return Z(),!1;if(b.o)return!1;
95b.o=b.getMovie(b.id);if(!b.o)P?(y?b.oMC.innerHTML=na:b.oMC.appendChild(P),P=null,M=!0):Z(b.id,b.url),b.o=b.getMovie(b.id);b.o&&k("waitEI");b.oninitmovie instanceof Function&&setTimeout(b.oninitmovie,1);return!0};V=function(){setTimeout(xa,1E3)};xa=function(){if(ca)return!1;ca=!0;p.remove(h,"load",V);if(J&&!ua)return k("waitFocus"),!1;var c;j||(c=b.getMoviePercent(),b._wD(n("waitImpatient",c===100?" (SWF loaded)":c>0?" (SWF "+c+"% loaded)":"")));setTimeout(function(){c=b.getMoviePercent();j||(b._wD("soundManager: No Flash response within expected time.\nLikely causes: "+
96(c===0?"Loading "+b.movieURL+" may have failed (and/or Flash "+i+"+ not present?), ":"")+"Flash blocked or JS-Flash security error."+(b.debugFlash?" "+n("checkSWF"):""),2),!K&&c&&(k("localFail",2),b.debugFlash||k("tryDebug",2)),c===0&&b._wD(n("swf404",b.url)),q("flashtojs",!1,": Timed out"+K?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)"));!j&&Ka&&(c===null?b.useFlashBlock||b.flashLoadTimeout===0?(b.useFlashBlock&&oa(),k("waitForever")):$(!0):b.flashLoadTimeout===0?k("waitForever"):
97$(!0))},b.flashLoadTimeout)};C=function(){function c(){p.remove(h,"focus",C);p.remove(h,"load",C)}if(ua||!J)return c(),!0;ua=Ka=!0;b._wD("soundManager::handleFocus()");I&&J&&p.remove(h,"mousemove",C);ca=!1;c();return!0};O=function(c){if(j)return!1;if(b.html5Only)return b._wD("-- SoundManager 2: loaded --"),j=!0,E(),q("onload",!0),!0;var a;if(!b.useFlashBlock||!b.flashLoadTimeout||b.getMoviePercent())j=!0,v&&(a={type:!u&&w?"NO_FLASH":"INIT_TIMEOUT"});b._wD("-- SoundManager 2 "+(v?"failed to load":
98"loaded")+" ("+(v?"security/load error":"OK")+") --",1);if(v||c){if(b.useFlashBlock&&b.oMC)b.oMC.className=H()+" "+(b.getMoviePercent()===null?b.swfCSS.swfTimedout:b.swfCSS.swfError);D({type:"ontimeout",error:a});q("onload",!1);G(a);return!1}else q("onload",!0);p.add(h,"unload",ga);if(b.waitForWindowLoad&&!ia)return k("waitOnload"),p.add(h,"load",E),!1;else b.waitForWindowLoad&&ia&&k("docLoaded"),E();return!0};Ia=function(){var c,a=[];if(b.useHTML5Audio&&b.hasHTML5){for(c in b.audioFormats)b.audioFormats.hasOwnProperty(c)&&
99a.push(c+": "+b.html5[c]+(!b.html5[c]&&u&&b.flash[c]?" (using flash)":b.preferFlash&&b.flash[c]&&u?" (preferring flash)":!b.html5[c]?" ("+(b.audioFormats[c].required?"required, ":"")+"and no flash support)":""));b._wD("-- SoundManager 2: HTML5 support tests ("+b.html5Test+"): "+a.join(", ")+" --",1)}};U=function(){k("init");if(j)return k("didInit"),!1;if(b.html5Only){if(!j)p.remove(h,"load",b.beginDelayedInit),b.enabled=!0,O();return!0}X();try{k("flashJS"),b.o._externalInterfaceTest(!1),b.allowPolling?
100ya(!0,b.flashPollingInterval||(b.useFastPolling?10:50)):k("noPolling",1),b.debugMode||b.o._disableDebug(),b.enabled=!0,q("jstoflash",!0)}catch(c){return b._wD("js/flash exception: "+c.toString()),q("jstoflash",!1),G({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),$(!0),O(),!1}O();p.remove(h,"load",b.beginDelayedInit);return!0};F=function(){if(la)return!1;la=!0;ma();(function(){var c=L.toLowerCase(),a=null,a=null,e=typeof console!=="undefined"&&typeof console.log!=="undefined";if(c.indexOf("sm2-usehtml5audio=")!==
101-1)a=c.charAt(c.indexOf("sm2-usehtml5audio=")+18)==="1",e&&console.log((a?"Enabling ":"Disabling ")+"useHTML5Audio via URL parameter"),b.useHTML5Audio=a;if(c.indexOf("sm2-preferflash=")!==-1)a=c.charAt(c.indexOf("sm2-preferflash=")+16)==="1",e&&console.log((a?"Enabling ":"Disabling ")+"preferFlash via URL parameter"),b.preferFlash=a})();if(!u&&b.hasHTML5)b._wD("SoundManager: No Flash detected"+(!b.useHTML5Audio?", enabling HTML5.":". Trying HTML5-only mode.")),b.useHTML5Audio=!0,b.preferFlash=!1;
102Fa();b.html5.usingFlash=Ea();w=b.html5.usingFlash;Ia();if(!u&&w)b._wD("SoundManager: Fatal error: Flash is needed to play some required formats, but is not available."),b.flashLoadTimeout=1;g.removeEventListener&&g.removeEventListener("DOMContentLoaded",F,!1);X();return!0};ra=function(){g.readyState==="complete"&&(F(),g.detachEvent("onreadystatechange",ra));return!0};ea();p.add(h,"focus",C);p.add(h,"load",C);p.add(h,"load",V);I&&J&&p.add(h,"mousemove",C);g.addEventListener?g.addEventListener("DOMContentLoaded",
103F,!1):g.attachEvent?g.attachEvent("onreadystatechange",ra):(q("onload",!1),G({type:"NO_DOM2_EVENTS",fatal:!0}));g.readyState==="complete"&&setTimeout(F,100)}var fa=null;if(typeof SM2_DEFER==="undefined"||!SM2_DEFER)fa=new T;S.SoundManager=T;S.soundManager=fa})(window);
Note: See TracBrowser for help on using the repository browser.