/*
   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.95b.20100101
*/
var soundManager=null;function SoundManager(b,a){this.flashVersion=8;this.debugMode=true;this.debugFlash=false;this.useConsole=true;this.consoleOnly=false;this.waitForWindowLoad=false;this.nullURL="null.mp3";this.allowPolling=true;this.useFastPolling=false;this.useMovieStar=false;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashLoadTimeout=1000;this.wmode=null;this.allowFullScreen=true;this.allowScriptAccess="always";this.defaultOptions={autoLoad:false,stream:true,autoPlay:false,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5000,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,multiShotEvents:false,position:null,pan:0,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions={onmetadata:null,useVideo:false,bufferTime:null};var h=null;var f=this;var d="soundManager";this.version=null;this.versionNumber="V2.95b.20100101";this.movieURL=null;this.url=null;this.altURL=null;this.swfLoaded=false;this.enabled=false;this.o=null;this.id=(a||"sm2movie");this.oMC=null;this.sounds={};this.soundIDs=[];this.muted=false;this.isFullScreen=false;this.isIE=(navigator.userAgent.match(/MSIE/i));this.isSafari=(navigator.userAgent.match(/safari/i));this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.specialWmodeCase=false;this._onready=[];this._debugOpen=true;this._didAppend=false;this._appendSuccess=false;this._didInit=false;this._disabled=false;this._windowLoaded=false;this._hasConsole=(typeof console!="undefined"&&typeof console.log!="undefined");this._debugLevels=["log","info","warn","error"];this._defaultFlashVersion=8;this._oRemoved=null;this._oRemovedHTML=null;var g=function(i){return document.getElementById(i)};this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.filePattern=null;this.features={buffering:false,peakData:false,waveformData:false,eqData:false,movieStar:false};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null};this._setVersionInfo=function(){if(f.flashVersion!=8&&f.flashVersion!=9){alert(f._str("badFV",f.flashVersion,f._defaultFlashVersion));f.flashVersion=f._defaultFlashVersion}f.version=f.versionNumber+(f.flashVersion==9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(f.flashVersion>8){f.defaultOptions=f._mergeObjects(f.defaultOptions,f.flash9Options);f.features.buffering=true}if(f.flashVersion>8&&f.useMovieStar){f.defaultOptions=f._mergeObjects(f.defaultOptions,f.movieStarOptions);f.filePatterns.flash9=new RegExp("\\.(mp3|"+f.netStreamTypes.join("|")+")(\\?.*)?$","i");f.features.movieStar=true}else{f.useMovieStar=false;f.features.movieStar=false}f.filePattern=f.filePatterns[(f.flashVersion!=8?"flash9":"flash8")];f.movieURL=(f.flashVersion==8?"soundmanager2.swf":"soundmanager2_flash9.swf");f.features.peakData=f.features.waveformData=f.features.eqData=(f.flashVersion>8)};this._overHTTP=(document.location?document.location.protocol.match(/http/i):null);this._waitingforEI=false;this._initPending=false;this._tryInitOnFocus=(this.isSafari&&typeof document.hasFocus=="undefined");this._isFocused=(typeof document.hasFocus!="undefined"?document.hasFocus():null);this._okToDisable=!this._tryInitOnFocus;this.useAltURL=!this._overHTTP;var e="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html";this.strings={notReady:"Not loaded yet - wait for soundManager.onload() before calling sound-related methods",appXHTML:d+"_createMovie(): appendChild/innerHTML set failed. May be app/xhtml+xml DOM-related.",swf404:d+": Verify that %s is a valid path.",tryDebug:"Try "+d+".debugFlash = true for more security details (output goes to SWF.)",checkSWF:"See SWF output for more debug info.",localFail:d+": Non-HTTP page ("+document.location.protocol+" URL?) Review Flash player security settings for this special case:\n"+e+"\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/",waitFocus:d+": Special case: Waiting for focus-related event..",waitImpatient:d+": Getting impatient, still waiting for Flash%s...",waitForever:d+": Waiting indefinitely for Flash...",needFunction:d+".onready(): Function object expected",badID:'Warning: Sound ID "%s" should be a string, starting with a non-numeric character',fl9Vid:"flash 9 required for video. Exiting.",noMS:"MovieStar mode not enabled. Exiting.",spcWmode:d+"._createMovie(): Removing wmode, preventing win32 below-the-fold SWF loading issue",currentObj:"--- "+d+"._debug(): Current sound objects ---",waitEI:d+"._initMovie(): Waiting for ExternalInterface call from Flash..",waitOnload:d+": Waiting for window.onload()",docLoaded:d+": Document already loaded",onload:d+".initComplete(): calling soundManager.onload()",onloadOK:d+".onload() complete",init:"-- "+d+".init() --",didInit:d+".init(): Already called?",flashJS:d+": Attempting to call Flash from JS..",noPolling:d+": Polling (whileloading()/whileplaying() support) is disabled.",secNote:"Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html",badRemove:"Warning: Failed to remove flash movie.",peakWave:"Warning: peak/waveform/eqData features unsupported for non-MP3 formats",shutdown:d+".disable(): Shutting down",queue:d+".onready(): Queueing handler",smFail:d+": Failed to initialise.",smError:"SMSound.load(): Exception: JS-Flash communication failed, or JS error.",manURL:"SMSound.load(): Using manually-assigned URL",onURL:d+".load(): current URL already assigned.",badFV:'soundManager.flashVersion must be 8 or 9. "%s" is invalid. Reverting to %s.'};this._str=function(){var p=Array.prototype.slice.call(arguments);var n=p.shift();var m=f.strings&&f.strings[n]?f.strings[n]:"";if(m&&p&&p.length){for(var l=0,k=p.length;l<k;l++){m=m.replace("%s",p[l])}}return m};this.supported=function(){return(f._didInit&&!f._disabled)};this.getMovie=function(i){return f.isIE?window[i]:(f.isSafari?g(i)||document[i]:g(i))};this.loadFromXML=function(i){try{f.o._loadFromXML(i)}catch(j){f._failSafely();return true}};this.createSound=function(j){var l="soundManager.createSound(): ";if(!f._didInit){throw f._complain(l+f._str("notReady"),arguments.callee.caller)}if(arguments.length==2){j={id:arguments[0],url:arguments[1]}}var k=f._mergeObjects(j);var i=k;if(i.id.toString().charAt(0).match(/^[0-9]$/)){f._wD(l+f._str("badID",i.id),2)}f._wD(l+i.id+" ("+i.url+")",1);if(f._idCheck(i.id,true)){f._wD(l+i.id+" exists",1);return f.sounds[i.id]}if(f.flashVersion>8&&f.useMovieStar){if(i.isMovieStar===null){i.isMovieStar=(i.url.match(f.netStreamPattern)?true:false)}if(i.isMovieStar){f._wD(l+"using MovieStar handling")}if(i.isMovieStar&&(i.usePeakData||i.useWaveformData||i.useEQData)){f._wDS("peakWave");i.usePeakData=false;i.useWaveformData=false;i.useEQData=false}}f.sounds[i.id]=new h(i);f.soundIDs[f.soundIDs.length]=i.id;if(f.flashVersion==8){f.o._createSound(i.id,i.onjustbeforefinishtime)}else{f.o._createSound(i.id,i.url,i.onjustbeforefinishtime,i.usePeakData,i.useWaveformData,i.useEQData,i.isMovieStar,(i.isMovieStar?i.useVideo:false),(i.isMovieStar?i.bufferTime:false))}if(i.autoLoad||i.autoPlay){if(f.sounds[i.id]){f.sounds[i.id].load(i)}}if(i.autoPlay){f.sounds[i.id].play()}return f.sounds[i.id]};this.createVideo=function(i){var j="soundManager.createVideo(): ";if(arguments.length==2){i={id:arguments[0],url:arguments[1]}}if(f.flashVersion>=9){i.isMovieStar=true;i.useVideo=true}else{f._wD(j+f._str("f9Vid"),2);return false}if(!f.useMovieStar){f._wD(j+f._str("noMS"),2)}return f.createSound(i)};this.destroySound=function(j,l){if(!f._idCheck(j)){return false}for(var k=0;k<f.soundIDs.length;k++){if(f.soundIDs[k]==j){f.soundIDs.splice(k,1);continue}}f.sounds[j].unload();if(!l){f.sounds[j].destruct()}delete f.sounds[j]};this.destroyVideo=this.destroySound;this.load=function(i,j){if(!f._idCheck(i)){return false}f.sounds[i].load(j)};this.unload=function(i){if(!f._idCheck(i)){return false}f.sounds[i].unload()};this.play=function(i,j){var k="soundManager.play(): ";if(!f._didInit){throw f._complain(k+f._str("notReady"),arguments.callee.caller)}if(!f._idCheck(i)){if(typeof j!="Object"){j={url:j}}if(j&&j.url){f._wD(k+'attempting to create "'+i+'"',1);j.id=i;f.createSound(j)}else{return false}}f.sounds[i].play(j)};this.start=this.play;this.setPosition=function(i,j){if(!f._idCheck(i)){return false}f.sounds[i].setPosition(j)};this.stop=function(i){if(!f._idCheck(i)){return false}f._wD("soundManager.stop("+i+")",1);f.sounds[i].stop()};this.stopAll=function(){f._wD("soundManager.stopAll()",1);for(var i in f.sounds){if(f.sounds[i] instanceof h){f.sounds[i].stop()}}};this.pause=function(i){if(!f._idCheck(i)){return false}f.sounds[i].pause()};this.pauseAll=function(){for(var j=f.soundIDs.length;j--;){f.sounds[f.soundIDs[j]].pause()}};this.resume=function(i){if(!f._idCheck(i)){return false}f.sounds[i].resume()};this.resumeAll=function(){for(var j=f.soundIDs.length;j--;){f.sounds[f.soundIDs[j]].resume()}};this.togglePause=function(i){if(!f._idCheck(i)){return false}f.sounds[i].togglePause()};this.setPan=function(i,j){if(!f._idCheck(i)){return false}f.sounds[i].setPan(j)};this.setVolume=function(j,i){if(!f._idCheck(j)){return false}f.sounds[j].setVolume(i)};this.mute=function(j){var l="soundManager.mute(): ";if(typeof j!="string"){j=null}if(!j){f._wD(l+"Muting all sounds");for(var k=f.soundIDs.length;k--;){f.sounds[f.soundIDs[k]].mute()}f.muted=true}else{if(!f._idCheck(j)){return false}f._wD(l+'Muting "'+j+'"');f.sounds[j].mute()}};this.muteAll=function(){f.mute()};this.unmute=function(j){var l="soundManager.unmute(): ";if(typeof j!="string"){j=null}if(!j){f._wD(l+"Unmuting all sounds");for(var k=f.soundIDs.length;k--;){f.sounds[f.soundIDs[k]].unmute()}f.muted=false}else{if(!f._idCheck(j)){return false}f._wD(l+'Unmuting "'+j+'"');f.sounds[j].unmute()}};this.unmuteAll=function(){f.unmute()};this.toggleMute=function(i){if(!f._idCheck(i)){return false}f.sounds[i].toggleMute()};this.getMemoryUse=function(){if(f.flashVersion==8){return 0}if(f.o){return parseInt(f.o._getMemoryUse(),10)}};this.disable=function(k){if(typeof k=="undefined"){k=false}if(f._disabled){return false}f._disabled=true;f._wDS("shutdown",1);for(var j=f.soundIDs.length;j--;){f._disableObject(f.sounds[f.soundIDs[j]])}f.initComplete(k)};this.canPlayURL=function(i){return(i?(i.match(f.filePattern)?true:false):null)};this.getSoundById=function(i,k){if(!i){throw new Error("SoundManager.getSoundById(): sID is null/undefined")}var j=f.sounds[i];if(!j&&!k){f._wD('"'+i+'" is an invalid sound ID.',2)}return j};this.onready=function(i,j){if(i&&i instanceof Function){if(f._didInit){f._wDS("queue")}if(!j){j=window}f._addOnReady(i,j);f._processOnReady();return true}else{throw f._str("needFunction")}};this.oninitmovie=function(){};this.onload=function(){soundManager._wD("soundManager.onload()",1)};this.onerror=function(){};this._idCheck=this.getSoundById;this._complain=function(j,l){var k="Error: ";if(!l){return new Error(k+j)}var n=new Error("");var o=null;if(n.stack){try{var p="@";var q=n.stack.split(p);o=q[4]}catch(m){o=n.stack}}if(typeof console!="undefined"&&typeof console.trace!="undefined"){console.trace()}var i=k+j+". \nCaller: "+l.toString()+(n.stack?" \nTop of stacktrace: "+o:(n.message?" \nMessage: "+n.message:""));return new Error(i)};var c=function(){return false};c._protected=true;this._disableObject=function(j){for(var i in j){if(typeof j[i]=="function"&&typeof j[i]._protected=="undefined"){j[i]=c}}i=null};this._failSafely=function(i){if(typeof i=="undefined"){i=false}if(!f._disabled||i){f._wDS("smFail",2);f.disable(i)}};this._normalizeMovieURL=function(i){var j=null;if(i){if(i.match(/\.swf(\?.*)?$/i)){j=i.substr(i.toLowerCase().lastIndexOf(".swf?")+4);if(j){return i}}else{if(i.lastIndexOf("/")!=i.length-1){i=i+"/"}}}return(i&&i.lastIndexOf("/")!=-1?i.substr(0,i.lastIndexOf("/")+1):"./")+f.movieURL};this._getDocument=function(){return(document.body?document.body:(document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]))};this._getDocument._protected=true;this._setPolling=function(i,j){if(!f.o||!f.allowPolling){return false}f.o._setPolling(i,j)};this._createMovie=function(y,o){var A=null;var w=(o?o:f.url);var r=(f.altURL?f.altURL:w);if(f.debugURLParam.test(window.location.href.toString())){f.debugMode=true}if(f._didAppend&&f._appendSuccess){return false}f._didAppend=true;f._setVersionInfo();f.url=f._normalizeMovieURL(f._overHTTP?w:r);o=f.url;if(f.useHighPerformance&&f.useMovieStar&&f.defaultOptions.useVideo===true){A="soundManager note: disabling highPerformance, not applicable with movieStar mode+useVideo";f.useHighPerformance=false}f.wmode=(!f.wmode&&f.useHighPerformance&&!f.useMovieStar?"transparent":f.wmode);if(f.wmode!==null&&f.flashLoadTimeout!==0&&(!f.useHighPerformance||f.debugFlash)&&!f.isIE&&navigator.platform.match(/win32/i)){f.specialWmodeCase=true;f._wDS("spcWmode");f.wmode=null}if(f.flashVersion==8){f.allowFullScreen=false}var t={name:y,id:y,src:o,width:"100%",height:"100%",quality:"high",allowScriptAccess:f.allowScriptAccess,bgcolor:f.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:f.wmode,allowfullscreen:(f.allowFullScreen?"true":"false")};if(f.debugFlash){t.FlashVars="debug=1"}if(!f.wmode){delete t.wmode}var i=null;var C=null;var u=null;var q=null;if(f.isIE){i=document.createElement("div");u='<object id="'+y+'" data="'+o+'" type="'+t.type+'" width="'+t.width+'" height="'+t.height+'"><param name="movie" value="'+o+'" /><param name="AllowScriptAccess" value="'+f.allowScriptAccess+'" /><param name="quality" value="'+t.quality+'" />'+(f.wmode?'<param name="wmode" value="'+f.wmode+'" /> ':"")+'<param name="bgcolor" value="'+f.bgColor+'" /><param name="allowFullScreen" value="'+t.allowFullScreen+'" />'+(f.debugFlash?'<param name="FlashVars" value="'+t.FlashVars+'" />':"")+"<!-- --></object>"}else{i=document.createElement("embed");for(C in t){if(t.hasOwnProperty(C)){i.setAttribute(C,t[C])}}}var m=null;var k=null;if(f.debugMode){m=document.createElement("div");m.id=f.debugID+"-toggle";k={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001};m.appendChild(document.createTextNode("-"));m.onclick=f._toggleDebug;m.title="Toggle SM2 debug console";if(navigator.userAgent.match(/msie 6/i)){m.style.position="absolute";m.style.cursor="hand"}for(C in k){if(k.hasOwnProperty(C)){m.style[C]=k[C]}}}var z=f._getDocument();if(z){f.oMC=g("sm2-container")?g("sm2-container"):document.createElement("div");var v=(f.debugMode?" sm2-debug":"")+(f.debugFlash?" flash-debug":"");if(!f.oMC.id){f.oMC.id="sm2-container";f.oMC.className="movieContainer"+v;var p=null;q=null;if(f.useHighPerformance){p={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}}else{p={position:"absolute",width:"8px",height:"8px",top:"-9999px",left:"-9999px"}}var n=null;if(!f.debugFlash){for(n in p){if(p.hasOwnProperty(n)){f.oMC.style[n]=p[n]}}}try{if(!f.isIE){f.oMC.appendChild(i)}z.appendChild(f.oMC);if(f.isIE){q=f.oMC.appendChild(document.createElement("div"));q.className="sm2-object-box";q.innerHTML=u}f._appendSuccess=true}catch(B){throw new Error(f._str("appXHTML"))}}else{if(f.debugMode||f.debugFlash){f.oMC.className+=v}f.oMC.appendChild(i);if(f.isIE){q=f.oMC.appendChild(document.createElement("div"));q.className="sm2-object-box";q.innerHTML=u}f._appendSuccess=true}if(f.debugMode&&!g(f.debugID)&&((!f._hasConsole||!f.useConsole)||(f.useConsole&&f._hasConsole&&!f.consoleOnly))){var j=document.createElement("div");j.id=f.debugID;j.style.display=(f.debugMode?"block":"none");if(f.debugMode&&!g(m.id)){try{z.appendChild(m)}catch(l){throw new Error(f._str("appXHTML"))}z.appendChild(j)}}z=null}if(A){f._wD(A)}f._wD("-- SoundManager 2 "+f.version+(f.useMovieStar?", MovieStar mode":"")+(f.useHighPerformance?", high performance mode, ":", ")+((f.useFastPolling?"fast":"normal")+" polling")+(f.wmode?", wmode: "+f.wmode:"")+(f.debugFlash?", flash debug mode":"")+" --",1);f._wD("soundManager._createMovie(): Trying to load "+o+(!f._overHTTP&&f.altURL?" (alternate URL)":""),1)};this._writeDebug=function(j,q,p){if(!f.debugMode){return false}if(typeof p!="undefined"&&p){j=j+" | "+new Date().getTime()}if(f._hasConsole&&f.useConsole){var i=f._debugLevels[q];if(typeof console[i]!="undefined"){console[i](j)}else{console.log(j)}if(f.useConsoleOnly){return true}}var n="soundmanager-debug";var m=null;try{m=g(n);if(!m){return false}var l=document.createElement("div");if(++f._wdCount%2===0){l.className="sm2-alt"}if(typeof q=="undefined"){q=0}else{q=parseInt(q,10)}l.appendChild(document.createTextNode(j));if(q){if(q>=2){l.style.fontWeight="bold"}if(q==3){l.style.color="#ff3333"}}m.insertBefore(l,m.firstChild)}catch(k){}m=null};this._writeDebug._protected=true;this._wdCount=0;this._wdCount._protected=true;this._wD=this._writeDebug;this._wDS=function(j,i){if(!j){return""}else{return f._wD(f._str(j),i)}};this._wDS._protected=true;this._wDAlert=function(i){alert(i)};if(window.location.href.indexOf("debug=alert")+1&&f.debugMode){f._wD=f._wDAlert}this._toggleDebug=function(){var j=g(f.debugID);var i=g(f.debugID+"-toggle");if(!j){return false}if(f._debugOpen){i.innerHTML="+";j.style.display="none"}else{i.innerHTML="-";j.style.display="block"}f._debugOpen=!f._debugOpen};this._toggleDebug._protected=true;this._debug=function(){f._wDS("currentObj",1);for(var l=0,k=f.soundIDs.length;l<k;l++){f.sounds[f.soundIDs[l]]._debug()}};this._debugTS=function(l,j,i){if(typeof sm2Debugger!="undefined"){try{sm2Debugger.handleEvent(l,j,i)}catch(k){}}};this._debugTS._protected=true;this._mergeObjects=function(k,j){var n={};for(var l in k){if(k.hasOwnProperty(l)){n[l]=k[l]}}var m=(typeof j=="undefined"?f.defaultOptions:j);for(var p in m){if(m.hasOwnProperty(p)&&typeof n[p]=="undefined"){n[p]=m[p]}}return n};this.createMovie=function(i){if(i){f.url=i}f._initMovie()};this.go=this.createMovie;this._initMovie=function(){if(f.o){return false}f.o=f.getMovie(f.id);if(!f.o){if(!f.oRemoved){f._createMovie(f.id,f.url)}else{if(!f.isIE){f.oMC.appendChild(f.oRemoved)}else{f.oMC.innerHTML=f.oRemovedHTML}f.oRemoved=null;f._didAppend=true}f.o=f.getMovie(f.id)}if(f.o){if(f.flashLoadTimeout>0){f._wDS("waitEI")}}if(typeof f.oninitmovie=="function"){setTimeout(f.oninitmovie,1)}};this.waitForExternalInterface=function(){if(f._waitingForEI){return false}f._waitingForEI=true;if(f._tryInitOnFocus&&!f._isFocused){f._wDS("waitFocus");return false}if(f.flashLoadTimeout>0){if(!f._didInit){var i=f.getMoviePercent();f._wD(f._str("waitImpatient",(i==100?" (SWF loaded)":(i>0?" (SWF "+i+"% loaded)":""))))}setTimeout(function(){var j=f.getMoviePercent();if(!f._didInit){f._wD(d+": No Flash response within reasonable time after document load.\nLikely causes: "+(j===null||j===0?"Loading "+f.movieURL+" may have failed (and/or Flash "+f.flashVersion+"+ not present?), ":"")+"Flash blocked or JS-Flash security error."+(f.debugFlash?" "+f._str("checkSWF"):""),2);if(!f._overHTTP){f._wDS("localFail",2);if(!f.debugFlash){f._wDS("tryDebug",2)}}if(j===0){f._wD(f._str("swf404",f.url))}f._debugTS("flashtojs",false,": Timed out"+(f._overHTTP)?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)")}if(!f._didInit&&f._okToDisable){f._failSafely(true)}},f.flashLoadTimeout)}else{if(!f._didInit){f._wDS("waitForever")}}};this.getMoviePercent=function(){return(f.o&&typeof f.o.PercentLoaded!="undefined"?f.o.PercentLoaded():null)};this.handleFocus=function(){if(f._isFocused||!f._tryInitOnFocus){return true}f._okToDisable=true;f._isFocused=true;f._wD("soundManager.handleFocus()");if(f._tryInitOnFocus){window.removeEventListener("mousemove",f.handleFocus,false)}f._waitingForEI=false;setTimeout(f.waitForExternalInterface,500);if(window.removeEventListener){window.removeEventListener("focus",f.handleFocus,false)}else{if(window.detachEvent){window.detachEvent("onfocus",f.handleFocus)}}};this.initComplete=function(i){if(f._didInit){return false}f._didInit=true;f._wD("-- SoundManager 2 "+(f._disabled?"failed to load":"loaded")+" ("+(f._disabled?"security/load error":"OK")+") --",1);if(f._disabled||i){f._processOnReady();f._debugTS("onload",false);f.onerror.apply(window);return false}else{f._debugTS("onload",true)}if(f.waitForWindowLoad&&!f._windowLoaded){f._wDS("waitOnload");if(window.addEventListener){window.addEventListener("load",f._initUserOnload,false)}else{if(window.attachEvent){window.attachEvent("onload",f._initUserOnload)}}return false}else{if(f.waitForWindowLoad&&f._windowLoaded){f._wDS("docLoaded")}f._initUserOnload()}};this._addOnReady=function(i,j){f._onready.push({method:i,scope:(j||null),fired:false})};this._processOnReady=function(){if(!f._didInit){return false}var n={success:(!f._disabled)};var k=[];for(var m=0,l=f._onready.length;m<l;m++){if(f._onready[m].fired!==true){k.push(f._onready[m])}}if(k.length){f._wD(d+": Firing "+k.length+" onready() item"+(k.length>1?"s":""));for(m=0,l=k.length;m<l;m++){if(k[m].scope){k[m].method.apply(k[m].scope,[n])}else{k[m].method(n)}k[m].fired=true}}};this._initUserOnload=function(){window.setTimeout(function(){f._processOnReady();f._wDS("onload",1);f.onload.apply(window);f._wDS("onloadOK",1)})};this.init=function(){f._wDS("init");f._initMovie();if(f._didInit){f._wDS("didInit");return false}if(window.removeEventListener){window.removeEventListener("load",f.beginDelayedInit,false)}else{if(window.detachEvent){window.detachEvent("onload",f.beginDelayedInit)}}try{f._wDS("flashJS");f.o._externalInterfaceTest(false);if(!f.allowPolling){f._wDS("noPolling",1)}else{f._setPolling(true,f.useFastPolling?true:false)}if(!f.debugMode){f.o._disableDebug()}f.enabled=true;f._debugTS("jstoflash",true)}catch(i){f._wD("js/flash exception: "+i.toString());f._debugTS("jstoflash",false);f._failSafely(true);f.initComplete();return false}f.initComplete()};this.beginDelayedInit=function(){f._windowLoaded=true;setTimeout(f.waitForExternalInterface,500);setTimeout(f.beginInit,20)};this.beginInit=function(){if(f._initPending){return false}f.createMovie();f._initMovie();f._initPending=true;return true};this.domContentLoaded=function(){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",f.domContentLoaded,false)}f.go()};this._externalInterfaceOK=function(i){if(f.swfLoaded){return false}var j=new Date().getTime();f._wD("soundManager._externalInterfaceOK()"+(i?" (~"+(j-i)+" ms)":""));f._debugTS("swf",true);f._debugTS("flashtojs",true);f.swfLoaded=true;f._tryInitOnFocus=false;if(f.isIE){setTimeout(f.init,100)}else{f.init()}};this._setSandboxType=function(i){var j=f.sandbox;j.type=i;j.description=j.types[(typeof j.types[i]!="undefined"?i:"unknown")];f._wD("Flash security sandbox type: "+j.type);if(j.type=="localWithFile"){j.noRemote=true;j.noLocal=false;f._wDS("secNote",2)}else{if(j.type=="localWithNetwork"){j.noRemote=false;j.noLocal=true}else{if(j.type=="localTrusted"){j.noRemote=false;j.noLocal=false}}}};this.reboot=function(){f._wD("soundManager.reboot()");if(f.soundIDs.length){f._wD("Destroying "+f.soundIDs.length+" SMSound objects...")}for(var j=f.soundIDs.length;j--;){f.sounds[f.soundIDs[j]].destruct()}try{if(f.isIE){f.oRemovedHTML=f.o.innerHTML}f.oRemoved=f.o.parentNode.removeChild(f.o);f._wD("Flash movie removed.")}catch(k){f._wDS("badRemove",2)}f.oRemovedHTML=null;f.oRemoved=null;f.enabled=false;f._didInit=false;f._waitingForEI=false;f._initPending=false;f._didAppend=false;f._appendSuccess=false;f._disabled=false;f._waitingforEI=true;f.swfLoaded=false;f.soundIDs={};f.sounds=[];f.o=null;for(j=f._onready.length;j--;){f._onready[j].fired=false}f._wD(d+": Rebooting...");window.setTimeout(soundManager.beginDelayedInit,20)};this.destruct=function(){f._wD("soundManager.destruct()");f.disable(true)};h=function(i){var j=this;this.sID=i.id;this.url=i.url;this.options=f._mergeObjects(i);this.instanceOptions=this.options;this._iO=this.instanceOptions;this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this._debug=function(){if(f.debugMode){var m=null;var o=[];var k=null;var n=null;var l=64;for(m in j.options){if(j.options[m]!==null){if(j.options[m] instanceof Function){k=j.options[m].toString();k=k.replace(/\s\s+/g," ");n=k.indexOf("{");o[o.length]=" "+m+": {"+k.substr(n+1,(Math.min(Math.max(k.indexOf("\n")-1,l),l))).replace(/\n/g,"")+"... }"}else{o[o.length]=" "+m+": "+j.options[m]}}}f._wD("SMSound() merged options: {\n"+o.join(", \n")+"\n}")}};this._debug();this.id3={};this.resetProperties=function(k){j.bytesLoaded=null;j.bytesTotal=null;j.position=null;j.duration=null;j.durationEstimate=null;j.loaded=false;j.playState=0;j.paused=false;j.readyState=0;j.muted=false;j.didBeforeFinish=false;j.didJustBeforeFinish=false;j.isBuffering=false;j.instanceOptions={};j.instanceCount=0;j.peakData={left:0,right:0};j.waveformData={left:[],right:[]};j.eqData=[];j.eqData.left=[];j.eqData.right=[]};j.resetProperties();this.load=function(k){if(typeof k!="undefined"){j._iO=f._mergeObjects(k);j.instanceOptions=j._iO}else{k=j.options;j._iO=k;j.instanceOptions=j._iO;if(j._lastURL&&j._lastURL!=j.url){f._wDS("manURL");j._iO.url=j.url;j.url=null}}if(typeof j._iO.url=="undefined"){j._iO.url=j.url}f._wD("soundManager.load(): "+j._iO.url,1);if(j._iO.url==j.url&&j.readyState!==0&&j.readyState!=2){f._wDS("onURL",1);return false}j.url=j._iO.url;j._lastURL=j._iO.url;j.loaded=false;j.readyState=1;j.playState=0;try{if(f.flashVersion==8){f.o._load(j.sID,j._iO.url,j._iO.stream,j._iO.autoPlay,(j._iO.whileloading?1:0))}else{f.o._load(j.sID,j._iO.url,j._iO.stream?true:false,j._iO.autoPlay?true:false);if(j._iO.isMovieStar&&j._iO.autoLoad&&!j._iO.autoPlay){j.pause()}}}catch(l){f._wDS("smError",2);f._debugTS("onload",false);f.onerror();f.disable()}};this.unload=function(){if(j.readyState!==0){f._wD('SMSound.unload(): "'+j.sID+'"');if(j.readyState!=2){j.setPosition(0,true)}f.o._unload(j.sID,f.nullURL);j.resetProperties()}};this.destruct=function(){f._wD('SMSound.destruct(): "'+j.sID+'"');f.o._destroySound(j.sID);f.destroySound(j.sID,true)};this.play=function(k){var l="SMSound.play(): ";if(!k){k={}}j._iO=f._mergeObjects(k,j._iO);j._iO=f._mergeObjects(j._iO,j.options);j.instanceOptions=j._iO;if(j.playState==1){var m=j._iO.multiShot;if(!m){f._wD(l+'"'+j.sID+'" already playing (one-shot)',1);return false}else{f._wD(l+'"'+j.sID+'" already playing (multi-shot)',1)}}if(!j.loaded){if(j.readyState===0){f._wD(l+'Attempting to load "'+j.sID+'"',1);j._iO.autoPlay=true;j.load(j._iO)}else{if(j.readyState==2){f._wD(l+'Could not load "'+j.sID+'" - exiting',2);return false}else{f._wD(l+'"'+j.sID+'" is loading - attempting to play..',1)}}}else{f._wD(l+'"'+j.sID+'"')}if(j.paused){j.resume()}else{j.playState=1;if(!j.instanceCount||f.flashVersion>8){j.instanceCount++}j.position=(typeof j._iO.position!="undefined"&&!isNaN(j._iO.position)?j._iO.position:0);if(j._iO.onplay){j._iO.onplay.apply(j)}j.setVolume(j._iO.volume,true);j.setPan(j._iO.pan,true);f.o._start(j.sID,j._iO.loop||1,(f.flashVersion==9?j.position:j.position/1000))}};this.start=this.play;this.stop=function(k){if(j.playState==1){j.playState=0;j.paused=false;if(j._iO.onstop){j._iO.onstop.apply(j)}f.o._stop(j.sID,k);j.instanceCount=0;j._iO={}}};this.setPosition=function(l,k){if(typeof l=="undefined"){l=0}var m=Math.min(j.duration,Math.max(l,0));j._iO.position=m;if(!k){}f.o._setPosition(j.sID,(f.flashVersion==9?j._iO.position:j._iO.position/1000),(j.paused||!j.playState))};this.pause=function(){if(j.paused||j.playState===0){return false}f._wD("SMSound.pause()");j.paused=true;f.o._pause(j.sID);if(j._iO.onpause){j._iO.onpause.apply(j)}};this.resume=function(){if(!j.paused||j.playState===0){return false}f._wD("SMSound.resume()");j.paused=false;f.o._pause(j.sID);if(j._iO.onresume){j._iO.onresume.apply(j)}};this.togglePause=function(){f._wD("SMSound.togglePause()");if(j.playState===0){j.play({position:(f.flashVersion==9?j.position:j.position/1000)});return false}if(j.paused){j.resume()}else{j.pause()}};this.setPan=function(l,k){if(typeof l=="undefined"){l=0}if(typeof k=="undefined"){k=false}f.o._setPan(j.sID,l);j._iO.pan=l;if(!k){j.pan=l}};this.setVolume=function(k,l){if(typeof k=="undefined"){k=100}if(typeof l=="undefined"){l=false}f.o._setVolume(j.sID,(f.muted&&!j.muted)||j.muted?0:k);j._iO.volume=k;if(!l){j.volume=k}};this.mute=function(){j.muted=true;f.o._setVolume(j.sID,0)};this.unmute=function(){j.muted=false;var k=typeof j._iO.volume!="undefined";f.o._setVolume(j.sID,k?j._iO.volume:j.options.volume)};this.toggleMute=function(){if(j.muted){j.unmute()}else{j.mute()}};this._whileloading=function(l,k,m){if(!j._iO.isMovieStar){j.bytesLoaded=l;j.bytesTotal=k;j.duration=Math.floor(m);j.durationEstimate=parseInt((j.bytesTotal/j.bytesLoaded)*j.duration,10);if(j.durationEstimate===undefined){j.durationEstimate=j.duration}if(j.readyState!=3&&j._iO.whileloading){j._iO.whileloading.apply(j)}}else{j.bytesLoaded=l;j.bytesTotal=k;j.duration=Math.floor(m);j.durationEstimate=j.duration;if(j.readyState!=3&&j._iO.whileloading){j._iO.whileloading.apply(j)}}};this._onid3=function(n,m){f._wD('SMSound._onid3(): "'+this.sID+'" ID3 data received.');var o=[];for(var l=0,k=n.length;l<k;l++){o[n[l]]=m[l]}j.id3=f._mergeObjects(j.id3,o);if(j._iO.onid3){j._iO.onid3.apply(j)}};this._whileplaying=function(m,k,p,l,o){if(isNaN(m)||m===null){return false}if(j.playState===0&&m>0){m=0}j.position=m;if(f.flashVersion>8){if(j._iO.usePeakData&&typeof k!="undefined"&&k){j.peakData={left:k.leftPeak,right:k.rightPeak}}if(j._iO.useWaveformData&&typeof p!="undefined"&&p){j.waveformData={left:p.split(","),right:l.split(",")}}if(j._iO.useEQData){if(typeof o!="undefined"&&o.leftEQ){var n=o.leftEQ.split(",");j.eqData=n;j.eqData.left=n;if(typeof o.rightEQ!="undefined"&&o.rightEQ){j.eqData.right=o.rightEQ.split(",")}}}}if(j.playState==1){if(j.isBuffering){j._onbufferchange(0)}if(j._iO.whileplaying){j._iO.whileplaying.apply(j)}if(j.loaded&&j._iO.onbeforefinish&&j._iO.onbeforefinishtime&&!j.didBeforeFinish&&j.duration-j.position<=j._iO.onbeforefinishtime){f._wD("duration-position &lt;= onbeforefinishtime: "+j.duration+" - "+j.position+" &lt= "+j._iO.onbeforefinishtime+" ("+(j.duration-j.position)+")");j._onbeforefinish()}}};this._onload=function(l){var k="SMSound._onload(): ";l=(l==1?true:false);f._wD(k+'"'+j.sID+'"'+(l?" loaded.":" failed to load? - "+j.url),(l?1:2));if(!l){if(f.sandbox.noRemote===true){f._wD(k+f._str("noNet"),1)}if(f.sandbox.noLocal===true){f._wD(k+f._str("noLocal"),1)}}j.loaded=l;j.readyState=l?3:2;if(j._iO.onload){j._iO.onload.apply(j)}};this._onbeforefinish=function(){if(!j.didBeforeFinish){j.didBeforeFinish=true;if(j._iO.onbeforefinish){f._wD('SMSound._onbeforefinish(): "'+j.sID+'"');j._iO.onbeforefinish.apply(j)}}};this._onjustbeforefinish=function(k){if(!j.didJustBeforeFinish){j.didJustBeforeFinish=true;if(j._iO.onjustbeforefinish){f._wD('SMSound._onjustbeforefinish(): "'+j.sID+'"');j._iO.onjustbeforefinish.apply(j)}}};this._onfinish=function(){if(j._iO.onbeforefinishcomplete){j._iO.onbeforefinishcomplete.apply(j)}j.didBeforeFinish=false;j.didJustBeforeFinish=false;if(j.instanceCount){j.instanceCount--;if(!j.instanceCount){j.playState=0;j.paused=false;j.instanceCount=0;j.instanceOptions={}}if(!j.instanceCount||j._iO.multiShotEvents){if(j._iO.onfinish){f._wD('SMSound._onfinish(): "'+j.sID+'"');j._iO.onfinish.apply(j)}}}else{if(j.useVideo){}}};this._onmetadata=function(l){var k="SMSound.onmetadata()";f._wD(k);if(!l.width&&!l.height){f._wDS("noWH");l.width=320;l.height=240}j.metadata=l;j.width=l.width;j.height=l.height;if(j._iO.onmetadata){f._wD(k+': "'+j.sID+'"');j._iO.onmetadata.apply(j)}f._wD(k+" complete")};this._onbufferchange=function(l){var k="SMSound._onbufferchange()";if(j.playState===0){return false}if(l==j.isBuffering){f._wD(k+": ignoring false default / loaded sound");return false}j.isBuffering=(l==1?true:false);if(j._iO.onbufferchange){f._wD(k+": "+l);j._iO.onbufferchange.apply(j)}};this._ondataerror=function(k){if(j.playState>0){f._wD("SMSound._ondataerror(): "+k);if(j._iO.ondataerror){j._iO.ondataerror.apply(j)}}else{}}};this._onfullscreenchange=function(i){f._wD("onfullscreenchange(): "+i);f.isFullScreen=(i==1?true:false);if(!f.isFullScreen){try{window.focus();f._wD("window.focus()")}catch(j){}}};if(window.addEventListener){window.addEventListener("focus",f.handleFocus,false);window.addEventListener("load",f.beginDelayedInit,false);window.addEventListener("unload",f.destruct,false);if(f._tryInitOnFocus){window.addEventListener("mousemove",f.handleFocus,false)}}else{if(window.attachEvent){window.attachEvent("onfocus",f.handleFocus);window.attachEvent("onload",f.beginDelayedInit);window.attachEvent("unload",f.destruct)}else{f._debugTS("onload",false);soundManager.onerror();soundManager.disable()}}if(document.addEventListener){document.addEventListener("DOMContentLoaded",f.domContentLoaded,false)}}if(typeof SM2_DEFER=="undefined"||!SM2_DEFER){soundManager=new SoundManager()};
