// Basic Javascript functions

function changeClass(theID, theType)
{
	var theElement = document.getElementById(theID);
	if (theType == "On")
	{
 		theElement.className = "menuChoice menuOn"
	} else {
 		theElement.className = "menuChoice menuOff"
	}
}

function getRequestObject()
{
	var req = null;
	try
	{
		req = new XMLHttpRequest();
	} catch (trymicrosoft) {
		try
		{
		 req = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (othermicrosoft) {
			try
			{
			 req = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (failed) {
				req = null;
			}
		}
	}
	
	return req;
}

function replaceText(el, text)
{
	if (el != null)
	{
		cleatText(el);
		var newNode = document.createTextNode(text);
		el.appendChild(newNode);
	}
}

function clearText(el)
{
	if (el != null)
	{
		if (el.childNodes)
		{
			for (var i=0; i<el.childNodes.length; i++)
			{
				var childNode = el.childNodes[i];
				el.removeChild(childNode);
			}
		}
	}
}

function getText(el)
{
	var text = "";
	if (el != null)
	{
		if (el.childNodes)
		{
			for (var i=0; i<el.childNodes.length; i++)
			{
				var childNode = el.childNodes[i];
				if (childNode.nodeValue != null)
				{
					text = text + childNode.nodeValue;
				}
			}
		}
	}
	return text;
}

function ShowHide(el, ztype)
{
	var zlabel = document.getElementById(el);
	zlabel.style.visibility = ztype;
}



