function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}


function weekStateChanged() 
{ 
  if (xmlHttp.readyState==4)
  { 
    document.getElementById("divgroep").innerHTML=xmlHttp.responseText;
  }
}


function weekGeselecteerd(weeknr, type, groep, element)
{
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  } 
  var url="selectie.inc.php";
  url=url+"?wat=week";
  url=url+"&weeknummer="+weeknr;
  url=url+"&type="+type;
  url=url+"&groep="+groep;
  url=url+"&element="+element;
  url=url+"&sid="+Math.random();
  
  xmlHttp.onreadystatechange=weekStateChanged;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}




function groupStateChanged() 
{ 
  if (xmlHttp.readyState==4)
  { 
    document.getElementById("divelement").innerHTML=xmlHttp.responseText;
  }
}



function groepGeselecteerd(weeknummer, groep, type)
{
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  } 

  var url="selectie.inc.php";
  url=url+"?wat=groep";
  url=url+"&weeknummer="+weeknummer;
  url=url+"&groep="+groep;
  url=url+"&type="+type;
  url=url+"&sid="+Math.random();
  
  xmlHttp.onreadystatechange=groupStateChanged;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}
