//顯示成最大寬為maxWidth，最大高為maxHeight的圖
function ImageResize( image , maxWidth , maxHeight )
{
	var img = new Image();

	img.src = image.src;
	
	if( ( img.width > 0 ) && ( img.height > 0 ) )
	{
		if( img.width / img.height >= maxWidth / maxHeight )
		{
			if( img.width > maxWidth )
			{ 
				image.width = maxWidth;
				image.height = ( img.height * maxWidth ) / img.width;
			}
			else
			{
				image.width = img.width; 
				image.height = img.height;
			}
		}
		else
		{
			if( img.height > maxHeight )
			{ 
				image.height = maxHeight;
				image.width = ( img.width * maxHeight ) / img.height; 
			}
			else
			{
				image.width = img.width; 
				image.height = img.height;
			}
		}
	}
}

function getImageFocus()
{
	var obj=document.getElementById('meida_area_list').firstChild.firstChild.firstChild;
	var objlength=obj.childNodes.length;
	for(var i=0;i<objlength;i++)
	{
		if(obj.childNodes.item(i).getAttribute("className")=='media_area_pic_bg_this')
		{
			var sobj=obj.childNodes.item(i);
			var sobjlength=sobj.childNodes.length;
			for(var j=0;j<sobjlength;j++)
			{
				if(sobj.childNodes.item(j).nodeName=='A')
				{
					sobj.childNodes.item(j).focus();
					break;
				}
			}
			break;
		}
	}
}