function displaySelects( selectVisibility ) {
	for ( var i = 0; i < document.forms.length; i++ ) {
		for ( var j = 0; j < document.forms[i].elements.length; j++ ) {
			if ( document.forms[i].elements[j].type.indexOf( "select" ) != -1 ) {
				document.forms[i].elements[j].style.visibility = selectVisibility;
			}
		}
	}
}



function showSubNav(strSubNav){

	var strNav;
	var bComplete;

	imgOn(strSubNav);

	if(document.getElementById){
		bComplete = "document.getElementById('" + strSubNav + "Menu')";
	}
	else if(document.all){
		bComplete = "document.all['" + strSubNav + "Menu']";
	}

	strNav = eval(bComplete);

	if (strNav){
		strNav.style.visibility = 'visible';
	}

	displaySelects( 'hidden' );

}


function hideSubNav(strSubNav){

	var strNav;
	var strComplete;

	imgOff(strSubNav);

	if(document.getElementById){
		bComplete = "document.getElementById('" + strSubNav + "Menu')";
	}
	else if(document.all){
		bComplete = "document.all['" + strSubNav + "Menu']";
	}

	strNav = eval(bComplete);

	if (strNav){
		strNav.style.visibility = 'hidden';
	}

	displaySelects( 'visible' );

}


if (document.images) {	
					
	nrson = new Image();
	nrson.src="/buttons04/nav_nrs_on.jpg";
	nrsoff = new Image();
	nrsoff.src="/buttons04/nav_nrs_off.jpg";

	iaon = new Image();
	iaon.src="/buttons04/nav_ia_on.jpg";
	iaoff = new Image();
	iaoff.src="/buttons04/nav_ia_off.jpg";

	bdon = new Image();
	bdon.src="/buttons04/nav_bd_on.jpg";
	bdoff = new Image();
	bdoff.src="/buttons04/nav_bd_off.jpg";

	hfon = new Image();
	hfon.src="/buttons04/nav_hf_on.jpg";
	hfoff = new Image();
	hfoff.src="/buttons04/nav_hf_off.jpg";

	inson = new Image();
	inson.src="/buttons04/nav_ins_on.jpg";
	insoff = new Image();
	insoff.src="/buttons04/nav_ins_off.jpg";

	confon = new Image();
	confon.src="/buttons04/nav_conf_on.jpg";
	confoff = new Image();
	confoff.src="/buttons04/nav_conf_off.jpg";

	ccpon = new Image();
	ccpon.src="/buttons04/nav_conf_on.jpg";
	ccpoff = new Image();
	ccpoff.src="/buttons04/nav_conf_off.jpg";

	techon = new Image();
	techon.src="/buttons04/nav_tech_on.jpg";
	techoff = new Image();
	techoff.src="/buttons04/nav_tech_off.jpg";

	loginon = new Image();
	loginon.src="/buttons04/nav_login_on.jpg";
	loginoff = new Image();
	loginoff.src="/buttons04/nav_login_off.jpg";

}


			
function imgOn(iname) {
	var objFont;

	objFont = eval("document.getElementById('mnu" + iname + "')");
	objFont.style.color="#000000";
}



function imgOff(iname) {
	var objFont;

	objFont = eval("document.getElementById('mnu" + iname + "')");
	objFont.style.color="#FFFFFF";
}


	
	var arMenu = new Array();

	arMenu[0] = new Array(
		"nrs",
		10,  //pixels from left
		110, // width of menu
		"About NRS", "/about/default.asp",
		"Press Room", "/about/press.asp",
		"Meet Our Staff", "/about/staff.asp",
		"Clients", "/about/clients.asp",
		"Links", "/about/links.asp",
		"Employment", "/about/jobline.asp",
		"Contact Us", "/about/contactus.asp"
		);


	arMenu[1] = new Array(
		"ia",
		60, // pixels from left
		250, // width of menu
		"ADV Review/Rewrite Service", "/ia/adv_review.asp",
		"Advertising/Performance Review", "/ia/performance.asp",
		"Adviser Code of Ethics", "/ia/ace.asp",
		"Annual ADV Amendments", "/ia/annual03.asp",
		"Annual Review Service", "/ia/annual_review.asp",
		"Anti-Money Laundering Kit", "/ia/amlkit.asp",
		"Compliance Alliance", "/ia/compAlliance.asp",
		"NRS ComplianceEssentials", "/ia/compease.asp",
		"NRS ComplianceEssentials Annual Review Tool", "/ia/compeaseart.asp",		
		"Compliance in a Box", "/ia/compinabox.asp",
		"Compliance Outsourcing Service", "/ia/outsourcing.asp",
		"ComplyNet", "/tech/complynet.asp",
		"Consulting Services", "/ia/consulting.asp",
		"Desktop Seminars", "/conf/desktop/default.asp",
		"Due Diligence Services", "/ia/diligence.asp",
		"Email Monitoring and Archiving", "/tech/emailarchiving.asp",
		"E-Z 2000 Registration Software", "/tech/ez_2000.asp",
		"IA Policies and Procedures", "/ia/manual.asp",
		"Investment Adviser Registration", "/ia/full_service.asp",
		"Mock SEC/State Examination", "/ia/audit.asp",
		"Model Investment Advisory Contracts", "/ia/model.asp",
		"NRS Privacy Kit", "/tech/privacy_kit.asp",
		"NRS Tracker", "/tech/tracker.asp",
		"State Registration/Notification Service", "/ia/state_reg.asp",
		"Red Flag Locator", "/ia/redflagloc.asp",
		"Regulatory Register Newsletter", "/tech/reg_reg.asp",
		"Wrap Fee Consulting", "/ia/wrapfee.asp"
		);
		
	arMenu[2] = new Array(
		"ic",
		197, // pixels from left
		175, // width of menu
		"Blue Sky Solution System", "/ic/default.asp",
		"Blue Sky Solution Outsourcing", "/ic/outsourcing.asp"
		);
		


	arMenu[3] = new Array(
		"bd",
		330, // pixels from left
		250, // width of menu
		"Broker-Dealer Registration", "/bd/full_service.asp",
		"State Registrations", "/bd/state_reg.asp",
		"Anti-Money Laundering Rep Training", "/bd/amltraining.asp",
		"Anti-Money Laundering Audit", "/bd/amlaudit.asp",
		"Written Supervisory Policies & Procedures", "/bd/wspp.asp",
		"Registered Representative Manual", "/bd/regrepman.asp",
		"Agent Registration Service Bureau", "/bd/agent_reg.asp",
		"Email Monitoring and Archiving", "/tech/emailarchiving.asp",
		"E-Z 2000 Registration Software", "/tech/ez_2000.asp",
		"NRS Privacy Kit", "/tech/privacy_kit.asp",
		"Regulatory Register Newsletter", "/tech/reg_reg.asp",
		"Mock NASD Examination", "/bd/mock_exam.asp",
		"ComplyNet", "/tech/complynet.asp",
		"NRS Tracker", "/tech/tracker.asp",
		"Consulting Services", "/bd/consulting.asp",
		"Compliance Outsourcing Service", "/bd/outsourcing.asp",
		"Annual Compliance Meeting", "/bd/annualcomp.asp",
		"NRS ComplianceEssentials BD", "/bd/compease.asp"
		);


	arMenu[4] = new Array(
		"hf",
		440, // pixels from left
		150, // width of menu
		"Anti-Money Laundering", "/hf/aml.asp",
		"NRS ComplianceEssentials", "/ia/compease.asp",
		"Consulting", "/hf/consulting.asp",
		"Form D", "/hf/formd.asp",
		"Registration Services", "/hf/full_service.asp"
		);
//Change "/ia/compease.asp" to "/hf/compease.asp" above, 
//when we're ready to support Hedge Fund Manual (DMS 3/23/2007)

	arMenu[5] = new Array(
		"ins",
		530,  //pixels from left
		200, // width of menu
		"Insurance Registration Service", "/ins/registration.asp",
		"Agent Licensing Services", "/ins/agent_lic.asp",
		"Appointment Outsourcing Service", "/ins/appoint.asp",
		"Best Practices Guide", "/ins/best_prac.asp",
		"NRS Tracker", "/tech/tracker.asp",
		"Consulting Services", "/ins/consulting.asp",
		"Compliance Outsourcing Service", "/ins/outsourcing.asp"
		);


	arMenu[6] = new Array(
		"conf",
		610, // pixels from left
		225, // width of menu
		"Conference & Seminar Calendar", "/tech/confcalform.asp",
		"Annual Spring Compliance Conference", "/conf/spring/default.asp",
		"Annual Fall Compliance Conference", "/conf/fall/default.asp",
		//"Building a Successful SEC Exam Strategy","/conf/SECExam/default.asp",
		//"Protecting Your Firm from SEC Scrutiny","/conf/SoftDollar/default.asp",
		"NRS 2007 Symposium on SEC Examinations of Investment Advisers","/conf/sec_ia_exam/default.asp",
		"NRS 2007 Symposium on Branch Office Auditor Training ","/conf/bd_audit_training/default.asp",
		//"Building Compliance Programs for IAs", "/conf/comppro/default.asp",
		//"Getting NASD Rules 3012, 3013 and 3010 Under Control", "/conf/bdrules/default.asp",
		//"'WHITE HOT' ADVISORY COMPLIANCE ISSUES", "/conf/compissue/default.asp",
		//"Meeting the Challenges of the Compliance Program Rule","/conf/CompProRule/default.asp",
		"Desktop Seminars", "/conf/desktop/default.asp",
		//"Hedge Fund Registration and Compliance Conference", "/conf/hedge/default.asp",
		"Library of Workbooks", "/conf/wkbooks.asp",
		"Basic Training for Investment Advisers", "/conf/basic/default.asp",
		"Customized Training", "/conf/custom.asp",
		"Future Events", "/conf/futureevents.asp",
		"Past Conferences", "/conf/pastconf.asp" 
		);

	arMenu[7] = new Array(
		"ccp",
		707, // pixels from left
		225, // width of menu
		"Center for Compliance Professionals (CCP)", "/ccp/default.asp",
		"CCP Certificate Program", "/ccp/certificate.asp", 
		"CCP Certifying Exam", "http://www.webassessor.com/nrs_ccp",
		"CCP Continuing Ed", "/ccp/IACCPContEdSummary.asp"
		);

	arMenu[8] = new Array(
		"tech",
		770, // pixels from left
		190, // width of menu
		"ComplyNet", "/tech/complynet.asp",
		"Custom Software Development", "/tech/custom.asp",
		"Email Monitoring and Archiving", "/tech/emailarchiving.asp",
		"E-Z 2000 Registration Software", "/tech/ez_2000.asp",
		"IA-Info", "/tech/ia_info.asp",
		"NRS Tracker", "/tech/tracker.asp",		
		"NRS Privacy Kit", "/tech/privacy_kit.asp",		
		"NRS Support", "/support/default.asp" 
		);


	arMenu[9] = new Array(
		"login",
		855, // pixels from left
		175, // width of menu
		"AML Kit", "/amlkit/default.asp",
		"AML Training", "/amltraining/default.asp",
		"Reg Rep Manual", "/regrepmanual/default.asp",
		"ComplyNet", "http://www.complyweb.com",
		"IA Policies and Procedures", "/ia_wsp/default.asp",
		"Compliance in a Box", "/compbox/content.asp",
		"Model Contracts", "/modcon/login.asp",
		"Privacy Kit", "/spkit/default.asp",
		"Adviser Code of Ethics", "/ace/default.asp",
		"NRS ComplianceEssentials", "/unified/default.asp",
		"NRS ComplianceEssentials ART", "/acr/default.asp",
		"NRS ComplianceEssentials WSP", "/bd_wsp/login.asp"
		);
//Add "NRS ComplianceEssentials HF", "/hfman/login.asp" to this list,  
//when we're ready to support Hedge Fund Manual (DMS 3/23/2007)

		//"BD Policies and Procedures", "/bd_wsp/default.asp",
		//"Compliance in a Box", "/compbox/default.asp",
		//"IA Model Contracts", "/modcontracts/default.asp"


function setUpMenus(strBackColor, strOverColor, strTextColor, strOverTextColor, strLineColor){


	if ((document.all) || (document.getElementById)){
		var strSubNav = "";
		for (j = 0; j < arMenu.length; j++){
			strSubNav += "<div id=\"" + arMenu[j][0] + "Menu\" style=\"z-Index:999;position: absolute; left: " + arMenu[j][1] + "; width: " + arMenu[j][2] + ";  visibility: hidden\"  onmouseover=\"showSubNav('" + arMenu[j][0] + "');\" onmouseout=\"hideSubNav('" + arMenu[j][0] + "');\">";

			strSubNav += "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"" + arMenu[j][2] + "\">";

			for (i=3; i < arMenu[j].length-1; i=i+2){
				strSubNav += "<tr>";

				strSubNav += "<td width=\"1\" bgcolor=\"#000000\"><img src=\"/images04/1.gif\" width=\"1\" height=\"18\"></td>";

				strSubNav += "<td width=\"6\" bgcolor=\"#6699FF\" class=\"siNavSide\"><img src=\"/images04/1.gif\" width=\"6\" height=\"18\"></td>";

				if (document.isRemoteHosted == 'local' ) {

					if ( (IsRelativeURL( arMenu[j][i+1] )) ) {

						strSubNav += "<td width=\"" + arMenu[j][2] + "\" bgcolor=\"" + strBackColor + "\" class=\"nrsNavMenu\" onClick=\"document.location.href='" + arMenu[j][i+1] + "'\" onmouseover=\"this.bgColor='" + strOverColor + "';this.style.color='" + strOverTextColor+ "';\" onmouseout=\"this.bgColor='" + strBackColor + "';this.style.color='" + strTextColor + "'\" style=\"color: " + strTextColor + "\"><div style=\"padding-left:10px;\">" + arMenu[j][i] + "</a></div></td>";
						
						}
					else {
					
						//do a window.open if the url is absolute, i.e. starting with http://, https://, ftp://, or mailto://
						strSubNav += "<td width=\"" + arMenu[j][2] + "\" bgcolor=\"" + strBackColor + "\" class=\"nrsNavMenu\" onClick=\"window.open('" + arMenu[j][i+1] + "')\" onmouseover=\"this.bgColor='" + strOverColor + "';this.style.color='" + strOverTextColor+ "';\" onmouseout=\"this.bgColor='" + strBackColor + "';this.style.color='" + strTextColor + "'\" style=\"color: " + strTextColor + "\"><div style=\"padding-left:10px;\">" + arMenu[j][i] + "</a></div></td>";
						
						}						
				}

				else if ( !(IsRelativeURL( arMenu[j][i+1] )) ) {

					strSubNav += "<td width=\"" + arMenu[j][2] + "\" bgcolor=\"" + strBackColor + "\" class=\"nrsNavMenu\" onClick=\"document.location.href='http://www.nrs-inc.com" + arMenu[j][i+1] + "'\" onmouseover=\"this.bgColor='" + strOverColor + "';this.style.color='" + strOverTextColor+ "';\" onmouseout=\"this.bgColor='" + strBackColor + "';this.style.color='" + strTextColor + "'\" style=\"color: " + strTextColor  + "\"><div style=\"padding-left:10px;\">" + arMenu[j][i] + "</a></div></td>";

				}

				else {

					strSubNav += "<td width=\"" + arMenu[j][2] + "\" bgcolor=\"" + strBackColor + "\" class=\"nrsNavMenu\" onClick=\"document.location.href='http://www.nrs-inc.com" + arMenu[j][i+1] + "'\" onmouseover=\"this.bgColor='" + strOverColor + "';this.style.color='" + strOverTextColor+ "';\" onmouseout=\"this.bgColor='" + strBackColor + "';this.style.color='" + strTextColor + "'\" style=\"color: " + strTextColor + "\"><div style=\"padding-left:10px;\">" + arMenu[j][i] + "</a></div></td>";

				}

				strSubNav += "<td width=\"1\" bgcolor=\"#000000\"><img src=\"/images04/1.gif\" width=\"1\" height=\"18\"></td>";

				strSubNav += "</tr>";

				strSubNav += "<tr>";

				strSubNav += "<td colspan=\"3\" bgcolor=\"" + strLineColor + "\" height=\"1\"><img src=\"/images04/1.gif\" width=\"1\" height=\"1\"></td>";

				strSubNav += "</tr>";

			}

			strSubNav += "</table>";

			strSubNav += "</div>";

		}

		document.write(strSubNav);

	}

}


function IsRelativeURL (url) {

	if (url.indexOf('http://') == 0) {
		return false;
	}

	else if (url.indexOf('https://') == 0) {
		return false;
	}

	else if (url.indexOf('ftp://') == 0) {
		return false;
	}

	else if (url.indexOf('mailto://') == 0) {
		return false;
	}

	else {
		return true;
	}

}

