
    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';
        }
    }
    
/****** LIST PAGE FUNCTIONS ********/
    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) {
        jQuery('#commentBody').val("["+name+"]\n" + sanitizeForReply(jQuery('#commentBody'+id).html()) + "\n[/"+name+"]\n");
    }
    function sanitizeForReply(str) {
        str = jQuery.trim(str);
        str = str.replace(/\n/img, '');
        str = str.replace(/\[[^\/]*?\].*?\[\/.*?\]/img, '');
        str = str.replace(/<blockquote.*?>.*?<\/blockquote>/img, '');
        str = str.replace(/<link.*?>/img, '');
        str = str.replace(/<br[ ]*[\/]?>/img, '\n');
        return str;
    }