var pos=0;
var x=0;
var w=1;
var n=1;
var z=0;
var ypos=93;
var stops=0;
var stops2=0;
var xpos= new Array (0, 0, 120, 228, 347, 452, 560, 669, 775);

if (document.getElementsByTagName && !document.all)    // to make it run
    document.all = document.getElementsByTagName("*"); // also with NS 6

if (document.layers) {                                 // for netscape 
  layerStyleRef  ="layer.";
  layerRef       ="document.layers";
  styleSwitch    ="";
}
else{                                                  // for ie
  layerStyleRef  ="layer.style.";
  layerRef       ="document.all";
  styleSwitch    =".style";
}

function move_body(layerName,left,top){
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top=top');
if(left<8)  left=8;
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left=left');
}

function show_body(layerName){
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
}

function hide_body(layerName){
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
}

function stop(ri)
{
move_body("B0",parseInt(ri),ypos);
show_body("B0");

ziel=parseInt(xpos[posecht]);

if(ri>ziel)
ri=ri-10;

if(ri<ziel)
ri=ri+10;

ab=ziel-ri;
if(ab<0) ab=ab*-1;

if(ab>10 && stops!=1)
{
setTimeout("stop("+parseInt(ri)+")",5);
}
else
{
move_body("B0",xpos[posecht],ypos);
show_body("B0");
}
}

function chao(ri)
{
rii=ri;
y=ypos-4+Math.random()*4;
ri=ri-5+Math.random()*10;
move_body("B0",parseInt(ri),y);
show_body("B0");

if(stops2!=1)
{
setTimeout("chao("+parseInt(rii)+")",15);
}
else
wechsel(pos);
}


function wechsel(butt)
{
stops=1;
stops2=1;

if(butt!=0 && butt!=2)
{
move_body("B0",xpos[butt],ypos);
show_body("B0");
pos=butt;
}

if(butt==2)
{
stops2=0;
chao(xpos[butt]);
pos=butt;
}

if(butt==0)
{
stops=0;
stop(xpos[pos]);
pos=posecht;
}
}


function we(button_1, button_2)
{
wechsel(button_1+1);
}

function we2(button_1, button_2)
{
we(button_1, button_2);
butt=button_1+1;
if(butt!=posecht)
window.parent.frames[1].location.href="nav"+butt+".htm";
posecht=butt;
}

