
var nTop = -1;
function resize_wnd (calltype)
{
  try {
    if ('object' != typeof(document.blank_img))
      return;
    if (document.blank_img.style.display == 'none')
      document.blank_img.style.display = 'block';

    if (nWndWidth == 600) nWndWidth = document.body.offsetWidth + 8;

    if (nTop < 0) {
      window.resizeTo(nWndWidth, 250);
      nTop = 250 - document.body.clientHeight;
    }
    var nHeight = 0;
    if (document.blank_img) nHeight = document.blank_img.offsetTop + nTop;
    document.blank_img.style.display = 'none';
    var maxHeight = screen.availHeight;

    if (nHeight > maxHeight) {
      nHeight = maxHeight;
      document.body.scroll= 'yes';
    }
    window.resizeTo(nWndWidth + 10, nHeight);
  } catch(e) {
    if (calltype != 'recall')
    {
      if (typeof(addOnloadHandle) == 'function')
        addOnloadHandle("resize_wnd(\"recall\")");
      else
        setTimeout("resize_wnd(\"recall\")", 1500);
    }
  }
}

function auto_fit_wnd (nNewWidth)
{
  if (nNewWidth) nWndWidth = nNewWidth;

  document.writeln("<img name='blank_img' src='http://file.sayclub.co.kr/images/blank.gif' align=top width=1 height=1 onload='resize_wnd();'>\n");
}

function auto_fit_wnd_ssl (nNewWidth)
{
  if (nNewWidth) nWndWidth = nNewWidth;

  document.writeln("<img name=\"blank_img\" src=\""+ssl_request_url('https://www.sayclub.com/images/blank.gif')+"\" align=top width=1 height=1 onload=\"resize_wnd();\">\n");
}