<!-- онлайн/оффлайн --> <script type="text/javascript"> var we=document.getElementsByTagName("ul") var x=0 for (x=0; x<=(we.length-1); x++) {if (we[x].innerHTML.indexOf("pa-online")!=-1) {we[x].innerHTML=we[x].innerHTML.substring(0, (we[x].innerHTML.indexOf("pa-online")-11))+"<img src='http://funkyimg.com/i/VH6G.png' />"} else if ((we[x].innerHTML.indexOf("pa-online")==-1)&&(we[x].innerHTML.indexOf("pa-author")!=-1)) {we[x].innerHTML=we[x].innerHTML+"<img src='http://funkyimg.com/i/VH6F.png' />"} } </script>
<!--Выделить код --> <script type="text/javascript"> function select_text(elem) { if(window.getSelection) { var s=window.getSelection(); if(s.setBaseAndExtent){ s.setBaseAndExtent(elem,0,elem,elem.innerText.length-1); } else { var r=document.createRange(); r.selectNodeContents(elem); s.removeAllRanges(); s.addRange(r); } } else if(document.getSelection){ var s=document.getSelection(); var r=document.createRange(); r.selectNodeContents(elem); s.removeAllRanges(); s.addRange(r); } else if(document.selection){ var r=document.body.createTextRange(); r.moveToElementText(elem); r.select(); } } </script> <script type="text/javascript"> var div = document.getElementById('pun-main').getElementsByTagName('div'); for(x in div){ if(div[x].className=='code-box'){ div[x].getElementsByTagName('strong')[0].innerHTML = '<a href="#" onclick="select_text(this.parentNode.parentNode.childNodes[1].getElementsByTagName(\'pre\')[0]); return false;">Выделение кода</a>'; } } </script>