activeMenuItem = '';

var marginleft = Math.round((xClientWidth() - 900) / 2) - 1;
var margintop = 74;


function subover(menuitem) {
	menuitem.className='subitem subitem-over';
}

function subout(menuitem) {
	menuitem.className='subitem';
}

function subactover(menuitem) {
	menuitem.className='subitem subitem-active subitem-active-over';
}

function subactout(menuitem) {
	menuitem.className='subitem subitem-active';
}




function topover(menuitem) {
	unselectAll();
	menuitem.className='topitem topitem-active';
}

function topout(menuitem) {
	menuitem.className='topitem';
}

function topstart(menuitem) {
	activeMenuItem = menuitem;
	menuitem.className='topitem topitem-active';
}

function unselectAll() {
	for (i=2; i<=9; i++) {
		topId = 'topitem' + i
		topItem = document.getElementById(topId);
		topItem.className='topitem';
	}
}

function topreturn() {
	topover(activeMenuItem);
}

/*
	Content Navigation
*/

function contentover(menuitem) {
	menuitem.className='contentitem contentitem-active';
}

function contentout(menuitem) {
	menuitem.className='contentitem';
}

contentover



/*
	x lib functions
*/

function xMenu1A(triggerId, menuId, mouseMargin, slideTime, openEvent)
{
  var isOpen = false;
  var trg = xGetElementById(triggerId);
  var mnu = xGetElementById(menuId);
  if (trg && mnu) {
	xHide(mnu);
	xAddEventListener(trg, openEvent, onOpen, false);
  }
  function onOpen()
  {
	if (!isOpen) {
	  xMoveTo(mnu, xPageX(trg)-marginleft, xPageY(trg)-margintop);
	  xShow(mnu);
	  mnu.className = 'submenu';
	  xSlideTo(mnu, xPageX(trg)-marginleft, xPageY(trg)-margintop + xHeight(trg), slideTime);
	  xAddEventListener(document, 'mousemove', onMousemove, false);
	  isOpen = true;
	}
  }
  function onMousemove(ev)
  {
	var e = new xEvent(ev);
	if (!xHasPoint(mnu, e.pageX, e.pageY, -mouseMargin) &&
		!xHasPoint(trg, e.pageX, e.pageY, -mouseMargin))
	{
	  xRemoveEventListener(document, 'mousemove', onMousemove, false);
	  // xSlideTo(mnu, xPageX(trg)-marginleft, xPageY(trg)-margintop, slideTime);
	  setTimeout("xHide('" + menuId + "')", slideTime);
	  isOpen = false;
	  topreturn();
	}
  }
} // end xMenu1A

		
/* xMenu1A Object Prototype

  Parameters:
	triggerId   - id string of trigger element.
	menuId      - id string of menu.
	mouseMargin - integer margin around menu;
				  when mouse is outside this margin the menu is hid.
	slideTime   - integer time for menu slide (in milliseconds).
	openEvent   - string name of event on which to open menu ('click', 'mouseover', etc).
*/


