function showHide(element){if(document.getElementById(element).style.display==""){document.getElementById(element).style.display="none";document.getElementById(element+"-hidden").style.display="";}else{document.getElementById(element).style.display="";document.getElementById(element+"-hidden").style.display="none";}}
function ShowInfo(){document.getElementById("comment-author").style.display="";document.getElementById("showinfo").style.display="none";document.getElementById("hideinfo").style.display="";}
function HideInfo(){document.getElementById("comment-author").style.display="none";document.getElementById("showinfo").style.display="";document.getElementById("hideinfo").style.display="none";}
formattingOpen=false;function toggleFormatting(){if(formattingOpen==false){document.getElementById("tags-allowed").style.display="";formattingOpen=true;}else{document.getElementById("tags-allowed").style.display="none";formattingOpen=false;}}
function hideOnLoad(element){document.getElementById(element).style.display="none";}
function addQuote(comment,quote){if(document.selection){comment.focus();sel=document.selection.createRange();sel.text=quote;comment.focus();}
else if(comment.selectionStart||comment.selectionStart=='0'){var startPos=comment.selectionStart;var endPos=comment.selectionEnd;var cursorPos=endPos;var scrollTop=comment.scrollTop;if(startPos!=endPos){comment.value=comment.value.substring(0,startPos)
+ quote
+ comment.value.substring(endPos,comment.value.length);cursorPos=startPos+ quote.length}
else{comment.value=comment.value.substring(0,startPos)
+ quote
+ comment.value.substring(endPos,comment.value.length);cursorPos=startPos+ quote.length;}
comment.focus();comment.selectionStart=cursorPos;comment.selectionEnd=cursorPos;comment.scrollTop=scrollTop;}
else{comment.value+=quote;}
try{ReloadTextDiv();}
catch(e){}}
function quote(postid,author,commentarea,commentID,textile){var posttext='';if(window.getSelection){posttext=window.getSelection();}
else if(document.getSelection){posttext=document.getSelection();}
else if(document.selection){posttext=document.selection.createRange().text;}
else{return true;}
if(posttext==''){var posttext=document.getElementById(commentID).innerHTML;var posttext=posttext.replace(/	/g,"");var posttext=posttext.replace(/<p>/g,"\n");var posttext=posttext.replace(/<\/\s*p>/g,"");var posttext=posttext.replace(/<br>/g,"")
var posttext=posttext.replace(/<blockquote>[^>]*<\/\s*blockquote>/g,"");var posttext=posttext.replace(/<blockquote>[^>]*<\/\s*blockquote>/g,"");var quote='<blockquote>\n'+posttext+'</blockquote>\n\n';var comment=document.getElementById(commentarea);addQuote(comment,quote);}else{if(textile){var quote='bq. '+posttext+'\n\n';}else{var quote='<blockquote>\n\n'+posttext+'\n\n</blockquote>\n';}
var comment=document.getElementById(commentarea);addQuote(comment,quote);}
return false;}
