// The CSS property height 100% is not inherited from the body
// This function will programmatically correct this
// Requires: cbe_core.js
function windowOnload() {
  fixHeight("outerframe");
  fixHeight("mid-section");
  fixHeight("mid-col-2");
      
  // Search button
  cbeNewImage('search', 'images/search.gif',58,18);
  cbeNewImage('search-over', 'images/search-over.gif',58,18);
  
  // submenu
  window.button = document.getElementById('button').cbe;
  button.addEventListener('mouseOut', mouseOutListener);
  button.addEventListener('mouseOver', mouseOverListener);

  // submenu mouseover image
  window.menuimg = document.getElementById('menuimg').cbe;
  InitMouseover();
  cbeNewImage('clouds_lhs', 'images/clouds_lhs.jpg',140,111);
  
  if (window.ishomepage) {
    window.menuimg.moveTo(120,346)
  }
} 

function fixHeight(id) {  
  if (is.gecko || is.ie) { 
    var E1 = document.getElementById(id);
    if (E1) {    
      var docHeight = E1.cbe.height();
      var winHeight = E1.cbe.parentNode.height();
      var height = docHeight > winHeight? docHeight : winHeight;
      E1.cbe.height( height );
    }
  }
}

function onResizeHandler() {
  window.location.reload();
}

window.onresize = onResizeHandler;

function mouseOutListener() {
  mapOver(1,false);  
  submenuOver(false);
  window.menuimg.hide();
}

function mouseOverListener() {
  mapOver(1,true);  
  submenuOver(true);
  window.menuimg.show();
}

function lhsImgSet(sImg) {
  cbeSetImage('lhsimg',sImg);
}
