var myNavBar1 = new NavBar(0);
var dhtmlMenu;

//define menu items (first parameter of NavBarMenu specifies main category width, second specifies sub category width in pixels)
//add more menus simply by adding more "blocks" of same code below

dhtmlMenu = new NavBarMenu(50, 0);
dhtmlMenu.addItem(new NavBarMenuItem("Home", "http://www.pedigreematching.com/main.htm"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(150, 0);
dhtmlMenu.addItem(new NavBarMenuItem("GlobeTrotter", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Features", "http://www.pedigreematching.com/GTFeatures.htm"));
dhtmlMenu.addItem(new NavBarMenuItem("Purchase Info", "http://www.pedigreematching.com/purchase.asp"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(180, 150);
dhtmlMenu.addItem(new NavBarMenuItem("Pedigree Matching Theory", "http://www.pedigreematching.com/breeding_theory_page_1.htm"));
myNavBar1.addMenu(dhtmlMenu);


dhtmlMenu = new NavBarMenu(110, 120);
dhtmlMenu.addItem(new NavBarMenuItem("Members Only", "http://www.pedigreematching.com/Members_only.asp"));
dhtmlMenu.addItem(new NavBarMenuItem("Support", "http://www.pedigreematching.com/Support.htm"));
dhtmlMenu.addItem(new NavBarMenuItem("Updates", "http://www.pedigreematching.com/updates.asp"));
dhtmlMenu.addItem(new NavBarMenuItem("Discussion Forum", "http://www.pedigreematching.com/forum/default.asp"));
dhtmlMenu.addItem(new NavBarMenuItem("Tips & Tricks", "http://www.pedigreematching.com/tips/tips_and_tricks.asp"));
dhtmlMenu.addItem(new NavBarMenuItem("Feedback Form", "http://www.pedigreematching.com/customer_feedback.htm"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(100, 150);
dhtmlMenu.addItem(new NavBarMenuItem("Contact", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Sales", "http://www.pedigreematching.com/contact_information.htm"));
dhtmlMenu.addItem(new NavBarMenuItem("Support", "http://www.pedigreematching.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Feedback Form", "http://www.pedigreematching.com/customer_feedback.htm"));

myNavBar1.addMenu(dhtmlMenu);

//set menu colors
myNavBar1.setColors("#000000", "#FFFFFF", "#008080", "#000000", "#FFFF00", "#FFFFFF", "#008080", "#000000", "#FFFF00")


//uncomment below line to center the menu (valid values are "left", "center", and "right"
//myNavBar1.setAlign("center")

window.onload = init;

function init() {

  myNavBar1.resize(getWindowWidth());
  myNavBar1.create();
  updatePosition();
}

function updatePosition() {

  var viewTop, viewBottom;
  var dy;

  viewTop = getPageScrollY();
  viewBottom = viewTop + getWindowHeight();

  if (myNavBar1.bottom < viewTop)
    myNavBar1.moveTo(0, viewTop - myNavBar.height);
  if (myNavBar1.top > viewBottom)
    myNavBar1.moveTo(0, viewBottom);

  dy = Math.round(Math.abs(viewTop - myNavBar1.y) / 2);
  if (viewTop < myNavBar1.y)
    dy = -dy;

  myNavBar1.moveBy(0, dy);
  setTimeout('updatePosition()', 25);
}