function vyberClanek(cesta, id, id_otazky)
{  
  var url = cesta;
  
  if (url != 0)
  {
    if (window.ActiveXObject)
    {
      httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else
    {
      httpRequest = new XMLHttpRequest();
    }
    httpRequest.open("GET", url, true);
    httpRequest.onreadystatechange= function () {processRequest(id, id_otazky); } ;
    httpRequest.send(null);
  }
}

function processRequest(id, id_otazky)
{
  if (httpRequest.readyState == 4)
  {
    if(httpRequest.status == 200)
    {
      //var mistoZobrazeni = document.getElementById("mistoZobrazeni");
      //mistoZobrazeni.innerHTML = httpRequest.responseText;
      //alert(httpRequest.responseText);
      
      var result = httpRequest.responseText;      
      
      if(result != "" && result != 0) {

        result_split = result.split("|");
        for(x = 0; x < ( result_split.length - 1 ); x++ ) {
        
          data = result_split[x].split("-");        
          id = data[0];

          document.getElementById("odp_"+id).innerHTML = data[1];
          document.getElementById("bar_"+id).style.width = data[2]+"%";

        }
        
        total_hlasy = document.getElementById("total_hlasy_"+id_otazky).innerHTML;
        
        document.getElementById("total_hlasy_"+id_otazky).innerHTML = ( total_hlasy * 1 + 1 );
      
      } else {
        
        min = document.getElementById("minutes").innerHTML;
        
        alert("Hlasovat můžete 1x za "+min+" minut!");
      
      }

    }
    else
    {
      alert("Chyba pri nacitani stanky"+ httpRequest.status +":"+ httpRequest.statusText);
    }
  }
}

function rotate(obr) 
{
  if (rotator==pocet) {rotator=0;}
  if (window.document.sample)
  {
    if (transtyp=1){transtyp=7};
    sample.filters.revealTrans.transition=transtyp;
    sample.filters.revealTrans.Apply();
    sample.src = obrsrc[rotator];
    sample.filters.revealTrans.Play();
    transtyp=transtyp + 1
  }
  else 
  {
    document.images["obraz"].src = obrsrc[rotator];
  } 
  rotator = rotator + 1
  window.setTimeout('rotate();',doba); 
}