$(document).ready(function(){ 
    $("#form_comment").hide();
    $("#comment_complete").hide();
});

$(document).ajaxStart(function(){
    $("#comment_complete").hide();
});



function submitComment(object_id, object_type, subject, body)
{
    $.post("/"+object_type+"/comment",
    { subject: subject, body: body, object_id: object_id },
    function(data) {
     if (data == "LOGINREQUIRED") alert("Login is required.");
     else if (data == "INVALIDINPUT") alert("Please write your comment.");
     else {
              $("#comment_complete").show();
              $("#form_comment").hide();
          }
     $("#rating_loading").hide();
    }
    );
}
