function checkDHTML()
{
 var DHTML = (document.getElementsById || document.all || document.layers);
}


function getObj(name)
{
 if (document.getElementById) return document.getElementById(name).style;  
 else if (document.all) return document.all[name].style;                   
 else if (document.layers) return document.layers[name];                  
}

var latestID = "";
var latestIDset = "";


function highlight(id)
{
 //if(!checkDHTML())return;            
 if(id != latestIDset) {
  var x = getObj('tblrow'+id);
  x.backgroundColor = '#333399';
 }
}



function holdhighlight(id)
{
 //if(!checkDHTML())return;            
 if(id != latestIDset) {
  var x = getObj('tblrow'+id);
  x.backgroundColor = '#221388';
 }
}


function showinfo(id)
{       
 if(id != latestIDset) {
  var x = getObj('tblrow'+id);
  x.backgroundColor = '#170D5D';

  if(latestIDset != "") hideinfo(latestID);                     
  var x = getObj('info');
  x.display = 'none';
  var x = getObj('info'+id);
  x.display = 'block';
  latestID = id;
  latestIDset = id;
 }
}


function hideinfo(id)              
{
 var x = getObj('tblrow'+id);
 x.fontWeight = 'normal';
 x.backgroundColor = '#221388';

 x = getObj('info'+latestID);
 x.display = 'none';
 x = getObj('info');
 x.display = 'block';
}


function delitem()                
{                       
 if (latestID != "") {
  if (confirm("Weet u zeker dat u deze activiteit wil verwijderen?")){
   location.href='kalender.php?delete='+latestID;
  }
 }
 else {
  alert("U heeft geen activiteit geselecteerd!");
 }
}


function edititem()
{
 if (latestID != "") {
  var newwindow=window.open('form.php?change='+latestID,'form','height=441,width=510');
  if (window.focus) {newwindow.focus();}
  //location.href='kalender.php?change='+latestID;
 }
 else {
  alert("U heeft geen activiteit geselecteerd!");
 }
}


function findScrollTop() 
{
        if (window.pageYOffset != null)  return window.pageYOffset;
        if (document.body.scrollWidth != null)  return document.body.scrollTop;
        return (null);
}


function UpdateIBoxHeight() 
{
        height = findScrollTop();
        document.all['IBox'].style.top = height + 4;
        setTimeout('UpdateIBoxHeight()',100);
}

