function getNewHttpObject() {
    var objType = false;
    try {
        objType = new ActiveXObject('Msxml2.XMLHTTP');
    } catch(e) {
        try {
            objType = new ActiveXObject('Microsoft.XMLHTTP');
        } catch(e) {
            objType = new XMLHttpRequest();
        }
    }
    return objType;
}
function ajax(url,elementContainer){
	document.getElementById(elementContainer).innerHTML = '<img style="margin-top:190px" src="../layout/load.gif" />';
	var theHttpRequest = getNewHttpObject();
	theHttpRequest.onreadystatechange = function() {processajax(elementContainer);};
	theHttpRequest.open("GET", url);
	theHttpRequest.send(false);

		function processajax(elementContainer){
		   if (theHttpRequest.readyState == 4) {
			   if (theHttpRequest.status == 200) {
				   document.getElementById(elementContainer).innerHTML = theHttpRequest.responseText;
			   } else {
				   document.getElementById(elementContainer).innerHTML="<p><span class='redtxt'>BŁĄD!<\/span> :&nbsp;NIE OKREŚLONY BŁĄD<\/p>";
			   }
		   }
		}

}
