function nextImg() {
	if(currentImg+1 < totalImgs) {
		currentImg++;
	}
	else {
		currentImg = 0;
	}
	showImg(currentImg);
}

function previousImg() {
	if(currentImg+1 > 1) {
		currentImg--;
	}
	else {
		currentImg = totalImgs-1;
	}
	showImg(currentImg);
}

function showImg(x) {
	document.getElementById('galleryimg').src = 'userfiles/image/' + arrayImgs[x];
	document.getElementById('gallerytitle').innerHTML = arrayTitle[x];
	document.getElementById('gallerydesc').innerHTML = arrayDesc[x];
}

