browser_name = navigator.appName;
browser_version = parseFloat(navigator.appVersion); 

if (browser_name == "Netscape" && browser_version <= 3.0)
	roll = 'false';
else if (browser_name == "Netscape" && browser_version >= 4.0)
	roll = 'true';
else if (browser_name == "Microsoft Internet Explorer" && browser_version <= 3.0)
	roll = 'false';
else if (browser_name == "Microsoft Internet Explorer" && browser_version >= 4.0)
	roll = 'true';
else
	roll = 'false';
		
bChanged = false;

function ReplaceIconImage(img)
{
	if (roll == 'true')
		document.images[img].src = "/TrainIco.gif";
}

function ReplaceSSImage(img)
{
	if (roll == 'true')
		document.images[img].src = "/images/NotLoaded.gif";
}

function FixImage(strImage, nWidth)
{
	//Only pass through if we need to...
	if (roll=='false') return;
	if (!document.images) return;
	if (!document.images[strImage]) return; //4/1/03
	if (document.images[strImage].SizeSet == true) return;
	if (document.images[strImage].width <= nWidth) return;
	if (document.images[strImage].width==0) return;
	
	//If we've gotten here, we need to shrink the image
	var nShrinkBy, nNewWidth, nNewHeight;
	
	//Figure out the percentage that we have to shrink the width to make it fit
	//nShrinkBy = document.images[strImage].width - nWidth;
	//nShrinkBy = nShrinkBy / document.images[strImage].width;
	nShrinkBy = document.images[strImage].height / document.images[strImage].width;
	
	//Set the width to the maximum width
	document.images[strImage].width = nWidth;
	
	//Set the height to the same percentage to maintain the aspect ratio
	document.images[strImage].height = nWidth * nShrinkBy; //document.images[strImage].height - (document.images[strImage].height * nShrinkBy);
	
	document.images[strImage].SizeSet = true;
	return;
}
