var hBar = new ItemStyle(70, 0, '', 0, 0, '15#336699', '10#6699CC', 'highText', 'highText', '', '',
 null, null, 'hand', 'hand');

 var subM = new ItemStyle(22, 0, '&gt;', -15, 3, '#CCCCDD', '#6699CC', 'lowText', 'highText',
 'itemBorder', 'itemBorder', null, null, 'hand', 'default');

 var subBlank = new ItemStyle(22, 1, '&gt;', -15, 3, '#CCCCDD', '#6699CC', 'lowText', 'highText',
 'itemBorderBlank', 'itemBorder', null, null, 'hand', 'default');

var button = new ItemStyle(22, 1, '&gt;', -15, 2, '10#006633', '10#CC6600', 'buttonText', 'buttonHover',
 'buttonBorder', 'buttonBorderOver', 80, 95, 'crosshair', 'default');

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).
//      10: the 'left' offset of this menu in pixels.
//       0: the 'top' offset of this menu in pixels.
//      17: 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.

//startMenu('root', false, 10, 0, 17, hBar, '', false);
startMenu('root', false, 'window.page.elmPos("menuBar").x', 'window.page.elmPos("menuBar").y', 17, hBar, '', false);
//addItem('&nbsp; File', 'mFile', 'sm:', null, 40);
//addItem('&nbsp; Members', 'mMembers', 'sm:', null, 65).onclick='window.location.href="/members/index.cfm"';
addItem('&nbsp; Home', '/', '', null, 50);
addItem('&nbsp; About CAMSS', 'mLeadership', 'sm:', null, 95);
// put a match clause for /members/ in here
//document.write(this.location.pathname);
if (this.location.pathname.match("\/members\/") != null) {
addItem('&nbsp; Members', 'mMembers', 'sm:', null, 65).onclick='window.location.href="/members/"';
} else {
    addItem('&nbsp; Join', 'mApplication', 'sm:', null, 45).onclick='window.location.href="/application/index.html"';
}
addItem('&nbsp; Education', 'mEducation', 'sm:', null, 70).onclick='window.location.href="/conference/index.html"';
addItem('&nbsp; Calendar', '/calendar/', '', null, 65);
addItem('&nbsp; Careers/Classifieds', 'mCareers', 'sm:', null, 125).onclick='window.location.href="/career/index.html"';
addItem('&nbsp; Discussion Board', 'mDiscussions', 'sm:', null, 110).onclick='window.location.href="/bbs/index.html"';
addItem('&nbsp; Links', '/links/index.html', '', null, 40);
//addItem('&nbsp; Resource Library', 'mResourceLibrary', 'sm:', null, 120);

startMenu('mLeadership', true, 0, 18, 175, subM, '', false);
addItem('Mission Statement', '/board/mission/index.html', '');
addItem('CAMSS Brochure', '/pdf/CAMSSMSSPBrochure2008.pdf', '');
addItem('Board of Directors', '/board/directors/index.html', '');
addItem('Chapters', 'mChapters', 'sm:', null, 20).onclick='window.location.href="/chapters/index.html"';
addItem('Past Presidents', '/board/presidents/past.html', '');
addItem('CAMSS Bylaws', '/board/camss_bylaws/index.html', '');
//addItem('Chapter Rules & Regulations', '/board/chapter_bylaws/index.html', '');

startMenu('mMembers', true, 0, 18, 185, subM, '', false);
//addItem('Member Home', '/members/index.cfm', '');
addItem('Membership Roster', '/members/roster/index.cfm', '');
addItem('Whats New Archives', '/members/newsletter/index.cfm', '');
//addItem('Education Forum', '/members/annual_conference/index.cfm', '');
//addItem('Discussion Board', '/members/discussion/index.cfm', '');
addItem('Resource Library', 'mResourceLibrary', 'sm:', null).onclick='window.location.href="/members/resource_library/index.cfm"';
addItem('Topics & Speakers', '/members/topics-and-speakers.cfm', '');
addItem('Board Report', '/pdf/CAMSSBoardReport-July182009.pdf', '');
addItem('Board Report Archives', '/members/brarchives.cfm', '');
addItem('Strategic Plan 2007-2009', '/pdf/CAMSSStrategicPlanAccomplishments2007-2009.pdf', '');
addItem('Strategic Plan 2009-2010', '/pdf/CAMSSStrategicPlan2009-2010.pdf', '');
addItem('Treasurers Reports', '/treasurersreports.cfm', '');
//addItem('Public Homepage', '/', '');
//addItem('SWAP:Check for<br />Update...^Visit<br /><b>TwinHelix</b>', 'http://www.twinhelix.com', '', subM, 38);


startMenu('mDiscussions', true, 0, 18, 150, subM, '', false);
//addItem('Discussions Home', '/bbs/index.html', '');
addItem('Login', '/cgi-bin/dcforum/dcboard.cgi?az=list&forum=DCForumID1&conf=DCConfID1', '');
addItem('Register', '/cgi-bin/dcforum/dcboard.cgi?az=user_register', '');

startMenu('mApplication', true, 0, 18, 170, subM, '', false);
//addItem('Application Home', '/application/index.html', '');
addItem('Join Online', '/application/member_form.cfm?ID=0', '');
addItem('Download Application', '/pdf/2010CAMSSMembershipApplication.doc', '');
addItem('Renew Membership Online', '/application/renew.cfm');
addItem('Top 10 Reasons to Join', '/pdf/Top10.pdf');

startMenu('mEducation', true, 0, 18, 150, subM, '', false);
addItem('Forum', 'mForum', 'sm:', null, 20).onclick='window.location.href="/conference/index.html"';
addItem('Scholarship', '/scholarship/index.html', '');
addItem('Degree Programs', '/scholarship/degreeprograms.html', '');
//addItem('Mentoring', 'mMentoring', 'sm:', null, 20).onclick='window.location.href="/members/mentoring.cfm"';

startMenu('mForum', true, 150, 0, 150, subM, '', false);
addItem('2011 Forum', '/conference/index.html', '');
addItem('2010 Forum Sponsors', '/conference/sponsors2010.html', '');
addItem('2010 Forum Exhibitors', '/conference/exhibitors2010.html', '');

startMenu('mCareers', true, 0, 18, 160, subM, '', false);
//addItem('Careers/Classifieds Home', '/career/index.html', '');
addItem('View Job Listings', '/career/classifieds/index.cfm', '');
addItem('Post A Job Listing', '/career/method.html', '');

startMenu('mChapters', true, 175, 0, 150, subM, '', false);
addItem('Chapter Map', '/chapters/chaptermap.html', '');
addItem('Southern Region', 'mSouthern', 'sm:', null, 20);
addItem('Northeast Region', 'mNortheast', 'sm:', null, 20);
addItem('Central Chapter', 'mCentral', 'sm:', null, 20);
addItem('Greater LA Region', 'mGreaterLA', 'sm:', null, 20);
addItem('Northwest Region', 'mNorthwest', 'sm:', null, 20);

startMenu('mSouthern', true, 150, 0, 160, subM, '', false);
addItem('Desert Chapter', '/chapters/desert.html', '');
addItem('Orange Country Chapter', '/chapters/orange_county.html', '');
addItem('San Diego Chapter', '/chapters/san_diego.html', '');

startMenu('mNortheast', true, 150, 0, 150, subM, '', false);
addItem('Mid-Valley Chapter', '/chapters/midvalley.html', '');
addItem('Yosemite Chapter', '/chapters/yosemite.html', '');

startMenu('mGreaterLA', true, 150, 0, 270, subM, '', false);
addItem('Greater Long Beach Chapter', '/chapters/long_beach.html', '');
addItem('Managed Care Chapter', '/chapters/managed-care.html', '');
addItem('San Fernando Valley/Ventura County Chapter', '/chapters/sanfern.html', '');
addItem('San Gabriel Chapter', '/chapters/san_gabriel.html', '');

startMenu('mNorthwest', true, 150, 0, 160, subM, '', false);
addItem('Steinbeck Chapter', '/chapters/steinbeck.html', '');
addItem('Redwood Empire Chapter', '/chapters/redwood.html', '');

startMenu('mCentral', true, 150, 0, 160, subM, '', false);
addItem('Central Valley Chapter', '/chapters/central.html', '');
addItem('Kern County Chapter', '/chapters/kern.html', '');
addItem('Mid-Coast Chapter', '/chapters/midcoast.html', '');

startMenu('mMentoring', true, 150, 0, 150, subM, '', false);
addItem('Become a Mentor', '/pdf/mentor-application.pdf', '');
addItem('Become a Prot&egrave;g&egrave;', '/pdf/protege-application.pdf', '');

startMenu('mNewsViews', true, 165, 0, 150, subM, '', false);
addItem('February, 2006', '/members/newsletter/feb06.cfm', '');
addItem('Winter, 2005', '/members/newsletter/winter05.cfm', '');
addItem('Fall, 2005', '/members/newsletter/fall05.cfm', '');
addItem('Spring, 2005', '/members/newsletter/spring05.cfm', '');
addItem('Fall, 2004', '/members/newsletter/fall04.cfm', '');
addItem('Summer, 2004', '/members/newsletter/sum04.cfm', '');
addItem('Summer, 2003', '/members/newsletter/sum03.cfm', '');
addItem('February/March, 2003', '/members/newsletter/0203.cfm', '');

//showDelay = 0;
//hideDelay = 500;
//hideDocClick = true;
//menu.root[0].oncreate = function() { pMenu.doVis('root', true) }
}

addMenuBorder(pMenu, window.subBlank,
 null, '#666666', 1, '#CCCCDD', 2);

addDropShadow(pMenu, window.subM,
 [40,"#333333",6,6,-4,-4], [40,"#666666",4,4,0,0]);
addDropShadow(pMenu, window.subBlank,
 [40,"#333333",6,6,-4,-4], [40,"#666666",4,4,0,0]);


if ((navigator.userAgent.indexOf('rv:0.')==-1) &&
    !(isOp&&!document.documentElement) && !(isIE4&&!window.external))
{
 pMenu.showMenu = new Function('mN','menuAnim(this, mN, 10)');
 pMenu.hideMenu = new Function('mN','menuAnim(this, mN, -15)');
}


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}}
 if (e && this.MS && navigator.platform.indexOf('Mac')>-1 && e.tagName=='A')
 {
  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};
};

function menuAnim(menuObj, menuName, dir)
{
 var mD = menuObj.menu[menuName][0];
 if (!mD.timer) mD.timer = 0;
 if (!mD.counter) mD.counter = 0;

 with (mD)
 {
  clearTimeout(timer);
  if (!lyr || !lyr.ref) return;
  if (!visNow && dir>0) dir = 0-dir;
  if (dir>0) lyr.vis('visible');
  lyr.sty.zIndex = dir>0 ? mD.zIndex + 1 : 1001;
  lyr.clip(0, 0, menuW+2, (menuH+2)*Math.pow(Math.sin(Math.PI*counter/200),0.75) );
  counter += dir;
  if (counter>100) { counter = 100; lyr.sty.zIndex = mD.zIndex }
  else if (counter<0) { counter = 0; lyr.vis('hidden') }
  else timer = setTimeout('menuAnim('+menuObj.myName+',"'+menuName+'",'+dir+')', 40);
 }
};

function addMenuBorder(mObj, iS, alpha, bordCol, bordW, backCol, backW)
{
 for (var mN in mObj.menu)
 {
  var mR=mObj.menu[mN], dS='<div style="position:absolute; background:';
  if (mR[0].itemSty != iS) continue;
  for (var mI=1; mI<mR.length; mI++)
  {
   mR[mI].iX += bordW+backW;
   mR[mI].iY += bordW+backW;
  }
  mW = mR[0].menuW += 2*(bordW+backW);
  mH = mR[0].menuH += 2*(bordW+backW);

  if (isNS4) mR[0].extraHTML += '<layer bgcolor="'+bordCol+'" left="0" top="0" width="'+mW+
   '" height="'+mH+'" z-index="980"><layer bgcolor="'+backCol+'" left="'+bordW+'" top="'+
   bordW+'" width="'+(mW-2*bordW)+'" height="'+(mH-2*bordW)+'" z-index="990"></layer></layer>';
  else mR[0].extraHTML += dS+bordCol+'; left:0px; top:0px; width:'+mW+'px; height:'+mH+
   'px; z-index:980; '+
   (alpha!=null?'filter:alpha(opacity='+alpha+'); -moz-opacity:'+alpha+'%; opacity:'+(alpha/100):'')+
   '">'+dS+backCol+'; left:'+bordW+'px; top:'+bordW+'px; width:'+(mW-2*bordW)+'px; height:'+
   (mH-2*bordW)+'px; z-index:990"></div></div>';
 }
};

function addDropShadow(mObj, iS)
{
 for (var mN in mObj.menu)
 {
  var a=arguments, mD=mObj.menu[mN][0], addW=addH=0;
  if (mD.itemSty != iS) continue;
  for (var shad=2; shad<a.length; shad++)
  {
   var s = a[shad];
   var alpha = (s[0]!=null && navigator.userAgent.indexOf('AppleWebKit') == -1);
   if (isNS4) mD.extraHTML += '<layer bgcolor="'+s[1]+'" left="'+s[2]+'" top="'+s[3]+'" width="'+
    (mD.menuW+s[4])+'" height="'+(mD.menuH+s[5])+'" z-index="'+(arguments.length-shad)+'"></layer>';
   else mD.extraHTML += '<div style="position:absolute; background:'+s[1]+'; left:'+s[2]+
    'px; top:'+s[3]+'px; width:'+(mD.menuW+s[4])+'px; height:'+(mD.menuH+s[5])+'px; z-index:'+
    (a.length-shad)+'; '+
    (alpha?'filter:alpha(opacity='+s[0]+'); -moz-opacity:'+s[0]+'%; opacity:'+(s[0]/100):'')+
    '"></div>';
   addW=Math.max(addW, s[2]+s[4]);
   addH=Math.max(addH, s[3]+s[5]);
  }
  mD.menuW+=addW; mD.menuH+=addH;
 }
};