function Ajax() {
	this.req = null;
	this.arg = null;
	this.getReq =	function () {
						if (this.req === null) {
							if (window.XMLHttpRequest) {
						    	this.req = new XMLHttpRequest();
						    } else if (window.ActiveXObject) {
						    	this.req = new ActiveXObject("Microsoft.XMLHTTP");
						    }
						}
						return this.req;
					}

	this.loadXMLDoc =	function (url, handler) {
				        	this.getReq().open("GET", url, true);
				        	this.getReq().onreadystatechange = handler;
				        	this.getReq().send(null);
					    }
}

function hide_flash_objects() {
	var objects = document.getElementsByTagName('OBJECT');
	for (var x = 0; x < objects.length; x++) {
		objects[x].style.visibility = "hidden";
	}
}
function show_flash_objects() {
	var objects = document.getElementsByTagName('object');
	for (var x = 0; x < objects.length; x++) {
		objects[x].style.visibility = "visible";
	}
}

window.onload = hoverInputGenerator;

function hoverInputGenerator() {
	var tmpInputs = document.getElementsByTagName('input');
	for (var x = 0; x < tmpInputs.length; x++) {
		var tmpClass = tmpInputs[x].className;
		if (tmpClass.split(' ')[tmpClass.split(' ').length - 1] != 'ignore_hover' && (tmpInputs[x].type == "text" || tmpInputs[x].type == "password")) {
			tmpInputs[x].onmouseover = new Function("this.className='" + tmpClass + (tmpClass.length > 0 ? " " : "") + "mousehover';");
			tmpInputs[x].onmouseout = new Function("this.className='" + tmpClass + "';");
		}
	}

	var tmpInputs = document.getElementsByTagName('textarea');
	for (var x = 0; x < tmpInputs.length; x++) {
		var tmpClass = tmpInputs[x].className;
		if (tmpClass.split(' ')[tmpClass.split(' ').length - 1] != 'ignore_hover') {
			tmpInputs[x].onmouseover = new Function("this.className='" + tmpClass + (tmpClass.length > 0 ? " " : "") + "mousehover';");
			tmpInputs[x].onmouseout = new Function("this.className='" + tmpClass + "';");
		}
	}
}

//Find object in page
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}