

// popup a new window
function popanyWin(i,w,h){

var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;

var anyWin
var features ='width='+ w +',height='+ h+',status = no, toolbar = no, resizable = no, left=' + winl + ',top=' + wint + ',scrollbars=yes' ;
if(!anyWin || anyWin.closed) {anyWin=window.open(i,"anyWin",features)}
else {anyWin.location=i}
anyWin.focus()
}


// open gallery positioned to a specific image
var selectedImage;
function openGallery(imgName) {
	selectedImage = imgName;
	popanyWin('Gallery.html',860,620);
}


// create a new image
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}


// swap images, arg1 for arg2
function changeImages() {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
		var node = document.getElementById(changeImages.arguments[i]);
			node.src = changeImages.arguments[i+1];
		}
	}
}




