function InlinePlayer(){var c=this,e=this,g=soundManager;this.excludeClass="inline-exclude";this.links=[];this.sounds=[];this.soundsByURL=[];this.indexByURL=[];this.lastSound=null;this.soundCount=0;var h=navigator.userAgent.match(/msie/i);this.config={playNext:false,autoPlay:false};this.css={sDefault:"sm2_link",sLoading:"sm2_loading",sPlaying:"sm2_playing",sPaused:"sm2_paused"};this.addEventHandler=function(a,b,d){typeof attachEvent=="undefined"?a.addEventListener(b,d,false):a.attachEvent("on"+b,
d)};this.removeEventHandler=function(a,b,d){typeof attachEvent=="undefined"?a.removeEventListener(b,d,false):a.detachEvent("on"+b,d)};this.classContains=function(a,b){return typeof a.className!="undefined"?a.className.match(new RegExp("(\\s|^)"+b+"(\\s|$)")):false};this.addClass=function(a,b){if(!a||!b||c.classContains(a,b))return false;a.className=(a.className?a.className+" ":"")+b};this.removeClass=function(a,b){if(!a||!b||!c.classContains(a,b))return false;a.className=a.className.replace(new RegExp("( "+
b+")|("+b+")","g"),"")};this.getSoundByURL=function(a){return typeof c.soundsByURL[a]!="undefined"?c.soundsByURL[a]:null};this.isChildOfNode=function(a,b){if(!a||!a.parentNode)return false;b=b.toLowerCase();do a=a.parentNode;while(a&&a.parentNode&&a.nodeName.toLowerCase()!=b);return a.nodeName.toLowerCase()==b?a:null};this.events={play:function(){e.removeClass(this._data.oLink,this._data.className);this._data.className=e.css.sPlaying;e.addClass(this._data.oLink,this._data.className)},stop:function(){e.removeClass(this._data.oLink,
this._data.className);this._data.className=""},pause:function(){e.removeClass(this._data.oLink,this._data.className);this._data.className=e.css.sPaused;e.addClass(this._data.oLink,this._data.className)},resume:function(){e.removeClass(this._data.oLink,this._data.className);this._data.className=e.css.sPlaying;e.addClass(this._data.oLink,this._data.className)},finish:function(){e.removeClass(this._data.oLink,this._data.className);this._data.className="";if(e.config.playNext){var a=e.indexByURL[this._data.oLink.href]+
1;a<e.links.length&&e.handleClick({target:e.links[a]})}}};this.stopEvent=function(a){if(typeof a!="undefined"&&typeof a.preventDefault!="undefined")a.preventDefault();else if(typeof event!="undefined"&&typeof event.returnValue!="undefined")event.returnValue=false;return false};this.getTheDamnLink=h?function(a){return a&&a.target?a.target:window.event.srcElement}:function(a){return a.target};this.handleClick=function(a){if(typeof a.button!="undefined"&&a.button>1)return true;var b=c.getTheDamnLink(a);
if(b.nodeName.toLowerCase()!="a"){b=c.isChildOfNode(b,"a");if(!b)return true}b.getAttribute("href");if(!b.href||!b.href.match(/\.mp3(\\?.*)$/i)||c.classContains(b,c.excludeClass)){if(h&&b.onclick)return false;return true}g._writeDebug("handleClick()");var d=b.href,f=c.getSoundByURL(d);if(f)if(f==c.lastSound)f.togglePause();else{f.togglePause();g._writeDebug("sound different than last sound: "+c.lastSound.sID);c.lastSound&&c.stopSound(c.lastSound)}else{f=g.createSound({id:"inlineMP3Sound"+c.soundCount++,
url:d,onplay:c.events.play,onstop:c.events.stop,onpause:c.events.pause,onresume:c.events.resume,onfinish:c.events.finish});f._data={oLink:b,className:c.css.sPlaying};c.soundsByURL[d]=f;c.sounds.push(f);c.lastSound&&c.stopSound(c.lastSound);f.play()}c.lastSound=f;if(typeof a!="undefined"&&typeof a.preventDefault!="undefined")a.preventDefault();else event.returnValue=false;return false};this.stopSound=function(a){soundManager.stop(a.sID);soundManager.unload(a.sID)};this.init=function(){g._writeDebug("inlinePlayer.init()");
for(var a=document.getElementsByTagName("a"),b=0,d=0;d<a.length;d++)if(a[d].href.match(/\.mp3/i)&&!c.classContains(a[d],c.excludeClass)){c.addClass(a[d],c.css.sDefault);c.links[b]=a[d];c.indexByURL[a[d].href]=b;b++}if(b>0){c.addEventHandler(document,"click",c.handleClick);c.config.autoPlay&&c.handleClick({target:c.links[0],preventDefault:function(){}})}g._writeDebug("inlinePlayer.init(): Found "+b+" relevant items.")};this.init()}var inlinePlayer=null;soundManager.debugMode=false;
soundManager.url="http://superpositionkitty.com/wp-content/themes/blackandwhite/swf/";soundManager.onload=function(){inlinePlayer=new InlinePlayer};