$(function() { 

	// Per region slide in the countries and show the red hover image
	
	$(".africa, #a_africa").hover(function () {
		$("#africa-countries").stop(true, true).show("slide", { direction: "right" }, 573);
		$(".africa").addClass('africa-hover');
	},
	function () {
		$("#africa-countries").hide("slide", { direction: "right" }, 573);
		$(".africa").removeClass('africa-hover');
	});
	
	$(".caribbean, #a_caribbean").hover(function () {
		$("#caribbean-countries").stop(true, true).show("slide", { direction: "right" }, 382);
		$(".caribbean").addClass('caribbean-hover');
	},
	function () {
		$("#caribbean-countries").hide("slide", { direction: "right" }, 382);
		$(".caribbean").removeClass('caribbean-hover');
	});	

	$(".southamerica, #a_southamerica").hover(function () {
		$("#southamerica-countries").stop(true, true).show("slide", { direction: "right" }, 194);
		$(".southamerica").addClass('southamerica-hover');
	},
	function () {
		$("#southamerica-countries").hide("slide", { direction: "right" }, 194);
		$(".southamerica").removeClass('southamerica-hover');
	});	
	
	// Give Network menu element selected class if the href matches the location to highlight the network page you are on
	$("#network li a").each(function (i) {
		if ( $(this).attr('href') == window.location.href) {
			$(this).addClass("selected");
		}
	});
	
});

