var PT = {
 playimg: null,
 player: null,
 go: function() {
 var all = document.getElementById("player").getElementsByTagName('a');
 for (var i = 0, a; a = all[i]; i++) {
 if (a.href.match(/\mp3$/i)) {
 a.innerHTML = "<img src='images/play.png' border='0' alt='mp3' title='play' />";
 a.style.border = '0';
 a.style.marginLeft = '5px';
 a.style.outline = '0';
 a.getElementsByTagName('img')[0].style.verticalAlign = 'middle';
 a.onclick = PT.makeToggle(a);
 }
 }
 },
 toggle: function(a) {
 if (a == PT.playLink)
 PT.destroy();
 else {
 if (PT.playLink)
 PT.destroy();
 var i = a.getElementsByTagName('img')[0];
 i.src = 'images/stop.png';
 i.title = 'stop';
 a.style.marginLeft = '5px';
 PT.playLink = a;
 PT.player = document.createElement('span');
 PT.player.innerHTML = '<embed src="http://webjay.org/flash/dark_player" width="1" height="1" id="player" wmode="transparent" flashVars="playlist_url=' + a.href + '&autoplay=1&skin_color_1=135,27,0,0&skin_color_2=-180,86,0,0" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"/>';
 a.parentNode.insertBefore(PT.player, a.nextSibling);
 }
 },
 destroy: function() {
 var i = PT.playLink.getElementsByTagName('img')[0];
 i.src = 'images/play.png';
 i.title = 'play';
 PT.playLink.style.marginRight = '1px';
 PT.playLink = null;
 PT.player.removeChild(PT.player.firstChild); /* for IE */
 PT.player.parentNode.removeChild(PT.player);
 PT.player = null;
 },
 makeToggle: function(a) {
 return function() {
 PT.toggle(a);
 return false;
 }
 }
};

(function () {
 var oo = window.onload;
 window.onload = function () {
 oo && oo();
 PT.go();
 };
})();