function win(code, cas)
{
var url = "sms.php?code="+code+"&country=pexeso&hash="+cas;

if (url != 0)
   {
   if (window.ActiveXObject)
      {
      httpWin = new ActiveXObject("Microsoft.XMLHTTP");
      }
   else
      {
      httpWin = new XMLHttpRequest();
      }
   httpWin.open("GET", url, true);
   httpWin.onreadystatechange= function () {processWin(code); } ;
   httpWin.send(null);
   }
}

function processWin(code)
{
if (httpWin.readyState == 4)
   {
   if (httpWin.status == 200)
      {
      document.getElementById("zprava").innerHTML = " | Výherní kód: <a href=\"down.php?code="+code+"\" class=\"odkaz\"><b>"+code+"</b></a> <small>(Klikni pro stažení pexesa nebo odešli v SMS. Viz. níže.)</small>"
      }
   else
      {
      alert("Chyba pri nacitani stanky: " + httpWin.status + " - " + httpWin.statusText);
      }
   }
}

window.setTimeout("odhlasit()", 1800000);
