var t;
var showOn;
function movecube(){
	clearTimeout(t);
	var curCount = count;
	window.status = ""  //curCount + "=" + count + "-" +  showOn + "-movecube*";
	if ((showOn == 0 && curCount < totaalAantal-1) || showOn == -1) 
		count++;
	if ((curCount >= totaalAantal - 1 + showOn) && showOn!=-1)
		count = 0;
	if (window.createPopup)
		cube.filters[0].apply()
		document.images.cube.src = cubeimage[count].src;
	if (window.createPopup)
		cube.filters[0].play()
		count++;

	var x=document.getElementById('slideNumber')
	var y=document.getElementById('slideInfo')
	if (document.getElementById('slideName')) 
		{var z=document.getElementById('slideName')
		z.innerHTML = specifyimage[count-1];
		}
	x.innerHTML = count + " / " + totaalAantal;
	y.innerHTML = specifyTitle;
	showOn = 1;
	window.status = ""  //curCount + "=" + count + "-" +  showOn + "-movecube";
	t=setTimeout("movecube()",delay);
	if (document.getElementById('navknoppenMain')) 
		{activateBar('navknoppenMain')};
	if (document.getElementById('navknoppen')) 
		{activateBar('navknoppen')};
	try{
		/* carpeSlider.js is necessary for following function */
		runOnload()
	}
		catch(err)
	{}
	}
	
function stopCount()
	{
	window.status = ""
	clearTimeout(t);
	 window.status = ""  //showOn + "-stopCount";
	}

function resetCount()
	{
	var fileName
	clearTimeout(t);
	var x=document.getElementById('slideNumber')
	var y=document.getElementById('slideInfo')
	try
	{
		count = -1;
		document.getElementById('placeholder').src = collage;
		fileName = ""
		x.innerHTML = "Tota(a)l:" + totaalAantal;
		showOn = -1;
	}
	catch(err)
	{
		count = 0;
		document.images.cube.src = cubeimage[count].src;
		fileName = specifyimage[count]
		x.innerHTML = count + 1 + " / " + totaalAantal;
		showOn = 0;
	}	
	if (document.getElementById('slideName')) 
		{var z=document.getElementById('slideName')
		z.innerHTML = fileName;
		}
	y.innerHTML = specifyTitle;
	 window.status = ""  //count + "-" + showOn +"-resetCount" ;
	}
	
function previousCount()
	{
	clearTimeout(t);
	var curCount = count;
	if (curCount <= showOn || showOn == -1)
		count = totaalAantal - 1;
	if (curCount == 1 + showOn && showOn!=-1)
		count = 0;
	if (curCount > 1 + showOn && curCount < totaalAantal-1)
		count = count - (1 + showOn);
	if (curCount >= totaalAantal-1)
		count = count - (1+ showOn);
		
	var x=document.getElementById('slideNumber')
	var y=document.getElementById('slideInfo')
	if (document.getElementById('slideName')) 
		{var z=document.getElementById('slideName')
		z.innerHTML = specifyimage[count];
		}
	x.innerHTML = count + 1 + " / " + totaalAantal;
	y.innerHTML = specifyTitle;
	document.getElementById('placeholder').src = specifyimage[count]
	showOn = 0
	 window.status = ""  //curCount + "=" + count + "-" + showOn + "-previousCount";
	}
	
function nextCount()
	{
	clearTimeout(t);
	var curCount = count;
	if (curCount >= totaalAantal-1 + showOn || showOn == -1)
		count = 0;
	if (curCount < totaalAantal-1 + showOn && showOn!=-1)
		count = count + 1 - showOn;
	var x=document.getElementById('slideNumber')
	var y=document.getElementById('slideInfo')
	if (document.getElementById('slideName')) 
		{var z=document.getElementById('slideName')
		z.innerHTML = specifyimage[count];
		}
	x.innerHTML = count + 1 + " / " + totaalAantal;
	y.innerHTML = specifyTitle;
	document.getElementById('placeholder').src = specifyimage[count]
	showOn = 0
	 window.status = ""  //curCount + "=" + count + "-" + showOn + "-nextCount";
	}
	
function activateBar(idElement)
	{
	element = document.getElementById(idElement);
	if(element.style.visibility=='hidden'){
		element.style.visibility='visible';
	}
	}

function changeDisplay(speedVal) {
	if (speedVal>=sliderFrom && speedVal<=sliderTo){
	delay =(speedVal*1000);
	movecube()
	}
}

