// Let's get the height of the available window for all browsers

function getWindowHeight()
{
     var windowHeight = 0;
     if (typeof(window.innerHeight) == 'number')
     {
          windowHeight = window.innerHeight;
     }
     else
     {
          if (document.documentElement && document.documentElement.clientHeight)
          {
               windowHeight = document.documentElement.clientHeight;
          }
          else
          {
               if (document.body && document.body.clientHeight)
               {
                    windowHeight = document.body.clientHeight;
               }
          }
     }
     return windowHeight;
}


function setLayout()
{
     if (document.getElementById)
     {
          var windowHeight = getWindowHeight();
          var layoutElement = document.getElementById('layout');
          var layoutHeight  = layoutElement.offsetHeight;

          // if the viewport is longer than the content, stretch the content
          if (windowHeight > layoutHeight)
          {

               layoutElement.style.height = (windowHeight-0) + 'px';
          }
     }
}

window.onload = function()
{
     setLayout();
 	 MM_preloadImages('images/kuohu_b.gif');
}

window.onresize = function()
{
     setLayout();
	 MM_preloadImages('images/kuohu_b.gif');
}