toggle = function(id, state, bgcolor) {
	var i, activeNav;
	activeNav = $("#mainnav .active").attr("id");
	if (id.indexOf("-S") == -1) {
		IDs = new Array("index", "approach", "portfolio", "culture", "news", "services", "contact");
	} else {
		IDs = new Array("index-S", "approach-S", "portfolio-S", "culture-S", "news-S", "services-S", "contact-S");
	}
	for (i=0; i<IDs.length; i++) {
		if (IDs[i] != activeNav) {
			$("#" + IDs[i]).attr("src", "/images/nav-" + bgcolor + "-" + IDs[i] + "-0.gif");
		}
	}
	switch(state) {
		case 1:
			$("#" + id).attr("src", "/images/nav-" + bgcolor + "-" + id + "-1.gif");
			break;
		case 0:
			if (id != activeNav) {
				$("#" + id).attr("src", "/images/nav-" + bgcolor + "-" + id + "-0.gif");
			}
			break;
	}
}

// not a function: preload menu images
image_names = new Array("index", "approach", "portfolio", "culture", "news", "services", "contact");
image_colors = new Array("008BC8", "FFFFFF", "000000", "FFDE17");
l = 0;
menu_image_on = new Array();
menu_image_off = new Array();
menu_image_onS = new Array();
menu_image_offS = new Array();
if (mainCat != "index") {
	l = 0;
	for (n = 0; n < image_names.length; n++) {
		menu_image_on[l] = new Image();
		//menu_image_off[l] = new Image();
		menu_image_on[l].src = "/images/nav-"+ mainCatColor + "-" + image_names[n] + "-1.gif";
		//menu_image_off[l].src = "/images/nav-" + mainCatColor + "-" + image_names[n]  + "-0.gif";
		l++;
	}
} else {
	l = 0;
	for (n = 0; n < image_names.length; n++) {
		menu_image_onS[l] = new Image();
		//menu_image_offS[] = new Image();
		menu_image_onS[l].src = "/images/nav-" + mainCatColor + "-" + image_names[n] + "-S-1.gif";
		//menu_image_offS[].src = "/images/nav-" + mainCatColor + "-index-S-0.gif";
		l++;
	}
}
// end preload menu images
