/* 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 who_we_are = ['difference','executive_profiles','blog','company_events','careers','privacy'];
var looking_career = ['search_jobs','apply','working_with_hirestrategy','resources','faqs'];
var our_specialties = ['technology','sales','administrative','human_resources','finance_accounting'];
var looking_talent = ['contract_services','direct_hire','executive_search','register','why_work','methodology','methodology','sourcing_channels','our_customers','our_customers','sample_searches','key_differentiators'];
var whats_going_on = ['recent_articles','press_releases','newsletters'];
var talk_to_us = ['reston_map_directions','dc_map_directions'];
//define the section names
var section_names = ['who_we_are', 'looking_career', 'our_specialties', 'looking_talent', 'whats_going_on', 'talk_to_us'];
var sections = [who_we_are, looking_career, our_specialties, looking_talent, whats_going_on, talk_to_us];
var extension = ".aspx";
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("/hirestrategy/","");
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()
	}
	
	
