function sndReq(method, url, post) {
	document.getElementById('pageLoad').innerHTML = '<div id="pageLoading">Chargement en cours...</div>';
	
	var http = false;

    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http = new XMLHttpRequest();
        
    } else if (window.ActiveXObject) { // IE
        try {
            http = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                http = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }

    if (!http) {
        alert('Abandon :( Impossible de créer une instance XMLHTTP');
        return false;
    }
    
    http.onreadystatechange = function() { handleResponse(http); };
    http.open(method, url);
    http.send(post);
    
}

function handleResponse(http) {
	if(http.readyState == 4){
		var response = http.responseText;
		var update = new Array();
		if (http.status == 200) {
			if (response.indexOf(';##;' != -1)) {
				
				update = response.split(';##;');
				for (i=0; i<update.length; i++) {
					if(update[i].indexOf('|' != -1)) {
						update[i] = update[i].split('|');
						if (update[i][0]) {
							if (document.getElementById(update[i][0]).style.display == 'none') {
								document.getElementById(update[i][0]).style.display = "block";
							}
							if (update[i][1]) {
								document.getElementById(update[i][0]).innerHTML = update[i][1];
							} else {
								document.getElementById(update[i][0]).style.display = "none";
							}
						}
					}
				}
				document.getElementById('pageLoad').innerHTML = '';
			}
		}
	} 
}

function sndReqOpenLayers(method, url, post) {	
	var http = false;
    
    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http = new XMLHttpRequest();
        
    } else if (window.ActiveXObject) { // IE
        try {
            http = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                http = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }

    if (!http) {
        return false;
    }
    
    http.onreadystatechange = function() { doNothing(http); };
    http.open(method, url);
    http.send(post);
}

function doNothing(http) {
	if(http.readyState == 4){
		var response = http.responseText;
		var update = new Array();
		try {
			if (http.status == 200) {
				return true
			}
		}
		catch(e) {
			return true
		}
	} 
}