// Cascading Popup Menus v5.2 - Single Frame Menu example script.


// If you're upgrading from v5.1, you can paste your existing menu data in, and if you're
// upgrading from v5.0 you need to add 'cursor' settings to your ItemStyles.
//
// And before going ANY further, you must have READ and AGREE TO the script license!
// It can be found on my site, in the syntax helpfile, or in the demo script document.


// 'horizontal Bar' style: menu items that use this ItemStyle are 83px wide, have 0px gaps
// between them, no popout indicator (the ">" in some menus) or popout indicator position,
// 10px padding of the text within items, #333333 background colour, a hover colour of #996633,
// 'highText' is the stylesheet class used for the menu text both normally and when highlighted,
// no border styles, 'null' means fully opaque items (set them to numbers between 0 and 100 to
// enable semitranslucency), and the 'hand'/'default' cursors are used for linked/submenu items.
var hBar = new ItemStyle(93, 0, '', 0, '', '15#333333', '10#996633', 'highText', 'highText', 'itemBorder', 'itemBorder',
 null, null, 'hand', 'default');


var aboutus = new ItemStyle(83, 0, '', 0, '', '15#333333', '10#996633', 'highText', 'highText', 'aboutusBorder', 'aboutusBorder',
 null, null, 'hand', 'default');

// The 'sub Menu' items: these have popout indicators of "Greater Than" signs ">" 15px from their
// right edge, and CSS borders. Text class also changes on mouseover if second lowText is changed.
// 20 is height of each dropdown menu item, 0 is space between dropdown items, 3 is position of text
// top to bottom 
var subM = new ItemStyle(20, 0, '&gt;', -15, 3, '#C8AD76', '#FFFFFF', 'lowText', 'lowText',
 '', '', null, null, 'hand', 'default');

// 'subBlank' is similar, but has an 'off' border the same colour as its background so it
// appears borderless when dim, and 0px spacing between items-could be 1px to show the hover border.
var subBlank = new ItemStyle(22, 0, '&gt;', -15, 3, '#CCCCDD', '#6699CC', 'lowText', 'highText',
 'itemBorderBlank', 'itemBorder', null, null, 'hand', 'default');

// 'feature'
//var feature = new ItemStyle(22, 0, '&gt;', -15, 3, '#336699', '#996600', 'lowText', 'highText',
// 'itemBorderBlank', 'itemBorder', null, null, 'hand', 'default');
var feature = new ItemStyle(83, 0, '', 0, '', '#666666', '#666666', 'highText', 'highText', 'itemBorder', 'itemBorder',
 null, null, 'hand', 'default');

// Create a PopupMenu() object, and pass its own name so it can reference itself later on.
// We also use a 'with' block to work with its properties and functions below.

var pMenu = new PopupMenu('pMenu');
with (pMenu)
{

// Here's what the values in the next startMenu() command mean, in order:
//  'root': the name of this menu.
//   false: orientated as a horizontal menu (true creates a vertical menu).
//      13: the 'left' offset of this menu in pixels.
//       0: the 'top' offset of this menu in pixels.
//      35: the height of this menu (for vertical menus, this becomes the menu width).
//    hBar: the ItemStyle used to give this menu colours and layout/formatting.
//      '': this menu does not display within a frame (see the Frameset Example Script to do that).
//   false: this menu shows submenus on mouseover. 'true' means show on click.
//
// Most of the items are 'sm:' items popping out submenus, except the last 'js:' JavaScript command
// to pop open a new window. I've also given each item a length in pixels, overriding the ItemStyle.
// startMenu('root', false, 13, 121, 35, hBar, '', true); ORIGINAL start menu from before -put back if 
//don't want menu centering

startMenu('root', false, 'window.page.winW()/2 - menuW/2', 120, 33, hBar, '', true);
addItem('&nbsp; About Us', 'mAboutUs', 'sm:', aboutus, 82);
addItem('&nbsp; Nuclear Process', 'mNuclearProcess', 'sm:', feature, 115);
addItem('&nbsp; Entrepreneur Partners', 'mEntrepreneurPartners', 'sm:', null, 150);
addItem('&nbsp; Portfolio Companies', 'portfoliocompanies.html', '', null, 140);
addItem('&nbsp; News and Information', 'mNewsandInformation', 'sm:', null, 150);
addItem('&nbsp; Contact Us', '/contactus.html', '', null, 83);


startMenu('mAboutUs', true, 0, 33, 125, subM, '', false);
addItem('Entrepreneur Partners', '/au_entrepartners.html', '');
addItem('Advisors', '/au_advisoryboard.html', '');

startMenu('mNuclearProcess', true, 1, 33, 190, subM, '', false);
addItem('Identify. Build. Achieve.', '/np_iba.html', '');
addItem('Strategic Capital', '/np_strategic.html', '');
addItem('Executive Search and Human Capital', '/np_human.html', '');
addItem('Operational Capital', '/np_operational.html', '');
addItem('Working Capital', '/np_working.html', '');


startMenu('mEntrepreneurPartners', true, 1, 33, 148, subM, '', false);
addItem('Entrepreneur Partners', '/ep_entrepartners.html', '');
addItem('Partner Perspectives', '/ep_partnerperspectives.html', '');


startMenu('mNewsandInformation', true, 1, 33, 148, subM, '', false);
addItem('News from Nucleus Partners', '/ni_news.html', '');
addItem('Portfolio Company News', '/ni_portfolioconews.html', '');
addItem('Partner Perspectives', '/partnerperspectives.html', '');

}



// ******************** MENU EFFECTS ********************
//
// Now you've created a basic menu object, you can add optional effects like borders and
// shadows to specific menus. You can remove this section entirely if you want, the
// functions called are found at the bottom of this file.



// BORDER: Added to all menus in a named object using a specified ItemStyle. The syntax is:
//  addMenuBorder(menuObject, ItemStyle,
//   opacity of border, 'border colour', border width, 'padding colour', padding width);
// Opacity is a number from 0 to 100, or null for solid colour (just like the ItemStyles).

//addMenuBorder(pMenu, window.subBlank,
// null, '#666666', 1, '#CCCCDD', 2);




// ******************** FUNCTIONS CALLED BY THE EFFECTS SECTION ********************

// These can be deleted if you're not using them. Alternatively, if you're using several menu
// data files, you may want to move them to the "core" script file instead.



// This is the "positioning from page anchors" code used by the advanced positioning expressions.
page.elmPos=function(e,p)
{
 var x=0,y=0,w=p?p:this.win;
 e=e?(e.substr?(isNS4?w.document.anchors[e]:getRef(e,w)):e):p;
 if(isNS4){if(e&&(e!=p)){x=e.x;y=e.y};if(p){x+=p.pageX;y+=p.pageY}}
 else if (e && e.focus && e.href && this.MS && /Mac/.test(navigator.platform))
 {
  e.onfocus = new Function('with(event){self.tmpX=clientX-offsetX;' +
   'self.tmpY=clientY-offsetY}');
  e.focus();x=tmpX;y=tmpY;e.blur()
 }
 else while(e){x+=e.offsetLeft;y+=e.offsetTop;e=e.offsetParent}
 return{x:x,y:y};
};



