var http = getHTTPObject(); 

function getHTTPObject() {
	var http_object;

	// MSIE Proprietary method

	/*@cc_on
	@if (@_jscript_version >= 5)
		try {
			http_object = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			try {
				http_object = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (E) {
				http_object = false;
			}
		}
	@else
		xmlhttp = http_object;
	@end @*/


	// Mozilla and others method

	if (!http_object && typeof XMLHttpRequest != 'undefined') {
		try {
			http_object = new XMLHttpRequest();
		}
		catch (e) {
			http_object = false;
		}
	}

	return http_object;
}

function getHTTPObject() {
	var xmlhttp;

	if(window.XMLHttpRequest){
		xmlhttp = new XMLHttpRequest();
	}
	else if (window.ActiveXObject){
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	if (!xmlhttp){
	xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}

	}
	return xmlhttp;
}

function handleHttpResponseMailDetail() {	
	if (http.readyState == 4) {
		if(http.status==200) {
			var response = http.responseText;
			document.getElementById('contactmessage').innerHTML = response;
			document.getElementById('imie').disabled = false;
			document.getElementById('email').disabled = false;
			document.getElementById('tel').disabled = false;
			document.getElementById('temat').disabled = false;
			document.getElementById('tresc').disabled = false;
			document.getElementById('sendMail').disabled = false;
		}
	}
}