/* Author: mg12 Update: 2008/02/23 Description: Quote comment. */ function quote(authorId,commentId,commentBox,admin){var author=document.getElementById(authorId).innerHTML;var comment=document.getElementById(commentId).innerHTML;var divClass=admin?'adminquote':'regularquote';var insertStr='
';insertStr+='\n'+author.replace(/\t|\n/g,"")+':';insertStr+=comment.replace(/\t/g,"");insertStr+='\n';quoteToInsert(insertStr,commentBox);}function quoteToInsert(insertStr,commentBox){if(document.getElementById(commentBox)&&document.getElementById(commentBox).type=='textarea'){myField=document.getElementById(commentBox);}else{return false;}if(document.selection){myField.focus();sel=document.selection.createRange();sel.text=insertStr;myField.focus();}else if(myField.selectionStart||myField.selectionStart=='0'){var startPos=myField.selectionStart;var endPos=myField.selectionEnd;var cursorPos=startPos;myField.value=myField.value.substring(0,startPos)+insertStr+myField.value.substring(endPos,myField.value.length);cursorPos+=insertStr.length;myField.focus();myField.selectionStart=cursorPos;myField.selectionEnd=cursorPos;}else{myField.value+=insertStr;myField.focus();}}