/*
 * Mantix.nl JavaScript - Copyright 2010
 * Powered by Mantix Nederland (www.mantix.nl)
 */

function getInfo(divName, method, url, uri) {
	var xmlHttpReq = false;
	var self = this;

	document.getElementById(divName).innerHTML = '<div class="center"><img src="/img/loading.gif" alt="Loading..." title="Loading..."/></div>';

	// Mozilla/Safari
	if (window.XMLHttpRequest) {
		self.xmlHttpReq = new XMLHttpRequest();
	}
	// IE
	else if (window.ActiveXObject) {
		self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	}

	self.xmlHttpReq.open((method == 'GET' ? 'GET' : 'POST'), url + (method == 'GET' ? '?' + uri : ''), true);
	self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	self.xmlHttpReq.onreadystatechange = function() {
		if (self.xmlHttpReq.readyState == 4) {
			document.getElementById(divName).innerHTML = self.xmlHttpReq.responseText;
			openWindow();
		}
	}
	self.xmlHttpReq.send((method == 'GET' ? 'null' : uri));
}

