﻿DependUserControls.CreateComment = function(serverVars) {
    this.ServerVars = serverVars;
    this.Initialize();
};

DependUserControls.CreateComment.prototype = {
    Initialize: function() {
        $('#' + serverVars.commentId).charCounter(500, { container: '#commentTextCounter' });
    }
};

function ValidateComment(source, arguments) {
    var length = arguments.Value.length;

    if (length < 2 || length > 500) {
        $('#' + source.id).html('Please enter your comment.');
        arguments.IsValid = false;
    } else {
        arguments.IsValid = true;
    }
}

Depend.Extend(DependUserControls.CreateComment, Depend.Core);