function loadReplyForm(video_id, comment_id) {
    var params = "video_id="+video_id+"&comment_id="+comment_id;
    new Ajax.Updater("reply_"+comment_id, '/comments/reply', {parameters: params, evalScripts: true});
}
function unLoadReplyForm(video_id, comment_id) {
    document.getElementById("reply_"+comment_id).innerHTML = '<button onclick="loadReplyForm('+video_id+', '+comment_id+');">Reply</button><button>Mark as spam</button>'
    if (document.getElementById('reply_error') != null && document.getElementById('reply_error') != 'undefined') {
        document.getElementById('reply_error').innerHTML = '';
    }
}
var count = "500";   //Example: var count = "500";
function limiter(comment, limit){
    var tex = document.getElementById(comment).value;
    var len = tex.length;
    if(len > count){
        tex = tex.substring(0,count);
        document.getElementById(comment).value =tex;
        return false;
    }
    document.getElementById(limit).innerHTML = count-len;
}

function markSpam(video_id, comment_id) {
    var params = "video_id="+video_id+"&comment_id="+comment_id;
    new Ajax.Updater("reply_"+comment_id, '/comments/spam', {parameters: params, evalScripts: true});
}