var commonResoPrevWidth, commonResoCurrentWidth;

function commonResoMainTableWidth()
{
  if ((1020 > commonResoCurrentWidth && 1020 > commonResoPrevWidth) || (1020 < commonResoCurrentWidth && 1020 < commonResoPrevWidth))
  {}
  else
  {
    if (1020 < commonResoCurrentWidth || 1 > commonResoCurrentWidth)
      document.getElementById('elMainTableWidth').style.width = '990px';
    else
      document.getElementById('elMainTableWidth').style.width = '100%';
  }
}

function commonResoBannerSize()
{
  if (690 < commonResoCurrentWidth || 1 > commonResoCurrentWidth)
  {
    if (690 < commonResoCurrentWidth && 690 < commonResoPrevWidth)
    {}
    else
    {
      document.getElementById('elLogoDisplay').style.display = 'table-cell';
      document.getElementById('elLogoDisplay').innerHTML = '<img border="0" src="img/logo.gif" width="110" height="75" alt="logo">';
      document.getElementById('elBannerSize').width = '510';
      document.getElementById('elBannerSize').height = '75';
    }
  }
  else
  {
    wSize = commonResoCurrentWidth-70;

    if (wSize < 510)
      hSize = wSize/6.8;
    else
    {
      wSize = 510;
      hSize = 75;
    }

    document.getElementById('elLogoDisplay').style.display = 'none';
    document.getElementById('elLogoDisplay').innerHTML = '';
    document.getElementById('elBannerSize').width = wSize;
    document.getElementById('elBannerSize').height = hSize;
  }
}

function commonResoSideNavi()
{
  if ((850 > commonResoCurrentWidth && 850 > commonResoPrevWidth) || (850 < commonResoCurrentWidth && 850 < commonResoPrevWidth))
  {}
  else
  {
    if (850 < commonResoCurrentWidth || 1 > commonResoCurrentWidth)
      document.getElementById('elSideNavi').style.width = '200px';
    else if (650 < commonResoCurrentWidth && 850 > commonResoCurrentWidth)
      document.getElementById('elSideNavi').style.width = '120px';
  }

  if ((650 > commonResoCurrentWidth && 650 > commonResoPrevWidth) || (650 < commonResoCurrentWidth && 650 < commonResoPrevWidth))
  {}
  else
  {
    if (650 < commonResoCurrentWidth && 800 > commonResoCurrentWidth)
      document.getElementById('elSideNavi').style.display = 'block';
    else if (650 > commonResoCurrentWidth && 1 < commonResoCurrentWidth)
      document.getElementById('elSideNavi').style.display = 'none';
  }
}

function commonResoGetWidth()
{
  if (window.innerWidth)
  {
    return window.innerWidth;
  }
  else if (document.documentElement && document.documentElement.clientWidth != 0)
  {
    return document.documentElement.clientWidth;
  }
  else if (document.body)
  {
    return document.body.clientWidth;
  }
  return 0;
}

