/* bc_navbuttons.js
* displays on states based on page title and section page is in
* biersma creative 2006
* relies on prototype because I'm checking it out (jen)
*/
//put the following in the file that includes this javascript to define the sections and then page names
//in the body tag, use <body onload="load_navigation">
//define arrays of page names using section names af the variables


var about = ['about_overview','message_partners','corporate_fact','what_clients_say'];
var who_we_are = ['terry_hillard','arnette_heintze','g_verden','harvey_radney','matthew_doherty','larry_johnson','plez_transou','kenneth_bouche','glen_cannon','alex_echo','georgeann_dicaprio','jennifer_bushaw','karen_carpenter','darren_beck','stephen_grant','vicky_froderman','william_aslan','senior_leadership_council','hillard_heintze_team','who_we_are_overview','kathleen_otoole','robert_parker','value_insight','slc','slc_value','pd_operations','consent_decree','crime_reduction','enablement_information','policing_strategies','participation_members','tom_streicher','jake_jacocks'];
var why_hillard_heintze = ['senior_security_leadership','world_class','integrity','best_practice','strategic_relationships'];
var how_we_can_help = ['how_we_can_help_overview','strategic_services','investigative_services','risk_assessment','behavioral_assessments','industries_we_serve','leaders_we_support','risk_assessments','information_analysis','security_management','strategic_development','operational_execution','justice_sharing','protective_operations','major_event_security','executive_protection','protection_development','emergency_preparedness','threat_mitigation','emergency_planning','disaster_planning','tabletop_exercises','education_awareness','security_education','emergency_education','threat_education','advisory_representation','brand_stewardship','sales_development','program_management','background_investigations','financial_crimes','mortgage_fraud','civil_investigations','corporate_diligence','employee_conduct','litigation_support','business_intelligence','case_studies','case_study1','case_study2','case_study3','case_study4','360_insight','case_study101','case_study102','case_study103','case_study104','case_study105','case_study106','case_study107','case_study108','case_study109','case_study110','case_study111','case_study112','case_study113','case_study114','case_study115','case_study116','case_study117'];
var partners = ['partners_overview','alliances','strategic_partners'];
var press = [];
var contact = [];
//define the section names
var section_names = ['about', 'who_we_are', 'why_hillard_heintze', 'how_we_can_help', 'partners', 'press', 'contact'];
var sections = [about, who_we_are, why_hillard_heintze, how_we_can_help, partners, press, contact];
var extension = ".php";
var contact = [];
var extention_off = "_nav.gif";
var extention_on = "_nav_on.gif";
var images_folder = "images/interior/";
var current_page = window.location.pathname.toLowerCase().replace("/","");
var page_name = current_page.replace(extension, "");

function load_navigation(){

 sections.each( function(currentSection, ind){
  //if name of page is the name of a section , turn it on and exit
    if(page_name == section_names[ind]){

	  //turn page title on, can just put this before load navigation if every page has a navigation item - and remove from second loop as well
      $(page_name).src = images_folder + page_name + extention_on;
	  return;
    }
	//look in the array with the name matching the current value

	currentSection.each( function(section_page){
	  if(section_page == page_name){
        //if the name of the page is in that array, make the section nav on and the page nav on and exit
		$(section_names[ind]).src = images_folder + section_names[ind] + extention_on;
        $(page_name).src = images_folder + page_name + extention_on;
		return;
		}
	});
  });
}

/*putting this in here because i don't want to put it in every single page head */
function Verify(form) {
		var user = form.username.value;
		var pass = form.password.value;

		if ((user == "") && (pass == ""))
		{
			window.alert("Please enter your user name and password to sign in.");
			form.username.focus();
			return false;
		}
		else if (user == "")
		{
			window.alert("Please enter your user name.");
			form.username.focus();
			return false;
		}
		else if (pass == "")
		{
			window.alert("Please enter your password.");
			form.password.focus();
			return false;
		}
		else
		{
			return true;
		}
	}

	function init()
	{
		document.forms[0].elements["username"].focus()
	}