// JavaScript Document


/**
*	Searches through all links on page, looking for those that link to the current page.
*	The links are changed to links to "#", and the CSS style is set to the given newsStyle.
*	@param newStyle - name of the CSS class to apply to links that point to current page.
*/
function changeSelfLinks(newClass, oldClass) {
	var aLink;
	var docURL = document.URL;
	if (docURL.charAt(docURL.length - 1) == '/') {
		docURL = docURL + "index.html";
	}
	var pndLoc = docURL.indexOf('#');
	if (pndLoc > - 1) {
		docURL = docURL.substr(0, pndLoc);
	}
	for (i = 0; i < document.links.length; i ++) {
		aLink = document.links[i];
		if (aLink.href == docURL) {
			aLink.href = "#";
			if (aLink.className == oldClass) {
				aLink.className = newClass;
			}
		}
	}
}


function disableLink(linkId) {
	var aLink = document.getElementById(linkId);
	
	aLink.href = "#";
	aLink.className = "menuSelected";
	aLink.setAttribute("onClick", "");
}


function toggleView(baseElement, count) {
	return true; // disable function
	
	var elem = document.getElementById(baseElement.id + "1");
	if (elem.className == "") {
		return true; // sub-menu already shown; follow link
	}
	//var newClass = (elem.className == "" ? "hidden" : "");
	elem.className = "";//newClass;
	for (i = 2; i <= count; i ++) {
		elem = document.getElementById("" + baseElement.id + i);
		elem.className = "";//newClass;
	}
	//baseElement.setAttribute("onClick", ""); // make 2nd click active
	baseElement.className = "menu";
	return false;
}

