function activateTbody (tbodyid) {
    var ids = new Array('huisgegevens','appartementgegevens');

    for(var i=0, len=ids.length;i<len;i++){
        if(ids[i]==tbodyid){
            Effect.Appear(ids[i]);
        } else {
            Effect.Fade(ids[i]);
        }
    }
}

function changeContactForm(selector){
	var allids = new Array('taxatiegegevens','actiegegevens', 'aankoopgegevens', 'makelaargegevens');

	switch(selector.value) {
		case "taxatie":
			var localids = new Array('taxatiegegevens', 'actiegegevens');
			break;
		case "aankoop":
			var localids = new Array('aankoopgegevens', 'actiegegevens', 'makelaargegevens');
			break;
		case "verkoop":
			var localids = new Array('actiegegevens');
			break;
		case "aanbod":
			var localids = new Array('actiegegevens');
			break;
		case "contact":
		default:
			var localids = new Array();
			break;
	}
	showhidelist(allids, localids);

}

function showhidelist(fullList, showlist){
	for(var i=0, len=fullList.length;i<len;i++){
		hideId(fullList[i]);
	}
	for(var i=0, len=showlist.length;i<len;i++){
		showId(showlist[i]);
	}
}

function showId(id){
	$(id).style.display='';
}

function hideId(id){
	$(id).style.display='none';
}

function arrowLeft(element, fotos){
    fotoid=fotos.shift();
    fotos.push(fotoid);
    thumbcont=$('thumbcontainer');

    new Effect.SlideLeft(thumbcont.firstChild.id, {direction: 'left', duration: 0.3});
    setTimeout("new Effect.SlideRight(thumbcont.childNodes[4].id, {direction: 'left', duration: 0.4})",205);
    //setTimeout("new Effect.BlindLeft(thumbcont.childNodes[4].id, {direction: 'left', duration: 0.2})",205);
    setTimeout("rotatePictures('left');",700);
}

function arrowRight(element, fotos){
    fotos.unshift(fotos.pop());
    thumbcont=$('thumbcontainer');

    rotatePictures('right');

    setTimeout("new Effect.SlideRight(thumbcont.firstChild.id, {direction: 'left', duration: 0.4})",205);
    new Effect.SlideLeft(thumbcont.childNodes[4].id, {direction: 'left', duration: 0.3});

    //setTimeout("",700);
}

function rotatePictures(direction){
    thumbcont=$('thumbcontainer');
    if(direction == 'left'){
        //firstnode=;
        thumbcont.appendChild(thumbcont.firstChild);
    } else {
        //lastnode=thumbcont.lastChild;
        thumbcont.insertBefore(thumbcont.lastChild, thumbcont.firstChild)
        //thumbcont.appendChild(lastnode);
    }

}

function showPicture(picturelink){
    $('normalpicture').src=picturelink;
}
