// JavaScript Document
function showImage(image_path)
{
	resizeImage(image_path);
}

function resizeImage(image_path)
{
var img       = new Image();
img.src       = image_path;
var image1    = document.getElementById('image1');
var imgWidth  = img.width;
var imgHeight = img.height;
var maxWidth  = 336;
var maxHeight = 252;
	
	if (imgWidth > maxWidth) 
	{
      f=1-((imgWidth - maxWidth) / imgWidth);
      image1.style.width=imgWidth * f;
      image1.style.height=imgHeight * f;
	}
	else
	{
		if (imgHeight > maxHeight) 
		{
      		f=1-((imgHeight - maxHeight) / imgHeight);
      		image1.style.width=imgWidth * f;
      		image1.style.height=imgHeight * f;
		}
		else
		{
			image1.style.width=imgWidth;
      		image1.style.height=imgHeight;
		}
	}
	
	image1.src = image_path;
}

