/**
* Simulates the :hover state for <div> elements in Internet Explorer
*
* Works by applying a class 'hover' to <div> elements when rolled over. The 'hover' class shares
* the same properties as the corresponding :hover class.
*
* Taken from http://www.alistapart.com/articles/dropdowns
* Sub-nav trigger DIV is located within a LI
*/
function init_menu() {
  if (!document.all || !document.getElementById) return;
  
  var navRoot = document.getElementById('nav-dropdown');
  for (i = 0; i < navRoot.childNodes.length; i++) {
    var node = navRoot.childNodes[i];      
    if (node.nodeName == 'UL') {

      for (j = 0; j < node.childNodes.length; j++) {
        var nodeC1 = node.childNodes[j];
        if (nodeC1.nodeName == 'LI') {
          
          for (k = 0; k < nodeC1.childNodes.length; k++) {
            var nodeC2 = nodeC1.childNodes[k];
            if (nodeC2.nodeName == 'DIV') {
              nodeC2.onmouseover = function() { this.className += ' hover'; }
              nodeC2.onmouseout  = function() { this.className = this.className.replace(' hover', ''); }              
            } // end if
          } // end for
          
        } // end if
      } // end for
      
    } // end if
  } // end for
} // end function


function newWindow(url, name, width, height) {
  photoWindow = window.open(url, name,"location=yes,directories=yes,menubar=yes,statusbar=yes,toolbar=yes,scrollbars=yes,height=" +height+ ",width=" +width+ ",resizable=yes");
  photoWindow.resizeTo(width,height);
  photoWindow.focus();
  return false;
}
