function showPage(image) {

	var pic = '../angevine/' + image + '.JPG';
	
// Preload the image into the cache (sometimes this doesn't work...)
	
	abbImg			= new Image();
		
	abbImg.src		= pic;
	
//	if (!abbImg.width) {
//		waitPage(pic,image,winWidth,winHeight,text);
//		var x = abbImg.width;
//		var y = abbImg.height;
//		}

//	abbImg.onload	=  clearAttributes();
	
// Open the page and set key variables
// document.documentElement.clientHeight/Width
// Remember that screen.width is the actual raster width, not the browser width!
	
	var HeightAdjustFactor	= .7;
	var WidthAdjustFactor	= .8;
	var winWidth			= screen.width;
	var winHeight			= Math.floor(screen.height * .95);
	var picMaxWidth			= Math.floor(winWidth * WidthAdjustFactor);
	var picMaxHeight		= Math.floor(winHeight * HeightAdjustFactor);
	var adjustWidth			= 1;
	
	// Assemble the top of the web page

	var doctype = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">';
	
	var meta = '<meta name=\"description\" content=\"USS Abbot (DD629) archive image #' + image + '\" />\n';
	
	meta += '<meta name=\"author\" content=\"Walter Baranger\" />\n';
	
	meta += '<meta name=\"generator\" content=\"angevine.js\" />\n';
	
	meta += '<meta name=\"keywords\" content=\"abbot,archive,images,DD629,destroyer\" />\n';
	
	meta += '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n';
	
	meta += '<link rel=\"stylesheet\" href=\"../DD629.css\" type=\"text/css\" media=\"all\" />\n';
	
	var text = doctype;
	text += '<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n';
	text += '<title>Image ' + image + '</title>\n';
	text += meta;
	text += '</head>\n<body class=\"angevineImg\">\n';
  
	var x = abbImg.width;
	var y = abbImg.height;
	
	// Try another way to get the height and width of the image:
	
	if (!x) {
	var x = abbImg.naturalWidth;
	var y = abbImg.naturalHeight;
	}

	var aspectRatio = x / y;
		
	// If the photo is too tall, proportionally adjust the width.
	// (If the image is too wide, it will automatically adjust later.)
	
	// If an undersized photo becomes too tall at 70% width, adjust it:
	
	if (y * (picMaxWidth / x) > picMaxHeight) {
		adjustWidth = (winHeight * HeightAdjustFactor) / (y * (picMaxWidth / x));
	}
	

// Use this if we know the size of the image
// of else use the generic version.
	
	if ((adjustWidth == 1) && (x == picMaxWidth)) {
	
		var method = "Image shown actual size";
	
	} 
	
	else if ((adjustWidth == 1) && (x < picMaxWidth)) {
	
		var method = "Image shown larger than actual size<br />Some blurring may occur";
	
	} 
	
	else if (adjustWidth < 1) {
				
		method = "Image shown smaller than actual size";
	
	}
	
	else
	
	{
				
		var method = "Image not shown actual size";
	}
	
	
   var styleWidth = Math.floor(100 * WidthAdjustFactor * adjustWidth);
	
// Write the IMG tag's style attribute:

	if (adjustWidth != 1) {
	
		var style = "width:" + styleWidth + "%";
	
	}
	
	else if (x > picMaxWidth) {
	
		var style = "80%";
	}
	
	else {
	
		var style = "";
	}


	
	var img = '\n<img src=\"' + pic + '\" alt=\"Image ' + image + '\" title=\"USS Abbot (DD629) Image\" style=\"' + style + '\" />\n';
	
// Retrieve the caption:
	
  	var caption = document.getElementById(image).innerHTML;
  	
  	caption = caption.replace(/<br>/gi,"<br />");
	
	caption = '<p class=\"angevineCaption\">' + caption + '</p>';
	
// Make other pieces of the page:
		
	var pushbutton = '<form method=\"post\" action=\"\"><input type=\"button\" style=\"color:green\" value=\"Close Window\" onclick=\"window.close()\" /></form>';
	
	var finalStatus = '\n\n<!-- TEST 50 y=' + y + 
		' aspectRatio='  + aspectRatio + 
		' picMaxHeight='  + picMaxHeight + 
		' HeightAdjustFactor='  + HeightAdjustFactor + 
		' width=' + abbImg.width + 
		' height=' + abbImg.height + 
		' winHeight=' + winHeight + 
		' adjustWidth=' + adjustWidth + 
		' -->\n\n';


// Assemble the new web page
	
	var text1 = text;
	text1 += img + caption + pushbutton;
	text1 += '<p style=\"color:darkgrey;font-size:x-small\">' + method + '</p>';
	text1 += finalStatus;
	text1 += '</body></html>';
	
// Open the window and write the data

	target = window.open('','angevine','width=' + winWidth + ',height=' + winHeight + ',status=yes,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes');
	
	target.document.open();
	target.document.write(text1);
	target.document.close();
}

function waitPage(pic,image,winWidth,winHeight,text) {

	target = window.open('','angevine','width=' + winWidth + ',height=' + winHeight + ',status=yes,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes');
	target.document.write(text);
	target.document.write('<img src=\"' + pic + '\" alt=\"Image ' + image + '\" title=\"USS Abbot (DD629) Image\" style=\"display:none\" />');
	target.document.write('<h1 style=\"padding-top:2em;color:aliceblue;text-align:center\">Stand By</h1><h2 style=\"padding-top:2em;color:aliceblue;text-align:center\">Image Loading&hellip;</h2></body></html>');
	target.document.close();
	target.window.close();
	
}

function loadFailure() {
    alert("Sorry. The image failed to load. Please try again.");
    return true;
}

function clearAttributes() {
	abbImg.removeAttribute("width"); 
    abbImg.removeAttribute("height");
	return true;
}