//////////////////////////////////////////////////////
	hovercolor   = "#FFFFFF";	// color name/code
	bgcolor      = "#CCDDEE";	// color name/code
	laycolor     = "#0066CC";      //color code for border lining
	bordercolor  = "#FFFFFF";
	textColor = '#003366';
	background   = "";			// picture url
	menu_border  = 2;			// IE only
	imagePath = "/economics/res/";	
	arrow    = "<img src=\""+imagePath+"b_arrow.gif\" border=\"0\"><br>" // url of arrow picture for submenus
	//blank    = "<img src='"+appPath+"gif/blank.gif'>&nbsp;"; // url of blank picture
	

//sets the distance from top of page for top-level menu 
if(Englishsite == "True"){
	if (document.getElementById) { //Internet Explorer 5+ on both Windows and Mac platforms, Netscape 6 and Opera 6+.
		theTop = 74+MENU_OFFSET;
		}
		else if (document.all) { //Internet Explorer 4. 
		theTop = 74+MENU_OFFSET;
		}
		else if (document.layers) { //Netscape 4.
		theTop = 75+MENU_OFFSET;
		}
} else {
	theTop=74+MENU_OFFSET;
}

No3 = (parseInt(navigator.appVersion) > 3) ? 1:0;
//determines Windows platform
var isWin = false;
if(navigator.platform == 'Win32') var isWin = true;

var timer;

function Show() {
	if(timer) clearTimeout(timer);
	for(menu=1; menu<Layer.length; menu++) {
		if(Layer[menu]) {
			if (document.getElementById) document.getElementById('L'+Layer[menu].ID).style.visibility = "hidden";
			else document.layers['L'+Layer[menu].ID].visibility = false;
			}
		}
	for(i=0;i<theSubMenu.length;i++) {
		if(document.getElementById) {
			document.getElementById(dependsOn[i]).style.background=bgcolor;
		}

	}

	for(i=0; i<arguments.length; i++) {
		menu=arguments[i];
		if (document.getElementById) document.getElementById('L'+menu).style.visibility = "visible";
		else document.layers['L'+menu].visibility = true;
		//for(j=0;j<theSubMenu.length;j++) { 
			//if(document.getElementById) {
				//if(menu==theSubMenu[j]) {
					//document.getElementById(dependsOn[j]).style.background=hovercolor;
					//document.getElementById(dependsOn[j]).style.color=textColor;
				//}
			//}
		//}
	}
}



function Hide() { timer = setTimeout("Show(); hideLayer(); setMenuHover(thisPage)", 500); }

var theHeight = '18px';

function createBaseItem(theName,theText,Width,Left,theLink,subLayer) {

	layerName = "layer" + theName;
	var theInfo = '';
	if(theName==1) {
		leftdivider = "b_leftside";
		adjust = 6;
	}
	else {
		leftdivider = "b_dividerleft";
		adjust = 5;
	}
	if(theLink.substr(0,4)!='java') linkText = "window.top.location.href='"+theLink+"'";
	else linkText = theLink;
	if(thisPage==theName) theText = "<b>"+theText+"</b>";
	if (document.getElementById) {
		if(isWin) {
			theInfo += "<DIV ID="+layerName+" onMouseover='setMenuHover(\""+theName+"\");' onMouseout='Hide();'  class=menuButton style='position:absolute; z-Index:10; left:"+Left+"; top:"+theTop+"'>";
			theInfo += "<table width="+eval(Width+adjust)+" border=0 cellpadding=0 cellspacing=0><tr><td><img src='"+imagePath+leftdivider+".gif'></td><td width="+Width+" class=menuButton>"+theText+"</td><td><img src='"+imagePath+"b_dividerright.gif'></td></tr><tr><td colspan=3 bgcolor=#000000 height=1><img src='"+imagePath+"s.gif' height=1></td></tr></table></DIV>";
			theInfo += "<DIV ID="+layerName+"on onMouseover='Show("+subLayer+"); hideLayer();' onMouseout='Hide();' onClick=\""+linkText+";Hide()\" class=menuButtonHover style='position:absolute; z-Index:10; visibility:hidden; left:"+Left+"; top:"+theTop+"'>";
			theInfo += "<table width="+eval(Width+adjust)+" border=0 cellpadding=0 cellspacing=0><tr><td><img src='"+imagePath+leftdivider+"lite.gif'></td><td width="+Width+" class=menuButtonHover>"+theText+"</td><td><img src='"+imagePath+"b_dividerrightlite.gif'></td></tr><tr><td colspan=3 bgcolor=#000000 height=1><img src='"+imagePath+"s.gif' height=1></td></tr></table></DIV>";
			}
		else theInfo += "<DIV ID="+layerName+"  onMouseover='Show("+subLayer+"); hideLayer();' onMouseout='Hide();'  class=menuButton style='position:absolute; z-Index:10; left:"+eval(Left+macAdjust)+"; top:"+theTop+";width:"+eval(3+Width)+";height:20;padding:2px'>"+theText+"</div>";
	}
	else {
		theInfo += "<LAYER name="+layerName+" onMouseover='setMenuHover(\""+theName+"\");' position=absolute visibility=true width="+eval(Width+adjust)+" height="+theHeight+" left="+Left+" top="+theTop+">";
		theInfo += "<table border=0 cellpadding=0 cellspacing=0 class='menuButton'><tr><td><img src='"+imagePath+leftdivider+".gif'></td><td class='menuButton' width="+Width+">"+theText+"</td><td><img src='"+imagePath+"b_dividerright.gif'></td></tr><tr><td colspan=3 bgcolor=#000000 height=1><img src='"+imagePath+"k.gif' height=1></td></tr></table></LAYER>";
		theInfo += "<LAYER name="+layerName+"on onMouseOver='Show("+subLayer+");' onFocus=\""+linkText+";Hide()\"";
		theInfo += "onMouseOut='Hide();' position=absolute visibility=hidden width="+eval(Width+adjust)+" height="+theHeight+" left="+Left+" top="+theTop+">";
		theInfo += "<table border=0 cellpadding=0 cellspacing=0 class=menuButtonHover><tr><td><img src='"+imagePath+leftdivider+"lite.gif'></td><td class=menuButtonHover width="+Width+">"+theText+"</td><td><img src='"+imagePath+"b_dividerrightlite.gif'></td></tr><tr><td colspan=3 bgcolor=#000000 height=1><img src='"+imagePath+"k.gif' height=1></td></tr></table></LAYER>";
		}	
	document.write(theInfo);
	}

function setMenuHover(theName) {
	if(timer) clearTimeout(timer);
	for(i=1;i<menuItems.length;i++) {
		layerName = "layer"+i+"on";
		if (i != theName) {
			if (document.getElementById) document.getElementById(layerName).style.visibility="hidden";
			else document.layers[layerName].visibility=false;
			}
		else {
			if (document.getElementById) document.getElementById(layerName).style.visibility="visible";
			else document.layers[layerName].visibility=true;
			}
		}
	}

function LayerSpecs(Left,Top,Width,ID) {
	this.left  = Left;
	if(ID>1) this.left-=1;
	if (document.layers)
		this.top   = theTop+5+(Top*18)-3;
	else
		this.top   = theTop+5+(Top*15) -1;
	this.ID = ID;
	
	
	if (navigator.appName=="Netscape"&&document.getElementById) {
	//detect netscape 6
		this.width = Width+10;
		if(ID>=9) this.left += 1;
	}
	else {
		this.width = Width;
		if(ID>=9) this.left += 10;
	}
	this.info  = "";
	T=1;


	links = new Array();
	NSlinks = new Array();
	show = new Array();
	texts = new Array();
	c = 1;
	for(i=4; i<arguments.length; i+=3) {
		j = i + 1;
		k = i + 2;
			if(arguments[i].substring(0,10)=='javascript') links[c] = arguments[i].substring(11,arguments[i].length);
			else links[c] = "window.top.location.href='"+arguments[i]+"'";

		NSlinks[c] = arguments[i];
		show[c] = arguments[j];
		texts[c] = arguments[k];
		
		if (document.layers) {
		// Netscape 4 users
			if(texts[c].substr(texts[c].length-1,1)==' ') {
				texts[c] = "<table cellspacing=\'0\' cellpadding=\'0\' width=\'" + eval(Width+10) + "\'><tr><td width=\'"+eval(Width+6)+"\'>&nbsp;<a href=\""+NSlinks[c]+"\" onClick=\"Hide()\" target=_top><font class=NSmenuOff>"+texts[c]+"</font></a></td><td width=\'4\'>"+arrow+"</td></tr></table>";
			}
			else {
				texts[c] = "<table cellspacing=\'0\' cellpadding=\'0\' width=\'" + eval(Width+10) + "\'><tr><td width=\'"+eval(Width+10)+"\'>&nbsp;<a href=\""+NSlinks[c]+"\" onClick=\"Hide()\" target=_top><font class=NSmenuOff>"+texts[c]+"</font></a></td></table>";
			}
		
		}
		// Netscape 6
		else if (navigator.appName=="Netscape"&&document.getElementById) {
			if(texts[c].substr(texts[c].length-1,1)==' ')	
				texts[c] = "<table cellspacing=\'0\' cellpadding=\'0\' width=\'" + eval(Width+10) + "\'><tr><td width=\'"+eval(Width+7)+"\' class=\"IEMenu2\">&nbsp;"+texts[c]+"<br></td><td width=\'7\'>"+arrow+"</td></tr></table>" ;
			else
				texts[c] = "<table cellspacing=\'0\' cellpadding=\'0\' width=\'" + eval(Width+10) + "\'><tr><td width=\'"+eval(Width+10)+"\' class=\"IEMenu2\">&nbsp;"+texts[c]+"</td></tr></table>";
		}
		// IE
		else {
			if(texts[c].substr(texts[c].length-1,1)==' ')	
				texts[c] = "<table cellspacing=\'0\' cellpadding=\'0\' width=\'" + eval(Width+10) + "\'><tr><td width=\'"+eval(Width+7)+"\' class=\"IEMenu2\">&nbsp;"+texts[c]+"</td><td width=\'4\'>"+arrow+"</td></tr></table>" ;
			else
				texts[c] = "<table cellspacing=\'0\' cellpadding=\'0\' width=\'" + eval(Width+10) + "\'><tr><td width=\'"+eval(Width+10)+"\' class=\"IEMenu2\">&nbsp;"+texts[c]+"</td></tr></table>";
		}
		
			
		c++;
	}

	for(i=1;i<links.length;i++) {

		layerName = "layer_"+ID+"_"+i;

		if(document.getElementById) {
		   this.info += "<DIV ID="+layerName+"  style=\"background-color:"+bgcolor+"\" class=IEmenu style='width:"+eval(Width-1)+"; position:relative; z-Index:10 ;top:0px; left:0px; background:"+bgcolor+";color:"+textColor+"' onMouseOver='"+show[i]+"; this.style.background=\""+hovercolor+"\";' onMouseOut='this.style.background=\""+bgcolor+"\";this.style.color=\""+textColor+"\"' onClick=\""+links[i]+";Hide()\">"+texts[i]+"</DIV>";
		   }
		else {
		   		this.info += "<LAYER z-Index=9 class=NSmenuOff BGCOLOR=\""+bgcolor+"\" onMouseOver='showLayer("+i+",\""+ID+"\","+c+")' WIDTH="+eval(Width)+" POSITION=RELATIVE TOP="+eval(T)+" LEFT=1 >"+texts[i]+"</LAYER>";
				this.info += "<LAYER z-Index=8 name="+layerName+" BGCOLOR=\""+hovercolor+"\" WIDTH="+eval(Width)+" onMouseOut='this.zIndex=8;' onMouseOver=\""+show[i]+"\" POSITION=RELATIVE TOP="+eval(T)+" LEFT=1>"+texts[i]+"</LAYER>";
		   }
		
		if (document.layers)
			T+=18;
		else
			T+=14;
	}
	if(document.layers) this.info +="<LAYER z-Index=9 BGCOLOR=\""+laycolor+"\"  WIDTH="+eval(Width+11)+" POSITION=RELATIVE TOP="+eval(T+2)+" LEFT=1 HEIGHT=1></LAYER>";
	if(this.ID.length > 1)  {
		theSubMenu[theSubMenuCounter] = this.ID;
		dependsOn[theSubMenuCounter] = "layer_"+this.ID.substring(0,1)+"_"+this.ID.substring(1,2);
		theSubMenuCounter++;
	}
	layerCounter++;
}

function setHover(topNum) {
	document.images["b_dividerleft"+topNum].src=imagePath+"b_dividerleftlite.gif";
}


var activeParent = '';
var activeLayer = '';

function hideLayer() {
	if ((activeParent) && (document.layers)) {
		document.eval('L'+activeParent).document.eval('layer_'+activeParent+"_"+activeLayer).zIndex=8;
		}
	}


function showLayer(layerNum, Parent,numRows) {
	for(i=1;i<numRows;i++) {
		if(i==layerNum) document.layers['L'+Parent].document.layers['layer_'+Parent+'_'+i].zIndex=10;
		else document.layers['L'+Parent].document.layers['layer_'+Parent+'_'+i].zIndex=8;
	}
}

function createMenu() {
   for(i=1; i<Layer.length; i++) {
	   if(Layer[i]) {
		if(document.getElementById && No3) document.write("<DIV onMouseOver='clearTimeout(timer)' onMouseOut='Hide()' ID='L"+Layer[i].ID+"' STYLE='position:absolute;z-Index:10; visibility:hidden; top:"+Layer[i].top+"; left:"+Layer[i].left+"; width:"+Layer[i].width+";border:1px solid "+laycolor+";border-right-width:1px;border-bottom-width:1px;background-color:"+laycolor+"'>"+Layer[i].info+"</DIV>");
		else if(document.layers && No3) document.write("<LAYER onMouseOver='clearTimeout(timer);' onMouseOut='Hide()' ID='L"+Layer[i].ID+"' POSITION=ABSOLUTE VISIBILITY=HIDDEN BGCOLOR='"+laycolor+"' BACKGROUND='"+background+"' TOP="+Layer[i].top+" LEFT="+Layer[i].left+" WIDTH="+Layer[i].width+" >"+Layer[i].info+"</LAYER>");
		}
	}
}
