//set the horiz nav hightlight
if (horiz_bkg && document.getElementById) {	
	if(horiz_bkg == "ll") {
		document.getElementById("b_about").src = "images/b_about_.gif";
	}
	else if(horiz_bkg == "l") {
		document.getElementById("b_bus_models").src = "images/b_bus_models_.gif";
	}
	else if(horiz_bkg == "m") {
		document.getElementById("b_products").src = "images/b_products_.gif";
	}
	else if(horiz_bkg == "r") {
		document.getElementById("b_technology").src = "images/b_technology_.gif";
	}
	else if(horiz_bkg == "rr") {
		document.getElementById("b_services").src = "images/b_services_.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_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

// 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) {
	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
	showLayerOp("image_viewer"); //use showLayerOp fuction from 2008begining.js should be included at top of main document.
}

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].className = 'current';
		}
	}
}


//Create Button Array
var buttonsArr = new Array();
buttonsArr["bmcompare"] = "<a href=\"matrix/\" target=\"_blank\" onclick=\"window.open(this.href,'_blank','width=890,height=725,resizable,menubar'); return false;\"><img src=\"images/buttons/090512_businessModelComp.gif\" id=\"bmcompareBtn\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding-right: 26px;\" /></a>";
buttonsArr["hovt"] = "<a href=\"library/hovt/\" target=\"_blank\"><img src=\"images/buttons/090805_HOVtour.gif\" id=\"HOVtour\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" /></a>";
buttonsArr["techdemo"] = "<a href=\"library/technologydemo.asp\" target=\"_blank\"><img src=\"images/buttons/090512_techDemo.gif\" id=\"techDemo\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" /></a>";
buttonsArr["commentarypodcast"] = "<a href=\"http://www.raymondjames.com/experts/\" href=\"_target\" onclick=\"window.open(this.href,'_blank','width=800,height=600,resizable'); return false;\"><img src=\"images/buttons/090512_commentaryPodcast.gif\" id=\"commentaryPodcastBtn\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding: 0px 16px 0px 10px;\" /></a>";
buttonsArr["networkwomen"] = "<a href=\"women_network.asp\"><img src=\"images/buttons/090512_networkWomen.gif\" id=\"networkWomenBtn\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding: 0px 16px 0px 10px;\" /></a>";
buttonsArr["advisortrainee"] = "<a href=\"http://www.raymondjames.com/advisorchoice/training/\"><img src=\"images/buttons/090512_advisorTrainee.gif\" id=\"advisorTraineeBtn\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding: 0px 16px 0px 10px;\" /></a>";
buttonsArr["marketingsupport"] = "<a href=\"advisor_marketing_resources.asp\"><img src=\"images/buttons/090512_marketingSupport.gif\" id=\"marketingSupportBtn\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding: 0px 16px 0px 10px;\" /></a>";
buttonsArr["bdchecklist"] = "<a href=\"library/broker_dealer_check.asp?affil=AC\" target=\"_blank\" onclick=\"window.open(this.href,'_blank','width=800,height=725,resizable,scrollbars'); return false;\"><img src=\"images/buttons/090512_brokerDealerCheckList.gif\" id=\"bdchecklistBtn\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding-right: 26px;\" /></a>";
buttonsArr["billofrights"] = "<a href=\"advisor_bill_rights.asp\"><img src=\"images/buttons/090512_billRights.gif\" id=\"billofrightsBtn\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding: 0px 16px 0px 10px;\" /></a>";
buttonsArr["contact"] = "<a href=\"request_info.asp\"><img src=\"images/buttons/090512_requestInfo.gif\" id=\"contactBtn\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding-right: 26px;\" /></a>";
buttonsArr["bdfaq"] = "<a href=\"broker_dealer_faq.asp\"><img src=\"images/buttons/090512_brokerDealerFAQ.gif\" id=\"bdfaqBtn\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding-right: 26px;\" /></a>";
buttonsArr["wpconsidermove"] = "<a href=\"white_papers.asp\"><img src=\"images/buttons/090512_whitePaperCareer.gif\" id=\"wpconsidermoveBtn\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding-right: 26px;\" /></a>";
buttonsArr["transitions"] = "<a href=\"/advisorchoice/library/multimedia/media_player.asp?url=23_RJAR_Transitions.flv&mediatype=FLV&width=376&height=350\" href=\"_target\" onclick=\"window.open(this.href,'_blank','width=400,height=500,resizable'); return false;\"><img src=\"images/buttons/090512_transitions.gif\" id=\"transitionsBtn\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding: 0px 16px 0px 10px;\" /></a>";
buttonsArr["wpbusmod"] = "<a href=\"white_papers.asp\"><img src=\"images/buttons/090806_whitePaperBusMod.gif\" id=\"wpbusmod\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding: 0px 16px 0px 10px;\" /></a>"
buttonsArr["annualreport08"] = "<a href=\"/annualreport/\" target=\"_blank\" onclick=\"window.open(this.href,'_blank','width=990,height=700,resizable,menubar'); return false;\"><img src=\"images/buttons/090115_annualreport08.gif\" id=\"annualreport08Btn\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding-right: 26px;\" /></a>";
buttonsArr["practiceinsights"] = "<a href=\"practice_insights_newsletter.asp\"><img src=\"images/buttons/090728_practiceInsights.gif\" id=\"practiceInsights\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding: 0px 16px 0px 10px;\" /></a>";
buttonsArr["smartmoney09"] = "<a href=\"http://www.raymondjames.com/pr/090609.htm\" target=\"_blank\"><img src=\"images/buttons/090716_smartMoney.gif\" id=\"smartmoney09\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" style=\"padding: 0px 16px 0px 10px;\" /></a>";
buttonsArr["reasonsgen"] = "<a href=\"reasons_generator.asp\"><img src=\"images/buttons/091019_reasonsGen.gif\" id=\"reasonsGen\" width=\"151\" height=\"108\" onmouseover=\"hovChange(this.id);\" onmouseout=\"hovChange(this.id);\" /></a>";
buttonsArr["tjfoxq409"] = "<a href=\"library/multimedia/media_player.asp?url=2009_1022Q4JamesFBN.flv&mediatype=FLV&width=376&height=350\" target=\"_blank\" onclick=\"window.open(this.href,'_blank','top=150,left=250,width=450,height=500,resizable'); return false;\"><img src=\"images/front/buttons/091022_tomJamesFoxQ4.gif\" id=\"091022_tomJamesFoxQ4\" width=\"144\" height=\"173\" style=\"padding: 0px 23px 0px 10px;\" /></a>"

//Create CallOut Array
var calloutsArr = new Array();
calloutsArr["generalsolidground"] = "<a href=\"reasons.asp\"><img src=\"/advisorchoice/images/front/callout/generalSolidground.gif\" width=\"372\" height=\"127\" /></a>";
calloutsArr["directsolidground"] = "<a href=\"library/multimedia/media_player.asp?url=2009_0722Q3JamesCNBC.flv&mediatype=FLV&width=376&height=350\" target=\"_blank\" onclick=\"window.open(this.href,'_blank','width=450,height=525,resizable,menubar'); return false;\"><img src=\"/advisorchoice/images/front/callout/directStandStrong.gif\" width=\"372\" height=\"127\" /></a>";
calloutsArr["directstandstrong"] = "<a href=\"library/multimedia/media_player.asp?url=2009_0722Q3JamesCNBC.flv&mediatype=FLV&width=376&height=350\" target=\"_blank\" onclick=\"window.open(this.href,'_blank','width=450,height=525,resizable,menubar'); return false;\"><img src=\"/advisorchoice/images/front/callout/directStandStrong.gif\" width=\"372\" height=\"127\" /></a>";
calloutsArr["generalaceducation"] = "<a href=\"reasons.asp#experiencedadvisors\"><img src=\"/advisorchoice/images/front/callout/generalACeducation.gif\" width=\"372\" height=\"127\" /></a>";
calloutsArr["directaceducation"] = "<a href=\"matrix/\" target=\"_blank\" onclick=\"window.open(this.href,'_blank','width=900,height=680,resizable,scrollbars'); return false;\"><img src=\"/advisorchoice/images/front/callout/directACeducation.gif\" width=\"372\" height=\"127\" /></a>";
calloutsArr["generalsatisfaction"] = "<a href=\"reasons.asp#satisfied\"><img src=\"/advisorchoice/images/front/callout/generalSatisfaction.gif\" width=\"372\" height=\"127\" /></a>";
calloutsArr["generalloveithere"] = "<a href=\"reasons.asp#satisfied\"><img src=\"/advisorchoice/images/front/callout/generalLoveItHere.gif\" width=\"372\" height=\"127\" /></a>";
calloutsArr["directloveithere"] = "<a href=\"white_papers.asp\"><img src=\"/advisorchoice/images/front/callout/directLoveItHere.gif\" width=\"372\" height=\"127\" /></a>";
calloutsArr["directloveithere2"] = "<a href=\"practice_insights_newsletter.asp\"><img src=\"/advisorchoice/images/front/callout/directLoveItHere2.gif\" width=\"372\" height=\"127\" /></a>";

