/****************************************************************************\
* common.js         javascript helper functions for the POF-AC pages
******************************************************************************
* 08.09.2005  J.Tremmel  Added IE-workaround for suckerfish dropdown menus
*
\****************************************************************************/

/**
* Safely adds a load event to the window.onload handler
* See: http://simon.incutio.com/archive/2004/05/26/addLoadEvent
* NOTE: Avoid direct <body onload="..."> assignments
*/
function addLoadEvent( func ) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() { oldonload(); func(); }
  }
}

addLoadEvent( function() {
  /** suckerfish dropdown menu, :hover workaround for IE browsers */
  if (document.all && document.getElementById) {
    try {
      var items = document.getElementById("menu").getElementsByTagName("li");
      for (var i = 0; i < items.length; i++) {
        items[i].onmouseover = function() {
          this.className += " ieOver";
        }
        items[i].onmouseout = function() {
          this.className = this.className.replace(" ieOver", "");
        }
      }
    } catch(e) {
      //alert(e);
    }
  }
});
