var xmlHttp;



function mostrarVideo(video){
  var url;
  url = "./top10Video.php?video=" + video;
  url += '&sid=' + Math.random();
  
  xmlHttp = getXmlHttpObject();
  if(xmlHttp == null){ return alert('Error al crear objecto XmlHttpObject')}
  
  xmlHttp.onreadystatechange = function(){
    if(xmlHttp.readyState == 'complete' || xmlHttp.readyState == 4){
      document.getElementById('cargando').style.display = 'none';
      document.getElementById('video').innerHTML = xmlHttp.responseText;
    }else{
      document.getElementById('cargando').style.display = 'block';
    }
  };
  xmlHttp.open('GET', url, true);
  xmlHttp.send(null);
}




function getXmlHttpObject(){
  xmlHttp = null;
  try{
    xmlHttp = new XMLHttpRequest();
  }catch(Ex){
    try{
      xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');      
    }catch(Ex){
      xmlHttp = new ActiveXObject('MsXml2.XMLHTTP');    			
    }      
  }
  return xmlHttp;
}