
	 
	 function URLEncode(texte)
			{
				// The Javascript escape and unescape functions do not correspond
				// with what browsers actually do...
				var SAFECHARS = "0123456789" +					// Numeric
						"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
				var HEX = "0123456789ABCDEF";
				var plaintext = texte;
				var encoded = "";
				for (var i = 0; i < plaintext.length; i++ ) {
					var ch = plaintext.charAt(i);
				    if (ch == " ") {
					    encoded += "+";				// x-www-urlencoded, rather than %20
					} else if (SAFECHARS.indexOf(ch) != -1) {
					    encoded += ch;
					} else {
					    var charCode = ch.charCodeAt(0);
						if (charCode > 255) {
						    alert( "Unicode Character '" 
			                        + ch 
			                        + "' cannot be encoded using standard URL encoding.\n" +
							          "(URL encoding only supports 8-bit characters.)\n" +
									  "A space (+) will be substituted." );
							encoded += "+";
						} else {
							encoded += "%";
							encoded += HEX.charAt((charCode >> 4) & 0xF);
							encoded += HEX.charAt(charCode & 0xF);
						}
					}
				} // for
				return encoded;
};

function Vote_cuisine(element, formulaire) {
    //alert(document.getElementById('patience').innerHTML);

    document.getElementById('sondage_cuisine').style.visibility = 'hidden';
    document.getElementById('sondage_cuisine').style.display = 'none';

    var form = document.getElementById(formulaire);




    var rad_val;
    for (var i = 0; i < document.Pollform_cuisine.reponse_sondage_cuisine.length; i++) {
        if (document.Pollform_cuisine.reponse_sondage_cuisine[i].checked) {
            rad_val = document.Pollform_cuisine.reponse_sondage_cuisine[i].value;
        }
    }

    var submitstring = "id_sondage=" + form.id_sondage_cuisine.value + "&reponse_sondage=" + rad_val;
    var element1 = document.getElementById(element);
    element1.style.visibility = 'visible';
    element1.style.display = 'inline';
    element1.innerHTML = '<table><tr><td align="center">Vote en cours d\'enregistrement<br>Veuillez Patienter...<br><br><img src="/images/ecards/wait_ecard.gif"></td></tr></table>';
    var xmlhttp = getHTTPObject();
    xmlhttp.open('POST', '/v2/services/sondage.asp', true);
    xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            var reponse = xmlhttp.responseText;
            element1.style.visibility = 'visible';
            element1.style.display = 'inline';
            element1.innerHTML = reponse;
        }
        else {

        }

    }
    vider_cache(xmlhttp);
    xmlhttp.send(submitstring);
}
						
			
			
			
			
