if (document.all) { 
  try { 
    document.execCommand("BackgroundImageCache", false, true); 
  } catch(oe) { } 
}

$(document).ready(function(){
  $('a.popup').click(function(event) {
    event.preventDefault();
    
    window.open(this.href, '');
  })
  
  $('form.submitForm').submit(function() {
    var $form   = $(this);
    var $submit = $('input:submit', this);
    
    $form.addClass('loading');
    $submit.attr('disabled', 'disabled');
    
    $(window).blur(function() {
      $('label', $form).removeClass('missing');
      $('div.alert', $form).hide();
      $form.removeClass('loading alert')
      $submit.removeAttr('disabled');
    })
  });
});

// Event.observe(
//  window,
//  'load',
//  init
// );
// 
// function init() {
//  var popups = $$('a.popup');
//  
//  popups.each(
//    function(link) {
//      Event.observe(
//        link,
//        'click',
//        function(event) {
//          Event.stop(event);
//          
//          window.open(link.href, '');
//        }
//      );
//    }
//  );
// }