//getXML (Page to call, serialized data, div to change)
//Returns XML 
function getXML(url, params, divID, callback) { 
	
	var xhr = false; 

	///window.XMLHttpRequest for all browsers. window.ActiveXObject for IE.
	if (window.XMLHttpRequest) {
		xhr = new XMLHttpRequest();
		xhr.overrideMimeType("text/xml");
	}
	else if (window.ActiveXObject) {
		xhr = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	if(xhr) {
		if(divID) {
			var obj = document.getElementById(divID);
			//obj.innerHTML = '<img id="login-help" src="http://restolink.com/img/spinner_big.gif" alt="Waiting..." class="waiting" />';
		}
		
		//Open connection
		xhr.open("POST", url, true);

		//Send the proper header information along with the request
		xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				
		xhr.onreadystatechange = function() { 
			if(xhr.readyState == 4 && xhr.status == 200) {
	    		var xml = xhr.responseXML;
	    		if(callback) {
	    			callback(xml);
	    		}
			}
		}
		
		xhr.send(params);
	}
	else{ 
		//console.log("XHR Open fail");
	}
}

