function getObj(a){return document.getElementById(a);}

function dynamicNav(){
	var path = window.location.href;

	if(path.match("/products/")){
			//getObj("products").src = "/images/nav/top_products_on.gif";
			getObj('products_close').style.backgroundImage = "url('/images/nav/top_products_on.gif')";
			//if(path.match("default")) getObj("products_overview").className = "navtext_selected";
			if((path.match("copy-machine"))||(path.match("copiers"))){
				getObj("copiers_overview").className = "people_navtext_selected";
				if(path.match("color")) getObj("color").className = "services_navtext_selected_sm";
				if(path.match("bw")) getObj("black_white").className = "services_navtext_selected_sm";
				if(path.match("wide")) getObj("wide_format").className = "services_navtext_selected_sm";
				if(path.match("graphics") && path.match("color")){
				getObj("graphics_color").className = "services_navtext_selected_sm";
				getObj("color").className = "navtext_secondary";
				}
			}
			if(path.match("multifunction")){
				getObj("multifunction_devices").className = "people_navtext_selected";
				if(path.match("color")) getObj("color").className = "services_navtext_selected_sm";
				if(path.match("bw")) getObj("black_white").className = "services_navtext_selected_sm";
				if(path.match("wide")) getObj("wide_format").className = "services_navtext_selected_sm";
			}
			if(path.match("production_systems")) getObj("production_systems").className = "people_navtext_selected";
			if(path.match("printers")){
				getObj("printers").className = "people_navtext_selected";
				if(path.match("color")) getObj("color").className = "services_navtext_selected_sm";
				if(path.match("bw")) getObj("black_white").className = "services_navtext_selected_sm";
				if(path.match("wide")) getObj("wide_format").className = "services_navtext_selected_sm";
				if(path.match("graphics") && path.match("color")){
				getObj("graphics_color").className = "services_navtext_selected_sm";
				getObj("color").className = "navtext_secondary";
				}
			}
			if(path.match("scanners")) getObj("scanners").className = "people_navtext_selected";
			if(path.match("fax_machines")) getObj("fax_machines").className = "people_navtext_selected";	
			if(path.match("document-management-solutions")) getObj("document_management").className = "people_navtext_selected";	
			if(path.match("document-imaging")) getObj("document-imaging").className = "people_navtext_selected";	
			if(path.match("integrated_solutions")) getObj("integrated_solutions").className = "people_navtext_selected";	
			if(path.match("supplies")){
				getObj("supplies").className = "people_navtext_selected";	
				if(path.match("media")) getObj("media").className = "services_navtext_selected_sm";
				if(path.match("ink")) getObj("ink_toner").className = "services_navtext_selected_sm";
				if(path.match("forms")) getObj("forms").className = "services_navtext_selected_sm";
			}
	}

	if(path.match("/services/")){
			//getObj("services_button").src = "/images/nav/top_services_on.gif";
			getObj('services_close').style.backgroundImage = "url('/images/nav/top_services_on.gif')";
			
			//if(path.match("default")) getObj("services_overview").className = "navtext_selected";
			if(path.match("facilities_mgmt")) getObj("facilities_management").className = "people_navtext_selected";
			if(path.match("financial_services")) getObj("financial_services").className = "people_navtext_selected";
			if(path.match("what_to_expect")){
				getObj("what_to_expect").className = "services_navtext_selected_sm";
				getObj("financial_services").className = "people_navtext_selected";
			}
			if(path.match("why_finance")){ 
				getObj("why_finance").className = "services_navtext_selected_sm";
				getObj("financial_services").className = "people_navtext_selected";
			}
			
			if(path.match("service_program")) getObj("image_service_program").className = "people_navtext_selected";
			if(path.match("onsite_services")) getObj("onsite_services").className = "people_navtext_selected";
			if(path.match("why_onsite_services")){ 
				getObj("onsite_services").className = "people_navtext_selected";
				getObj("why_onsite_services").className = "services_navtext_selected_sm";
			}
			if(path.match("onsite_services_scope")){ 
				getObj("onsite_scope").className = "services_navtext_selected_sm";
				getObj("onsite_services").className = "people_navtext_selected";
			}
			if(path.match("image_service")){ 
				getObj("imageservice").className = "services_navtext_selected_sm";
				getObj("image_service_program").className = "people_navtext_selected";
			}
			if(path.match("image_manager")){ 
				getObj("imagemanager").className = "services_navtext_selected_sm";
				getObj("image_service_program").className = "people_navtext_selected";
			}
			if(path.match("image_care")){ 
				getObj("imagecare").className = "services_navtext_selected_sm";
				getObj("image_service_program").className = "people_navtext_selected";
			}
			if(path.match("image_control")){ 
				getObj("imagecontrol").className = "services_navtext_selected_sm";
				getObj("image_service_program").className = "people_navtext_selected";
			}
	}

	if(path.match("/people/")){
			getObj('people_close').style.backgroundImage = "url('/images/nav/top_people_on.gif')";
			
			//getObj("people_button").src = "/images/nav/top_people_on.gif";
			//if(path.match("default")) getObj("people_overview").className = "navtext_selected";
			if(path.match("sales_reps")) getObj("sales_reps").className = "people_navtext_selected";
			if(path.match("system_engineers")) getObj("system_engineers").className = "people_navtext_selected";
			if(path.match("service_techs")) getObj("service_technicians").className = "people_navtext_selected";
			if(path.match("customer_service_reps")) getObj("customer_service_reps").className = "people_navtext_selected";
	}
	if(path.match("/resources/")){
			getObj('resources_close').style.backgroundImage = "url('/images/nav/top_resources_on.gif')";
			
			//getObj("resources_button").src = "/images/nav/top_resources_on.gif";
			//if(path.match("default")) getObj("resources_overview").className = "navtext_selected";
			if(path.match("request_service")) getObj("resources_request").className = "people_navtext_selected";
			if(path.match("help_desk")) getObj("resources_help").className = "people_navtext_selected";
			if(path.match("report_meter")) getObj("resources_meter").className = "people_navtext_selected";
			if(path.match("download_drivers")) getObj("resources_download").className = "people_navtext_selected";
			if(path.match("order_supplies")) getObj("resources_ordersupplies").className = "people_navtext_selected";
			if(path.match("imanager")) getObj("resources_imanager").className = "people_navtext_selected";			
			if(path.match("gfc_online")) getObj("resources_gfconline").className = "people_navtext_selected";	
			if(path.match("security")) getObj("resources_security").className = "people_navtext_selected";	
	}
	if(path.match("/about/")){
			getObj('about_close').style.backgroundImage = "url('/images/nav/top_about_on.gif')";
			
			//getObj("about_button").src = "/images/nav/top_about_on.gif";
			//if(path.match("default")) getObj("about_overview").className = "navtext_selected";
			if(path.match("vision")) getObj("about_vision").className = "people_navtext_selected";
			if(path.match("history")) getObj("about_history").className = "people_navtext_selected";
			if(path.match("customer_testimonials")) getObj("about_testimonials").className = "people_navtext_selected";
			if(path.match("community_relations")) getObj("about_relations").className = "people_navtext_selected";
			if(path.match("branch_locations")) getObj("about_locations").className = "people_navtext_selected";
			if(path.match("partners")) getObj("about_partners").className = "people_navtext_selected";			
	}
	if(path.match("/contact/")){
			//if(path.match("default")) getObj("contact_us").className = "navtext_selected";
			if(path.match("branch_locations")) getObj("branch_locations").className = "people_navtext_selected";
			if(path.match("request_information")) getObj("request_information").className = "people_navtext_selected";
			if(path.match("submit_feedback")) getObj("feedback").className = "people_navtext_selected";
			if(path.match("contact_sales_rep")) getObj("salesrep").className = "people_navtext_selected";
			if(path.match("contact_service_technician")) getObj("servicetechnician").className = "people_navtext_selected";
			if(path.match("contact_support_rep")) getObj("supportrepresentative").className = "people_navtext_selected";
	}			
	if(path.match("/news/")){
			//if(path.match("default")) getObj("news_room").className = "navtext_selected";
			if(path.match("newsletters")) getObj("newsletters").className = "people_navtext_selected";
			if(path.match("press_releases")) getObj("press_releases").className = "people_navtext_selected";
			if(path.match("case_studies")) getObj("case_studies").className = "people_navtext_selected";
			if(path.match("events")) getObj("events").className = "people_navtext_selected";
	}	
	if(path.match("/careers/")){ 
   // if(path.match("default")) getObj("careers").className = "navtext_selected";
	//if(path.match("/careers/")) getObj("careers").className = "navtext_selected";
	// BT 2/27/09 this code was causing javascript error on Careers pages so modified the next 4 lines
	//if(path.match("available_jobs")){ getObj("available_jobs").className = "navtext_selected"; careers.className = "navtext";}
	//if(path.match("employee_testimonials")){ getObj("employee_testimonials").className = "navtext_selected"; careers.className = "navtext";}
	//if(path.match("employee_benefits")){ getObj("employee_benefits").className = "navtext_selected"; careers.className = "navtext"; }
	//if(path.match("apply_online")){ getObj("apply_online").className = "navtext_selected"; careers.className = "navtext"; }
	if(path.match("available_jobs")){ getObj("available_jobs").className = "navtext_selected";}
	if(path.match("employee_testimonials")){ getObj("employee_testimonials").className = "navtext_selected";}
	if(path.match("employee_benefits")){ getObj("employee_benefits").className = "navtext_selected";}
	if(path.match("apply_online")){ getObj("apply_online").className = "navtext_selected";}
	}
	if(path.match("/n-pay/")) getObj("resources_payonline").className = "people_navtext_selected";			

	if(path.match("/cgi-bin/")){
			getObj('resources_close').style.backgroundImage = "url('/images/nav/top_resources_on.gif')";
			if(path.match("adsproc_reqs")) getObj("resources_request").className = "people_navtext_selected";
	}
}