var snelheid = 35;
var eindhoogte;
var interval;
function toggle(velda){
var	div='item'+velda;
var	img='img'+velda;
}
function image(img)
{
	var	img='img'+img;
	var id = document.getElementById(img);
	if(id.src=="http://www.debresserverhuizingen.nl/images/maximize.png")
	{
		id.src = 'images/minimize.png';
		id.alt = '-';
	}
	else
	{
		id.src = 'images/maximize.png';
		id.alt = '+';
	}
}
function slide(div)
{
	var	div='item'+div;
    var id = document.getElementById(div);
    id.style.overflow = 'hidden';
    
    if(id.style.display == "none")
    {
//        clearInterval(interval);
        id.style.display = '';
//        eindhoogte = (id.offsetHeight - 5);
 //       id.style.height = '1px';
        
 //       interval = setInterval('verhoog(\'' + div + '\');', 0001);
    }
    else
    {
		 id.style.display = 'none';
  //      clearInterval(interval);
//        id.style.height = id.offsetHeight + 'px';
//        interval = setInterval('verlaag(\'' + div + '\');', 0001);
    }
}

function verhoog(id)
{
    id = document.getElementById(id);
    var px = parseInt(id.style.height);
    
    if(px < eindhoogte)
    {
        id.style.height = px + Math.ceil(eindhoogte / snelheid) + 'px';
    }
    else
    {
        id.style.height = '100%';
        clearInterval(interval);
    }
}

function verlaag(id)
{
    id = document.getElementById(id);
    var hoogte = (parseInt(id.style.height) - Math.ceil(eindhoogte / snelheid));
    
    if(hoogte < 1)
    {
        id.style.display = 'none';
        id.style.height = '100%';
        clearInterval(interval);
    }
    else
    {
        id.style.height = hoogte + 'px';
    }
} 
