var xmlHTTP;

function createXMLHttp() {
	if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	}
}

function ajax(url, obj) {
	if (window['xmlHttp'] == undefined) {
		createXMLHttp();
	}
	
	if (window['xmlHttp'] != undefined) {
		xmlHttp.open("GET", url, true);
		xmlHttp.send(null);
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState == 4) {
				if (xmlHttp.status == 200) {
					if (obj) {
						document.getElementById(obj).innerHTML = xmlHttp.responseText;
					}
				}
			}
		}
	}
}

function g(e) {
	var out;
	
	if (!(out = document.getElementById(e))) {
		return false;
	}
	
	return out;
}

function showBox(element, show) {
	g(element).style.display = (show) ? 'block' : 'none';
}
