function initIeHover( navElements ) {
  for (var i=0; i<navElements.length; i++) {
    navElements[i].onmouseover=function(e) {
      this.className+=" iehover";
    }
    navElements[i].onmouseout=function(e) {
      this.className=this.className.replace(new RegExp(" iehover\\b"), "");
    }
  }
}

Popup.prototype.templates = {
  'player_window' : {
    'scrollbars'  : 'no',
    'resizable'   : 'no',
    'toolbar'     : 'no',
    'menubar'     : 'no',
    'location'    : 'no',
    'status'      : 'no'
  }
};

Event.addBehavior({
  'a.offsite,a.external' : Popup,
  'a.video' : Popup({
    'target': 'video_window',
    'template': 'player_window',
    'window': {'width':480,'height':380}
  }),
  'a.player960' : Popup({
    'target': 'video_window',
    'template': 'player_window',
    'window': {'width':960,'height':720+20}
  }),
  'a.player640': Popup({
    'target': 'video_window',
    'template': 'player_window',
    'window': {'width':640,'height':480+20}
  })
});

Event.addBehavior({
  'a.download,a[href*=/download/],a[rel=enclosure]' : TrackedLink({ prefix : '/downloads/' }),
  'a.external,a.offsite' : TrackedLink({ prefix : '/external/' })
});

Event.onReady(function() {
  if (window.attachEvent) {
    var navElements = document.getElementById("nav").getElementsByTagName("LI");
    initIeHover( navElements );
  }
});
