function prepareSlideShowAuto()
{
	if(!document.getElementById) return false;
	if(!document.getElementById("slideShowAuto")) return false;
	if(!document.getElementById("slideShowAutoTable")) return false;
	if(!document.createElement) return false;
	
	// opvragen van de foto's
	var slideShow = document.getElementById("slideShowAuto");
	var table = document.getElementById("slideShowAutoTable");
	
	//verbinding met Lightbox
	/*var links = table.getElementsByTagName("a");
	for(var i=0;i<links.length;i++)
	{
		links[i].setAttribute("rel", "lightbox[tuin]");
	}*/
																  
	// eventhandlers toevoegen aan slideShow
	slideShow.onmouseover = function()
	{
		stopSlideShowAuto();
	}
	slideShow.onmouseout = function()
	{
		startSlideShowAuto();
	}
}
addLoadEvent(prepareSlideShowAuto);

//definieren van functie properties zoadat ze geen globale variabelen zijn.
	runSlideShowAuto.offset  = 0;
	startSlideShowAuto.timeout  = 0;

function startSlideShowAuto() 
{
	
	 startSlideShowAuto.timeout = window.setInterval("runSlideShowAuto()", 10);
}

function stopSlideShowAuto() 
{
	window.clearInterval(startSlideShowAuto.timeout);
}

function runSlideShowAuto()
{
	if(!document.getElementById) return false;
	if(!document.getElementById("slideShowAuto")) return false;
	if(!document.getElementById("slideShowAutoTable")) return false;
	
	var div    = document.getElementById("slideShowAuto");
	var table  = document.getElementById("slideShowAutoTable");
	var count  = table.getElementsByTagName("td").length;
	var pixelMove  = 1;

	table.style.left = runSlideShowAuto.offset + "px";
	runSlideShowAuto.offset = runSlideShowAuto.offset - pixelMove;
	
	var tmp = table.offsetLeft + table.getElementsByTagName("td")[0].offsetWidth;
	if(tmp < 0)
	{
		var restoreTd = table.getElementsByTagName("td")[0].parentNode.removeChild(table.getElementsByTagName("td")[0]);
		table.getElementsByTagName("tr")[0].appendChild(restoreTd);
    table.style.left = tmp + "px";
    runSlideShowAuto.offset = tmp;
	}
}
addLoadEvent(startSlideShowAuto);