1 // ------------------------------------------ funkce pro anketu 2 function send_xmlhttprequest(obsluha, method, url, content, headers) 3 { 4 var xmlhttp = (window.XMLHttpRequest ? new XMLHttpRequest : (window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : false)); 5 if (!xmlhttp) { return false; } 6 xmlhttp.open(method, url); 7 xmlhttp.onreadystatechange = function() 8 { obsluha(xmlhttp); }; 9 if (headers) { 10 for (var key in headers) { 11 xmlhttp.setRequestHeader(key, headers[key]); 12 } 13 } 14 xmlhttp.send(content); 15 return true; 16 } 17 18 function anketa_hlasovat(formular,id_anketa){ 19 // odeslání poadavku na aktualizaci dat 20 var id_odpoved; 21 id_odpoved=""; 22 for (i=0;i<=4;i++){ 23 if (formular.anketa[i].checked) {id_odpoved="A"+(i+1);} 24 } 25 26 if (id_odpoved=="") { 27 alert ("CHYBA: vyberte prosím alespoò jednu monost!"); 28 return true; 29 }else{ 30 if (!send_xmlhttprequest(anketa_obsluha, 'GET', 'anketa_hlasuj.asp?id_anketa=' + id_anketa+'&id_odpoved='+id_odpoved)) { return false; } 31 document.getElementById('q_status').innerHTML = 'Probíhá hlasování'; 32 return true; 33 } 34 } 35 36 function anketa_obsluha(xmlhttp) { 37 if (xmlhttp.readyState == 4) { 38 //aktualizace odpovìdí na základì aktuálního stavu 39 var odpovedi = xmlhttp.responseXML.getElementsByTagName('odpoved'); 40 var status = xmlhttp.responseXML.getElementsByTagName('anketa'); 41 42 if (status[0].getAttribute('status_text')=="ok") { 43 document.getElementById('q_status').innerHTML = "Dìkujeme za hlas."; 44 for (var i=0; i < odpovedi.length; i++) { 45 if (odpovedi[i].getAttribute('lenght')!=0){ 46 document.getElementById("anketa_"+(i+1)).className = "hidden"; 47 document.getElementById("hlasuj").className = "hidden"; 48 document.getElementById("anketa_graf"+(i+1)).style.width = odpovedi[i].getAttribute('lenght')+"px" ; 49 document.getElementById("anketa_procenta"+(i+1)).innerHTML = odpovedi[i].firstChild.data+"%"; 50 } 51 } 52 53 }else{ 54 document.getElementById('q_status').innerHTML = "V této anketì jste ji hlasoval."; 55 } 56 57 } 58 } 59 60
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.