Journal.MessageForm = Class.create({ 
  initialize: function() {  
    this.formTable    = $( '_commentMsgFormTable' );
    this.msgInput     = $( '_commentMsgInput' );
    this.submitButton = $( '_commentMsgSendBtn' );
    
    this.prepare();
  }, // initialize
  
  prepare: function() {
    this.addInModalWin = true;
    this.validationMarkuper = new DM.Validation.Markuper({
      formTable      : this.formTable,
      validationRows : [ 'commentMsg' ],
      validationMsgs : [ 'введіть текст повідомлення' ]
    });
    
    var self = this;
    this.submitButton.onclick = function() {
      self.submit();
    } // onclick
  }, // prepare
  
  validate: function() {
    var msgFailed  = this.msgInput.value == '';
    
    var formFailed = this.validationMarkuper.update({
      commentMsg  : msgFailed
    });
    
    return formFailed;
  }, // validate
  
  submit: function() {
    if ( this.validate() ) {
      smartSubmit( this.submitButton );
    } // if
  } // submit
}); // Journal.MessageForm