//////////////////////////////
// standard variables you can change
//////////////////////////////
var flyoutFontType = "Verdana, Arial, Helvetica"
var leftFontSize = 13
var leftFontWeight = 0		// 0 = normal   1 = bold
var leftFontStyle = 0		// 0 = normal   1 = italics
var subFontSize = 11
var subFontWeight = 0		// 0 = normal   1 = bold
var subFontStyle = 0		// 0 = normal   1 = italics

if (subFontWeight==1) {subFontWeight="bold"} else {subFontWeight="normal"}
if (subFontStyle==1) {subFontStyle="italic"} else {subFontStyle="normal"}
if (leftFontStyle==1) {leftFontStyle="italic"} else {leftFontStyle="normal"}
if (leftFontWeight==1) {leftFontWeight="bold"} else {leftFontWeight="normal"}

// standard widths and heights of the menus
var leftTop = 154
var leftLeft = 8
var leftWidth = 148
var leftContentHgt = 15
var subWidth = 210
var subContentHgt = 15

// create submenu left position off of leftLeft and leftWidth
var subLeft = leftLeft + leftWidth

// graphic for menu items with flyout
// 0 = Show arrow  1 = Hide arrow
var arrowShow = 1			
var arrowPath = "/images/blackarrow.gif"

// main left nav color information
var leftOverBgColor = '#EAF1FD'
var leftOverBorderColor = '#92B5F3'
var leftOverTextColor = '#003366'
var leftColor = '#FFFFFF'
var leftTextColor = '#000000'

// sub-menu left nav color information
var subOverBgColor = '#EAF1FD'
var subOverBorderColor = '#92B5F3'
var subOverTextColor = '#003366'
var subColor = '#FDFDFF'
var subTextColor = '#003366'

// ie only options
var subTrans = 90			// 0 = transparent  100 = solid
var subDsDir = 135			// 0 to 359 degrees angle of shadow
var subDsColor = '#2F2F2F'	// drop shadow color
var subDsStrength = 3		// how many pixels the shadow will fall
var ieStrips = 0			// 0 = Off   1 = on		

///////////////////////
// variables and functions below support the actions of the flyout menu
// ***DO NOT MODIFY***
///////////////////////

var activeMenu = false;
var activeItem = false;

///////////////////////
// Changes background and border colors as well as showing the flyout menu
///////////////////////
function showFlyout (obj,flyObj) {
	if (activeMenu != false) {
		hideFlyout();
	}
	var theObj = getObjectStyle(obj);
	changeColor(obj,leftOverBgColor,leftOverBorderColor,leftOverTextColor);
	theObj.cursor = hand;
	activeItem = obj;
	activeMenu = flyObj;	
	if ((bw.ie55 || bw.ie6) && ieStrips == 1) {
		var filterObj = getObject(flyObj);
		filterObj.filters[0].Apply();	
		showObj(flyObj);
		filterObj.filters[0].Play();		
	} else {
		showObj(flyObj);
	}
	showObj('menuCloser');
}

///////////////////////
// Changes background and border colors to default as well as hiding the flyout menu
// set flyObj to 0 if it does not have a flyout menu
///////////////////////
function hideFlyout () {
	if (activeMenu != false) {
		hideObj(activeMenu);
		hideObj('menuCloser');
		activeMenu = false;
	}
	if (activeItem != false) {
		changeColor(activeItem,leftColor,leftColor,leftTextColor);
		activeItem = false;
	}
}

function subShowColor (obj) {
	var theObj = getObjectStyle(obj);
	changeColor(obj,subOverBgColor,subOverBorderColor,subOverTextColor);
}

function subHideColor (obj) {
	changeColor(obj,subColor,subColor,subTextColor);
}

///////////////////////
// variables and functions below support creation of the flyout menu
// ***DO NOT MODIFY***
///////////////////////
function buildFlyout() {
	document.write('<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>')
	buildMainTable()
	document.write('<div id="menuCloser" style="position:absolute; left:0px; top:0px; width:500px; height:500px; z-index:50; visibility:hidden;"><a href="javascript:;" onMouseOver="hideFlyout();"><img src="/images/trans.gif" width="500" height="500" alt="" border="0"></a></div>')
}

function buildMainTable() {
	var subMenus = new Array()
	var j = 0
	if (bw.ns4) {
		var txt = ""
		var layerTop = leftTop
		for(i=1; i<=leftItems; i++) {
			idMenu = 'toplevel'+i
			mainMenu = eval('leftMenu'+i)
			txt+='<layer id="'+idMenu+'" pagex="'+leftLeft+'" pagey="'+layerTop+'" z-index="100" width="'+leftWidth+'" height="'+leftContentHgt+'" '
			txt+='style="font-family:'+flyoutFontType+'; font-weight:'+leftFontWeight+'; font-style:'+leftFontStyle+'; font-size:'+leftFontSize+'px; border:1px solid '+leftColor+';" '
			if (mainMenu[2] == 0) {
				txt+='onMouseOver="showFlyout(\''+idMenu+'\',\''+mainMenu[3]+'\');"><a href="'+mainMenu[1]+'" style="text-decoration:none; color:'+leftTextColor+'">&nbsp;'+mainMenu[0]+'&nbsp;'
				if (arrowShow == 1) {txt+='<img align="absbottom" src="'+arrowPath+'" alt="" border="0">'}
				txt+='</a></layer>'
				subMenus[j]=i
				j++
			} else if (mainMenu[2] == 1) {
				txt+='onMouseOver="hideFlyout(); return overlib(\''+mainMenu[3]+'\');" onMouseOut="return nd();"><a href="'+mainMenu[1]+'" style="text-decoration:none; color:'+leftTextColor+'">&nbsp;'+mainMenu[0]+'&nbsp;</a></layer>'
			} else {
				txt+='onMouseOver="hideFlyout();"><a href="'+mainMenu[1]+'" style="text-decoration:none; color:'+leftTextColor+'">&nbsp;'+mainMenu[0]+'&nbsp;</a></layer>'
			}
			layerTop = layerTop + leftContentHgt + 3
		}
	} else {
		var leftHgt=(bw.op7)?leftContentHgt + 4:leftContentHgt;
		var cellSpacing = 1
		var imageAlign = 'absbottom'
		var mainTopText = ""
		var mainMiddleText = ""
		var mainBottomText = ""
		if (bw.op) {imageAlign = 'middle'}
		if (bw.op) {cellSpacing = 0}
		mainTopText='<div id="mainmenu" style="position:absolute; left:'+leftLeft+'px; top:'+leftTop+'px; width:'+leftWidth+'px; z-index:100;">'
		mainTopText+='<table width="'+leftWidth+'" border="0" cellspacing="'+cellSpacing+'" cellpadding="0">'
		mainBottomText='</table></div>'
		for(i=1; i<=leftItems; i++) {
			idMenu = 'toplevel'+i
			mainMenu = eval('leftMenu'+i)
			mainMiddleText+='<tr><td height="'+leftHgt+'" id="'+idMenu+'" style="font-family:'+flyoutFontType+'; font-weight:'+leftFontWeight+'; font-style:'+leftFontStyle+'; font-size:'+leftFontSize+'px; border: '+leftColor+' solid 1px;" '
			if (mainMenu[2] == 0) {
				mainMiddleText+='onMouseOver="showFlyout(\''+idMenu+'\',\''+mainMenu[3]+'\');" onClick="document.location.href=\''+mainMenu[1]+'\';">&nbsp;'+mainMenu[0]+'&nbsp;'
				if (arrowShow == 1) {mainMiddleText+='<img align="'+imageAlign+'" src="'+arrowPath+'" alt="" border="0">'}
				mainMiddleText+='</td></tr>'
				subMenus[j]=i
				j++
			} else if (mainMenu[2] == 1) {
				mainMiddleText+='onMouseOver="hideFlyout(); changeColor(\''+idMenu+'\',\''+leftOverBgColor+'\',\''+leftOverBorderColor+'\',\''+leftOverTextColor+'\'); return overlib(\''+mainMenu[3]+'\');" '
				mainMiddleText+='onClick="document.location.href=\''+mainMenu[1]+'\';" onMouseOut=" changeColor(\''+idMenu+'\',\''+leftColor+'\',\''+leftColor+'\',\''+leftTextColor+'\'); return nd();">&nbsp;'+mainMenu[0]+'&nbsp;</td></tr>'
			} else {
				mainMiddleText+='onMouseOver="hideFlyout(); changeColor(\''+idMenu+'\',\''+leftOverBgColor+'\',\''+leftOverBorderColor+'\',\''+leftOverTextColor+'\'); onClick="document.location.href=\''+mainMenu[1]+'\'; " '
				mainMiddleText+='onMouseOut="changeColor(\''+idMenu+'\',\''+leftColor+'\',\''+leftColor+'\',\''+leftTextColor+'\');">&nbsp;'+mainMenu[0]+'&nbsp;</td></tr>'			
			}
		}
		var txt = mainTopText+mainMiddleText+mainBottomText;
	}
	document.write(txt);
	buildSubTables (subMenus);
}

function buildSubTables (subMenuNum) {
	subTop = leftTop - 1
	for (i=0; i<subMenuNum.length; i++) {
		subtxt = ""
		subTableTop = ""
		subTableMiddle = ""
		subTableBottom = ""
		if (bw.ns4) {
			subTableTop='<div style="layer-background-color:'+subColor+'; border-style:solid; border-width:1px; border-color:#000000; position:absolute; left:'+subLeft+'px; top:'+subTop+'px; width:'+subWidth+'px; z-index:'+100+i+'; visibility:hidden;" '
			subTableTop+='id="submenu'+subMenuNum[i]+'"><table width="'+subWidth+'" bgcolor="'+subColor+'" border="0" cellspacing="0" cellpadding="0">'
			subTableBottom='</table></div>'
			subItems=eval('sub'+subMenuNum[i]+'Items')
			for(j=1; j<=subItems; j++) {
				idItem = 'sub'+subMenuNum[i]+'level'+j
				subMenu = eval('sub'+subMenuNum[i]+'Menu'+j)
				subTableMiddle+='<tr><td height="'+subContentHgt+'" id="'+idItem+'" style="border:'+subColor+' solid 1px; font-family:'+flyoutFontType+'; font-size:'+subFontSize+'px; color:'+subTextColor+';" '
				subTableMiddle+='onMouseOver="subShowColor(\''+idItem+'\');" onMouseOut="subHideColor(\''+idItem+'\');"><a href="'+subMenu[1]+'" style=" font-weight:'+subFontWeight+'; font-style:'+subFontStyle+'; text-decoration:none;">&nbsp;'+subMenu[0]+'&nbsp;</a></td></tr>'	
			}
		} else {
			var ieTbFilter=(bw.ie55 || bw.ie6)?' filter:alpha(opacity='+subTrans+') progid:DXImageTransform.Microsoft.Shadow(direction='+subDsDir+', color=\''+subDsColor+'\', strength='+subDsStrength+');':'';
			var ieDivFilter=((bw.ie55 || bw.ie6) && ieStrips == 1)?'filter: progid:DXImageTransform.Microsoft.Strips(Duration=0.4, Motion=\'rightdown\'); ':'';
			subTableTop='<div style="'+ieDivFilter+'position:absolute; left:'+subLeft+'px; top:'+subTop+'px; width:'+subWidth+'px; z-index:'+100+i+'; visibility:hidden;" id="submenu'+subMenuNum[i]+'"">'
			subTableTop+='<table width="'+subWidth+'" border="0" cellspacing="1" cellpadding="1" style="border:1px solid #000000; background-color:'+subColor+';'+ieTbFilter+'">'
			subTableBottom='</table></div>'
			subItems=eval('sub'+subMenuNum[i]+'Items')
			for(j=1; j<=subItems; j++) {
				idItem = 'sub'+subMenuNum[i]+'level'+j
				subMenu = eval('sub'+subMenuNum[i]+'Menu'+j)
				subTableMiddle+='<tr><td height="'+subContentHgt+'" id="'+idItem+'" style="font-family:'+flyoutFontType+'; font-weight:'+subFontWeight+'; font-style:'+subFontStyle+'; font-size:'+subFontSize+'px; border: '+subColor+' solid 1px; color:'+subTextColor+';" '
				subTableMiddle+='onMouseOver="subShowColor(\''+idItem+'\');" onClick="document.location.href=\''+subMenu[1]+'\';" onMouseOut="subHideColor(\''+idItem+'\');">&nbsp;'+subMenu[0]+'&nbsp;</td></tr>'	
			}
		}
	var subtxt = subTableTop+subTableMiddle+subTableBottom;
	document.write(subtxt);
	subTop = subTop + leftContentHgt + 4
	}
}
