function moverat(capa,inicx,inicy,finx,finy,duracion,tinicial,tactual){
if (tactual>=tinicial)
 {
  if (tactual<(tinicial+duracion))
   {
  if(ns4)
    {
    document.layers[capa].left=((finx-inicx)/duracion*(tactual-tinicial)+inicx)
    document.layers[capa].top=((finy-inicy)/duracion*(tactual-tinicial)+inicy);
    }
    else{
     document.getElementById(capa).style.left=((finx-inicx)/duracion*(tactual-tinicial)+inicx);
     document.getElementById(capa).style.top=((finy-inicy)/duracion*(tactual-tinicial)+inicy);
    }
    terminado=0;
   }
  else
   {
  if(ns4)
    {
    document.layers[capa].top=finy;
    document.layers[capa].left=finx;
    }
    else{
    document.getElementById(capa).style.top=finy;
    document.getElementById(capa).style.left=finx;
    }
   }
 }
  else  terminado=0;

}



function moverpos(){

if (ocupado==0)
 {
 ocupado=1;
 valor0=new Date();
 }
terminado=1;
refer=(new Date()-valor0);
moverat('cparo',35,31,204,31,676,400,refer);

moverat('cpboton1',200,285,489,93,800,1600,refer);
moverat('cpboton2',200,285,449,229,800,1600,refer);
moverat('cpboton3',200,285,390,347,800,1600,refer);
moverat('cpboton4',200,285,309,446,800,1600,refer);

moverat('cptexto1',494,97,494,97,100,2800,refer);
moverat('cptexto2',454,233,454,233,100,3000,refer);
moverat('cptexto3',395,351,395,351,100,3200,refer);
moverat('cptexto4',314,450,314,450,100,3400,refer);

if (terminado==0) setTimeout("moverpos()",10);
else {
  ocupado=0;
  status='Surken Electroinformática';
  return(true);
  }
} 


function moverposdis1(){
if (ocupado==0)
 {
 ocupado=1;
 valor0=new Date();
 }
terminado=1;
refer=(new Date()-valor0);
moverat('cpboton1a',501,96,260,100,400,0,refer);
moverat('cpboton1b',501,96,241,193,400,0,refer);
moverat('cptexto1a',265,104,265,104,1,400,refer);
moverat('cptexto1b',246,197,246,197,1,400,refer);
if (terminado==0) setTimeout("moverposdis1()",10);
else {
ocupado=0;
status='Surken Electroinformática';
return(true);
}
} 



function moverposprod1(){
if (ocupado==0)
 {
 ocupado=1;
 valor0=new Date();
 }
terminado=1;
refer=(new Date()-valor0);
moverat('cpboton2a',461,232,235,186,400,00,refer);
moverat('cpboton2b',461,232,210,260,400,00,refer);
moverat('cpboton2c',461,232,167,340,400,00,refer);

moverat('cptexto2a',240,190,240,190,1,400,refer);
moverat('cptexto2b',215,264,215,264,1,400,refer);
moverat('cptexto2c',172,344,172,344,1,400,refer);
if (terminado==0) setTimeout("moverposprod1()",10);
else {
ocupado=0;
status='Surken Electroinformática';
return(true);
}
} 


function moverposdis2(){
if (ocupado==0)
 {
 ocupado=1;
 valor0=new Date();
 }
terminado=1;
refer=(new Date()-valor0);
moverat('cptexto1a',-300,1,-300,1,1,0,refer);
moverat('cptexto1b',-300,1,-300,1,1,0,refer);

moverat('cpboton1a',260,100,501,96,400,0,refer);
moverat('cpboton1b',241,193,501,96,400,0,refer);

moverat('cpboton1a',-300,1,-300,1,1,401,refer);
moverat('cpboton1b',-300,1,-300,1,1,401,refer);

moverat('cpmasc1',265,241,265,241,1,401,refer);
moverat('cpsurken',152,260,152,260,1,401,refer);
if (terminado==0) setTimeout("moverposdis2()",10);
else {
ocupado=0;
status='Surken Electroinformática';
return(true);
}
}


function moverposprod2(){
if (ocupado==0)
 {
 ocupado=1;
 valor0=new Date();
 }
terminado=1;
refer=(new Date()-valor0);
moverat('cptexto2a',-300,1,-300,1,1,0,refer);
moverat('cptexto2b',-300,1,-300,1,1,0,refer);
moverat('cptexto2c',-300,1,-300,1,1,0,refer);
moverat('cpboton2a',235,186,461,232,400,00,refer);
moverat('cpboton2b',210,260,461,232,400,00,refer);
moverat('cpboton2c',167,340,461,232,400,00,refer);
moverat('cptexto2a',-300,1,-300,1,1,401,refer);
moverat('cptexto2b',-300,1,-300,1,1,401,refer);
moverat('cptexto2c',-300,1,-300,1,1,401,refer);

moverat('cpmasc1',265,241,265,241,1,400,refer);
moverat('cpsurken',152,260,152,260,1,400,refer);

if (terminado==0) setTimeout("moverposprod2()",10);
else {
ocupado=0;
status='Surken Electroinformática';
return(true);
}
} 

function Pulsado1(){
  if (ocupado==0){
  if (mivalor=='cpboton1'){
  mivalor="nulo";
  Normal('cpboton1');
  moverat('cptexto1a',-300,1,-300,1,1,1,2);
  moverat('cptexto1b',-300,1,-300,1,1,1,2);
  moverposdis2();
  }

else{
  Pulsado('cpboton1');
  Normal('cpboton2');
  moverat('cpmasc1',-300,1,-300,1,1,1,2);
  moverat('cpsurken',-300,1,-300,1,1,1,2);
  moverat('cpboton2a',-300,1,-300,1,1,1,2);
  moverat('cpboton2b',-300,1,-300,1,1,1,2);
  moverat('cpboton2c',-300,1,-300,1,1,1,2);
  moverat('cptexto2a',-300,1,-300,1,1,1,2);
  moverat('cptexto2b',-300,1,-300,1,1,1,2);
  moverat('cptexto2c',-300,1,-300,1,1,1,2);
  moverposdis1();
  }
 }
 }


function Pulsado2(){
  if (ocupado==0){
  if (mivalor=='cpboton2'){
  mivalor="nulo";
  Normal('cpboton2');
  moverat('cptexto2a',-300,1,-300,1,1,1,2);
  moverat('cptexto2b',-300,1,-300,1,1,1,2);
  moverat('cptexto2c',-300,1,-300,1,1,1,2);
  moverposprod2();
  }

else{
  Pulsado('cpboton2');
  Normal('cpboton1');
  moverat('cpmasc1',-300,1,-300,1,1,1,2);
  moverat('cpsurken',-300,1,-300,1,1,1,2);
  moverat('cpboton1a',-300,1,-300,1,1,1,2);
  moverat('cpboton1b',-300,1,-300,1,1,1,2);
  moverat('cptexto1a',-300,1,-300,1,1,1,2);
  moverat('cptexto1b',-300,1,-300,1,1,1,2);
  moverposprod1();
  }
 }
 }


function Normal(nombreImg){
 if (mivalor==nombreImg)  var img=eval("i1P.src");
 else var img=eval("i1N.src");
 document[nombreImg].src=img;
// status='Surken Electroinformática';
 }


function Normalb(nombreImg){
 var img=eval("i2N.src");
 document[nombreImg].src=img;
// status='Surken Electroinformática';
 }


function Sobre(nombreImg){
  var img = eval("i1S.src");
  document[nombreImg].src = img;
 }

function Sobreb(nombreImg){
  var img = eval("i2S.src");
  document[nombreImg].src = img;
 }


function Pulsadob(nombreImg){
  status='Surken Electroinformática';
  var img = eval("i2P.src");
  document[nombreImg].src = img;
 }

function Pulsado(nombreImg){
  status='Surken Electroinformática';
  var img = eval("i1P.src");
  document[nombreImg].src = img;
  mivalor=nombreImg;
 }

