window.onload = function() {
	if(document.getElementById("artworknavlist")){
		var artworknav = document.getElementById("artworknavlist");
		var imageslist = artworknav.getElementsByTagName("img");
		var imageWidth;
		var imagesTotalWidth = 0;
		for(var i = 0; i < imageslist.length; i++) {
			imageWidth = imageslist[i].width;
			imageWidth = imageWidth + 4;
			imagesTotalWidth = imagesTotalWidth + imageWidth;
		}
		document.getElementById("artworknavlist").style.width = imagesTotalWidth + 'px';
		
		/* The following lines prevent the navigation arrows from showing up if they're not needed */
		var navwidth = parseInt(document.getElementById("artworknavlist").style.width);
		if (navwidth > 950){
			document.getElementById("arrows").style.display = 'block';
		}
	}
	else {

	}
	
	if(document.getElementById("imagenavlist")){
		var artworknav = document.getElementById("imagenavlist");
		var imageslist = artworknav.getElementsByTagName("img");
		var imageWidth;
		var imagesTotalWidth = 0;
		for(var i = 0; i < imageslist.length; i++) {
			imageWidth = imageslist[i].width;
			imageWidth = imageWidth + 4;
			imagesTotalWidth = imagesTotalWidth + imageWidth;
		}
		document.getElementById("imagenavlist").style.width = imagesTotalWidth + 'px';
		
		/* The following lines prevent the navigation arrows from showing up if they're not needed */
		var navwidth = parseInt(document.getElementById("imagenavlist").style.width);
		if (navwidth > 317){
			document.getElementById("thumbarrows").style.display = 'block';
		}
	}
	else {

	}
	
	if(document.getElementById("seeinside")){
		var artworknav = document.getElementById("seeinside");
		var imageslist = artworknav.getElementsByTagName("div");
		var imageWidth = 850;
		var imagesTotalWidth = imageWidth * imageslist.length;
		document.getElementById("seeinside").style.width = imagesTotalWidth + 'px';
	}
	else {
		return;
	}
}
