function loadXHR(){
	var xhr=null;
    if(window.XMLHttpRequest){ 
        xhr = new XMLHttpRequest();
    }
    else if(window.ActiveXObject){
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
    }	
	return xhr;
}

function ajax_return_value(Xml, Destination){
    xhr = loadXHR();
    xhr.onreadystatechange = function() { ajax_return_value_RSP(xhr, Xml, Destination); };
    xhr.open('GET', Xml, true);
    xhr.send(null);
}

function ajax_return_value_RSP(xhr, Xml, Destination){
	if (xhr.readyState==4){
		var docXML = xhr.responseXML;
		var content = docXML.getElementsByTagName('value')[0].firstChild.nodeValue;
		document.getElementById(Destination).innerHTML = content;
	}
}

function ajax_linkvote(Xml, Id){
    xhr = loadXHR();
    xhr.onreadystatechange = function() { ajaxRSP_linkvote(xhr, Xml, Id); };
    xhr.open('GET', Xml, true);
    xhr.send(null);
}

function ajaxRSP_linkvote(xhr, Xml, Id){
	if (xhr.readyState==4){
		var docXML = xhr.responseXML;
		
		var pctpour = docXML.getElementsByTagName('pctpour')[0].firstChild.nodeValue;
		document.getElementById('zonevote_pour_' + Id).innerHTML = pctpour;

		var pctcontre = docXML.getElementsByTagName('pctcontre')[0].firstChild.nodeValue;
		document.getElementById('zonevote_contre_' + Id).innerHTML = pctcontre;

		var alerttodisplay = docXML.getElementsByTagName('alert')[0].firstChild.nodeValue;
		alert(alerttodisplay);
	}
}