function collapseThread(A){var C=document.getElementById(A);if(!C){alert("ERROR:\nThe document structure is different\nfrom what Threaded Comments expects.\nYou are missing the element '"+A+"'");return }var B=findBody(C);if(C.className.indexOf("collapsed")>-1){C.className=C.className.replace(" collapsed","")}else{C.className+=" collapsed"}}function expandThread(A){var C=document.getElementById(A);if(!C){alert("ERROR:\nThe document structure is different\nfrom what Threaded Comments expects.\nYou are missing the element '"+A+"'");return }var B=findBody(C);if(C.className.indexOf("collapsed")>-1){C.className=C.className.replace(" collapsed","")}}function findBody(D){var C=D.getElementsByTagName("div");var A;for(var B=0;B<C.length;++B){if(C.item(B).className.indexOf("body")>-1){return C.item(B)}}return false}function onAddComment(){var A=document.getElementById("commentform");A.submit()}function moveAddCommentBelow(K,C,I){expandThread(K);var B=document.getElementById("addcomment");if(!B){alert("ERROR:\nThreaded Comments can't find the 'addcomment' div.\nThis is probably because you have changed\nthe comments.php file.\nMake sure there is a tag around the form\nthat has the id 'addcomment'");return }var G=document.getElementById(K);if(I){for(var D=0;D<G.childNodes.length;++D){var H=G.childNodes.item(D);if(typeof (H.className)=="string"&&H.className.indexOf("collapsed")<0){H.className+=" collapsed"}}}B.parentNode.removeChild(B);G.appendChild(B);if(G.className.indexOf("alt")>-1){B.className=B.className.replace(" alt","")}else{B.className+=" alt"}var E=document.getElementById("comment_reply_ID");if(E==null){alert("Brians Threaded Comments Error:\nThere is no hidden form field called\n'comment_reply_ID'. This is probably because you\nchanged the comments.php file and forgot\nto include the field. Please take a look\nat the original comments.php and copy the\nform field over.")}E.value=C;var A=document.getElementById("reroot");if(A==null){alert("Brians Threaded Comments Error:\nThere is no anchor tag called 'reroot' where\nthe comment form starts.\nPlease compare your comments.php to the original\ncomments.php and copy the reroot anchor tag over.")}A.style.display="block";var J=G.getElementsByTagName("A");var F=J.item(0).id;document.getElementById("comment").focus()}function checkDocumentIntegrity(){str="";str+=checkElement("reroot","div tag");str+=checkElement("addcomment","div tag");str+=checkElement("comment_reply_ID","hidden form field");str+=checkElement("content","div tag");str+=checkElement("comment","textfield");str+=checkElement("addcommentanchor","anchor tag");if(str!=""){str="Brian's Threaded Comments are missing some of the elements that are required for it to function correctly.\nThis is probably the because you have changed the original comments.php that was included with the plugin.\n\nThese are the errors:\n"+str;str+="\nYou should compare your comments.php with the original comments.php and make sure the required elements have not been removed.";alert(str)}}function checkElement(A,C){var B=document.getElementById(A);if(!B){if(C==null){C="element"}return"- The "+C+" with the ID '"+A+"' is missing\n"}else{return""}}function reRoot(){var A=document.getElementById("addcomment");var C=document.getElementById("reroot");C.style.display="none";var B=document.getElementById("content");A.parentNode.removeChild(A);B.appendChild(A);A.className=A.className.replace(" alt","");document.location.href="#addcommentanchor";document.getElementById("comment").focus();document.getElementById("comment_reply_ID").value="0"}function changeCommentSize(C){var B=document.getElementById("comment");var A=parseInt(B.style.height);if(!A&&B.offsetHeight){A=B.offsetHeight}A+=C;if(A<20){A=20}B.style.height=A+"px"};