var contRate = 248/138;

function checkImg (img)
{
	var width = parseInt(img.width);
	var height = parseInt(img.height);
	var rate = width/height;

	var actualWidth = 0;
	var actualHeight = 0;
	if (rate == contRate)
	{
		//if (width > 248)
		//{
			img.style.width = "248px";
			img.style.height = "138px";
			actualWidth = 248;
			actualHeight = 138;
		//}
	}
	else
	{
		if (rate > contRate)
		{
			//if (height > 138)
			//{
				img.style.width = Math.round(138*rate)+"px";
				img.style.height = "138px";
				actualWidth =Math.round(138*rate);
				actualHeight =138;
			//}
		}
		else
		{///rate < contRate
			//if (width > 248)
			//{
				img.style.width = "248px";
				img.style.height = Math.round(248/rate)+"px";
				actualWidth = 248;
				actualHeight = Math.round(248/rate);
			//}
		}
	}
	
	if (actualWidth==0) actualWidth=width;
	if (actualHeight==0) actualHeight=height;
	img.style.position="absolute";
	img.style.top=Math.round((138-(actualHeight))/2)+"px";
	img.style.left=Math.round((248-(actualWidth))/2)+"px";
	
	
	
	window.status=Math.round((248-(actualWidth))/2)+"px";
	return false;
}

