var obj = "";                                  
  var eig = "";                                  
  var breite = 0;
  var hoehe = 0;
  fallkurve = new Array(500,450,400,350,300,250,200,150,100,50,0,30,50,60,65,60,50,30,0,20,30,35,30,20,0,10,15,17,15,10,2,3,2,0,0);
  var ni1;
  var all;
   
function Init()
{
    if (document.layers)
    {                       
      obj  = "document.layers"; 
      eig  = "";
      breite = innerWidth;
      hoehe = innerHeight;
      document.layers["go"].document.bgColor = "darkblue"; 
      document.layers["go1"].document.bgColor = "darkblue";
    }
    else if (document.all ) 
    {
      obj = "document.all"; 
      eig = ".style"; 
      breite = document.all.seite.offsetWidth;
      hoehe = document.all.seite.offsetHeight;
      document.all.go1.style.backgroundColor = "darkblue"; 
      document.all.go.style.backgroundColor = "darkblue"; 
    }
    else
    {
      all = document.getElementsByTagName("*");
      obj = "all"; 
      eig = ".style"; 
      breite = innerWidth;
      hoehe = innerHeight;
      all.go1.style.backgroundColor = "darkblue"; 
      all.go.style.backgroundColor = "darkblue"; 
    }
    
    document.getElementById("content").style.visibility="hidden";

    breite = Math.ceil(breite/8)*8;
    hoehe = Math.ceil(hoehe/8)*8;
    
    head1 = eval(obj+'["head"]'+eig);
    mytext1 = eval(obj+'["mytext"]'+eig);
    ch1 = eval(obj+'["ch"]'+eig);  
    de1 = eval(obj+'["de"]'+eig);
    fr1 = eval(obj+'["fr"]'+eig);
    oe1 = eval(obj+'["oe"]'+eig);
    go12 = eval(obj+'["go"]'+eig);
    line1 = eval(obj+'["line"]'+eig);
    go11 = eval(obj+'["go1"]'+eig);
    design1 = eval(obj+'["design"]'+eig);
    background1 = eval(obj+'["background"]'+eig);
    
    head1.left = (breite/2)-200;
    ch1.left = (breite/2);  
    de1.left = (breite/2);
    fr1.left = (breite/2);
    oe1.left = (breite/2);
    background1.left = (breite/2)-70; 
    go12.left = 50;
    line1.left = 0;
    line1.width=breite-0;
    go11.left = 50;
    design1.left = (breite/2);
   
    
    head1.top = 20;
    ch1.top = (hoehe/2);    
    de1.top = (hoehe/2);
    fr1.top = (hoehe/2);
    oe1.top = (hoehe/2);
    background1.top = (hoehe/2)-130;
    go12.top =  hoehe+10;
    line1.top = (hoehe/2)+160;
    go11.top =  hoehe+10;
    design1.top = (hoehe/2)+170;
 
    
    Timer(0);
} 
 function Timer(zeit){
    var head = eval(obj + '["head"]' + eig);
    var mytext = eval(obj + '["mytext"]' + eig);
    var de = eval(obj + '["de"]' + eig);
    var fr = eval(obj + '["fr"]' + eig);
    var oe = eval(obj + '["oe"]' + eig);
    var ch = eval(obj + '["ch"]' + eig);    
    var background = eval(obj + '["background"]' + eig);    
    var go = eval(obj + '["go"]' + eig);
    var line = eval(obj + '["line"]' + eig);
    var go1 = eval(obj + '["go1"]' + eig);
    var design = eval(obj + '["design"]' + eig);
   
    line.width=breite;
    if(zeit==0) head.visibility="visible", fr.visibility="visible";
    if(zeit==0)  background.visibility="visible";
    if(zeit==0) oe.visibility="visible";
    if(zeit==0) de.visibility="visible", ch.visibility="visible";
    if(zeit==0) mytext.visibility="hidden";
    if(zeit==2) line.visibility="visible";
    if(zeit==2) design.visibility="visible";
    if(zeit==3) go.visibility="visible";
    if(zeit==3) go1.visibility="visible";
    
   
    if(zeit==0) Move("fr",((breite/2)+100),((hoehe/2)+0),5,200);     
    if(zeit==0) Move("oe",((breite/2)),((hoehe/2)+100),70,200);   
    if(zeit==0) Move("de",((breite/2)-120),((hoehe/2)+10),70,200);
    if(zeit==0) Move("ch",((breite/2)-80),((hoehe/2)-90),50,200);
    
    if(zeit==1) Move("design",(50),((hoehe/2)+175),10,1);
    if(zeit==2) Sprung("go",0,140);
    if(zeit==3) Sprung("go1",0,110);
    if(zeit>=4) Blink();
    if(zeit>=10) mytext.visibility="visible";
    if(zeit>=150) return;
    zeit++;
    setTimeout('Timer('+zeit+')', 200);
  }
  function Blink()
  { 
  if(document.layers)
  {
	  if( (Math.round(Math.random()*10000/10000)) == 1 ) 
	  {
		    document.layers["de"].document.bgColor = "#C0C0C0"; 
		}
		else
		{
		    document.layers["de"].document.bgColor = "#FFFFFF";      
		} 
		if( (Math.round(Math.random()*10000/10000)) == 1 ) 
	    {
		    document.layers["fr"].document.bgColor = "#C0C0C0"; 
		}
		else
		{
		    document.layers["fr"].document.bgColor = "#FFFFFF";      
		} 
		if( (Math.round(Math.random()*10000/10000)) == 1 ) 
	    {
		    document.layers["oe"].document.bgColor = "#C0C0C0"; 
		}
		else
		{
		    document.layers["oe"].document.bgColor = "#FFFFFF";      
		} 
		
		if( (Math.round(Math.random()*10000/10000)) == 1 ) 
	    {
		    document.layers["ch"].document.bgColor = "#C0C0C0"; 
		}
		else
		{
		    document.layers["ch"].document.bgColor = "#FFFFFF";      
		} 		
		
		
		
  }
  else if ( document.all )
  {  
    if( (Math.round(Math.random()*10000/10000)) == 1 ) 
	  {
		    document.all.de.style.backgroundColor = "#C0C0C0"; 
		}
		else
		{
		    document.all.de.style.backgroundColor = "#FFFFFF";      
		} 
		if( (Math.round(Math.random()*10000/10000)) == 1 ) 
	    {
		    document.all.oe.style.backgroundColor = "#C0C0C0"; 
		}
		else
		{
		    document.all.oe.style.backgroundColor = "#FFFFFF";      
		} 
		if( (Math.round(Math.random()*10000/10000)) == 1 ) 
	    {
		    document.all.fr.style.backgroundColor = "#C0C0C0"; 
		}
		else
		{
		    document.all.fr.style.backgroundColor = "#FFFFFF";      
		} 
		
		
		if( (Math.round(Math.random()*10000/10000)) == 1 ) 
	    {
		    document.all.ch.style.backgroundColor = "#C0C0C0"; 
		}
		else
		{
		    document.all.ch.style.backgroundColor = "#FFFFFF";      
		}
	}	
	else
	{	
    if( (Math.round(Math.random()*10000/10000)) == 1 ) 
	  {
		    all.de.style.backgroundColor = "#C0C0C0"; 
		}
		else
		{
		   all.de.style.backgroundColor = "#FFFFFF";      
		} 
		if( (Math.round(Math.random()*10000/10000)) == 1 ) 
	    {
		    all.oe.style.backgroundColor = "#C0C0C0"; 
		}
		else
		{
		    all.oe.style.backgroundColor = "#FFFFFF";      
		} 
		if( (Math.round(Math.random()*10000/10000)) == 1 ) 
	    {
		    all.fr.style.backgroundColor = "#C0C0C0"; 
		}
		else
		{
		    all.fr.style.backgroundColor = "#FFFFFF";      
		} 
		
		if( (Math.round(Math.random()*10000/10000)) == 1 ) 
	    {
		    all.ch.style.backgroundColor = "#C0C0C0"; 
		}
		else
		{
		    all.ch.style.backgroundColor = "#FFFFFF";      
		}
			
	
	}			
		
  }
  function Move(ebene,x,y,v) {                   
    
    var an = eval(obj + '[ebene]' + eig);
    if (parseInt(an.left)==x && parseInt(an.top)==y) {
      return;
    }
    else {
      if (parseInt(an.left) < x) {
        temp = parseInt(an.left);
        temp+=4;
        an.left = temp;
      }
      if (parseInt(an.left) > x) {
        temp = parseInt(an.left);
        temp-=4;
        an.left = temp;
      }
      if (parseInt(an.top) < y) {
        temp = parseInt(an.top);
        temp+=4;
        an.top = temp;
      }
      if (parseInt(an.top) > y) {
        temp = parseInt(an.top);
        temp-=4;
        an.top = temp;
      }
      setTimeout('Move(\"' +ebene+ '\",' +x+ ',' +y+ ',' +v+ ')', v);
    }
  }
function Sprung(ebene,i,stopy)
{
    N = eval(obj + '[ebene]' + eig);
    if(fallkurve.length <= i) return;
    y = (hoehe/2)+stopy-fallkurve[i]
    N.top = y;
    i++;
    setTimeout('Sprung(\"'+ebene+'\",'+i+','+stopy+')', 50);
}
