
var hBar = new ItemStyle(22, 3, '&gt;', -13, 2, '#5F8E96', '#5F8E96', 'highText', 'highText', 'itemBorder', 'itemBorder',
 80, null, 'hand', 'default');

var subM = new ItemStyle(22, 0, '&gt;', -13, 2, '#CCCCcc', '#9f9f9f', 'lowText', 'highText',
 'itemBorder', 'itemBorder', 75, null, 'hand', 'default');

function tableXposition() { //mine :)
	if (document.body.clientWidth > 1000) {  //mine :)
		return (document.body.clientWidth/2 - 55 - 329 - 85)
	} else {
		return (document.body.clientWidth/2 - 55 - 329)
	}
}

var pMenu = new PopupMenu('pMenu');
with (pMenu) {

startMenu('root', true, 'tableXposition();', 108, 110, hBar);
addItem('&nbsp; College Home', 'http://engineering.uakron.edu', '');
addItem('&nbsp; Dean&acute;s Office', 'http://engineering.uakron.edu/deansoffice.php', '');
addItem('&nbsp; Departments', 'mDepartments', 'sm:');
addItem('&nbsp; Programs', 'mPrograms', 'sm:');
addItem('&nbsp; Other Offices', 'mOtherOffices', 'sm:');
addItem('&nbsp; Student Groups', 'mStudentGroups', 'sm:');
addItem('&nbsp; People', 'mPeople', 'sm:');
addItem('&nbsp; Make a Gift', 'http://www.uakron.edu/development/', '');

	startMenu('mDepartments', true, 112, 0, 110, subM);
	addItem('Biomedical', 'http://www.biomed.uakron.edu/', '');
	addItem('Chemical', 'http://chemical.uakron.edu/', '');
	addItem('Civil', 'http://civil.uakron.edu/', '');
	addItem('Elec. & Comp.', 'http://ece.uakron.edu/', '');
	addItem('Mechanical', 'mMechanical', 'sm:');
	
		startMenu('mMechanical', true, 112, 0, 150, subM);
		addItem('Homepage', 'http://mechanical.uakron.edu/', '');
		addItem('Faculty & Staff', 'http://mechanical.uakron.edu/facultystaff.php', '');
		addItem('Undergraduate', 'http://mechanical.uakron.edu/undergraduate.php', '');
		addItem('Graduate', 'http://mechanical.uakron.edu/graduate.php', '');
		addItem('Certificate Prgms.', 'http://mechanical.uakron.edu/certificate.php', '');
		addItem('Laboratories', 'http://mechanical.uakron.edu/labs.php', '');
		addItem('Advisory Council', 'http://mechanical.uakron.edu/advisorycouncil.php', '');
		addItem('Available Positions', 'http://mechanical.uakron.edu/jobs.php', '');
		addItem('Outcomes and Objectives ', 'http://mechanical.uakron.edu/poao.php', '');

	startMenu('mPrograms', true, 112, 0, 145, subM);
	addItem('Undergraduate', 'http://engineering.uakron.edu/undergraduate.html', '');
	addItem('Graduate', 'http://engineering.uakron.edu/graduate.html', '');
	addItem('Cooperative Education', 'http://engineering.uakron.edu/coop/', '');
	addItem('IDEAs', 'http://engineering.uakron.edu/ideas-home.php', '');
	addItem('Women in Engineering', 'mProgramsmWiep', 'sm:');

		startMenu('mProgramsmWiep', true, 147, 0, 110, subM);
		addItem('Home', 'http://wiep.uakron.edu/index.html', '');
		addItem('About', 'http://wiep.uakron.edu/about.html', '');
		addItem('WIE Chair', 'http://wiep.uakron.edu/wiechair.html', '');
		addItem('Staff', 'http://wiep.uakron.edu/staff.html', '');
		addItem('Choose U of A', 'http://wiep.uakron.edu/chooseuofa.html', '');
		addItem('For Students', 'http://wiep.uakron.edu/students.html', '');
		addItem('Alumnae', 'http://wiep.uakron.edu/alumnae.html', '');
		addItem('Advisory Council', 'http://wiep.uakron.edu/advisorycouncil.html', '');
		addItem('Sponsors', 'http://wiep.uakron.edu/sponsors.html', '');
		addItem('Scrapbook', 'http://wiep.uakron.edu/scrapbook.html', '');

	startMenu('mOtherOffices', true, 112, 0, 162, subM);
	addItem('Comp. & Networking Serv.', 'mOtherOfficesECNS', 'sm:');
		
		startMenu('mOtherOfficesECNS', true, 164, 0, 110, subM);
		addItem('Home', 'http://engineering.uakron.edu/~ecns/index.php', '');
		addItem('Services', 'http://engineering.uakron.edu/~ecns/services.php', '');
		addItem('Staff', 'http://engineering.uakron.edu/~ecns/staff.php', '');
		addItem('Work Schedule', 'http://engineering.uakron.edu/~ecns/schedule.php', '');
		
	startMenu('mStudentGroups', true, 112, 0, 110, subM);
	addItem('AIChE', 'http://engineering.uakron.edu/~aiche/', '');
	addItem('ASCE', 'http://civil.uakron.edu/asce/index.html', '');
	addItem('ASME', 'http://engineering.uakron.edu/~asme/', '');
	addItem('BMES', 'http://guts.biomed.uakron.edu/bmes/', '');
	addItem('IEEE', 'http://engineering.uakron.edu/~ieee/index.html', '');
	addItem('NSBE', 'http://www.uakron.edu/nsbe/', '');
	addItem('SAE', 'http://engineering.uakron.edu/~sae/SAE/introduction.html', '');
	addItem('SWE', 'http://engineering.uakron.edu/~swe/', '');
	addItem('Descriptions', 'http://engineering.uakron.edu/groups.html', '');
	
	startMenu('mPeople', true, 112, 0, 110, subM);
	addItem('Home', 'http://engineering.uakron.edu/people/index.html', '');
	addItem('Faculty & Staff', 'http://engineering.uakron.edu/people/facultystaff.php', '');
	addItem('Awards', 'http://engineering.uakron.edu/people/awards.html', '');
	addItem('Seminars', 'http://engineering.uakron.edu/people/seminars.html', '');
	addItem('Faculty Research', 'http://engineering.uakron.edu/research/research.html', '');

}

addDropShadow(pMenu, window.subM,
 [25,"#333333",3,3,-4,-4], [25,"#666666",2,2,0,0]);
//addDropShadow(pMenu, window.subBlank,
// [25,"#333333",3,3,-4,-4], [25,"#666666",2,2,0,0]);



if (!isOp && navigator.userAgent.indexOf('rv:0.')==-1)
{
 pMenu.showMenu = new Function('mN','menuAnim(this, mN, 20)');
 pMenu.hideMenu = new Function('mN','menuAnim(this, mN, -10)');
}



if (!isNS4)
{
 pMenu.update(true);
}
else
{
 var popOldOL = window.onload;
 window.onload = function()
 {
  if (popOldOL) popOldOL();
  pMenu.update();
 }
}

var nsWinW = window.innerWidth, nsWinH = window.innerHeight, popOldOR = window.onresize;
window.onresize = windowresized;
function windowresized() {
 if (popOldOR) popOldOR();
 if (isNS4 && (nsWinW!=innerWidth || nsWinH!=innerHeight)) history.go(0);
 pMenu.position();
}

window.onscroll = function()
{
 pMenu.position();
}

if (isNS4)
{
 document.captureEvents(Event.CLICK);
 document.onclick = function(evt)
 {
  with (pMenu) if (overI) click(overM, overI);
  return document.routeEvent(evt);
 }
}

if (!isIE || isOp)
{
 var nsPX=pageXOffset, nsPY=pageYOffset;
 setInterval('if (nsPX!=pageXOffset || nsPY!=pageYOffset) ' +
 '{ nsPX=pageXOffset; nsPY=pageYOffset; window.onscroll() }', 50);
}





// ANIMATION:
//
// Each menu object you create by default shows and hides its menus instantaneously.
// However you can override this behaviour with custom show/hide animation routines,
// as we have done in the "Menu Effects" section. Feel free to edit this, or delete
// this entire function if you're not using it. Basically, make functions to handle
// menuObj.showMenu() and .hideMenu(), both of which are passed menu names.
//
// Customisers: My lyr.clip() command gets passed the parameters (x1, y1, x2, y2)
// so you might want to adjust the direction etc. Oh, and I'm adding 2 to the dimensions
// to be safe due to different box models in some browsers.
// Another idea: add some if/thens to test for specific menu names...?


function menuAnim(menuObj, menuName, dir)
{
 // The array index of the named menu (e.g. 'mFile') in the menu object (e.g. 'pMenu').
 var mD = menuObj.menu[menuName][0];
 // Add timer and counter variables to the menu data structure, we'll need them.
 if (!mD.timer) mD.timer = 0;
 if (!mD.counter) mD.counter = 0;

 with (mD)
 {
  // Stop any existing animation.
  clearTimeout(timer);

  // If the layer doesn't exist (cross-frame navigation) quit.
  if (!lyr || !lyr.ref) return;
  // Show the menu if that's what we're doing.
  if (dir>0) lyr.vis('visible');
  // Also raise showing layers above hiding ones.
  lyr.sty.zIndex = 1001 + dir;

  // Alpha fade in IE5.5+. Mozilla's opacity isn't well suited to this as it's an inheritable
  // property rather than a block-level filter, and it's slow, but uncomment and try it perhaps.
  // WARNING: This looks funny if you're mixing opaque and translucent items e.g. solid menus
  // with dropshadows. If you're going to use it, make sure all your alpha values for a given
  // menus are numbers, or they're all null (solid).
  //if (isIE && window.createPopup) lyr.alpha(counter&&(counter<100) ? counter : null);

  // Clip the visible area. Tweak this if you want to change direction/acceleration etc.
  lyr.clip(0, 0, menuW+2, (menuH+2)*Math.pow(Math.sin(Math.PI*counter/200),0.75) );
  // Remove clipping in NS6 on completion, seems to help old versions.
  if ((isDOM&&!isIE) && (counter>=100)) lyr.sty.clip='';

  // Increment the counter and if it hasn't reached the end (10 steps either way),
  // set the timer to call the show/hide function again in 40ms.
  counter += dir;
  if (counter>100) counter = 100;
  else if (counter<0) { counter = 0; lyr.vis('hidden') }
  else timer = setTimeout(menuObj.myName+'.'+(dir>0?'show':'hide')+'Menu("'+menuName+'")', 40);
 }
}

// Here's the alternative IE5.5+ filter animation function.
function menuFilterShow(menuObj, menuName, filterName)
{
 var mD = menuObj.menu[menuName][0];
 with (mD.lyr)
 {
  sty.filter = filterName;
  var f = ref.filters;
  if (f&&f.length&&f[0]) f[0].Apply();
  vis('visible');
  if (f&&f.length&&f[0]) f[0].Play();
 }
}



// BORDERS AND DROPSHADOWS:
//
// Here's the menu border and dropshadow functions we call above. Edit ot delete if you're
// not using them. Basically, they assign a string to pMenu.menu.menuName[0].extraHTML, which
// is written to the document with the menus as they are created -- the string can contain
// anything you want, really. They also adjust the menu dimensions and item positions
// to suit. Dig out the Object Browser script and open up "pMenu" for more info.

function addMenuBorder(mObj, iS, alpha, bordCol, bordW, backCol, backW)
{
 // Loop through the menu array of that object, finding matching ItemStyles.
 for (var mN in mObj.menu)
 {
  var mR=mObj.menu[mN], dS='<div style="position:absolute; background:';
  if (mR[0].itemSty != iS) continue;
  // Loop through the items in that menu, move them down and to the right a bit.
  for (var mI=1; mI<mR.length; mI++)
  {
   mR[mI].iX += bordW+backW;
   mR[mI].iY += bordW+backW;
  }
  // Extend the total dimensions of menu accordingly.
  mW = mR[0].menuW += 2*(bordW+backW);
  mH = mR[0].menuH += 2*(bordW+backW);

  // Set the menu's extra content string with divs/layers underneath the items.
  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/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)
{
 // Pretty similar to the one above, just loops through list of extra parameters making
 // dropshadow layers (from arrays) and extending the menu dimensions to suit.
 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];
   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)+'; '+(s[0]!=null?'filter:alpha(opacity='+s[0]+'); -moz-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;
 }
}