// leave the submenu on, don't hide after a moment

$(document).ready(function() {
	// find out what page you're on
	currentURL = window.location.pathname;
	currentFileName = currentURL.substr(1);
	
	// depending on the current page show respective submenu
	// left: -1000em (invisible - Spry Widget settings)
	// left: auto (visible - Spry Widget settings)
	if ((currentFileName == "about-us.php") || (currentFileName == "about-us-company.php") || (currentFileName == "about-us-team.php") || (currentFileName == "what-we-do-clients.php")) {
		$("#about").css('left', "auto");
		highlight("about");
	} else if ((currentFileName == "what-we-do.php") || (currentFileName == "what-we-do-pr.php") || (currentFileName == "what-we-do-marketing.php") || (currentFileName == "what-we-do-events.php") || (currentFileName == "gallery.php")) {
		$("#what-we-do").css('left', "auto");
		highlight("what-we-do");
	} else if ((currentFileName == "why-redmint.php") || (currentFileName == "why-redmint-firsts.php")) {
		$("#why-redmint").css('left', "auto");
		highlight("why-redmint");
	}
	
	
	
});

function highlight(d) {
	$("#"+d+" a").each(function() {
		var h = $(this).attr("pathname").substr(1);
		if (h == currentFileName) {
			$(this).css("padding-left", "20px");
			$(this).css("color", "#000000");
		} else {
			$(this).css("padding-left", "25px");
			$(this).css("color", "#617D6E");
		}
	});
}
