/****************************************************
*               Jim's DHTML Menu v1.1               *
*                DHTML Cascading Menu               *
*                    (IE4+, NS6+)                   *
*               Programmer:  Jim Salyer             *
****************************************************/

// Below are the global variables and the menu arrrays.  Please edit only those two sections.
// A list of symbols for sub-menu indicators, cursor types, etc. can be found in read-me.txt.

var numOfMenus    = 4;          // Set the total number of menus (including the main menu).
var hideTimer     = 500;        // Set the timer to hide menus (in milliseconds).
var menuOffsetH   = 2;          // Set the horizontal offset of sub-menus (in pixels). This is how many pixels the menus appear across from each other.
var menuOffsetV   = 0;          // Set the vertical offset of sub-menus (in pixels).  This is how many pixels the menus appear down from each other.
var mainMenuH     = false;      // Set whether or not the main menu is horizontal or vertical (true for horizontal and false for vertical).
var mainMenuLeft  = 5;          // Set the distance between the left edge of the document and the menu (in pixels).
var mainMenuTop   = 350;         // Set the distance between the top edge of the document and the menu (in pixels).
var menuShowOpt   = 'over';     // Set whether or not you want the sub-menus to show on mouse over or mouse click ('over' for over and 'click' for click).
var menuHideOpt   = 'out';      // Set whether or not you want the sub-menus to hide on mouse out or mouse click outside the menu ('out' for out and 'click' for click).
var bgType        = 'color';    // Set the type of background to be used ('color', 'image', or 'none').
var bgColorOver   = 'blue';    // Set the background color of the menu item on mouse over.
var bgColorOut    = 'maroon';   // Set the background color of the menu item on mouse out.
var bgImage       = '';         // Set the URL of the menu's background image.
var brdrBtwnItems = true;       // Set the option to have a border between menu items (true or false).
var borderWidth   = 2;          // Set the width of the border of the menu and its items (in pixels).
var borderStyle   = 'solid';    // Set the border style of the menu and its items ('solid', 'dashed', 'dotted', etc.).
var borderColor   = 'black';    // Set the border color of the menu and its items.
var fontFamily    = 'Verdana';  // Set the name of the font for menu text.
var fontSize      = 13;         // Set the font size of menu text (in pixels).
var fontStyle     = 'normal';   // Set the font style of menu text ('normal', 'italic', 'strikethrough', etc.).
var fontWeight    = 'bold';     // Set the font weight of menu text ('normal' or 'bold').
var fontColorOver = 'yellow';   // Set the color of the text on mouse over.
var fontColorOut  = 'yellow';    // Set the color of the text on mouse out.
var markType      = 'symbol';   // Set the type of sub-menu marker ('image' or 'symbol').
var markImgHOver  = '';         // Set the URL of the mouse over horizontal sub-menu marker.
var markImgHOut   = '';         // Set the URL of the mouse out horizontal sub-menu marker.
var markImgVOver  = '';         // Set the URL of the mouse over vertical sub-menu marker.
var markImgVOut   = '';         // Set the URL of the mouse out vertical sub-menu marker.
var markSymH      = 'v';        // Set the HTML code of the horizontal sub-menu marker symbol.
var markSymV      = '&raquo;';  // Set the HTML code of the vertical sub-menu marker symbol.
var menuZIndex    = 1000;       // Set the z-index of all the menus in the menu system (make sure its bigger than the # of elements on your page).
var menuCursor    = 'hand';     // Set the cursor style for the menus on mouse over in IE4+.
var menuCursorNS  = 'pointer';  // Set the cursor style for the menus on mouse over in NS6+.
var itemTxtDec    = 'none';     // Set the text decoration for text within menu items.
var imgTrans      = 'off';      // Set whether or not you want a fading transition for rollover images.

// Please try to set the menuPadding and borderWidth variables to the same value.  They can be as large or small as you like, but making one larger or smaller will stretch or compress the other.
// If you want your menus to open and close on a click, then try setting your timer to a larger number than you would normally set it to.
// Be careful not to set your font size too big.  It may squish the inner borders of the menus.  If you want to use a bigger font, adjust the height of your menu items accordingly.

// Below are arrays that hold the widths and heights of the menu items.  Edit these arrays according to the template below.
// If the menu is vertical, make all of the item widths the same number.  If the menu is horizontal (only applies on main menu), make all the heights the same number.

var menu0Heights = new Array();
menu0Heights[0] = 30;
menu0Heights[1] = 30;
menu0Heights[2] = 30;
menu0Heights[3] = 30;
menu0Heights[4] = 30;
menu0Heights[5] = 30;
menu0Heights[6] = 30;
menu0Heights[7] = 30;
menu0Heights[8] = 30;
menu0Heights[9] = 30;
menu0Heights[10] = 30;
menu0Heights[11] = 30;
menu0Heights[12] = 30;

var menu0Widths = new Array();
menu0Widths[0] = 235;
menu0Widths[1] = 235;
menu0Widths[2] = 235;
menu0Widths[3] = 235;
menu0Widths[4] = 235;
menu0Widths[5] = 235;
menu0Widths[6] = 235;
menu0Widths[7] = 235;
menu0Widths[8] = 235;
menu0Widths[9] = 235;
menu0Widths[10] = 235;
menu0Widths[11] = 235;
menu0Widths[12] = 235;

var menu1Heights = new Array();
menu1Heights[0] = 30;
menu1Heights[1] = 30;
//menu1Heights[2] = 20;
//menu1Heights[3] = 20;

var menu1Widths = new Array();
menu1Widths[0] = 125;
menu1Widths[1] = 125;
//menu1Widths[2] = 125;
//menu1Widths[3] = 125;

var menu2Heights = new Array();
menu2Heights[0] = 30;
menu2Heights[1] = 30;

var menu2Widths = new Array();
menu2Widths[0] = 125;
menu2Widths[1] = 125;

var menu3Heights = new Array();
menu3Heights[0] = 30;
menu3Heights[1] = 30;
menu3Heights[2] = 30;

var menu3Widths = new Array();
menu3Widths[0] = 125;
menu3Widths[1] = 125;
menu3Widths[2] = 125;

// Do not edit any of this code until you reach the arrays calling the BuildItem and BuildMenu functions!!!

var theBrowser = '';
function BrowserDetect()
{
	if (navigator.appName == 'Microsoft Internet Explorer')
	{
		if (parseInt(navigator.appVersion) >= 3)
			theBrowser = 'IE';
		else
			theBrowser = '';
	}
	else if (navigator.appName == 'Netscape')
	{
		if (parseInt(navigator.appVersion) >= 5)
			theBrowser = 'NS6';
		else
			theBrowser = '';
	}
	else
		theBrowser = '';
}

BrowserDetect();

function RetElem(theName)
{
	if (theBrowser == 'IE')
		return(document.all[theName]);
	else if (theBrowser == 'NS6')
		return(document.getElementById(theName));
}

function HideLoop(num)
{
	RetElem('menu' + num).style.visibility = 'hidden';
}

var menusShown = false;

function KeepMenuOpen()
{
	menusShown = true;
}

function HideAll()
{
	menusShown = false;
	for (i=1; i<=numOfMenus-1; i++)
		HideLoop(i);
}

function CheckAgain()
{
	if (menusShown == false)
		HideAll();
}

function Check()
{
	menusShown = false;
	setTimeout('CheckAgain()', hideTimer);
}

function HideAfter(menuNum)
{
	menusShown = true;
	for (i=menuNum+1; i<=numOfMenus-1; i++)
		HideLoop(i);
}

function HideBeforeShow(menuNum, parentMenuNum)
{
	HideAfter(menuNum);
	for (i=menuNum-1; i>=1; i--)
		HideLoop(i);
}

function CheckAbs(num)
{
	if (num == 0)
		num = num;
	else
		num = abs(num);
	return(num);
}

function Show(menuNum, parentMenuNum, itemNum, showDir)
{
	menusShown = true;
	HideBeforeShow(menuNum, parentMenuNum);

	if (showDir == 'l')
	{
		var menuLeft = RetElem('menu' + parentMenuNum).offsetLeft + RetElem('menu' + parentMenuNum).offsetWidth - menuOffsetH;
		var menuTop = RetElem('menu' + parentMenuNum).offsetTop + RetElem('menu' + parentMenuNum + 'item' + itemNum).offsetTop + menuOffsetV;
		if (itemNum == 0)
			menuTop = RetElem('menu' + parentMenuNum).offsetTop + menuOffsetV;
	}
	else if (showDir == 'r')
	{
		var menuLeft = RetElem('menu' + parentMenuNum).offsetLeft + RetElem('menu' + parentMenuNum).offsetWidth - menuOffsetH;
		var menuTop = RetElem('menu' + parentMenuNum).offsetTop + RetElem('menu' + parentMenuNum + 'item' + itemNum).offsetTop + menuOffsetV;
		if (itemNum == 0)
			menuTop = RetElem('menu' + parentMenuNum).offsetTop + menuOffsetV;
	}
	else if (showDir == 't')
	{
		var menuLeft = RetElem('menu' + parentMenuNum).offsetLeft + RetElem('menu' + parentMenuNum + 'item' + itemNum).offsetLeft;
		var menuTop = RetElem('menu' + parentMenuNum).offsetTop - RetElem('menu' + parentMenuNum).offsetHeight + menuOffsetV;
	}
	else if (showDir == 'b')
	{
		var menuLeft = RetElem('menu' + parentMenuNum).offsetLeft + RetElem('menu' + parentMenuNum + 'item' + itemNum).offsetLeft;
		var menuTop = RetElem('menu' + parentMenuNum).offsetTop + RetElem('menu' + parentMenuNum).offsetHeight - menuOffsetV;
	}

	var theTempLeft = menuLeft;
	var theTempTop  = menuTop;

	if ((menuLeft + RetElem('menu' + menuNum).offsetWidth) > document.body.clientWidth)
		menuLeft -= (menuLeft + RetElem('menu' + menuNum).offsetWidth) - document.body.clientWidth;
	else if (menuLeft < document.body.clientLeft)
		menuLeft += CheckAbs(menuLeft);
	else if ((menuTop + RetElem('menu' + menuNum).offsetHeight) > document.body.clientHeight)
		menuTop -= (menuTop + RetElem('menu' + menuNum).offsetHeight) - document.body.clientHeight;
	else if (menuTop < document.body.clientTop)
		menuTop += CheckAbs(menuTop);

	if (RetElem('menu' + menuNum).offsetHeight > document.body.offsetHeight)
		menuTop = theTempTop;
	else if (RetElem('menu' + menuNum).offsetWidth > document.body.offsetWidth)
		menuLeft = theTempLeft;

	RetElem('menu' + parentMenuNum).style.visibility = 'visible';

	RetElem('menu' + menuNum).style.left       = menuLeft + 'px';
	RetElem('menu' + menuNum).style.top        = menuTop + 'px';
	RetElem('menu' + menuNum).style.visibility = 'visible';
}

function MenuHeight(menuHeights)
{
	var totalHeight = 0;
	for (i=0; i<=menuHeights.length-1; i++)
	{
		totalHeight += menuHeights[i];
		if (theBrowser == 'NS6')
			totalHeight += borderWidth * 3;
	}
	if (theBrowser == 'NS6')
		totalHeight -= borderWidth;
	else if (theBrowser == 'IE' && brdrBtwnItems == false)
		totalHeight += borderWidth * 4;
	else
		totalHeight += borderWidth;
	return(totalHeight);
}

function MenuWidth(menuWidths)
{
	var totalWidth = 0;
	for (i=0; i<=menuWidths.length-1; i++)
	{
		totalWidth += menuWidths[i];
		if (theBrowser == 'NS6')
			totalWidth += borderWidth * 3;
	}
	if (theBrowser == 'NS6')
		totalWidth -= borderWidth;
	else if (theBrowser == 'IE' && brdrBtwnItems == false)
		totalWidth += borderWidth * 4;
	else
		totalWidth += borderWidth;
	return(totalWidth);
}

function BuildItem(heightList, widthList, itemContent, contentCentered, itemLink, itemTarget, itemNum, menuToOpenNum, showDir, parentMenuNum)
{
	var collectHeight = 0;
	var collectWidth = 0;
	if (theBrowser == 'IE')
		var menuPadding = 2;
	else
		var menuPadding = borderWidth;

	for (i=itemNum-1; i>=0; i--)
	{
		collectHeight += heightList[i];
		collectWidth += widthList[i];
		if (theBrowser == 'NS6')
		{
			collectHeight += borderWidth * 3;
			collectWidth += borderWidth * 3;
		}
		
		if (theBrowser == 'IE' && brdrBtwnItems == true)
		{
			if (borderWidth > 2)
			{
				collectHeight += borderWidth;
				collectWidth += borderWidth;
			}
			else if (borderWidth < 2)
			{
				collectHeight -= borderWidth;
				collectWidth -= borderWidth;
			}
		}
	}

	var itemLeft = 0;
	var itemTop = 0;

	if (itemNum !== heightList.length-1)
	{
		if (brdrBtwnItems == true)
			itemBorder = 'border-bottom:' + borderWidth + 'px ' + borderStyle + ' ' + borderColor + ';';
		else
			itemBorder = '';
	}
	else
		itemBorder = '';

	if (parentMenuNum == 0 && mainMenuH == true)
	{
		itemLeft = collectWidth;
		itemTop = 0;
		if (itemNum == 0)
			itemLeft = 0;

		if (itemNum !== heightList.length-1)
		{
			if (brdrBtwnItems == true)
				itemBorder = 'border-right:' + borderWidth + 'px ' + borderStyle + ' ' + borderColor + ';';
			else
				itemBorder = '';
		}
		else
			itemBorder = '';
	}
	else
	{
		itemLeft = 0;
		itemTop = collectHeight;
		if (itemNum == 0)
			itemTop = 0;
	}

	if (itemContent.substr(0, 9) == 'rollover?')
	{
		var rolloverArray = itemContent.split('?');
		var rollFunction1 = 'ChangeImg(\'menu' + parentMenuNum + 'rollover' + itemNum + '\', ' + parentMenuNum + ', ' + itemNum + ', \'' + rolloverArray[2] + '\');';
		var rollFunction2 = 'ChangeImgBack(\'menu' + parentMenuNum + 'rollover' + itemNum + '\', ' + parentMenuNum + ', ' + itemNum + ', \'' + rolloverArray[1] + '\');';
		var theContent = '<img border="0" name="menu' + parentMenuNum + 'rollover' + itemNum + '" onMouseover="' + rollFunction1 + '" onMouseout="' + rollFunction2 + '" src="' + rolloverArray[1] + '">';
	}
	else
		var theContent = itemContent;

	if (contentCentered == 'yes')
	{
		var centerTag1 = '<center>';
		var centerTag2 = '</center>';
	}
	else
	{
		var centerTag1 = '';
		var centerTag2 = '';
	}

	var itemFont = centerTag1 + '<font color="' + fontColorOut + '" face="' + fontFamily + '" id="menu' + parentMenuNum + 'font' + itemNum + '" style="width:' + (widthList[itemNum] - 10) + 'px; font-family:' + fontFamily + '; font-size:' + fontSize + 'px; font-style:' + fontStyle + '; font-weight:' + fontWeight + '; text-decoration:' + itemTxtDec + ';">' + theContent + '</font>' + centerTag2;

	var bgFunction1 = 'ChangeBg(\'menu' + parentMenuNum + '\', ' + itemNum + ');';
	var bgFunction2 = 'ChangeBgBack(\'menu' + parentMenuNum + '\', ' + itemNum + ');';
	var fontFunction1 = 'ChangeFont(\'menu' + parentMenuNum + 'font' + itemNum + '\', ' + itemNum + ', ' + parentMenuNum + ', ' + itemNum + ');';
	var fontFunction2 = 'ChangeFontBack(\'menu' + parentMenuNum + 'font' + itemNum + '\', ' + itemNum + ', ' + parentMenuNum + ', ' + itemNum + ');';
	
	var theMarker = '';
	var showFunction = '';
	var markFunction1 = '';
	var markFunction2 = '';
	if (menuToOpenNum !== 0)
	{
		if (markType == 'image')
		{
			if (parentMenuNum == '0' && mainMenuH == true)
				theMarker = '<img direction="h" name="menu' + parentMenuNum + 'mark' + itemNum + '" src="' + markImgHOut + '" style="position:absolute; top:2px; left:' + (widthList[itemNum] - (borderWidth + 10)) + 'px;" vSpace="' + (fontSize / 3) + '">';
			else
			 	theMarker = '<img direction="v" name="menu' + parentMenuNum + 'mark' + itemNum + '" src="' + markImgVOut + '" style="position:absolute; top:2px; left:' + (widthList[itemNum] - (borderWidth + 10)) + 'px;" vSpace="' + (fontSize / 3) + '">';

			showFunction = 'Show(' + menuToOpenNum + ', ' + parentMenuNum + ', ' + itemNum + ', \'' + showDir + '\');';
			markFunction1 = 'ChangeMarkerImg(\'menu' + parentMenuNum + 'mark' + itemNum + '\', ' + parentMenuNum + ', ' + itemNum + ');';
			markFunction2 = 'ChangeMarkerImgBack(\'menu' + parentMenuNum + 'mark' + itemNum + '\', ' + parentMenuNum + ', ' + itemNum + ');';
		}
		else if (markType == 'symbol')
		{
			if (parentMenuNum == 0 && mainMenuH == true)
				theMarker = '<font color=' + fontColorOut + ' face=' + fontFamily + ' id=menu' + parentMenuNum + 'mark' + itemNum + ' style=position:absolute;top:0px;left:' + (widthList[itemNum] - (borderWidth + 10)) + 'px;font-size:' + fontSize + 'px;font-style:' + fontStyle + ';font-weight:' + fontWeight + ';>' + markSymH + '</font>';
			else
				theMarker = '<font color=' + fontColorOut + ' face=' + fontFamily + ' id=menu' + parentMenuNum + 'mark' + itemNum + ' style=position:absolute;top:0px;left:' + (widthList[itemNum] - (borderWidth + 10)) + 'px;font-size:' + fontSize + 'px;font-style:' + fontStyle + ';font-weight:' + fontWeight + ';>' + markSymV + '</font>';

			showFunction = 'Show(' + menuToOpenNum + ', ' + parentMenuNum + ', ' + itemNum + ', \'' + showDir + '\');';
			markFunction1 = 'ChangeMarker(\'menu' + parentMenuNum + 'mark' + itemNum + '\', ' + parentMenuNum + ', ' + itemNum + ');';
			markFunction2 = 'ChangeMarkerBack(\'menu' + parentMenuNum + 'mark' + itemNum + '\', ' + parentMenuNum + ', ' + itemNum + ');';
		}
		else
			showFunction = 'Show(' + menuToOpenNum + ', ' + parentMenuNum + ', ' + itemNum + ', \'' + showDir + '\');';
	}
	else
	{
		showFunction = 'HideAfter(' + parentMenuNum + ');';
		theMarker = '';
		markFunction1 = '';
		markFunction2 = '';
	}

	var theHeight = 0;
	var theWidth = 0;
	var theHeightTemp = heightList[itemNum];
	var theWidthTemp = widthList[itemNum];
	if (theBrowser == 'IE' && brdrBtwnItems == true)
	{
		if (borderWidth > 2)
		{
			theHeight = theHeightTemp + borderWidth;
			theWidth = theWidthTemp + borderWidth;
		}
		else if (borderWidth < 2)
		{
			theHeight = theHeightTemp - borderWidth;
			theWidth = theWidthTemp - borderWidth;
		}
		else
		{
			theHeight = theHeightTemp;
			theWidth = theWidthTemp;
		}
	}
	else
	{
		theHeight = theHeightTemp;
		theWidth = theWidthTemp;
	}

	if (theBrowser == 'IE' && itemNum == heightList.length-1)
	{
		if (parentMenuNum == 0 && mainMenuH == true)
			theWidth -= borderWidth;
		else
			theHeight -= borderWidth;
	}
	
	var itemString = '';
	var theFunction = '';
	var theFunction2 = '';
	if (menuShowOpt == 'over')
	{
		theFunction = showFunction;
		theFunction2 = 'KeepMenuOpen()';
	}
	else if (menuShowOpt == 'click')
	{
		if (menuToOpenNum == 0)
			var theFunction = 'HideAfter(' + parentMenuNum + ');';
		else
			var theFunction = 'KeepMenuOpen();';
		theFunction2 = showFunction;
	}
	itemString += '<a href=' + itemLink + ' style="text-decoration:' + itemTxtDec + ';" target="' + itemTarget + '">';
	itemString += '<div id="menu' + parentMenuNum + 'item' + itemNum + '" onClick="' + theFunction2 + '" onMouseover="' + theFunction + ' ' + bgFunction1 + ' ' + fontFunction1 + ' ' + markFunction1 + '" onMouseout="' + bgFunction2 + ' ' + fontFunction2 + ' ' + markFunction2 + '" style="padding:' + menuPadding + 'px; cursor:' + menuCursorNS + '; cursor:' + menuCursor + '; height:' + theHeight + 'px; width:' + theWidth + 'px; position:absolute; left:' + itemLeft + 'px; top:' + itemTop + 'px; background-color:' + bgColorOut + '; ' + itemBorder + '">';
	itemString += '  ' + itemFont + theMarker;
	itemString += '</div>';
	itemString += '</a>';
	return(itemString);
}

function BuildMenu(parentMenuNum, heightList, widthList, itemArray)
{
	var hideFunction1 = '';
	var hideFunction2 = '';
	if (menuHideOpt == 'out')
		hideFunction1 = 'Check()';
	else if (menuHideOpt == 'click')
		hideFunction2 = 'Check()';

	var theLeft = 0;
	var theTop = 0;
	var theHeight = 0;
	var theWidth = 0;
	var theVisibility = 'visible';
	if (theBrowser == 'IE')
		var menuPadding = 2;
	else
		var menuPadding = borderWidth;

	if (parentMenuNum == 0)
	{
		theLeft = mainMenuLeft;
		theTop = mainMenuTop;
		if (mainMenuH == true)
		{
			theHeight = heightList[0] + (borderWidth * 2);
			theWidth = MenuWidth(widthList);
		}
		else
		{
			theHeight = MenuHeight(heightList);
			theWidth = widthList[0] + (borderWidth * 2);
		}
	}
	else
	{
		theLeft = 0;
		theTop = 0;
		theHeight = MenuHeight(heightList);
		theWidth = widthList[0] + (borderWidth * 2);
		theVisibility = 'hidden';
	}

	if (theBrowser == 'IE' && brdrBtwnItems == true)
	{
		if (borderWidth > 2)
		{
			theHeight += borderWidth;
			theWidth += borderWidth;
		}
		else if (borderWidth < 2)
		{
			theHeight -= borderWidth;
			theWidth -= borderWidth;
		}

		if (borderWidth > 2 && parentMenuNum == 0 && mainMenuH == true)
			theWidth += borderWidth * (itemArray.length - 1);
		else if (borderWidth > 2 && parentMenuNum == 0 && mainMenuH == false)
			theHeight += borderWidth * (itemArray.length - 1);
		else if (borderWidth > 2 && parentMenuNum !== 0)
			theHeight += borderWidth * (itemArray.length - 1);
		else if (borderWidth < 2 && parentMenuNum == 0 && mainMenuH == true)
			theWidth -= borderWidth * (itemArray.length - 1);
		else if (borderWidth < 2 && parentMenuNum == 0 && mainMenuH == false)
			theHeight -= borderWidth * (itemArray.length - 1);
		else if (borderWidth < 2 && parentMenuNum !== 0)
			theHeight -= borderWidth * (itemArray.length - 1);
	}

	var menuString = '';
	var theBg1 = '';
	var theBg2 = '';
	if (theBrowser == 'IE' || theBrowser == 'NS6')
	{
		if (bgType == 'color')
			theBg1 = 'background-color:' + bgColorOut + ';';
		else if (bgType == 'image')
			theBg1 = 'background:url(\'' + bgImage + '\');';
		else
			theBg1 = '';

		menuString += '<div id="menu' + parentMenuNum + '" onMouseover="KeepMenuOpen()" onMouseout="' + hideFunction1 + '" style="visibility:' + theVisibility + '; height:' + theHeight + 'px; width:' + theWidth + 'px; position:absolute; left:' + theLeft + 'px; top:' + theTop + 'px; ' + theBg1 + ' border:' + borderWidth + 'px ' + borderStyle + ' ' + borderColor + '; z-index:' + menuZIndex + ';">';
		for (key in itemArray)
			menuString += itemArray[key];
		menuString += '</div>';
	}
	return(menuString);
}

function ChangeImg(imgName, parentMenuNum, itemNum, imgSrc)
{
	if (imgTrans == 'on')
	{
		RetElem(imgName).style.filter = 'blendTrans(duration=.5)';
		RetElem(imgName).filters.blendTrans.apply();
		RetElem(imgName).src = imgSrc;
		RetElem(imgName).filters.blendTrans.play();
	}
	else
		RetElem(imgName).src = imgSrc;
}

function ChangeImgBack(imgName, parentMenuNum, itemNum, imgSrc)
{
	if (imgTrans == 'on')
	{
		RetElem(imgName).style.filter = 'blendTrans(duration=.5)';
		RetElem(imgName).filters.blendTrans.apply();
		RetElem(imgName).src = imgSrc;
		RetElem(imgName).filters.blendTrans.play();
	}
	else
		RetElem(imgName).src = imgSrc;
}

function ChangeBg(menuName, itemNum)
{
	RetElem(menuName + 'item' + itemNum).style.backgroundColor = bgColorOver;
}

function ChangeBgBack(menuName, itemNum)
{
	RetElem(menuName + 'item' + itemNum).style.backgroundColor = bgColorOut;
}

function ChangeFont(fontName, parentMenuNum, itemNum)
{
	RetElem(fontName).color = fontColorOver;
}

function ChangeFontBack(fontName, parentMenuNum, itemNum)
{
	RetElem(fontName).color = fontColorOut;
}

function ChangeMarkerImg(imgName, parentMenuNum, itemNum)
{
	if (RetElem(imgName).direction == 'h')
		RetElem(imgName).src = markImgHOver;
	else
		RetElem(imgName).src = markImgVOver;
}

function ChangeMarkerImgBack(imgName, parentMenuNum, itemNum)
{
	if (RetElem(imgName).direction == 'h')
		RetElem(imgName).src = markImgHOut;
	else
   	RetElem(imgName).src = markImgVOut;
}

function ChangeMarker(markName, parentMenuNum, itemNum)
{
	RetElem(markName).color = fontColorOver;
}

function ChangeMarkerBack(markName, parentMenuNum, itemNum)
{
	RetElem(markName).color = fontColorOut;
}

function ResFix(elemToFix)
{
	var theElem;
	var stanResHeight = 600;

	if (navigator.appName == 'Microsoft Internet Explorer')
		theElem = document.all[elemToFix];
	else if (navigator.appName == 'Netscape' && parseInt(navigator.appVersion) >= 5)
		theElem = document.getElementById(elemToFix);
	else
	{
		alert('Your browser does not support this script');
		return(0);
	}

	if (screen.height == 480)
		theElem.style.left = theElem.offsetLeft / 1.36;
	else if (screen.height == 600)
		theElem.style.left = theElem.offsetLeft;
	else if (screen.height == 768)
		theElem.style.left = theElem.offsetLeft / .728;
	else if (screen.height == 1024)
		theElem.style.left = theElem.offsetLeft / .555;
	else if (screen.height == 1200)
		theElem.style.left = theElem.offsetLeft / .428;
	else
	{
		alert('Your browser does not support this script.');
		return(0);
	}
}

/**************************************************/
// Edit the arrays below according to the template given below.
// items0[0] = BuildItem(heightList[name of height array you made above], widthList[name of width array you made above], itemContent[the HTML inside the menu item], contentCentered[Do you want the content centered? 'yes' or 'no'], itemLink[URL of link], itemTarget[window target of link], itemNum[num of item starting at 0 for each menu], menuToOpenNum[self-explanatory], showDir[direction menu that opens should pop out ('l' for left, 'r' for right, 't' for top, 'b' for bottom)], parentMenuNum[num of menu that is this item's parent]
// For roll-over images in place of HTML content, the syntax for itemContent is as follows:
// 'rollover?image1.ext?image2.ext'
/**************************************************/

// main menu items
var items0 = new Array();
items0[0] = BuildItem(menu0Heights, menu0Widths, 'HOME', 'no', '../index.htm', '_self', 0, 0, '', 0);
items0[1] = BuildItem(menu0Heights, menu0Widths, 'BULLETINS', 'no', '#', '_self',1 , 1, 'r', 0);
items0[2] = BuildItem(menu0Heights, menu0Widths, 'COMMITTEES/ORGANIZATIONS', 'no', '../Committees_Organizations.htm', '_self', 2, 2, 'r', 0);
items0[3] = BuildItem(menu0Heights, menu0Widths, 'FUNERAL ANNOUNCEMENTS', 'no', '../Funeral.htm', '_self', 3, 0, '', 0);
items0[4] = BuildItem(menu0Heights, menu0Widths, 'MISSION STATEMENT', 'no', '../MissionStatement.htm', '_self', 4, 0, '', 0);
items0[5] = BuildItem(menu0Heights, menu0Widths, 'PARISH HEALTH', 'no', '../Parish%20Health.htm', '_self', 5, 0, '', 0);
items0[6] = BuildItem(menu0Heights, menu0Widths, 'PARISH HISTORY', 'no', '../Parish_History.htm', '_self', 6, 0, '', 0);
items0[7] = BuildItem(menu0Heights, menu0Widths, 'SACRAMENTS', 'no', '../Sacraments.htm', '_self', 7, 0, '', 0);
items0[8] = BuildItem(menu0Heights, menu0Widths, 'ST. CLOUD DIOCESE', 'no', 'http://www.stclouddiocese.org/', '_blank', 8, 0, '', 0);
items0[9] = BuildItem(menu0Heights, menu0Widths, 'ST. MARYS RELIGIOUS ED.', 'no', '../ReligiousEducation.htm', '_self', 9, 0, '', 0);
items0[10] = BuildItem(menu0Heights, menu0Widths, 'ST. MARYS SCHOOL', 'no', 'http://smsa.stclouddiocese.org/', '_blank', 10, 0, '', 0);
items0[11] = BuildItem(menu0Heights, menu0Widths, 'STAFF', 'no', '../Staff.htm', '_self', 11, 0, '', 0);
items0[12] = BuildItem(menu0Heights, menu0Widths, 'CONTACT US', 'no', 'mailto:stmary@stmaryalexandria.org', '_self', 12, 0, '', 0);

// bulletin submenu items
var items1 = new Array();
items1[0] = BuildItem(menu1Heights, menu1Widths, 'Current', 'no', '../BulletinCurrent.pdf', '_blank', 0, 0, '', 1);
items1[1] = BuildItem(menu1Heights, menu1Widths, 'Previous', 'no', '../PreviousBulletins.htm', '_self', 1, 0, '', 1);
//items1[2] = BuildItem(menu1Heights, menu1Widths, 'Link', 'no', 'link.htm', '_self', 2, 0, '', 1);
//items1[3] = BuildItem(menu1Heights, menu1Widths, 'Link', 'no', 'link.htm', '_self', 3, 0, '', 1);

var items2 = new Array();
items2[0] = BuildItem(menu2Heights, menu2Widths, 'Pastoral Council Mtg. Minutes', 'no', '../PastoralCouncil/PCM.pdf', '_blank', 0, 0, '', 2);
//items2[1] = BuildItem(menu2Heights, menu2Widths, 'Menu 3', 'no', '#', '_self', 1, 3, 'r', 2);

var items3 = new Array();
items3[0] = BuildItem(menu3Heights, menu3Widths, '', 'no', 'link.htm', '_self', 0, 0, '', 3);
items3[1] = BuildItem(menu3Heights, menu3Widths, 'Link', 'no', 'link.htm', '_self', 1, 0, '', 3);
items3[2] = BuildItem(menu3Heights, menu3Widths, 'Link', 'no', 'link.htm', '_self', 2, 0, '', 3);

var menus = new Array();
menus[0] = BuildMenu(0, menu0Heights, menu0Widths, items0);		// main menu
menus[1] = BuildMenu(1, menu1Heights, menu1Widths, items1);		// bulletin submenu
menus[2] = BuildMenu(2, menu2Heights, menu2Widths, items2);		// committees submenu
menus[3] = BuildMenu(3, menu3Heights, menu3Widths, items3);

// If you would like to have the sub-menus close onClick, please set the menuHideOpt to 'click' and then paste the code below into the body tag of your document, excluding the "//" before the code.
// onClick="Check()"
// If you would like the main menu to adjust itself to different screen resolutions, pase the code below into the body tag of your document, excluding the "//" before the code.
// onLoad="ResFix('menu0')"

// Do not edit below this line!!!
if (theBrowser == 'IE' || theBrowser == 'NS6')
	for (key in menus)
		document.write(menus[key]);
else
	alert('Your browser does not support this menu.\nPlease upgrade to Internet Explorer 4 or Netscape 6 to view it.');