/** @license SoundManager 2: JavaScript Sound for the Web ---------------------------------------------- http://schillmania.com/projects/soundmanager2/ Copyright (c) 2007, Scott Schiller. All rights reserved. Code provided under the BSD License: http://schillmania.com/projects/soundmanager2/license.txt V2.97a.20120318 */ (function(F){function W(W,la){function n(a){return function(d){var e=this._t;return!e||!e._a?(e&&e.sID?c._wD(m+"ignoring "+d.type+": "+e.sID):c._wD(m+"ignoring "+d.type),null):a.call(this,d)}}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= !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}}; 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, duration:null};this.movieID="sm2-container";this.id=la||"sm2movie";this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.versionNumber="V2.97a.20120318";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, 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= !1;var Ea,c=this,g=null,m="HTML5::",r,t=navigator.userAgent,i=F,O=i.location.href.toString(),k=document,na,X,j,A=[],oa=!0,w,P=!1,Q=!1,p=!1,x=!1,Y=!1,o,Za=0,R,v,pa,G,H,Z,Fa,qa,D,$,aa,I,ra,sa,ba,ca,J,Ga,ta,$a=["log","info","warn","error"],Ha,da,Ia,S=null,ua=null,q,va,K,Ja,ea,fa,wa,s,ga=!1,xa=!1,Ka,La,Ma,ha=0,T=null,ia,y=null,Na,ja,U,B,ya,za,Oa,l,Pa=Array.prototype.slice,E=!1,u,ka,Qa,z,Ra,Aa=t.match(/(ipad|iphone|ipod)/i),ab=t.match(/firefox/i),bb=t.match(/droid/i),C=t.match(/msie/i),cb=t.match(/webkit/i), V=t.match(/safari/i)&&!t.match(/chrome/i),db=t.match(/opera/i),Ba=t.match(/(mobile|pre\/|xoom)/i)||Aa,Ca=!O.match(/usehtml5audio/i)&&!O.match(/sm2\-ignorebadua/i)&&V&&!t.match(/silk/i)&&t.match(/OS X 10_6_([3-7])/i),Sa="undefined"!==typeof console&&"undefined"!==typeof console.log,Da="undefined"!==typeof k.hasFocus?k.hasFocus():null,L=V&&"undefined"===typeof k.hasFocus,Ta=!L,Ua=/(mp3|mp4|mpa)/i,M=k.location?k.location.protocol.match(/http/i):null,Va=!M?"http://":"",Wa=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|mp4v|3gp|3g2)\s*(?:$|;)/i, 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=!M;this._global_a=null;if(Ba&&(c.useHTML5Audio=!0,c.preferFlash=!1,Aa))E=c.ignoreFlash=!0;this.supported=this.ok=function(){return y?p&&!x:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(c){return r(c)||k[c]||i[c]};this.createSound=function(a){function d(){b=ea(b);c.sounds[f.id]=new Ea(f);c.soundIDs.push(f.id); return c.sounds[f.id]}var e,b=null,f=e=null;e="soundManager.createSound(): "+q(!p?"notReady":"notOK");if(!p||!c.ok())return wa(e),!1;2===arguments.length&&(a={id:arguments[0],url:arguments[1]});b=v(a);b.url=ia(b.url);f=b;f.id.toString().charAt(0).match(/^[0-9]$/)&&c._wD("soundManager.createSound(): "+q("badID",f.id),2);c._wD("soundManager.createSound(): "+f.id+" ("+f.url+")",1);if(s(f.id,!0))return c._wD("soundManager.createSound(): "+f.id+" exists",1),c.sounds[f.id];if(ja(f))e=d(),c._wD("Loading sound "+ f.id+" via HTML5"),e._setup_html5(f);else{if(8=a)return!1;for(a-=1;0<=a;a--)if(c=l[a],!c.fired&&b.position>=c.position)c.fired=!0,n++,c.method.apply(c.scope,[c.position]);return!0};this._resetOnPosition=function(b){var a,c;a=l.length;if(!a)return!1;for(a-=1;0<=a;a--)if(c=l[a],c.fired&&b<=c.position)c.fired=!1,n--; return!0};u=function(){var a=b._iO,d=a.from,f=a.to,e,h;h=function(){c._wD(b.sID+': "to" time of '+f+" reached.");b.clearOnPosition(f,h);b.stop()};e=function(){c._wD(b.sID+': playing "from" '+d);if(null!==f&&!isNaN(f))b.onPosition(f,h)};if(null!==d&&!isNaN(d))a.position=d,a.multiShot=!1,e();return a};Ya=function(){var a,c=b._iO.onposition;if(c)for(a in c)if(c.hasOwnProperty(a))b.onPosition(parseInt(a,10),c[a])};t=function(){var a,c=b._iO.onposition;if(c)for(a in c)c.hasOwnProperty(a)&&b.clearOnPosition(parseInt(a, 10))};i=function(){b.isHTML5&&Ka(b)};N=function(){b.isHTML5&&La(b)};f=function(){l=[];n=0;p=!1;b._hasTimer=null;b._a=null;b._html5_canplay=!1;b.bytesLoaded=null;b.bytesTotal=null;b.duration=b._iO&&b._iO.duration?b._iO.duration:null;b.durationEstimate=null;b.eqData=[];b.eqData.left=[];b.eqData.right=[];b.failures=0;b.isBuffering=!1;b.instanceOptions={};b.instanceCount=0;b.loaded=!1;b.metadata={};b.readyState=0;b.muted=!1;b.paused=!1;b.peakData={left:0,right:0};b.waveformData={left:[],right:[]};b.playState= 0;b.position=null};f();this._onTimer=function(a){var c,f=!1,h={};if(b._hasTimer||a){if(b._a&&(a||(0e.duration?b.duration:e.duration:parseInt(b.bytesTotal/b.bytesLoaded*b.duration, 10),void 0===b.durationEstimate)b.durationEstimate=b.duration;3!==b.readyState&&e.whileloading&&e.whileloading.apply(b)};this._whileplaying=function(a,c,d,f,e){var h=b._iO;if(isNaN(a)||null===a)return!1;b.position=a;b._processOnPosition();if(!b.isHTML5&&8j)c._wD(q("needfl9")),c.flashVersion=j=9;c.version=c.versionNumber+(c.html5Only?" (HTML5-only mode)":9===j?" (AS3/Flash 9)":" (AS2/Flash 8)");8'}if(P&&Q)return!1;if(c.html5Only)return qa(),e(),c.oMC=r(c.movieID),X(),Q=P=!0,!1;var f=d||c.url,g=c.altURL||f,h;h=ba();var i,l,j=K(),m,n=null,n=(n=k.getElementsByTagName("html")[0])&&n.dir&&n.dir.match(/rtl/i),a="undefined"===typeof a?c.id:a;qa();c.url=Ia(M?f:g);d=c.url;c.wmode=!c.wmode&&c.useHighPerformance?"transparent":c.wmode;if(null!==c.wmode&&(t.match(/msie 8/i)||!C&&!c.useHighPerformance)&&navigator.platform.match(/win32|win64/i))o("spcWmode"),c.wmode=null;h={name:a, id:a,src:d,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)h.FlashVars="debug=1";c.wmode||delete h.wmode;if(C)f=k.createElement("div"),l=['',b("movie",d),b("AllowScriptAccess",c.allowScriptAccess),b("quality",h.quality),c.wmode?b("wmode",c.wmode):"",b("bgcolor",c.bgColor),b("hasPriority","true"),c.debugFlash?b("FlashVars",h.FlashVars):"",""].join("");else for(i in f=k.createElement("embed"),h)h.hasOwnProperty(i)&&f.setAttribute(i,h[i]);ta();j=K();if(h=ba())if(c.oMC=r(c.movieID)||k.createElement("div"),c.oMC.id){m=c.oMC.className;c.oMC.className=(m?m+" ":"movieContainer")+(j?" "+j:"");c.oMC.appendChild(f); if(C)i=c.oMC.appendChild(k.createElement("div")),i.className="sm2-object-box",i.innerHTML=l;Q=!0}else{c.oMC.id=c.movieID;c.oMC.className="movieContainer "+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"},n)j.left=Math.abs(parseInt(j.left,10))+"px";if(cb)c.oMC.style.zIndex=1E4;if(!c.debugFlash)for(m in j)j.hasOwnProperty(m)&& (c.oMC.style[m]=j[m]);try{C||c.oMC.appendChild(f);h.appendChild(c.oMC);if(C)i=c.oMC.appendChild(k.createElement("div")),i.className="sm2-object-box",i.innerHTML=l;Q=!0}catch(p){throw Error(q("domError")+" \n"+p.toString());}}P=!0;e();c._wD("soundManager::createMovie(): Trying to load "+d+(!M&&c.altURL?" (alternate URL)":""),1);return!0};aa=function(){if(c.html5Only)return ca(),!1;if(g)return!1;g=c.getMovie(c.id);if(!g)S?(C?c.oMC.innerHTML=ua:c.oMC.appendChild(S),S=null,P=!0):ca(c.id,c.url),g=c.getMovie(c.id); g&&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;l.remove(i,"load",Z);if(L&&!Da)return o("waitFocus"),!1;var a;p||(a=c.getMoviePercent(),c._wD(q("waitImpatient",100===a?" (SWF loaded)":0