var topstartpos=200;
var stepwidth=3;
var timeoutmove=10;
var timeoutstand=200;
if (top.frames.length > 0) {
   top.location.href=self.location;
}
var ch,stoppos,endpos,step,idioma;
var posix=0;
Bank1 = new Image();
Bank1.src = "grafik/coche_run.gif";
Bank2 = new Image();
Bank2.src = "grafik/coche_stop.gif";
Bank3 = new Image();
Bank3.src = "grafik/coche_start.gif";
function VentanaX() {
         if (window.innerWidth) {
            return window.innerWidth;
         } else if (document.body && document.body.offsetWidth) {
            return document.body.offsetWidth;
         } else {
            return screen.width;
         }
}
function Init() {
         document.getElementById("nojs").innerHTML="";
         car = eval(document.getElementById("cochegrafic"));
         ch = eval(document.getElementById("coche"));
         ch.style.position = "absolute";
         ch.style.top = "200px";
         ch.style.left = "0px";
         car.src = Bank1.src;
         endpos=VentanaX();
         stoppos=endpos/2 - 100;
         step=stoppos/stepwidth;
         window.setTimeout("MoveCocheIn()",40);
}
function MoveCocheIn() {
         posix = posix + step;
         ch.style.left = posix + "px";
         if (posix < stoppos) {
            window.setTimeout("MoveCocheIn()",timeoutmove);
         } else {
            window.setTimeout("ChangeToStop()",timeoutstand);
         }
}
function MoveCocheOut(lengua) {
         idioma=lengua;
         car.src = Bank1.src;
         posix = posix + step;
         ch.style.left = posix + "px";
         if (posix < endpos) {
            window.setTimeout("MoveCocheOut(idioma)",timeoutmove);
         } else {
            window.location.href= idioma + "/index.html?in=y";
         }
}
function ChangeToStop() {
         car.src = Bank2.src;
}
function ChangeToRun(lengua) {
         idioma=lengua;
         car.src = Bank3.src;
         window.setTimeout("MoveCocheOut(idioma)",timeoutstand);
}
