// Javascript
function prepareSlideShow()
{
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;
  if(!document.getElementById("slideShow")) return false;
  if(!document.getElementById("slideShowTable")) return false;
  if(!document.getElementById("naarRechts")) return false;
  if(!document.getElementById("naarLinks")) return false;

	// genereren van van javascript afhankelijke html
	
	var slideShow = document.getElementById("slideShow");
	var table = document.getElementById("slideShowTable");
	
	// 
	/*var tableRow = document.createElement("tr");
	for(i = 0; i < imgSource.length; i++)
	{
		var tableCell = document.createElement("td");
		var anker = document.createElement("a");
		anker.setAttribute("href", path[i]);
		
		// invoegen van lightbox
		anker.setAttribute("rel", "lightbox[tuin]");
		
		var foto = document.createElement("img");
		foto.setAttribute("src", imgSource[i]);
		tableCell.appendChild(anker);
		anker.appendChild(foto);
		tableRow.appendChild(tableCell);
	}*/
	
	
	//slideshow.appendChild(preview);

	
	table.style.position = "absolute";
	table.style.left = "0px";
	table.style.bottom = "0px";
	tableWidth = table.offsetWidth;
  
	// alle links zoeken
	
	var links1 = document.getElementById("naarRechts");
	var links2 = document.getElementById("naarLinks");
	
	// behaviour koppelen aan de links
	links2.onmouseover = function()
	{
		moveElement("slideShowTable", -(tableWidth) + 266, 0, 10)
	}

	links2.onmouseout = function()
	{	
		var xPos = parseInt(table.style.left);
		var yPos = parseInt(table.style.bottom);
		moveElement("slideShowTable", xPos, yPos, 10)
	}
	
	links1.onmouseover = function()
	{
		moveElement("slideShowTable", 60, 0, 10);
	}
	
	links1.onmouseout = function()
	{	
		var xPos = parseInt(table.style.left);
		var yPos = parseInt(table.style.bottom);
		moveElement("slideShowTable", xPos, yPos, 10)
	}
}
addLoadEvent(prepareSlideShow);