// This is used to control the Magic-Y menu
// Toggle Layer style for left property
function togLyr (el, status) { 
    var yale = (status == 1) ? "0" : "-999em";
    document.getElementById(el).style.left = yale;
}


// goToSection script for Goto Section Menu
function toggleGTS(state) {
	if (document.getElementById) {
		var gtsLink = document.getElementById("gtsLink");
		gtsLink.setAttribute("href", "#");
		var menu = document.getElementById("goToSectionBox").firstChild;
		while (menu.nodeType != 1) {
			menu = menu.nextSibling;
		}
		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);
	}
}


