function applySelectedTo(link) {
	var ul = document.getElementsByTagName("ul")[9]; // get the 9th ul tag (or the number for the menu) on the page
	var allLinks = ul.getElementsByTagName("a"); // get all the links within that ul
	for (var i=0; i<allLinks.length; i++) { // iterate through all those links
		allLinks[i].className = ""; // and assign their class names to nothing
	}
	link.className = "selected";  // finally, assign class="selected" to our chosen link

	var allDivs = document.getElementsByTagName("div");
	for (var k=0; k<allDivs.length; k++) {
		allDivs[k].className = "";	
	}
	var themeId = link.getAttribute("href").split("#")[1];
	themeId = document.getElementById(themeId);
	themeId.className = "on";
}
//this script is for IE 6 to show the css dropdown menus other browsers don't need this for the drop down menus to work
sfHover = function() {
var sfEls = document.getElementById("navigation").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
