//make sure the top lines in the content area align on interior pages
if (document.getElementById("right_top_spacer") && document.getElementsByTagName("h2")[0] && document.getElementsByTagName("h2")[0].offsetHeight > 40) {
	document.getElementById("right_top_spacer").style.height = document.getElementsByTagName("h2")[0].offsetHeight - 14 + "px"
}

// set right vertical bar height
if (document.getElementById("body_content") && document.getElementById("body_content").offsetHeight < 358)
document.getElementById("body_content").style.height = "291px" // 15px less because of padding-bottom in style sheet

// set right vertical bar height
if (document.getElementById("body_content_wide") && document.getElementById("body_content_wide").offsetHeight < 358)
document.getElementById("body_content_wide").style.height = "291px" // 15px less because of padding-bottom in style sheet

// check file name and highlight if it matches a link
var file_name = location.href
// get rid of query string
if (file_name.indexOf('?')!= -1){
		var query = true
		var ques_loc = file_name.indexOf('?')
		var query_string = file_name.substring(ques_loc, file_name.length)
		file_name=file_name.substring(0,ques_loc)
}

// get rid of bookmarks
if (file_name.indexOf('#')!= -1){
		var bm = true
		var bm_loc = file_name.indexOf('#')
		var bookmark = file_name.substring(bm_loc, file_name.length)
		file_name=file_name.substring(0,bm_loc)
}

// loop through all the links
for(check_links = 0; check_links < document.links.length; check_links++)
{
	var link_name = document.links[check_links].href
	
	// highlight link if it matches filename
	if(document.getElementById)
	{
		if(link_name == file_name)
		{ document.links[check_links].className = "current"; }
	}
}

// give alternating colors to tables with the regTbl class
// if(document.getElementsByTagName){
//	var el = document.getElementsByTagName("TR");
//	for(var i=0; i < el.length; i++){
//		if(el[i].parentNode.parentNode.className.indexOf("regTbl") != -1){
//			if(i%2 == 1){el[i].className = "tblon";} 
//			else {el[i].className = "tbloff";}
//		}
//	}
//}


function navHighlight (horiz_bkg){
	var id
	if (horiz_bkg == "ab"){id = "b_about"}
	else if (horiz_bkg == "mu"){id = "b_mutual_funds"}
	else if (horiz_bkg == "ma"){id = "b_managed_accounts"}
	else if (horiz_bkg == "mg"){id = "b_managers"}
	else if (horiz_bkg == "in"){id = "b_institutional"}
	else if (horiz_bkg == "dc"){id = "b_dcio"}
	else if (horiz_bkg == "it"){id = "b_international"}
	else {return false;}
	document.getElementById(id).src = "images/buttons/" + id + "_.gif"
	document.getElementById(id).onmouseout = function(){
		document.getElementById(id).src = "images/buttons/" + id + "_.gif"
	}
}
//check if horiz_bkg exists and run the function if true
if(window.horiz_bkg && document.getElementById){navHighlight(horiz_bkg)}
// end horizontal nav hightlight
