﻿function postComment() {
    var sComment = trim(document.getElementById("txtComment").value);
    if (sComment == "") {
        alert("You must provide a comment in order to post.");
    }
    else if (sComment.length > 3600) {
        alert("You cannot post a comment that is longer than 3600 characters in length.  Please shorten your comment or save it as more than one comment.");
    }
    else {
        var sParams = "comment=" + sComment + "&pid=" + document.getElementById("pid").value + "&ct=" + document.getElementById("ct").value;
        rpc.startRequest(commentCreated, "Unable to post your comment, please try again.", "/rpc/SaveComment.ashx", sParams);
    }
}
function commentCreated(response) {
    window.location.reload();
}

