// Feststellen Fenster Höhe

var fensterhoehe = 0
function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  fensterhoehe = myHeight;
//  	var ausg = document.getElementById("ausgabe1");
//	ausg.innerHTML = fensterhoehe;

}

function getY() {
  if (self.pageYOffset) // all except Explorer
  {
    y = self.pageYOffset;
  }
  else if (document.documentElement && document.documentElement.scrollTop)
  // Explorer 6 Strict
  {
    y = document.documentElement.scrollTop;
  }
  else if (document.body) // all other Explorers
  {
    y = document.body.scrollTop;
  }

  return(y);
}
function banner_move()
  {
	startabstand = fensterhoehe - 220;


    var y = getY();
	var zz = document.getElementById("inhalt");
	var zz2 = zz.style.height;

	topstyle = fensterhoehe - 220 + y;
	var differ = Math.abs(y - ii);
	
	
	if ((topstyle+ii) > 550)  {
	if (ii < y) {
document.getElementById("leoscroll").style.top =  fensterhoehe - 220 + ii  +"px";
if ((differ>60) && (differ<120)) { ii = ii + 2; }
if (differ>=120) { ii = ii + 8; }
else {ii++; }
	
	
setTimeout("banner_move()",50);}

if (ii > y) {
document.getElementById("leoscroll").style.top =  fensterhoehe - 220 + ii  +"px";
if ((differ>60) && (differ<120)) { ii = ii - 2; }
if (differ>=120) { ii = ii - 8; }
else {ii--; }

setTimeout("banner_move()",50);}




	  }
	  
//     	var ausg = document.getElementById("ausgabe1");
//ausg.innerHTML = document.getElementById("leoscroll").style.top;
//
//
//     	var ausg2 = document.getElementById("ausgabe2");
//ausg2.innerHTML = y;
	
  }

function init()
  {
	  	ii = 0;
   window.onscroll= banner_move;
//	setInterval(banner_move, 30);
	startabstand = fensterhoehe - 220;
	if (startabstand < 550) document.getElementById("leoscroll").style.top = 550 +"px";
	else document.getElementById("leoscroll").style.top =  fensterhoehe - 220 +"px";
}
onresize = function()
{
	init();
	alertSize();
}


