$(document).ready(function() {
  Controller.prototype.activateFormValidation = activateFormValidation;

  controller.activateFormValidation();
});

function activateFormValidation() {
  $(document.tellafriend_form).validate({
    rules: {
      from_name: 'required',
      from: {
        required: true,
        email: true
      },
      to: {
        required: true,
        email: true
      },
      captcha: 'required'
    },
    messages: {
      from_name: '',
      from: {
        required: '',
        email: ''
      },
      to: {
        required: '',
        email: ''
      },
      captcha: ''
    }
  });

  controller.focusField($("div#tellafriend_right input[name=from_name]"));
}

