var xmlHttp
function listCommenti(id_video, tot, tot_pag, start, pagina){ 
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null){
  alert ("Browser does not support HTTP Request")
  return
 } 
 var url="includes/responsexml.php"
 
 url=url+"?id_video="+id_video
 url=url+"&tot="+tot
 url=url+"&tot_pag="+tot_pag
 url=url+"&start="+start
 url=url+"&pagina="+pagina
 url=url+"&sid="+Math.random()
 xmlHttp.onreadystatechange=stateChanged 
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
 }

function stateChanged(){ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
  xmlDoc=xmlHttp.responseXML;
  var tot = xmlDoc.getElementsByTagName("totale")[0].childNodes[0].nodeValue;  
  for (i=0; i<tot; i++) {
   document.getElementById("id_"+i).innerHTML     = xmlDoc.getElementsByTagName("id")[i].childNodes[0].nodeValue;
   document.getElementById("autore_"+i).innerHTML = xmlDoc.getElementsByTagName("autore")[i].childNodes[0].nodeValue;
   document.getElementById("testo_"+i).innerHTML  = xmlDoc.getElementsByTagName("testo")[i].childNodes[0].nodeValue;
   document.getElementById("time_"+i).innerHTML   = xmlDoc.getElementsByTagName("time")[i].childNodes[0].nodeValue;
  }
 }
}

function GetXmlHttpObject(){ 
 var objXMLHttp=null
 if (window.XMLHttpRequest){
  objXMLHttp=new XMLHttpRequest()
 }
 else if (window.ActiveXObject){
  objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
 }
 return objXMLHttp
}