// retrieves the XMLHttpRequest object
function createXmlHttpRequestObject2()
{
  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("Error creating the XMLHttpRequest object.");
  else 
    return xmlHttp;
}

function status_downloading2()
{}
function status_ready2()
{}


var start1;
var end1;
var doba_prov = 0;

get_valid();
		
function init_pom()
{
  get_data1('1',adresa1);
  get_data2('2',adresa2);
  get_data3('3',adresa3);
  get_data4('4',adresa4);
  get_data5('5',adresa5);
  get_data6('6',adresa6);
  get_data7('7',adresa7);
  get_data8('8',adresa8);
}


function get_valid()
{
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
    xmlHttp.open("GET", "./load_val.php?"+kam_jit2, true);
    xmlHttp.onreadystatechange = function() {vypis_valid(); };

    xmlHttp.send(null);
  }
  else
    setTimeout("get_valid()", 1000);
    
}

function vypis_valid()
{
  start1 = new Date();
  
  if (xmlHttp.readyState == 4)
  {
    if (xmlHttp.status == 200)
    {
      calendar1 = xmlHttp.responseText;
      //document.getElementById("divCalendar2").innerHTML = calendar1;

      status_ready2();
    }
    else
    {
      alert("There was a problem accessing the server: " + xmlHttp.statusText);
    }
  }
}


function handle_get_messages2()
{
  if (xmlHttp.readyState == 4)
  {
    if (xmlHttp.status == 200)
    {
      zprava = xmlHttp.responseText;
      if (zprava != '')
        alert(zprava);
      status_ready1();
    }
    else
    {      alert("There was a problem accessing the server: " + xmlHttp.statusText);    }
  }
}
