Код:
<!--Универсальный mp3 плеер--> <style type="text/css"> #button-mp3 {background-image:url('http://img413.imageshack.us/img413/5702/sound3.gif'); padding:0; line-height:0; background-position:center; background-repeat:no-repeat} </style> <script type="text/javascript"> function addSpoiler_mp3(str,from,internal){ var pos=0,pos2=0,newpos=0 if((pos=str.indexOf("[mymp3]",from))==-1) return str; if((pos2=str.indexOf("[/mymp3]"),pos+8)==-1) return str; newpos=str.indexOf("[mymp3]",pos+8) if(newpos<pos2 && newpos!=-1) str=addSpoiler_mp3(str,pos+8,true) if((pos2=str.indexOf("[/mymp3]",pos+8))==-1) return str; txt = str.substring(pos+7,pos2); if((sepPos=txt.indexOf("|",0))==-1) return str; str=str.substring(0,pos)+makeSpoiler_mp3(txt.substring(0,sepPos),txt.substring(sepPos+1,txt.length))+str.substring(pos2+8,str.length) if( str.indexOf("[mymp3]")!=-1 && internal==false) str=addSpoiler_mp3(str,0,false) return str } function makeSpoiler_mp3(txt1,txt2){ txt='<br /><embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" src="http://www.enricolai.com/FMP3/FMP3.swf" quality="high" allowscriptaccess="sameDomain" flashvars="vol=80&action=stop&title='+txt2+'&color=000000&textcolor=ffffff&loop=no&lma=no;height=60&width=260&mp3='+txt1+'" height="60" width="260">'; return txt; } var popup; function popmp3() { popup = window.open("http://klopp.net.ru/files/","popDialog","height=380,width=440") if (!document.all) {popup.moveTo(100,100);} return false } function tag_urlm() {var FoundErrors = ''; var enterURL = prompt("Введите ссылку на mp3 файл", "http://"); var enterTITLE = prompt("Введите автора и название песни", "Песня"); if (!enterURL) {FoundErrors += " " + error_no_url;} if (FoundErrors) {alert("Ошибка!" + FoundErrors); return;} insert("[mymp3]" + enterURL + "|" + enterTITLE + "[/mymp3]");} if((document.URL.indexOf("viewtopic.php")!=-1) || (document.URL.indexOf("post.php")!=-1)){ elm=document.getElementById("pun-main").getElementsByTagName("div") for(x in elm) if(elm[x].className=="post-content"){ var post=elm[x] post.innerHTML=addSpoiler_mp3(post.innerHTML,0,false)}} if(form=document.getElementById("form-buttons")) form.getElementsByTagName("tr")[0].insertCell(17).innerHTML="<img src='/i/blank.gif' title='Загрузить mp3' id='button-mp3' onclick=\"popmp3(); tag_urlm()\">" </script>