
var level1 = new ItemStyle(25, 0, '', 0, 5, '', '#F00', 'highText', 'whiteText', '', '',
 null, 80, 'hand', 'default');

var level2 = new ItemStyle(20, 0, '', 0, 5, '#000', '#FFF', 'whiteText', 'highText', '', '',
 null, 90, 'hand', 'default');

var level2T = new ItemStyle(38, 0, '', 0, 5, '#CC6600', '#FFDCA8', 'lowText', 'highText', '', '',
 95, 90, 'hand', 'default');

var level3 = new ItemStyle(25, 0, '', 0, 5, '#000066', '#FFDCA8', 'whiteText', 'highText', '', '',
 null, null, 'hand', 'default');

var subBlank = new ItemStyle(22, 1, '&gt;', -15, 3, '#CCCCDD', '#6699CC', 'lowText', 'highText',
 'itemBorderBlank', 'itemBorder', null, null, 'hand', 'default');



var pMenu = new PopupMenu('pMenu');
with (pMenu)

{

startMenu('root', true, '15', '210', 130, level1);

addItem('About the CAC', 'http://gwbweb.wustl.edu/cac/index.html', '');
addItem('Events', 'http://gwbweb.wustl.edu/cac/events.html', '');
//addItem('Measures Collection', 'http://gwbweb.wustl.edu/sw/measures/', '');
addItem('People', 'mPeople', 'sm:');
addItem('Research', 'mResearch', 'sm:');
addItem('Resources', 'mResources', 'sm:');
addItem('------','#',''); //make these so nothing happens when rollover
//addItem('','#','');

addItem('Contact Us', 'http://gwbweb.wustl.edu/cac/contact_form.html', '');
addItem('GWB Homepage','http://gwbweb.wustl.edu','');
addItem('Wash U Home','http://www.wustl.edu','');


startMenu('mPeople', true, 70, -10, 130, level2);
addItem('Advisory Boards','http://gwbweb.wustl.edu/cac/boards.htm','');
addItem('Staff','http://gwbweb.wustl.edu/cac/people','');


startMenu('mResources', true, 70, -10, 130, level2);

addItem('Links','http://gwbweb.wustl.edu/cac/links.htm','');
addItem('Measures Collection', 'http://gwbweb.wustl.edu/cac/resources/measures/collections.htm', '');
addItem('Request Assistance','http://gwbweb.wustl.edu/cac/Resources/RA_work_request.htm','');
addItem('Training', 'http://gwbweb.wustl.edu/cac/training.htm', '');


startMenu('mResearch', true, 70, -10, 210, level2);

addItem('Projects by Status','http://gwbweb.wustl.edu/cac/research/status.htm','');
addItem('Projects by Researcher','http://gwbweb.wustl.edu/cac/research/researcher.htm','');
addItem('Recent Findings','http://gwbweb.wustl.edu/cac/research/recent_findings.htm','');
addItem('Publications by CAC Researchers','http://gwbweb.wustl.edu/cac/research/publications.htm','');


//startMenu('mLib', true, 45, 20, 160, level2);
//addItem('About the Library','http://gwbweb.wustl.edu/library/info.html','');

//startMenu('mStaff', true, 45, 17, 140, level3);
//addItem('Michael E. Powell','/people/staff/powell.html','');

//startMenu('mWeb', true, 45, 17, 160, level2);
//addItem('Government Sites','http://library.wustl.edu/subjects/government/','');


}



// *** (4) EVENTS ***
//
// In JavaScript, there are document 'events' you need to set so any scripts you are using
// are notified of things like page loading/clicking/scrolling. If you've got several menus
// or another JavaScript entirely in your page, you'll need to add all their functions in here.
// For another menu object, call its functions like update() and position() next to pMenu's,
// I've put examples in to show where these need to go.
//    The reason for these is that every time you set them, they override a previous setting.
// So make sure you collate all the functions that need to be called in here! Syntax:

//object.onevent = function()
//{
// function1();
// function2();
// ...
//}

// That's similar to: <BODY ONEVENT="function1(); function2(); ...">


// The most important event is one used to display the menu by calling one of several methods of
// any menu object(s) you have created. This is where you select the menu creation mode. 'Dynamic'
// mode inserts the menus into the document once it has finished loading and supports features
// like modifying the menu after creation. You update a menu in 'Dynamic' mode by just calling the
// .update() method of a menu object like 'pMenu'.
//    'Fast' creation mode writes the menus to the document here and now, which is faster and
// more reliable in many browsers but only when the document's loading -- you do this by passing
// 'true' without quotes to the update function to signal that we're inline.
//    Opera only supports Fast mode and Netscape 4 only supports in Dynamic mode, so we use
// browser-detect code here. If you find some browser has troubles with one mode or another, try
// the other menu creation method -- see the "Cross-Browser" code at the very top of the SCRIPT
// tag for the variables used.
//    Hardcore tweakers -- there's some extra code commented in the popOver() function at the top
// which lets you create the root menu on page load and other menus only as needed, which might
// be useful for very very large menus in a single frame. Look it up if you want.

if (!isNS4)
{
 // Write menus now in non-NS4 browsers, by calling the "Fast" mode .update(true) method.
 pMenu.update(true);
 //anotherMenu.update(true);
}
else
{
 // For Netscape 4, back up the old onload function and make a new one to update our menus.
 // This is the regular "Dynamic" mode menu update, it works in IE and NS6 too if required.
 var popOldOL = window.onload;
 window.onload = function()
 {
  if (popOldOL) popOldOL();
  pMenu.update();
  //anotherMenu.update();
 }
}


// Other events must be assigned, these are less complicated, just add or remove menu objects.

var nsWinW = window.innerWidth, nsWinH = window.innerHeight, popOldOR = window.onresize;
window.onresize = function()
{
 if (popOldOR) popOldOR();
 if (isNS4 && (nsWinW!=innerWidth || nsWinH!=innerHeight)) history.go(0);
 pMenu.position();
 //anotherMenu.position();
}

window.onscroll = function()
{
 pMenu.position();
 //anotherMenu.position();
}


// NS4 can't reliably capture clicks on layers, so here's a workaround.
if (isNS4)
{
 document.captureEvents(Event.CLICK);
 document.onclick = function(evt)
 {
  with (pMenu) if (overI) click(overM, overI);
  //with (anotherMenu) if (overI) click(overM, overI);
  return document.routeEvent(evt);
 }
}

// Activate the window.onscroll() event in non-Microsoft browsers.
if (!isIE || isOp)
{
 var nsPX=pageXOffset, nsPY=pageYOffset;
 setInterval('if (nsPX!=pageXOffset || nsPY!=pageYOffset) ' +
 '{ nsPX=pageXOffset; nsPY=pageYOffset; window.onscroll() }', 50);
}

