var theWidth = '945px';
 
function trueheight() {
 if (window.innerHeight) {
  return window.innerHeight;
 } else if (document.body && document.documentElement.clientHeight) {
  return document.documentElement.clientHeight;
 } else {
  return 0;
 }
}

function bgcenter() {
  var theLaufband = $('laufband1');
  var theOffset = Math.floor(($('body').getWidth() - 770) / 2) - 90;
  theLaufband.setStyle({
      'left' : theOffset + 'px'
  });
   
   var fhoehe = trueheight();
   var choehe = $('canvas').getHeight();
   if (fhoehe - (choehe + theOffset) > 0) {
   	var mhoehe = fhoehe - $('header').getHeight() - $('bottom').getHeight() - $('footer').getHeight();
   	// console.log("m:" + mhoehe + ", f:" + fhoehe + ", c:" + choehe);
   	$('canvas').setStyle({
   		'height' : mhoehe + 'px'
   	});
   }
}

document.observe("dom:loaded", function() {
	/* init scroller */
	initScroller($('wslider'));
	bgcenter();
});

Event.observe(window, "resize", bgcenter);
