function toggleGTS(state) {
	if (document.getElementById) {
		var gtsLink = document.getElementById("gtsLink");
		gtsLink.setAttribute("href", "#"); // get rid of the href
		var menu = document.getElementById("goToSectionBox").firstChild;
// Make sure the firstChild is an HTML tag and nothing else
		while (menu.nodeType != 1) { //nodeType 1 is HTML element
			menu = menu.nextSibling; // assign next sibling instead
		}
		setElementClass(gtsLink, state);
		setElementClass(menu, state);
		if (document.getElementById("searchType")) {
			if (state == "active") { 
				document.getElementById("searchType").style.visibility = "hidden";
			} else {
				document.getElementById("searchType").style.visibility = "visible";
			}
		}
	}
}


function getElementClass(element) {
	if (element.getAttribute("class")) {
		return element.getAttribute("class");
	} else if (element.getAttribute("className")) {
		return element.getAttribute("className");
	}
}

function setElementClass(element, classValue) {
	if (element.setAttribute("class", classValue)) {
		element.setAttribute("class", classValue);
	} else if (element.setAttribute("className", classValue)) {
		element.setAttribute("className", classValue);
	}
}