function fixbg() {
  var calHeight = $('container').getHeight();
  $('sidebg').setStyle({ height: (document.viewport.getHeight() > calHeight?document.viewport.getHeight():calHeight) + 'px' });
/*
  $('sidebar01').setStyle({ height: (document.viewport.getHeight() > calHeight?document.viewport.getHeight():calHeight) + 'px' });
  $('sidebar02').setStyle({ height: (document.viewport.getHeight() > calHeight?document.viewport.getHeight():calHeight) + 'px' });
*/
  $('bgl').setStyle({ height: (document.viewport.getHeight() > calHeight?document.viewport.getHeight():calHeight) + 'px' });
  $('bgr').setStyle({ height: (document.viewport.getHeight() > calHeight?document.viewport.getHeight():calHeight) + 'px' });
  $('bgcontent').setStyle({ height: (document.viewport.getHeight() > calHeight?document.viewport.getHeight():calHeight) + 'px' });

  var calWidth = $('container').getWidth() - $('bgtl').getWidth() - $('bgrtl').getWidth();
  $('bgrr').setStyle({ width: (calWidth > 729?calWidth:729) + 'px' });
  calWidth = $('container').getWidth() - $('bgl').getWidth() - $('bgr').getWidth();
  $('bgcontent').setStyle({ width: (calWidth > 729?calWidth:729) + 'px' });
}

Event.observe(window, 'load', function() { fixbg(); fixbg(); });
Event.observe(window, 'resize', function() { fixbg(); fixbg(); });

