

//begin horizontal nav hightlight
function navHighlight (horiz_bkg){
	var id
	if (horiz_bkg == "b_about"){id = "b_about"}
	else if (horiz_bkg == "b_research"){id = "b_research"}
	else if (horiz_bkg == "b_inv_bank"){id = "b_inv_bank"}
	else if (horiz_bkg == "b_sales"){id = "b_sales"}
	else if (horiz_bkg == "b_corp"){id = "b_corp"}
	else {return false;}
	document.getElementById(id).src = "images/build07/" + id + "_.gif"
	document.getElementById(id).onmouseout = function(){
		document.getElementById(id).src = "images/build07/" + 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



// make login take you to the page you're on when you click on the main login button
if (document.getElementById("u_account_access")){
	if (document.getElementById("u_account_access").childNodes[0].href){
		if (document.getElementById("u_account_access").childNodes[0].href.indexOf("login_main.asp") > -1){
			document.getElementById("u_account_access").childNodes[0].href = document.getElementById("u_account_access").childNodes[0].href + "?filename=" + escape(location.href.substring(location.href.lastIndexOf('/')+1, location.href.length))
		}
	}
}
// end login button script






//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 = "343px" // 15px less because of padding-bottom in style sheet

//safari scroll bar - html { min-height: 100%; margin-bottom: 1px; }




// 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";}
		}
	}
}







//begin image viewer
function imageViewer (image_path,top,left) {
	
	//var close_window = "<p style='margin-top: 10px; margin-bottom: 0px; text-align: center;'><a href='Close window' onclick='document.getElementById(\"image_viewer\").style.visibility = \"hidden\"; return false;'>Close window</a></p>"
	
	if((top == "") || (top == null))
	{ top = "50" }
	if((left == "") || (left == null))
	{ left = "250" }
	
	document.getElementById("image_viewer").innerHTML = "<p style='margin-top: 10px; margin-bottom: 0px; text-align: center;'><a href='Close window' onclick='hideLayer(\"image_viewer\"); return false;'><img src=" + image_path + " border=\"0\"><br />Close window</a></p>"
	document.getElementById("image_viewer").style.top = top + "px"
	document.getElementById("image_viewer").style.left = left + "px"
	//above code uses hide layer from top of document js file
	//document.getElementById("image_viewer").style.visibility = "visible"
	showLayerOp("image_viewer") //use fade-in from top of document js file

}

if(document.getElementById){
	document.write ("<div id='image_viewer' style='position: absolute; top: 50px; left: 250px; visibility: hidden; background: #ddd9d5; padding: 10px; border: 1px solid #999490'></div>")
}
//end image viewer

if(document.getElementById && !document.all){
	document.getElementById("grand").style.height = document.getElementById("grand").style.height + 1 + "px"
}

// 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
	// exclude nn4 and others
		if(document.getElementById){
			if (link_name == file_name) {
				document.links[check_links].style.color='#236fdc';
			}
		}
}




//start of code for text sizer icons
if (document.getElementById("textSizer")) //check to make sure span tag is there before writting to it.
{
	document.getElementById("textSizer").innerHTML =	"Text&nbsp;size:\
														<a href=\"#\" onclick=\"changeStyle(0); return false;\"><img src=\"images/build07/text_size_sm.gif\" id=\"text_size_sm\" width=\"16\" height=\"15\" alt=\"\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id)\" /></a>\
														<a href=\"#\" onclick=\"changeStyle(1); return false;\"><img src=\"images/build07/text_size_m.gif\" id=\"text_size_m\" width=\"16\" height=\"15\" alt=\"\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id)\" /></a>\
														<a href=\"#\" onclick=\"changeStyle(2); return false;\"><img src=\"images/build07/text_size_lg.gif\" id=\"text_size_larg\" width=\"16\" height=\"15\" alt=\"\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id)\" /></a>"
}
//end of code for text sizer icons
//end section to write out "rate this page" and links for text sizer


