function actMijnAgenda(actie,id)
{
  tmpUrl = 'actajax_mijnagenda.cfm?actie='+actie+'&actieid='+id;
  req = new Ajax.Request(
  tmpUrl,
  {
    method: "post",
    parameters: tmpUrl,
    asynchronous: "true",
    onComplete: showMijnAgenda
  }
  );

  //checkAvailSeries(sessie,serie);
}

//JSON decoder:
function decodeJSON(JSONstr)
{
  //alert(JSONstr);
	eval("var obj = "+JSONstr);
  //alert("YEH!");
	return obj;
}	

function showMijnAgenda(transport) {

  tmpObjectList = decodeJSON(transport.responseText);
  tmpContent = "";
  //alert("toonavail");

  // x is divid0
  //var tem = tmpObjectList.size();
  //alert(tem);
  for (x in tmpObjectList)
  {

    //alert(x + ' | ' + tmpObjectList[x]['html']); 
    //alert(x + ' | ' + tmpObjectList[x]['class']); 
    //alert(x + ' | ' + tmpObjectList[x]['display']); 
    //alert(x + ' | ' + tmpObjectList[x]['enable']); 
    tmpContent = "";
    //tmpContent = tmpObjectList[x]['HTML'];
    //alert(tmpObjectList[x]['display']);
    // haal de gegevens voor deze div op uit de array
    //$(x).update(tmpContent);
    if (tmpObjectList[x]['html'])
    { 
      $(x).update(tmpObjectList[x]['html']); 
    }

    //$(x).show();
    if (tmpObjectList[x]['class'])
    { 
      $(x).addClassName(tmpObjectList[x]['class']); 
    }

    if (tmpObjectList[x]['display'] == "block")
    { $(x).show(); }
    if (tmpObjectList[x]['display'] == "none")
    { $(x).hide(); }

    if (tmpObjectList[x]['enable'])
    { 
     if (tmpObjectList[x]['enable'] == "enable")
      { 
      	$(x).enable(); 
      } else {
      	$(x).disable(); 
      }
    } 
      
    if (tmpObjectList[x]['select'])
    { 
      if (tmpObjecList[x]['select'] == 'selected')
      { $(x).enable(); }
      if (tmpObjecList[x]['select'] == 'checked')
      { $(x).disable(); }
    }
    //alert(x);

  }
  //$('data').update(tmpContent);
  //$('data').show();
}


