// set right vertical bar height
if (document.getElementById("body_content") && document.getElementById("body_content").offsetHeight < 350)
document.getElementById("body_content").style.height = "350px" // 15px less because of padding-bottom in style sheet

if (document.getElementById("body_content_wide") && document.getElementById("body_content_wide").offsetHeight < 350)
document.getElementById("body_content_wide").style.height = "350px" // 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
	// exclude nn4 and others
		if(document.getElementById){
			if (link_name == file_name) {
				document.links[check_links].style.color='#236fdc';
			}
		}
}




//begin horizontal nav hightlight
function navHighlight (horiz_bkg){
	var id
	if (horiz_bkg == "ho"){id = "b_home"}
	else if (horiz_bkg == "ab"){id = "b_about"}
	else if (horiz_bkg == "ya"){id = "b_your_adviser"}
	else if (horiz_bkg == "st"){id = "b_strategic"}
	else if (horiz_bkg == "pc"){id = "b_press_centre"}
	else if (horiz_bkg == "co"){id = "b_contact"}
	else if (horiz_bkg == "le"){id = "b_legal"}
	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

// 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";}
		}
	}
}