function showPage(num,pictureNum){
	if(pictureNum == "" || pictureNum == undefined || pictureNum == null)pictureNum = 1;
	for(var i=1;document.getElementById('page'+i) != null; i++){
		hidePictureInfo(i);
		if(document.getElementById('page'+i) != null){
			var objPage = document.getElementById('page'+i);
			var objNav = document.getElementById('pageNav'+i);
			if(i == num){
				if(objPage != null)objPage.style.display="block";
				if(objNav != null)objNav.style.backgroundColor="#FFFFFF";
				var objPageText = document.getElementById('page'+num+'_text');
				if(objPageText != null)objPageText.style.display="block";
				var objPagePictures = document.getElementById('page'+num+'_pictures');
				if(objPagePictures != null)objPagePictures.style.display="block";
				var objPagesNav = document.getElementById('pageNav');
				if(objPagesNav != null)objPagesNav.style.display="block";
			}else{
				if(objPage != null)objPage.style.display="none";
				if(objNav != null)objNav.style.backgroundColor="#6A5845";
			}
		}
	}
	showPicture(num,pictureNum);
	
}

function showPicture(pageNum,pictureNum){
	for(var i=1;document.getElementById('picture'+pageNum+"_"+i) != null; i++){
		if(document.getElementById('picture'+pageNum+"_"+i) != null){
			var objPicture = document.getElementById('picture'+pageNum+"_"+i);
			var objNav = document.getElementById('pictureNav'+pageNum+"_"+i);
			if(i == pictureNum){
				if(objPicture != null)objPicture.style.display="block";
				if(objNav != null)objNav.style.borderColor="#FFFFFF";
			}else{
				if(objPicture != null)objPicture.style.display="none";
				if(objNav != null)objNav.style.borderColor="#6A5845";
			}
		}
	}
	return false;
}

function showPictureInfo(pageNum,pictureNum){
	for(var i=1;document.getElementById('page'+pageNum+"_pictureInfo"+i) != null; i++){
		if(document.getElementById('page'+pageNum+"_pictureInfo"+i) != null){
			var objPictureInfo = document.getElementById('page'+pageNum+'_pictureInfo'+i);
			var objPageText = document.getElementById('page'+pageNum+'_text');
			var objPagePictures = document.getElementById('page'+pageNum+'_pictures');
			if(i == pictureNum){
				if(objPictureInfo != null)objPictureInfo.style.display="block";
			}else{
				if(objPictureInfo != null)objPictureInfo.style.display="none";
			}
			if(objPageText != null)objPageText.style.display="none";
			if(objPagePictures != null)objPagePictures.style.display="none";
		}
	}
	var objPagesNav = document.getElementById('pageNav');
	if(objPagesNav != null)objPagesNav.style.display="none";
	return false;
}

function hidePictureInfo(pageNum){
	for(var i=1;document.getElementById('page'+pageNum+"_pictureInfo"+i) != null; i++){
		if(document.getElementById('page'+pageNum+"_pictureInfo"+i) != null){
			var objPictureInfo = document.getElementById('page'+pageNum+'_pictureInfo'+i);
			if(objPictureInfo != null)objPictureInfo.style.display="none";
		}
	}
	return false;
}