//modify for 800x600 resolution
//rewrite the horizontal nav with smaller buttons, resize elemments
/*if (screen.width < 801){
	
	var buttons800 = "<table cellspacing=\"0\" cellpadding=\"0\" id=\"buttons\"><tr><td id=\"button_ll\" width=\"25%\"><div><a href=\"afasdf\" onmouseover=\"showLayerOp('personal_investing');clearTimeout(timer['personal_investing']);\" onmouseout=\"closeCounter('personal_investing');\" id=\"b_per_inv_cell\"><img src=\"/images/build06/b_per_inv_800.gif\" id=\"b_per_inv\" name=\"b_per_inv\" width=\"192\" height=\"34\" alt=\"Personal Investing\" border=\"0\" onmouseover=\"src='images/build06/b_per_inv_800_.gif'\" onmouseout=\"src='images/build06/b_per_inv_800.gif'\" /></a></div></td><td id=\"button_l\" width=\"25%\"><div><a href=\"afasdf\" onmouseover=\"showLayerOp('institutional');clearTimeout(timer['institutional']);\" onmouseout=\"closeCounter('institutional');\" id=\"b_inst_corp_cell\"><img src=\"/images/build06/b_inst_corp_800.gif\" id=\"b_inst_corp\" name=\"b_inst_corp\" width=\"192\" height=\"34\" alt=\"Institutional + Corporate\" border=\"0\" onmouseover=\"src='images/build06/b_inst_corp_800_.gif'\" onmouseout=\"src='images/build06/b_inst_corp_800.gif'\" /></a></div></td><td id=\"button_r\" width=\"25%\"><div><a href=\"afasdf\" onmouseover=\"showLayerOp('opportunities');clearTimeout(timer['opportunities']);\" onmouseout=\"closeCounter('opportunities');\"><img src=\"/images/build06/b_pro_opp_800.gif\" id=\"b_pro_opp\" name=\"b_pro_opp\" width=\"192\" height=\"34\" alt=\"Professional Opportunities\" border=\"0\" onmouseover=\"src='images/build06/b_pro_opp_800_.gif'\" onmouseout=\"src='images/build06/b_pro_opp_800.gif'\" /></a></div></td><td id=\"button_rr\" width=\"25%\"><div><a href=\"afasdf\" onmouseover=\"showLayerOp('about');clearTimeout(timer['about']);\" onmouseout=\"closeCounter('about');\"><img src=\"/images/build06/b_about_800.gif\" id=\"b_about\" name=\"b_about\" width=\"192\" height=\"34\" alt=\"About Our Company\" border=\"0\" onmouseover=\"src='images/build06/b_about_800_.gif'\" onmouseout=\"src='images/build06/b_about_800.gif'\" /></a></div></td></tr></table>"


	if(document.getElementById("lcol_spacer")){document.getElementById("lcol_spacer").style.width = "192px"}
	if(document.getElementById("mcol_spacer")){document.getElementById("mcol_spacer").style.width = "384px"}
	if(document.getElementById("rcol_spacer")){document.getElementById("rcol_spacer").style.width = "192px"}
	if(document.getElementById("buttons")){document.getElementById("buttons").style.width = "770px"}
	if(document.getElementById("main")){document.getElementById("main").style.width = "770px"}
	if(document.getElementById("buttons_area")){document.getElementById("buttons_area").innerHTML = buttons800}
	if(document.getElementById("personal_investing")){document.getElementById("personal_investing").style.left = "109px"}
	if(document.getElementById("institutional")){document.getElementById("institutional").style.left = "302px"}
	if(document.getElementById("opportunities")){document.getElementById("opportunities").style.left = "494px"}
	if(document.getElementById("about")){document.getElementById("about").style.left = "634px"}
	
}*/

//set the horiz nav hightlight
if(horiz_bkg && document.getElementById){
	var small_width = ""
	if (screen.width < 801){small_width = "_800"} //this sets it to a different image for 800x600 resolution
	if (horiz_bkg == "ll"){
		document.getElementById("b_services").src = "/images/build06/b_ppa_services" + small_width + "_.gif"
		document.getElementById("b_services").onmouseout = function(){
			document.getElementById("b_services").src = "/images/build06/b_ppa_services" + small_width + "_.gif"
		}
	}
	if (horiz_bkg == "l"){
		document.getElementById("b_planning").src = "/images/build06/b_ppa_planning" + small_width + "_.gif"
		document.getElementById("b_planning").onmouseout = function(){
			document.getElementById("b_planning").src = "/images/build06/b_ppa_planning" + small_width + "_.gif"
		}
	}
	if (horiz_bkg == "m"){
		document.getElementById("b_resources").src = "/images/build06/b_ppa_resources" + small_width + "_.gif"
		document.getElementById("b_resources").onmouseout = function(){
			document.getElementById("b_resources").src = "/images/build06/b_ppa_resources" + small_width + "_.gif"
		}
	}
	if (horiz_bkg == "r"){
		document.getElementById("b_listings").src = "/images/build06/b_ppa_listings" + small_width + "_.gif"
		document.getElementById("b_listings").onmouseout = function(){
			document.getElementById("b_listings").src = "/images/build06/b_ppa_listings" + small_width + "_.gif"
		}
	}
	if (horiz_bkg == "rr"){
		document.getElementById("b_career").src = "/images/build06/b_ppa_career" + small_width + "_.gif"
		document.getElementById("b_career").onmouseout = function(){
			document.getElementById("b_career").src = "/images/build06/b_ppa_career" + small_width + "_.gif"
		}
	}

}

//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

if (document.getElementById("body_content_te") && document.getElementById("body_content_te").offsetHeight < 358)
document.getElementById("body_content_te").style.height = "291px" // 15px less because of padding-bottom in style sheet

if (document.getElementById("body_content_ie") && document.getElementById("body_content_ie").offsetHeight < 358)
document.getElementById("body_content_ie").style.height = "291px" // 15px less because of padding-bottom in style sheet

if (document.getElementById("body_content_ic") && document.getElementById("body_content_ic").offsetHeight < 358)
document.getElementById("body_content_ic").style.height = "291px" // 15px less because of padding-bottom in style sheet

if (document.getElementById("body_content_iira") && document.getElementById("body_content_iira").offsetHeight < 358)
document.getElementById("body_content_iira").style.height = "291px" // 15px less because of padding-bottom in style sheet

if (document.getElementById("body_content_bcu") && document.getElementById("body_content_bcu").offsetHeight < 358)
document.getElementById("body_content_bcu").style.height = "291px" // 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

// 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';
			}
		}
}
