
function transition() {
  (function() {
    Effect.Fade('thank-you', {
      afterFinish: function(effect) {
        Effect.Appear('inner-newsletter');
      }
    });
  }).delay(3);
}

var active_archive_month = null;
var active_trade_show = null;
var active_news = null;
var active_archive = null;

function loaded() {
  $$('#five-trade-shows .tradeshow').each(function(element){
    element.observe('mouseover', function(event){
      if ((active_trade_show != element) &&
          (event.element() == element)) {
        if (active_trade_show) {
          active_trade_show.morph("background-color:#2367a8", {duration:0.5});
        }
        active_trade_show = element;
        active_trade_show.morph("background-color:#185095", {duration:0.5});
      }
    });
  });
  
  
  $$('#news-index .article').each(function(element){
    element.observe('mouseover', function(event){
      if ((active_news != element) &&
          (event.element() == element)) {
        if (active_news) {
          active_news.morph("background-color:#e7f5fc", {duration:0.5});
        }
        active_news = element;
        active_news.morph("background-color:#d6eaf3", {duration:0.5});
      }
    });
  });
  
  
  $$('#archive .article').each(function(element){
    element.observe('mouseover', function(event){
      if ((active_archive != element) &&
          (event.element() == element)) {
        if (active_archive) {
          active_archive.morph("background-color:#e7f5fc", {duration:0.5});
        }
        active_archive = element;
        active_archive.morph("background-color:#d6eaf3", {duration:0.5});
      }
    });
  });
  
  
  $$('#archive .month').each(function(element){
    if (element.hasClassName('current')) active_archive_month = element;
    element.observe('click', function(event){
      if (element == active_archive_month) return false;
      if (active_archive_month) {
        $(active_archive_month.readAttribute('rel')).hide();
        active_archive_month.removeClassName('current');
      }
      active_archive_month = element;
      $(element.readAttribute('rel')).show();
      element.addClassName('current');
    });
  });
}