function showError(id){var obj=document.getElementById(id);if(obj==null)return false;obj.style.backgroundColor='rgb(252, 209, 209)';obj.style.border='1px solid rgb(185, 58, 58)';return false;} function showHideFlagged(id){var which=document.getElementById("showHide-"+id);if(which==null)return false;if(which.innerHTML=="Show"){which.innerHTML="Hide";which.title="Hide";document.getElementById("comment-"+id).style.display="block";}else{which.innerHTML="Show";which.title="Show";document.getElementById("comment-"+id).style.display="none";} return false;} function showHideFlagging(id,option){var which=document.getElementById("flagging-"+id);if(which==null)return false;if(option=="show"){which.style.visibility="visible";} if(option=="hide"){which.style.visibility="hidden";} return false;} function flagComment(id){if(confirm('Are you sure you want to report this comment as spam?')){jQuery('#flagCommentIdInput').val(id);jQuery('#flagCommentForm').submit();} return false;} function resetFlagCount(id){if(confirm('Are you sure you want to reset the flags for this comment?')){jQuery('#resetFlagCountIdInput').val(id);jQuery('#resetFlagCountForm').submit();} return false;} function clearText(inp,txt){if(inp.value==txt){inp.value='';inp.style.color='#000';}} function resetText(inp,txt){if(inp.value==''){inp.value=txt;inp.style.color='#999';}} function deleteComment(id){if(confirm('Are you sure you want to delete this comment?')){jQuery('#deleteCommentIdInput').val(id);jQuery('#deleteCommentForm').submit();} return false;} function toggleEditComment(id){jQuery('#commentBody'+id).toggle();jQuery('#commentEdit'+id).toggle();return false;} function editComment(id){jQuery('#commentBody'+id).hide();jQuery('#commentEdit'+id).show();return false;} function cancelEditComment(id){jQuery('#commentBody'+id).show();jQuery('#commentEdit'+id).hide();jQuery('#editCommentBody'+id).val(jQuery.trim($('#commentBody'+id).html()));return false;} function replyToComment(id,name){var sourceContainer=jQuery('#commentBody'+id);var sanitized=jQuery('.fw_sanitized',sourceContainer);if(sanitized.length>0)sourceContainer=sanitized;jQuery('#commentBody').val("["+name+"]\n"+sanitizeForReply(sourceContainer.html())+"\n[/"+name+"]\n");} function replyToCommentRichText(id,name){var sourceContainer=jQuery('#commentBody'+id);var sanitized=jQuery('.fw_sanitized',sourceContainer);if(sanitized.length>0)sourceContainer=sanitized;commentBody.setContent("["+name+"]\n"+sanitizeForReply(sourceContainer.html())+"\n[/"+name+"]\n");} function sanitizeForReply(str){str=jQuery.trim(str);str=str.replace(/\n/img,'');str=str.replace(/\[[^\/]*?\].*?\[\/.*?\]/img,'');str=str.replace(/.*?<\/blockquote>/img,'');str=str.replace(//img,'');str=str.replace(//img,'\n');str=str.replace(//img,'$1');str=str.replace(/(http[s]?:.*)\n([^<]*)<\/a[ ]*>/img,'$1$2');str=str.replace(//img,'');str=str.replace(/<\/a[ ]*?>/img,'');return str;}