function enlargeImage(locationKey,imageName,imageWidth,imageHeight) {
	//configure width and height to scale, consider orientation of image
	if(imageHeight > imageWidth) {
		imageHeight += 150;
		imageWidth += 120;
	}
	else {
		imageWidth += 150;
		imageHeight += 120;
	}
	//add room for margins
	imageHeight += 115;
	imageWidth += 66;
	//open the window
	window.open('image.phtml?f_locationKey=' + locationKey + '&f_imageName=' + imageName, 'enlargeImage','scrollbars=no,width=' + imageWidth + ',height=' + imageHeight + ',resizable=no');
}

function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}

function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
	  document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
  }
}

//preload navigation images
preload("nav_past_off", "artwork/nav_past_off.gif");
preload("nav_past_on", "artwork/nav_past_on.gif");
preload("nav_past_disabled", "artwork/nav_past_disabled.gif");
preload("nav_future_off", "artwork/nav_future_off.gif");
preload("nav_future_on", "artwork/nav_future_on.gif");
preload("nav_future_disabled", "artwork/nav_future_disabled.gif");

