function buildProgMenus (pageType) {
    
var dotDot = "";
var imgPath = "../";

// overall menu placement on page -- same for all since header size is same
menuVert = 163;
menuHoriz = 160;
// Netscape 4.7 support
if (document.layers) {
    menuVert	= 188;
}

// If this is a sub-subpage, add a level for the image and link paths
if (pageType == "2") {
    var dotDot="../";
    var imgPath="../../";
}

// If this is a sub-sub-subpage, add a level for the image and link paths
if (pageType == "3") {
    var dotDot="../../";
    var imgPath="../../../";
}

if (pageType == "0") {
    var tableHead = "<table cellspacing=\"0\" cellpadding=\"0\""
    + "width=\"760\" border=\"0\">"
    + "<tr bgcolor=\"#f8d868\">"
    + "<td valign=\"top\" align=\"left\" width=\"133\" bgcolor=\"#F8D868\">"
    + "<img src=\""+imgPath+"images/gnav_start_piece.gif\" width=\"133\""
    + "height=\"38\" hspace=\"0\" vspace=\"0\" border=\"0\" alt=\"\"></td>"
    + "<td>&nbsp;</td></tr></table>";

} else {
    var tableHead = "<table cellspacing=\"0\" cellpadding=\"0\""
    + "width=\"760\" border=\"0\">"
    + "<tr bgcolor=\"#f8d868\">"
    + "<td valign=\"top\" align=\"left\" width=\"133\" "
    + "bgcolor=\"#F8D868\">"
    + "<a href=\""+dotDot+"index.html\""
    + "onmouseover=\"closeAll(2); imgAct('gnav7')\""
    + "onmouseout=\"imgInact('gnav7')\">"
    + "<img src=\""+imgPath+"/images/nav1_home_off.gif\" width=\"133\" height=\"38\""
    + "hspace=\"0\" vspace=\"0\" border=\"0\" alt=\"Home\""
    + "name=\"gnav7\"></a></td><td>&nbsp;</td></tr></table>";
}

BLANK_IMAGE=imgPath+"images/pixel.gif";
//keywords
var code="code";var url="url";var sub="sub";
//styles
var color = {"border":"#05305a", "shadow":"#DBD8D1", "bgON":"#f8d868","bgOVER":"#f8d868"};
var top_css = {"ON":"clsCMTopOn", "OVER":"clsCMTopOver"};
var degrees_css = {"ON":"degreesOn", "OVER":"degreesOver"};
var research_css = {"ON":"researchOn", "OVER":"researchOver"};
var people_css = {"ON":"peopleOn", "OVER":"peopleOver"};
var seminars_css = {"ON":"seminarsOn", "OVER":"seminarsOver"};
var contact_css = {"ON":"contactOn", "OVER":"contactOver"};


var STYLE = {"border":1, "shadow":2, "color":color, "css":top_css};
var DEGREES = {"border":0, "shadow":0, "color":color, "css":degrees_css};
var RESEARCH = {"border":0, "shadow":0, "color":color, "css":research_css};
var PEOPLE = {"border":0, "shadow":0, "color":color, "css":people_css};
var SEMINARS = {"border":0, "shadow":0, "color":color, "css":seminars_css};
var CONTACT = {"border":0, "shadow":0, "color":color, "css":contact_css};
var BORDER = {"border":1, "shadow":2, "color":color, "css":background_css};

var background_color = {"border":"#05305a", "shadow":"#DBD8D1", "bgON":"#f8d868","bgOVER":"#F8d868"};

var background_css = {"ON":"clsCMBackgroundOn", "OVER":"clsCMBackgroundOver"};
var backgroundw_css = {"ON":"clsCMBackgroundwOn", "OVER":"clsCMBackgroundwOver"};
var STYLE_BACKGROUND = {"border":1, "shadow":0, "color":background_color, "css":background_css};
var STYLE_BACKGROUNDW = {"border":1, "shadow":0, "color":background_color, "css":backgroundw_css};
var BULLET = "<img src=\""+imgPath+"images/bullet_pnav2.gif\" width=\"8\" height=\"8\" alt=\"\" hspace=\"0\" vspace=\"0\" border=\"0\">&nbsp;";
var INDENT = "&nbsp;&nbsp;&nbsp;<img src=\""+imgPath+"images/bullet_pnav2.gif\" width=\"8\" height=\"8\" alt=\"\" hspace=\"0\" vspace=\"0\" border=\"0\">&nbsp;";


// Here I use a trick to shrink the menu backgrounds such that the 
// borders on the tops and bottoms of each item are covered, leaving an
// overall border for the menu.  The spacing is different for different
// browsers and platforms.

var menuBgVertSize 	= 21;
var menuVertOffset	= 17;

// Default menu widths
var degreesWidth 	= 140;
var researchWidth 	= 140;
var peopleWidth 	= 140;
var seminarsWidth 	= 140;
var contactWidth 	= 140;

if (navigator.appName=="Netscape") {
    menuBgVertSize = 22;
    menuVertOffset = 17;
}


// Firefox for Mac
if ((navigator.userAgent.indexOf("Firefox") != -1) && (navigator.userAgent.indexOf("Mac") != -1)) {
    menuBgVertSize = 22;
    menuVertOffset = 18;
}

// IE for Mac
if ((navigator.userAgent.indexOf("MSIE") != -1) && (navigator.userAgent.indexOf("Mac") != -1)) {
    menuBgVertSize = 18;
    menuVertOffset = 16;
}

// Safari
if (navigator.userAgent.indexOf("Safari") != -1) {
    peopleWidth = 140;
}

// Netscape 7 on Solaris
if ((navigator.userAgent.indexOf("Netscape/7.0") != -1) && (navigator.userAgent.indexOf("SunOS") != -1)) {
    peopleWidth = 150;
}

// Netscape 4.7 
if (document.layers) {
    menuVertOffset = 18;
}




// navigation menu items and formats for COOLjsMenu code
var MENU_ITEMS_STYLING =
[
	{pos:[menuHoriz,menuVert], itemoff:[0,86], leveloff:[21,0], style:STYLE, size:[22,102]},
	{code:"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",url:dotDot+"degrees/",format:{style:DEGREES,size:[22,136],leveloff:[22,-2]},
		sub:[
			{itemoff:[menuVertOffset,0], size:[menuBgVertSize,degreesWidth]},
			{code:BULLET+"Programs", url:dotDot+"degrees/programs.html",format:{style:STYLE_BACKGROUND}},
			{code:BULLET+"M.S. Requirements", url:dotDot+"degrees/ms.html",format:{style:STYLE_BACKGROUND}},
			{code:BULLET+"Ph.D. Requirements", url:dotDot+"degrees/phd.html",format:{style:STYLE_BACKGROUND}},
			{code:BULLET+"Courses", url:dotDot+"courses/",format:{style:STYLE_BACKGROUND}},
			{code:BULLET+"Admissions", url:dotDot+"degrees/admissions.html",format:{style:STYLE_BACKGROUND}}
		]
	},
	{code:"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", url:dotDot+"research/", format:{style:RESEARCH,itemoff:[0,160],leveloff:[22,-20],size:[22,86]},
		sub:[
			{itemoff:[menuVertOffset,0], size:[menuBgVertSize,researchWidth]},
			{code:BULLET+"Research Areas", url:dotDot+"research/research.html",format:{style:STYLE_BACKGROUND}},
			{code:BULLET+"Publications", url:dotDot+"research/publications.php",format:{style:STYLE_BACKGROUND}},
		]
	},
	{code:"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", url:dotDot+"people/", format:{style:PEOPLE,itemoff:[0,100],leveloff:[22,-20],size:[22,55]},
		sub:[
			{itemoff:[menuVertOffset,0],size:[menuBgVertSize,peopleWidth]},
			{code:BULLET+"Faculty", url:dotDot+"people/faculty.php",format:{style:STYLE_BACKGROUND}},
			{code:BULLET+"Alumni", url:"http://coe.berkeley.edu/forms/alumni/alumni-address-update-form",format:{style:STYLE_BACKGROUND}},
		]
	},
	{code:"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", url:"http://events.berkeley.edu/index.php/calendar/sn/cee.html?filter=Secondary%20Event%20Type&filtersel=1098", format:{style:SEMINARS,itemoff:[0,85],leveloff:[22,-25],size:[22,69]}},
	{code:"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", url:dotDot+"contact.html", format:{style:CONTACT,itemoff:[0,97],leveloff:[22,-20],size:[22,72]}}
];

    /* Set up the background table with the home link */
    document.write(tableHead);
    /* Now put the menu all together */
    new COOLjsMenu("menu1", MENU_ITEMS_STYLING); 
}
