function smajax_createXMLHttpRequest() {
	var httpR = null;
	try {
		httpR = new XMLHttpRequest();
	}
	catch (e) {
		var versions = new Array(
				"MSXML2.XMLHTTP.6.0",
				"MSXML2.XMLHTTP.5.0",
				"MSXML2.XMLHTTP.4.0",
				"MSXML2.XMLHTTP.3.0",
				"MSXML2.XMLHTTP",
				"Microsoft.XMLHTTP");
		for (var i = 0; i < versions.length && httpR == null; i++) {
			try {
				httpR = new ActiveXObject(versions[i]);
			}
			catch (e) {}
		}
	}

	if (httpR == null) {
		alert("Error creating the XMLHttpRequestObject");
	}
	else {
		return httpR;
	}
}

function smajax_loadResultTo(httpRequest, elementId) {
	if (httpRequest.readyState == 4) {
		if(httpRequest.status == 200) {
			document.getElementById(elementId).innerHTML = httpRequest.responseText;
		}
		else {
			alert('Error '+ httpRequest.status + ' - ' + httpRequest.statusText);
		}
	}
}
