// Variables for Active Menu (Colors)
var itemBg    = "#F9F9F9";
var itemColor = "#F9F9F9";
var fontColor = "#E33131";

// Active Menu Functions
function getObj(elementID) {
	return document.getElementById(elementID);
}

function shiftTo(obj,x,z) {
	var newObj = getObj(obj)
	newObj.style.left = x + "px";
	newObj.style.top = y + "px";
	newObj.style.zIndex = z;
}

function getObjX(obj) {
	return parseInt(getObj(obj).style.left);
}

function getObjY(obj) {
	return parseInt(getObj(obj).style.top);
}

function getObjZ(obj) {
	return parseInt(getObj(obj).style.zIndex);
}

function emptyNode(elementID) {
	var node = getObj(elementID);
	for (i=0;i<node.childNodes.length;i++) {
		node.removeChild(node.childNodes[i]);
	}
}

function checkDOM(newlocation) {
	if (!theDOM1) {
		window.location.replace(newlocation);
	}
}

function setBackground(thisobj, color) { 
	thisobj.style.background = color; 
}


function setColor(thisobj, color) {
	thisobj.style.color = color;
}

function setVisibility(obj,vis) {
	var theObj = getObj(obj);
	if (vis == true || vis=='visible' || vis=='y') {
		theObj.style.visibility = "visible";
	}
        else {
		theObj.style.visibility = "hidden";
	}
}

function isVisible(obj) {
	var theObj = getObj(obj);
	return theObj.style.visibility;
}

function showmenu(menuID) {
	setVisibility('menubox'+menuID,"visible");
}

function hidemenu(menuID) {
	setVisibility('menubox'+menuID,"hidden");
}

function goUrl(thisobj,menunum,itemnum) {
	window.location.href = eval("menu"+menunum+"url["+itemnum+"]");
}