/*
* Functions for slideshow
*
*/

function changeSlide(kind){
	//set variables (get active img and max of images)
	var actPic = parseInt(document.getElementById('actPic').value);
	var newActPic = 0;
	var selectedImg = 0;
	
	//check button next is clicked and add 1 to current nr
	if (kind == 'next') newActPic = actPic + 1;
	else newActPic = actPic - 1;

	//check if new nr is not smaller than 1
	newActPic = Math.max(1,newActPic);
	//check if new nr is not bigger than the max of images	
	newActPic = Math.min(maxNr,newActPic);

	selectedImg = newActPic -1;

	//show img on page
	slideShow('slide',SmallImages[selectedImg],BigImages[selectedImg]);

	//show active image nr on page
	document.getElementById('showNumber').innerHTML=newActPic;

	//put active image nr in hidden field
	document.getElementById('actPic').value = newActPic;
}


function slideShow(idCell, smallImgName,bigImgName) {
	document.getElementById(idCell).bigIMG = bigImgName;
	document.getElementById(idCell).background = smallImgName;  
	//document.getElementById(idCell).style.background = "url(" + imgName + ")"; 
} 