// Javascript scaleimage.js 
// scale a big image so it fits in the browser window
// this is not the most portable, but it works
// in my browser and that's all i really care
// about for this application
// Dale Bewley
function ScaleSize() {
	var img = document.getElementById('imgTag');
	//img.Src = img.getAttribute('src');
	img.Width = parseInt(img.getAttribute('width'));
	img.Height = parseInt(img.getAttribute('height'));

	img.Ratio = (img.Width / img.Height);

	var docWidth = document.body.clientWidth;
	var docHeight = document.body.clientHeight;
	var margin = 10;

	if (img.Width > (docWidth + (2 * margin))) {
	    img.Width = (docHeight - (2 * margin)) * img.Ratio;
	    //img.Width = docWidth;
	    img.Height = docHeight - (2 * margin);
	}

	document.getElementById("imgTag").style.width = img.Width;
	document.getElementById("imgTag").style.height = img.Height;
}
