var or = or || {};

(function($){

  or.utilities = {
    flashbar: {
      autohide: function()
      {
        $('.flash_bar').each(function() {
          var delay = 5000;
          window.setTimeout(function(){ $('.flash_bar').slideUp(); }, delay);
        });
      }
    },
    lightbox: {
      defaults: {
        imageLoading: '/images/plugins/lightbox-ico-loading.gif',
        imageBtnPrev: '/images/plugins/lightbox-btn-prev.gif',
        imageBtnNext: '/images/plugins/lightbox-btn-next.gif',
        imageBtnClose: '/images/plugins/lightbox-btn-close.gif',
        imageBlank: '/images/plugins/lightbox-blank.gif',
        fixedNavigation: true
      },
      initializeImageGrid: function() {
        return $('.lightbox-grid').each(function(){
          $(this).find('a.lightbox:has(img)').lightBox(or.utilities.lightbox.defaults);
        });
      }
    },
    tables: {
      stripe: function(){
        $('tr:even').addClass('even-row');
        $('tr:odd').addClass('odd-row');
      }
    }
  };

  or.forms = {
    newsletter: {
      handleSignup: function() {
        var form = $('.newsletter form').ajaxForm({
          success: function() {
            alert("Thank you for signing up");
            $(form).resetForm();
          }
        });
      }
    }
  };
  
})(jQuery);