window.onload = init;

// Global CrossBrowserElement Objects:
var slideMenu;

//-----------------------------------------------------------------------------
// onLoad event handler.

function init()
{
  slideMenu = new CrossBrowserElement('slideMenu');
  
  if (is.nav4) {          // exclude Moz
    slideMenu.setLeft(20);
    window.onresize = regen;
  }
  else {
    slideMenu.setLeft(12);
    window.onscroll = controlSlideMenu;
  }

  slideMenu.setTop(6000);
  slideMenu.show();
  slideMenu.ySpeed = .4;
  controlSlideMenu();

  if (window.demoInit) {
    demoInit();
  }

  window.defaultStatus = "Goddard Company Financial Services";
}

//-----------------------------------------------------------------------------
// onResize event handler for NN4.
// I added regen() to solve the NN4 crashing problem. This has something to do
// with what NN4 does after a window resize... still unsure about this.

function regen()
{
  window.location.reload();
}

//-----------------------------------------------------------------------------
// Functions for the creation and operation of the listbox navigation menu.

function navMenuGo()
{
  var _url = document.forms.navForm.navMenu.options[document.forms.navForm.navMenu.selectedIndex].value;
  if ( _url != "") {
    document.location.href = _url;
  }
}


//-----------------------------------------------------------------------------
// This function is the onScroll event handler (in IE). It calculates the 
// slide target and calls the object's slide method.

var slideMenuOffsetTop=110;

function controlSlideMenu()
{
  var topOfClientArea = getScrollY();

  slideMenu.slideToY(topOfClientArea + slideMenuOffsetTop);

  if (is.nav4up || is.opera) {
    setTimeout("controlSlideMenu()",250);
  }
}



// End Gnav1.js
