// menu
function toggle (obj) {
	if (obj.className.substr(obj.className.length-2) == "On")
		obj.className = obj.className.substring(0,obj.className.length-2) + "Off"
	else if (obj.className.substr(obj.className.length-3) == "Off")
		obj.className = obj.className.substring(0,obj.className.length-3) + "On"
}

var xmlhttp;

function loadXMLDoc(url) {
	if (url=="") return;
	xmlhttpChange = getArticle;

	// code for Mozilla, etc.
	if (window.XMLHttpRequest) {
		xmlhttp = new XMLHttpRequest();
		xmlhttp.onreadystatechange = xmlhttpChange;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null)
	}
	// code for IE
	else if (window.ActiveXObject) {
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
		if (xmlhttp) {
			xmlhttp.onreadystatechange = xmlhttpChange;
			xmlhttp.open("GET",url,true);
			xmlhttp.send()
		}
	}
}

function getArticle() {
	if (xmlhttp.readyState==4) {
		if (xmlhttp.status==200) {
			document.getElementById("content").innerHTML = xmlhttp.responseText
			hdBanner()
		}
	}
}

function trim(inputString) {
   if (typeof inputString != "string") { return inputString; }

	retValue = inputString.replace( /^\s+/g, "" );

	return retValue.replace( /\s+$/g, "" );
}

function isInt(obj) {
	if (obj.value == "") {
		return true
	}

	if (isNaN(parseInt(obj.value))) {
		obj.value = "";
		obj.focus();
		return false;
	}
	else {
		return true;
	}
}

function moveA2B(objA, objB, x, y) {
	offsetX = 0;
	offsetY = 0;

	while (objB.nodeName != "BODY") {
		offsetX += objB.offsetLeft;
		offsetY += objB.offsetTop;
		objB = objB.offsetParent;
	}

	objA.style.left = offsetX + x;
	objA.style.top = offsetY + y;
}

