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 g=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 h=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?h(i)||document[i]:h(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 g(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(k,j){if(!f._idCheck(k)){return false}for(var l=0;l<f.soundIDs.length;l++){if(f.soundIDs[l]==k){f.soundIDs.splice(l,1);continue}}f.sounds[k].unload();if(!j){f.sounds[k].destruct()}delete f.sounds[k]};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 g){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(j,k){if(!j){throw new Error("SoundManager.getSoundById(): sID is null/undefined")}var i=f.sounds[j];if(!i&&!k){f._wD('"'+j+'" is an invalid sound ID.',2)}return i};this.onready=function(j,i){if(j&&j instanceof Function){if(f._didInit){f._wDS("queue")}if(!i){i=window}f._addOnReady(j,i);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(z,n){var t=null;var y=(n?n:f.url);var r=(f.altURL?f.altURL:y);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?y:r);n=f.url;if(f.useHighPerformance&&f.useMovieStar&&f.defaultOptions.useVideo===true){t="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 C={name:z,id:z,src:n,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){C.FlashVars="debug=1"}if(!f.wmode){delete C.wmode}var o=null;var B=null;var u=null;var q=null;if(f.isIE){o=document.createElement("div");u='<object id="'+z+'" data="'+n+'" type="'+C.type+'" width="'+C.width+'" height="'+C.height+'"><param name="movie" value="'+n+'" /><param name="AllowScriptAccess" value="'+f.allowScriptAccess+'" /><param name="quality" value="'+C.quality+'" />'+(f.wmode?'<param name="wmode" value="'+f.wmode+'" /> ':"")+'<param name="bgcolor" value="'+f.bgColor+'" /><param name="allowFullScreen" value="'+C.allowFullScreen+'" />'+(f.debugFlash?'<param name="FlashVars" value="'+C.FlashVars+'" />':"")+"<!-- --></object>"}else{o=document.createElement("embed");for(B in C){if(C.hasOwnProperty(B)){o.setAttribute(B,C[B])}}}var j=null;var k=null;if(f.debugMode){j=document.createElement("div");j.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};j.appendChild(document.createTextNode("-"));j.onclick=f._toggleDebug;j.title="Toggle SM2 debug console";if(navigator.userAgent.match(/msie 6/i)){j.style.position="absolute";j.style.cursor="hand"}for(B in k){if(k.hasOwnProperty(B)){j.style[B]=k[B]}}}var w=f._getDocument();if(w){f.oMC=h("sm2-container")?h("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 l=null;if(!f.debugFlash){for(l in p){if(p.hasOwnProperty(l)){f.oMC.style[l]=p[l]}}}try{if(!f.isIE){f.oMC.appendChild(o)}w.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(A){throw new Error(f._str("appXHTML"))}}else{if(f.debugMode||f.debugFlash){f.oMC.className+=v}f.oMC.appendChild(o);if(f.isIE){q=f.oMC.appendChild(document.createElement("div"));q.className="sm2-object-box";q.innerHTML=u}f._appendSuccess=true}if(f.debugMode&&!h(f.debugID)&&((!f._hasConsole||!f.useConsole)||(f.useConsole&&f._hasConsole&&!f.consoleOnly))){var m=document.createElement("div");m.id=f.debugID;m.style.display=(f.debugMode?"block":"none");if(f.debugMode&&!h(j.id)){try{w.appendChild(j)}catch(i){throw new Error(f._str("appXHTML"))}w.appendChild(m)}}w=null}if(t){f._wD(t)}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 "+n+(!f._overHTTP&&f.altURL?" (alternate URL)":""),1)};this._writeDebug=function(j,q,l){if(!f.debugMode){return false}if(typeof l!="undefined"&&l){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 p="soundmanager-debug";var n=null;try{n=h(p);if(!n){return false}var m=document.createElement("div");if(++f._wdCount%2===0){m.className="sm2-alt"}if(typeof q=="undefined"){q=0}else{q=parseInt(q,10)}m.appendChild(document.createTextNode(j));if(q){if(q>=2){m.style.fontWeight="bold"}if(q==3){m.style.color="#ff3333"}}n.insertBefore(m,n.firstChild)}catch(k){}n=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=h(f.debugID);var i=h(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,i,j){if(typeof sm2Debugger!="undefined"){try{sm2Debugger.handleEvent(l,i,j)}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(j,i){f._onready.push({method:j,scope:(i||null),fired:false})};this._processOnReady=function(){if(!f._didInit){return false}var l={success:(!f._disabled)};var k=[];for(var n=0,m=f._onready.length;n<m;n++){if(f._onready[n].fired!==true){k.push(f._onready[n])}}if(k.length){f._wD(d+": Firing "+k.length+" onready() item"+(k.length>1?"s":""));for(n=0,m=k.length;n<m;n++){if(k[n].scope){k[n].method.apply(k[n].scope,[l])}else{k[n].method(l)}k[n].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)};g=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 l=null;var n=null;var k=64;for(m in j.options){if(j.options[m]!==null){if(j.options[m] instanceof Function){l=j.options[m].toString();l=l.replace(/\s\s+/g," ");n=l.indexOf("{");o[o.length]=" "+m+": {"+l.substr(n+1,(Math.min(Math.max(l.indexOf("\n")-1,k),k))).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(l){var m="SMSound.play(): ";if(!l){l={}}j._iO=f._mergeObjects(l,j._iO);j._iO=f._mergeObjects(j._iO,j.options);j.instanceOptions=j._iO;if(j.playState==1){var k=j._iO.multiShot;if(!k){f._wD(m+'"'+j.sID+'" already playing (one-shot)',1);return false}else{f._wD(m+'"'+j.sID+'" already playing (multi-shot)',1)}}if(!j.loaded){if(j.readyState===0){f._wD(m+'Attempting to load "'+j.sID+'"',1);j._iO.autoPlay=true;j.load(j._iO)}else{if(j.readyState==2){f._wD(m+'Could not load "'+j.sID+'" - exiting',2);return false}else{f._wD(m+'"'+j.sID+'" is loading - attempting to play..',1)}}}else{f._wD(m+'"'+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(k,l,m){if(!j._iO.isMovieStar){j.bytesLoaded=k;j.bytesTotal=l;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=k;j.bytesTotal=l;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,k){f._wD('SMSound._onid3(): "'+this.sID+'" ID3 data received.');var o=[];for(var m=0,l=n.length;m<l;m++){o[n[m]]=k[m]}j.id3=f._mergeObjects(j.id3,o);if(j._iO.onid3){j._iO.onid3.apply(j)}};this._whileplaying=function(m,n,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 n!="undefined"&&n){j.peakData={left:n.leftPeak,right:n.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 k=o.leftEQ.split(",");j.eqData=k;j.eqData.left=k;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(k){var l="SMSound._onload(): ";k=(k==1?true:false);f._wD(l+'"'+j.sID+'"'+(k?" loaded.":" failed to load? - "+j.url),(k?1:2));if(!k){if(f.sandbox.noRemote===true){f._wD(l+f._str("noNet"),1)}if(f.sandbox.noLocal===true){f._wD(l+f._str("noLocal"),1)}}j.loaded=k;j.readyState=k?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()};
function PagePlayer(e){var k=this;var f=this;var d=soundManager;var c=navigator.userAgent.match(/msie/i);var b=navigator.userAgent.match(/opera/i);var a=navigator.userAgent.match(/firefox/i);this.config={flashVersion:8,usePeakData:false,useWaveformData:false,useEQData:false,fillGraph:false,allowRightClick:true,useThrottling:false,autoStart:false,playNext:true,updatePageTitle:false,emptyTime:"-:--",useFavIcon:true};d.debugMode=(window.location.href.toString().match(/debug=1/i)?true:false);this._mergeObjects=function(m,l){var q={};for(var n in m){q[n]=m[n]}var p=(typeof l=="undefined"?{}:l);for(var r in p){if(typeof q[r]=="undefined"){q[r]=p[r]}}return q};if(typeof e!="undefined"&&e){this.config=this._mergeObjects(e,this.config)}this.css={sDefault:"sm2_link",sLoading:"sm2_loading",sPlaying:"sm2_playing",sPaused:"sm2_paused"};this.cssBase=[];if(this.config.usePeakData){this.cssBase.push("use-peak")}if(this.config.useWaveformData||this.config.useEQData){this.cssBase.push("use-spectrum")}this.cssBase=this.cssBase.join(" ");d.flashVersion=this.config.flashVersion;if(d.flashVersion>=9){d.useMovieStar=this.config.useMovieStar;d.movieStarOptions.useVideo=this.config.useVideo;d.defaultOptions.usePeakData=this.config.usePeakData;d.defaultOptions.useWaveformData=this.config.useWaveformData;d.defaultOptions.useEQData=this.config.useEQData}this.links=[];this.sounds=[];this.soundsByObject=[];this.lastSound=null;this.soundCount=0;this.strings=[];this.dragActive=false;this.dragExec=new Date();this.dragTimer=null;this.pageTitle=document.title;this.lastWPExec=new Date();this.vuMeterData=[];this.oControls=null;this.addEventHandler=function(n,m,l){typeof(attachEvent)=="undefined"?n.addEventListener(m,l,false):n.attachEvent("on"+m,l)};this.removeEventHandler=function(n,m,l){typeof(attachEvent)=="undefined"?n.removeEventListener(m,l,false):n.detachEvent("on"+m,l)};this.hasClass=function(m,l){return(typeof(m.className)!="undefined"?new RegExp("(^|\\s)"+l+"(\\s|$)").test(m.className):false)};this.addClass=function(m,l){if(!m||!l){return false}if(k.hasClass(m,l)){return false}m.className=(m.className?m.className+" ":"")+l};this.removeClass=function(m,l){if(!m||!l){return false}if(!k.hasClass(m,l)){return false}m.className=m.className.replace(new RegExp("( "+l+")|("+l+")","g"),"")};this.getElementsByClassName=function(p,l,s){var r=(s||document);var q=[];var o,n;var m=[];if(typeof(l)!="undefined"&&typeof(l)!="string"){for(o=l.length;o--;){if(!m||!m[l[o]]){m[l[o]]=r.getElementsByTagName(l[o])}}}else{if(l){m=r.getElementsByTagName(l)}else{m=r.all||r.getElementsByTagName("*")}}if(typeof(l)!="string"){for(o=l.length;o--;){for(n=m[l[o]].length;n--;){if(k.hasClass(m[l[o]][n],p)){q[q.length]=m[l[o]][n]}}}}else{for(o=0;o<m.length;o++){if(k.hasClass(m[o],p)){q[q.length]=m[o]}}}return q};this.getOffX=function(l){var m=0;if(l.offsetParent){while(l.offsetParent){m+=l.offsetLeft;l=l.offsetParent}}else{if(l.x){m+=l.x}}return m};this.isChildOfClass=function(m,l){if(!m||!l){return false}while(m.parentNode&&!k.hasClass(m,l)){m=m.parentNode}return(k.hasClass(m,l))};this.getParentByNodeName=function(m,l){if(!m||!l){return false}l=l.toLowerCase();while(m.parentNode&&l!=m.parentNode.nodeName.toLowerCase()){m=m.parentNode}return(m.parentNode&&l==m.parentNode.nodeName.toLowerCase()?m.parentNode:null)};this.getTime=function(m,n){var l=Math.floor(m/1000);var o=Math.floor(l/60);var p=l-(o*60);return(n?(o+":"+(p<10?"0"+p:p)):{min:o,sec:p})};this.getSoundByObject=function(l){return(typeof k.soundsByObject[l.rel]!="undefined"?k.soundsByObject[l.rel]:null)};this.getSoundIndex=function(m){for(var l=k.links.length;l--;){if(k.links[l].rel==m.rel){return l}}return -1};this.setPageTitle=function(l){if(!k.config.updatePageTitle){return false}try{document.title=(l?l+" - ":"")+k.pageTitle}catch(m){k.setPageTitle=function(){return false}}};this.togglePause=function(l){if(l){thisLink=l.parentNode.parentNode.getElementsByTagName("a")[0];f.handleClick({target:thisLink})}else{if(k.lastSound&&k.lastSound.playState==1){k.lastSound.togglePause()}else{f.handleClick({target:f.links[0]})}}};this.removeBuyLinks=function(){elms=YD.getElementsByClassName("buyLink");for(i=0;i<elms.length;i++){elms[i].parentNode.removeChild(elms[i])}};this.addBuyLink=function(l){if(!l._data.oLI.parentNode){return}thisImg=l._data.oLI.parentNode.getElementsByTagName("img")[0];if(!thisImg){return}buyLink=document.createElement("a");buyLink.innerHTML="buy";buyLink.className="buyLink";YD.insertBefore(buyLink,thisImg.parentNode);href=document.location.href.match(/\w+\-[^\/]+/);buyLink.href="/mp3/"+href+"/"+title_id+"?ev=dg-bt"};this.events={next:function(l){if(!k.lastSound){return}curID=k.lastSound._data.nIndex;nextTrack=curID+1;f.handleClick({target:f.links[nextTrack]});now_playing=YD.get("now-playing-"+l);if(!now_playing){return}now_playing.innerHTML="Now playing: "+k.lastSound._data.originalTitle},prev:function(l){if(!k.lastSound){return}curID=k.lastSound._data.nIndex;f.handleClick({target:f.links[curID-1]});now_playing=YD.get("now-playing-"+l);if(!now_playing){return}now_playing.innerHTML="Now playing: "+k.lastSound._data.originalTitle},playAlbum:function(l){el=YD.get("playlist-"+l);img=YD.get("playpause-icon-"+l);elms=YD.getElementsByClassName("playpause-icon");for(i=0;i<elms.length;i++){elms[i].src=DISCOGS.static_server+"/images/control_play.png"}firstTrack=el.getElementsByTagName("a")[0];if(k.lastSound&&k.lastID==l){f.handleClick({target:k.links[k.lastSound._data.nIndex]})}else{f.handleClick({target:firstTrack})}now_playing=YD.get("now-playing-"+l);if(!now_playing){return}now_playing.innerHTML="Now playing: "+k.lastSound._data.originalTitle;if(k.lastSound&&k.lastSound.paused){img.src=DISCOGS.static_server+"/images/control_play.png"}else{img.src=DISCOGS.static_server+"/images/control_pause.png"}k.lastID=l},play:function(){f.removeClass(this._data.oLI,this._data.className);this._data.className=f.css.sPlaying;f.addClass(this._data.oLI,this._data.className);k.setPageTitle(this._data.originalTitle);if(YD.get("playpause-icon")){YD.get("playpause-icon").src=DISCOGS.static_server+"/images/control_pause.png"}k.removeBuyLinks();k.addBuyLink(this)},stop:function(){f.removeClass(this._data.oLI,this._data.className);this._data.className="";this._data.oPosition.style.width="0px";k.setPageTitle();k.resetPageIcon();k.removeBuyLinks()},pause:function(){if(f.dragActive){return false}f.removeClass(this._data.oLI,this._data.className);this._data.className=f.css.sPaused;f.addClass(this._data.oLI,this._data.className);k.setPageTitle();k.resetPageIcon();if(YD.get("playpause-icon")){YD.get("playpause-icon").src=DISCOGS.static_server+"/images/control_play.png"}k.removeBuyLinks()},resume:function(){if(f.dragActive){return false}f.removeClass(this._data.oLI,this._data.className);this._data.className=f.css.sPlaying;f.addClass(this._data.oLI,this._data.className);if(YD.get("playpause-icon")){YD.get("playpause-icon").src=DISCOGS.static_server+"/images/control_pause.png"}k.removeBuyLinks();k.addBuyLink(this)},finish:function(){f.removeClass(this._data.oLI,this._data.className);this._data.className="";this._data.oPosition.style.width="0px";if(k.config.playNext&&this._data.nIndex<f.links.length-1){f.handleClick({target:f.links[this._data.nIndex+1]})}else{k.setPageTitle();k.resetPageIcon()}k.removeBuyLinks()},whileloading:function(){this._data.oLoading.style.width=(((this.bytesLoaded/this.bytesTotal)*100)+"%");if(!this._data.didRefresh&&this._data.metadata){this._data.didRefresh=true;this._data.metadata.refresh()}},onload:function(){if(!this.loaded){var m=this._data.oLI.getElementsByTagName("a")[0];var n=m.innerHTML;var l=this;m.innerHTML=n+' <span style="font-size:0.5em"> | Load failed, d\'oh! '+(d.sandbox.noRemote?" Possible cause: Flash sandbox is denying remote URL access.":(d.sandbox.noLocal?"Flash denying local filesystem access":"404?"))+"</span>";setTimeout(function(){m.innerHTML=n},5000)}else{if(this._data.metadata){this._data.metadata.refresh()}}},metadata:function(){d._wD("video metadata: "+this.width+"x"+this.height);d.oMC.style.width=this.width+"px";d.oMC.style.height=this.height+"px"},whileplaying:function(){var l=null;if(f.dragActive||!f.config.useThrottling){k.updateTime.apply(this);if(d.flashVersion>=9){if(f.config.usePeakData&&this.instanceOptions.usePeakData){k.updatePeaks.apply(this)}if(f.config.useWaveformData&&this.instanceOptions.useWaveformData||f.config.useEQData&&this.instanceOptions.useEQData){k.updateGraph.apply(this)}}if(this._data.metadata){l=new Date();if(l&&l-k.lastWPExec>500){k.refreshMetadata(this);k.lastWPExec=l}}this._data.oPosition.style.width=(((this.position/k.getDurationEstimate(this))*100)+"%")}else{l=new Date();if(l-k.lastWPExec>500){k.updateTime.apply(this);if(d.flashVersion>=9){if(f.config.usePeakData&&this.instanceOptions.usePeakData){k.updatePeaks.apply(this)}if(f.config.useWaveformData&&this.instanceOptions.useWaveformData||f.config.useEQData&&this.instanceOptions.useEQData){k.updateGraph.apply(this)}}if(this._data.metadata){k.refreshMetadata(this)}this._data.oPosition.style.width=(((this.position/k.getDurationEstimate(this))*100)+"%");k.lastWPExec=l}}}};var h=document.getElementsByTagName("head")[0];this.setPageIcon=function(m){if(!k.config.useFavIcon||!k.config.usePeakData||!m){return false}var l=document.getElementById("sm2-favicon");if(l){h.removeChild(l);l=null}if(!l){l=document.createElement("link");l.id="sm2-favicon";l.rel="shortcut icon";l.type="image/png";l.href=m;document.getElementsByTagName("head")[0].appendChild(l)}};this.resetPageIcon=function(){if(!k.config.useFavIcon){return false}var l=document.getElementById("favicon");if(l){l.href="/favicon.ico"}};this.updatePeaks=function(){var m=this._data.oPeak;var l=m.getElementsByTagName("span");l[0].style.marginTop=(13-(Math.floor(15*this.peakData.left))+"px");l[1].style.marginTop=(13-(Math.floor(15*this.peakData.right))+"px");if(k.config.flashVersion>8&&k.config.useFavIcon&&k.config.usePeakData){k.setPageIcon(k.vuMeterData[parseInt(16*this.peakData.left)][parseInt(16*this.peakData.right)])}};this.updateGraph=function(){if((!f.config.useWaveformData&&!f.config.useEQData)||f.config.flashVersion<9){return false}var o=this._data.oGraph.getElementsByTagName("div");if(f.config.useWaveformData){var n=8;for(var l=255;l--;){o[255-l].style.marginTop=(1+n+Math.ceil(this.waveformData.left[l]*-n))+"px"}}else{var m=9;for(var l=255;l--;){o[255-l].style.marginTop=((m*2)-1+Math.ceil(this.eqData[l]*-m))+"px"}}};this.resetGraph=function(){if(!f.config.useEQData||f.config.flashVersion<9){return false}var o=this._data.oGraph.getElementsByTagName("div");var n=(!f.config.useEQData?"9px":"17px");var l=(!f.config.fillGraph?"1px":"32px");for(var m=255;m--;){o[255-m].style.marginTop=n;o[255-m].style.height=l}};this.refreshMetadata=function(q){var n=null;var m=q.position;var p=q._data.metadata.data;for(var o=0,l=p.length;o<l;o++){if(m>=p[o].startTimeMS&&m<=p[o].endTimeMS){n=o;break}}if(n!=p.currentItem){q._data.oLink.innerHTML=p.mainTitle+' <span class="metadata"><span class="sm2_divider"> | </span><span class="sm2_metadata">'+p[n].title+"</span></span>";k.setPageTitle(p[n].title+" | "+p.mainTitle);p.currentItem=n}};this.updateTime=function(){var l=k.strings.timing.replace("%s1",k.getTime(this.position,true));l=l.replace("%s2",k.getTime(k.getDurationEstimate(this),true));this._data.oTiming.innerHTML=l};this.getTheDamnTarget=function(l){return(l.target||l.srcElement||window.event.srcElement)};this.withinStatusBar=function(l){return(k.isChildOfClass(l,"controls"))};this.handleClick=function(p){if(p.button==2){if(!f.config.allowRightClick){f.stopEvent(p)}return(f.config.allowRightClick)}var s=k.getTheDamnTarget(p);if(k.dragActive){k.stopDrag()}if(k.withinStatusBar(s)){return false}if(s.nodeName.toLowerCase()!="a"){s=k.getParentByNodeName(s,"a")}if(!s){return true}var n=s.getAttribute("href");if(!s.href||(!d.canPlayURL(s.href)&&!k.hasClass(s,"playable"))||k.hasClass(s,"exclude")){if(c&&s.onclick){return false}return true}var r=s.href;var l=k.getSoundByObject(s);if(l){k.setPageTitle(l._data.originalTitle);if(l==k.lastSound){if(l.readyState!=2){if(l.playState!=1){l.play()}else{l.togglePause()}}else{d._writeDebug("Warning: sound failed to load (security restrictions, 404 or bad format)",2)}}else{if(k.lastSound){k.stopSound(k.lastSound)}l._data.oTimingBox.appendChild(document.getElementById("spectrum-container"));l.togglePause()}}else{l=d.createSound({id:"pagePlayerMP3Sound"+(k.soundCount++),url:r,onplay:k.events.play,onstop:k.events.stop,onpause:k.events.pause,onresume:k.events.resume,onfinish:k.events.finish,whileloading:k.events.whileloading,whileplaying:k.events.whileplaying,onmetadata:k.events.metadata,onload:k.events.onload});var m=k.oControls.cloneNode(true);s.parentNode.appendChild(m);s.parentNode.appendChild(document.getElementById("spectrum-container"));k.soundsByObject[s.rel]=l;l._data={oLink:s,oLI:s.parentNode,oControls:k.getElementsByClassName("controls","div",s.parentNode)[0],oStatus:k.getElementsByClassName("statusbar","div",s.parentNode)[0],oLoading:k.getElementsByClassName("loading","div",s.parentNode)[0],oPosition:k.getElementsByClassName("position","div",s.parentNode)[0],oTimingBox:k.getElementsByClassName("timing","div",s.parentNode)[0],oTiming:k.getElementsByClassName("timing","div",s.parentNode)[0].getElementsByTagName("div")[0],oPeak:k.getElementsByClassName("peak","div",s.parentNode)[0],oGraph:k.getElementsByClassName("spectrum-box","div",s.parentNode)[0],nIndex:k.getSoundIndex(s),className:k.css.sPlaying,originalTitle:s.innerHTML,metadata:null};l._data.oTimingBox.appendChild(document.getElementById("spectrum-container"));if(l._data.oLI.getElementsByTagName("ul").length){l._data.metadata=new g(l)}var q=k.strings.timing.replace("%s1",k.config.emptyTime);q=q.replace("%s2",k.config.emptyTime);l._data.oTiming.innerHTML=q;k.sounds.push(l);if(k.lastSound){k.stopSound(k.lastSound)}k.resetGraph.apply(l);l.play()}k.lastSound=l;return k.stopEvent(p)};this.handleMouseDown=function(l){if(l.button==2){if(!f.config.allowRightClick){f.stopEvent(l)}return(f.config.allowRightClick)}var m=k.getTheDamnTarget(l);if(!k.withinStatusBar(m)){return true}k.dragActive=true;k.lastSound.pause();k.setPosition(l);k.addEventHandler(document,"mousemove",k.handleMouseMove);k.addClass(k.lastSound._data.oControls,"dragging");k.stopEvent(l);return false};this.handleMouseMove=function(l){if(k.dragActive){if(k.config.useThrottling){var m=new Date();if(m-k.dragExec>20){k.setPosition(l)}else{window.clearTimeout(k.dragTimer);k.dragTimer=window.setTimeout(function(){k.setPosition(l)},20)}k.dragExec=m}else{k.setPosition(l)}}else{k.stopDrag()}return false};this.stopDrag=function(l){if(k.dragActive){k.removeClass(k.lastSound._data.oControls,"dragging");k.removeEventHandler(document,"mousemove",k.handleMouseMove);if(!f.hasClass(k.lastSound._data.oLI,k.css.sPaused)){k.lastSound.resume()}k.dragActive=false;k.stopEvent(l);return false}};this.handleStatusClick=function(l){k.setPosition(l);if(!f.hasClass(k.lastSound._data.oLI,k.css.sPaused)){k.resume()}return k.stopEvent(l)};this.stopEvent=function(l){if(typeof l!="undefined"&&typeof l.preventDefault!="undefined"){l.preventDefault()}else{if(typeof event!="undefined"&&typeof event.returnValue!="undefined"){event.returnValue=false}}return false};this.setPosition=function(q){var n=k.getTheDamnTarget(q);var p=n;while(!k.hasClass(p,"controls")&&p.parentNode){p=p.parentNode}var m=k.lastSound;var l=parseInt(q.clientX);var o=Math.floor((l-k.getOffX(p)-4)/(p.offsetWidth)*k.getDurationEstimate(m));if(!isNaN(o)){o=Math.min(o,m.duration)}if(!isNaN(o)){m.setPosition(o)}};this.stopSound=function(l){d._writeDebug("stopping sound: "+l.sID);d.stop(l.sID);d.unload(l.sID)};this.getDurationEstimate=function(l){if(l.instanceOptions.isMovieStar){return(l.duration)}else{return(!l._data.metadata||!l._data.metadata.data.givenDuration?l.durationEstimate:l._data.metadata.data.givenDuration)}};this.createVUData=function(){var o=0;var n=0;var m=j.getContext("2d");var q=m.createLinearGradient(0,16,0,0);q.addColorStop(0,"rgb(0,192,0)");q.addColorStop(0.3,"rgb(0,255,0)");q.addColorStop(0.625,"rgb(255,255,0)");q.addColorStop(0.85,"rgb(255,0,0)");var l=m.createLinearGradient(0,16,0,0);var p="rgba(0,0,0,0.2)";l.addColorStop(0,p);l.addColorStop(1,"rgba(0,0,0,0.5)");for(o=0;o<16;o++){k.vuMeterData[o]=[]}for(var o=0;o<16;o++){for(n=0;n<16;n++){j.setAttribute("width",16);j.setAttribute("height",16);m.fillStyle=l;m.fillRect(0,0,7,15);m.fillRect(8,0,7,15);m.fillStyle=q;m.fillRect(0,15-o,7,16-(16-o));m.fillRect(8,15-n,7,16-(16-n));m.clearRect(0,3,16,1);m.clearRect(0,7,16,1);m.clearRect(0,11,16,1);k.vuMeterData[o][n]=j.toDataURL("image/png")}}};var j=null;this.testCanvas=function(){var o=document.createElement("canvas");var l=null;if(!o||typeof o.getContext=="undefined"){return null}l=o.getContext("2d");if(!l||typeof o.toDataURL!="function"){return null}try{var m=o.toDataURL("image/png")}catch(n){return null}return o};if(this.config.useFavIcon){j=k.testCanvas();if(j&&(a||b)){k.createVUData()}else{this.config.useFavIcon=false}}this.init=function(){d._writeDebug("pagePlayer.init()");var o=document.getElementsByTagName("a");var n=0;for(var m=0;m<o.length;m++){if((d.canPlayURL(o[m].href)||k.hasClass(o[m],"playable"))&&!k.hasClass(o[m],"exclude")){o[m].rel="pagePlayerMP3Sound"+m;k.links[k.links.length]=o[m];k.addClass(o[m],k.css.sDefault);n++}}if(n>0){var l=document.getElementById("sm2_timing");k.strings.timing=l.innerHTML;l.innerHTML="";l.id="";k.addEventHandler(document,"click",k.handleClick);k.addEventHandler(document,"mousedown",k.handleMouseDown);k.addEventHandler(document,"mouseup",k.stopDrag);k.addEventHandler(window,"unload",function(){})}d._writeDebug("pagePlayer.init(): Found "+n+" relevant items.");if(k.config.autoStart){f.handleClick({target:f.links[0]})}};var g=function(t){var v=this;var s=t._data.oLI;var l=s.getElementsByTagName("ul")[0];var p=l.getElementsByTagName("li");var q=document.createElement("div");q.innerHTML="<span>&nbsp;</span>";q.className="annotation";var r=document.createElement("div");r.innerHTML="<span>&nbsp;</span>";r.className="annotation alt";var n=document.createElement("div");n.className="note";this.totalTime=0;this.strToTime=function(o){var w=o.split(":");var y=0;for(var x=w.length;x--;){y+=parseInt(w[x])*Math.pow(60,w.length-1-x,10)}return y};this.data=[];this.data.givenDuration=null;this.data.currentItem=null;this.data.mainTitle=t._data.oLink.innerHTML;for(var m=0;m<p.length;m++){this.data[m]={o:null,title:p[m].getElementsByTagName("p")[0].innerHTML,startTime:p[m].getElementsByTagName("span")[0].innerHTML,startSeconds:v.strToTime(p[m].getElementsByTagName("span")[0].innerHTML.replace(/[()]/g,"")),duration:0,durationMS:null,startTimeMS:null,endTimeMS:null,oNote:null}}var u=f.getElementsByClassName("duration","div",s);this.data.givenDuration=(u.length?v.strToTime(u[0].innerHTML)*1000:0);for(m=0;m<this.data.length;m++){this.data[m].duration=parseInt(this.data[m+1]?this.data[m+1].startSeconds:(v.data.givenDuration?v.data.givenDuration:t.durationEstimate)/1000)-this.data[m].startSeconds;this.data[m].startTimeMS=this.data[m].startSeconds*1000;this.data[m].durationMS=this.data[m].duration*1000;this.data[m].endTimeMS=this.data[m].startTimeMS+this.data[m].durationMS;this.totalTime+=this.data[m].duration}this.createElements=function(){var o=document.createDocumentFragment();var z=null;var x=null;var y=null;for(var w=0;w<v.data.length;w++){z=(w%2==0?q:r).cloneNode(true);x=z.getElementsByTagName("span")[0];z.rel=w;v.data[w].o=z;y=n.cloneNode(true);if(w%2==0){y.className="note alt"}y.innerHTML=this.data[w].title;z.onmouseover=v.mouseover;z.onmouseout=v.mouseout;this.data[w].oNote=y;t._data.oControls.appendChild(y);o.appendChild(z)}v.refresh();t._data.oStatus.appendChild(o)};this.refresh=function(){var y=0;var w=null;var x=(v.data.givenDuration?v.data.givenDuration:t.durationEstimate);for(var o=0;o<v.data.length;o++){if(x){w=(((v.data[o].duration*1000)/x)*100);v.data[o].o.style.left=(y?y+"%":"-2px");v.data[o].oNote.style.left=(y?y+"%":"0px");y+=w}}};this.mouseover=function(o){v.data[this.rel].oNote.style.visibility="hidden";v.data[this.rel].oNote.style.display="inline-block";v.data[this.rel].oNote.style.marginLeft=-parseInt(v.data[this.rel].oNote.offsetWidth/2)+"px";v.data[this.rel].oNote.style.visibility="visible"};this.mouseout=function(){v.data[this.rel].oNote.style.display="none"};this.createElements();this.refresh()};this.initDOM=function(){var p=k.getElementsByClassName("spectrum-box","div",document.documentElement)[0];if(d.flashVersion>=9){k.addClass(k.getElementsByClassName("playlist","ul",document.documentElement)[0],k.cssBase);var o=p.getElementsByTagName("div")[0];var n=document.createDocumentFragment();var m=null;for(var l=256;l--;){m=o.cloneNode(false);m.style.left=(l)+"px";n.appendChild(m)}p.removeChild(o);p.appendChild(n)}this.oControls=document.getElementById("control-template").cloneNode(true);this.oControls.id="";this.init()}}var pagePlayer=new PagePlayer(typeof PP_CONFIG!="undefined"?PP_CONFIG:null);soundManager.onready(function(){if(soundManager.supported()){pagePlayer.initDOM()}});