var xmlHttp = createXmlHttpRequestObject(); 

function goto(adres)
{
if(adres!=0){
location.href=adres;}
}

function createXmlHttpRequestObject() 
{
  var xmlHttp;
  if(window.ActiveXObject)
  {
    try
    {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  else
  {
    try 
    {
      xmlHttp = new XMLHttpRequest();
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }

  if (!xmlHttp)
    alert("Błąd podczas tworzenia obiektu XMLHttpRequest.");
  else 
    return xmlHttp;
}


function staty(modul,idpage)
{
   strona1 =escape(document.referrer);

 

  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
    strona =escape(document.referrer);
        
        p=navigator.platform;
        n=navigator.userAgent;
        h=screen.height;
        w=screen.width;
         if(!navigator.browserLanguage){ jezyk=navigator.language;}else{jezyk=navigator.browserLanguage;}
        dane=strona+'&h='+h+'&w='+w+'&id='+idpage+'&l='+jezyk+'&p='+p+"&n="+n;
        
    xmlHttp.open("GET", "stat.php?modul="+modul+"&adres=" + dane, true);
    xmlHttp.onreadystatechange = handleServerResponse;
    xmlHttp.send(null);
  }
  else
    setTimeout('staty()', 2000);
}

function handleServerResponse() 
{
  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
     
    } 
    else 
    {
      alert("Nie mozna zapisac statow: " + xmlHttp.statusText);
    }
  }
}



