//open window for xtra large image
function showImage(pathtoimage,iwidth) {
	html = '<html><head><title>Larger Image</title></head> '+
	'<body style="margin:10px;padding:0;border:0;"> '+
	'<center> '+ 
	'<p><a href="javascript:window.close()">Close</a> this window</p> '+
	'<p><img style="margin:0;padding:0;border:0;width:'+iwidth+'px" '+
	'src="'+pathtoimage+'"></p> '+
	'</center> '+
	'</body></html>';

	var width = parseInt(screen.availWidth * .9);
	iwidth=iwidth+40; //10px margin
	if ( width > iwidth ) {width=iwidth;}
	var height = parseInt(screen.availHeight * .9);
	var params = 'width='+width+',height='+height+',scrollbars=yes,resizable=yes,top=0,left=0'; //no spaces between elements
	popup=window.open('','LargerImage',params);
	popup.document.write(html);
	popup.focus(); //in case behind main win
	popup.document.close();
	return false;
};
