$(document).ready(function() {
  if($('#megaform').length) {
    $('#megaform').ketchup();
  }
  
  if($('#megaform2').length) {
    $('#megaform2').ketchup({
      validationAttribute: 'rel',
      errorContainer: $('<div>', {
        'class': 'ketchup-error-container-alt',
        html: '<ol></ol>'
      }),
      initialPositionContainer: function(errorContainer, field) {
        //errorContainer = the error-container with all childs
        //field = the field that needs to get validated
      },
      positionContainer: function(errorContainer, field) {},
      showContainer: function(errorContainer) {
        errorContainer.slideDown('fast');
      },
      hideContainer: function(errorContainer) {
        errorContainer.slideUp('fast');
      }
    });
  }
  
  if($('#megaform3').length) {
    $('#megaform3').ketchup();
  }
  
  if($('#megaform4').length) {
    $('#megaform4').ketchup();
  }
});