function getImageWidth(img) {
  return img.width;
}
function getImageHeight(img) {
  return img.height;
}
function resizeImage(img, max_width, max_height) {
  if (!img)
    return;

  var img_width     = getImageWidth(img);
  var img_height    = getImageHeight(img);

  portion_w   = img_width / max_width ;
  portion_h   = img_height / max_height;

  if (img_width!=max_width || img_height!=max_height) {
    // ÃÖ´ë Å©±â·Î ÁÙÀÌ±â
    if (portion_w>portion_h) {
      // °¡·Î ºñÀ²·Î ¼¼·Î Á¶Á¤
      img.width     = max_width;
      img.height    = img_height * max_width / img_width;
    } else {
      // ¼¼·Î ºñÀ²·Î °¡·Î Á¶Á¤
      img.height    = max_height;
      img.width     = img_width * max_height / img_height;
    }
  } else {
    return;
  }
}
function decreaseImage(img, max_width, max_height) {
  if (!img)
    return;

  var img_width     = getImageWidth(img);
  var img_height    = getImageHeight(img);

  portion_w   = img_width / max_width ;
  portion_h   = img_height / max_height;

  if (img_width>max_width || img_height>max_height) {
    // ÃÖ´ë Å©±â·Î ÁÙÀÌ±â
    if (portion_w>portion_h) {
      // °¡·Î ºñÀ²·Î ¼¼·Î Á¶Á¤
      img.width     = max_width;
      img.height    = img_height * max_width / img_width;
    } else {
      // ¼¼·Î ºñÀ²·Î °¡·Î Á¶Á¤
      img.height    = max_height;
      img.width     = img_width * max_height / img_height;
    }
  } else {
    return;
  }
}

function f_imgResize(objName, nSize)
{
	obj = document.all[objName];
	nWidth = nSize;

	try
	{
		if (obj.length)
		{
			for(i = 0; i < obj.length; i++)
			{
				if (obj[i].width > nWidth)
				{
					obj[i].width = nWidth;
				}
			}
		}
		else
		{
			if (obj.width > nWidth)
				obj.width = nWidth;
		}
	} catch (e) {

	}
}