function replyToComment(commentId){ var i, comment = document.getElementById('comment-'+commentId).cloneNode(true), url ="http://annevankesteren.nl", // without slash link, bq, textarea; link = comment.lastChild.firstChild.href.substring(comment.lastChild.firstChild.href.match(/#/).index,url.length); bq = comment.getElementsByTagName('blockquote'); for(i = 0; i < bq.length; i++){ if(bq[i].lastChild.className === "source") bq[i].removeChild(bq[i].lastChild); } bq = null; comment.removeChild(comment.lastChild); comment = comment.innerHTML; comment = comment.replace(/<[^>]+>/g, function(m) { return m.toLowerCase() }); comment = "
"+comment+"
\n"; textarea = document.getElementsByTagName('textarea')[0]; textarea.value += comment; textarea.focus(); } function addReplyLinks(){ var comments, theLink; comments = document.getElementById('comments'); if(!comments) return false; comments = comments.nextSibling; if(comments.nodeType != 1) comments = comments.nextSibling; comments = comments.getElementsByTagName('p'); for(i=0;i