document.addEvent('domready',function() {
 var startSize = $('content').getStyle('height').toInt();
 fixContent(startSize);
 window.addEvent('resize',function() {
   fixContent(startSize);
 });
 window.addEvent('load',function() {
   fixContent(startSize);
 });
});

function fixContent(startSize) {
 var modifier = 265;
 var scrollHeight = $(document.body).getScrollHeight() - 155;
 $(document.body).setStyle('height',scrollHeight+'px');
 $(document.html).setStyle('height',scrollHeight+'px');
 $('wrapper').setStyle('height',scrollHeight+'px');
 
 
 var newSize = Math.round($(document.body).getScrollHeight() - modifier);
 if (newSize > startSize) {
  $('content').setStyle('height',newSize + 'px');
 } else {
  $('content').setStyle('height',startSize + 'px');
 }
}
