function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

/* original code by Craig Grannell - http://www.snubcommunications.com/iceland/iceland-old.html */

// swap image and caption

function swapPhoto(photoSRC,contenttochange,photoNum,totalPhotos,captiontochange,captionTxt) {
	document.images.imgPhoto.src = photoSRC;
  scrollTo(0,0);
	document.getElementById(contenttochange).innerHTML = photoNum+" of "+totalPhotos;
	document.getElementById(captiontochange).innerHTML = captionTxt;
}

// swap photos and collapse buttons 

function swap(targetId,buttonId){
  
	if (document.getElementById) {
		target = document.getElementById(targetId);
		buttonName = document.getElementById(buttonId);
		if (target.style.display == "none") {
			target.style.display = "";
		} else {
			target.style.display = "none";
		}
		if (target.style.display == "none") {
			buttonName.src = "nav_open.gif";
		} else {
			buttonName.src = "nav_close.gif";
		}
	}
}
