// JavaScript Document
// topnav background image
var topnav_bg = 'url(img/btn_hover2.jpg)';
// leftnav background image
var leftnav_bg = 'url(img/btn_l_hover.jpg)';
// Create the array that will control the buttons being highlighted
var aNavButtonControl = {
	'auctions.php':{'id':'blank_bg','background_image':'url(img/btn_hover_special.png)'},
	'findyourvehicle.php':{'id':'vehicle','background_image':topnav_bg},
	'aboutus.php':{'id':'about','background_image':topnav_bg},
	'services.php':{'id':'services','background_image':topnav_bg},
	'contactus.php':{'id':'contact','background_image':topnav_bg},
	'careers.php':{'id':'careers','background_image':topnav_bg},
	'index.php':{'id':'home','background_image':leftnav_bg},
	'locations.php':{'id':'locations','background_image':leftnav_bg},
	'training.php':{'id':'training','background_image':leftnav_bg},
	'employees.php':{'id':'employee','background_image':leftnav_bg},
	'community.php':{'id':'community','background_image':leftnav_bg},
	'survey.php':{'id':'customer','background_image':leftnav_bg}
};
// get the path name of the file we are on
var url = window.location.pathname;
// pull out just the file name
var filename = url.substring(url.lastIndexOf('/')+1);

$(document).ready(function(){
	// If file name is defined in the array let move on
	if ( aNavButtonControl[filename] != undefined ) {
		// Replace the specific id with a background-image of it's specific background variable
		$('#' + aNavButtonControl[filename].id).css({"background-image":aNavButtonControl[filename].background_image,"color":"white"});
	}
});
