function GetTdHeight()
{
	var theTdHeight;
	theTdHeight = document.getElementById('theTD').clientHeight;
	document.test.thetext.value = theTdHeight;
	resizeImage(theTdHeight)
}

function resizeImage(theTdHeight)
{
	var theResizeImage,currentHeight,theRemainder,theMinHeight,theNewHeight;
	theRemainder = theTdHeight;
	theRemainder%=5;
	theResizeImage = document.getElementById('theResizeImage');
	currentHeight = theResizeImage.height;
	theMinHeight = 300;
	theNewHeight = theTdHeight - theMinHeight;
	document.test.thetext2.value = theRemainder;
	if (theRemainder==0)
	{
		theResizeImage.height = theNewHeight + currentHeight + 1
	}
	if (theRemainder==1)
	{
		theResizeImage.height = theNewHeight + currentHeight + 5
	}
	if (theRemainder==2)
	{
		theResizeImage.height = theNewHeight + currentHeight + 4
	}
	if (theRemainder==3)
	{
		theResizeImage.height = theNewHeight + currentHeight + 3
	}
	if (theRemainder==4)
	{
		theResizeImage.height = theNewHeight + currentHeight + 2
	}
}