El resto creo que funciona, alguien me puede ayudar
Código PHP:
a = new Array();
a[0] = 1;
a[1] = 50;
function valorizer(ID){
//lastCalled obtiene el valor que le toca
alert(ID);
a = lastCalled(a[0],a[1]);
fundido(a[0],a[1],ID);
//para que no este llamando hasta el infinito
//if(a[0] >= 0 && a[1] >= 14){
alert("llama "+a[0]+","+a[1]);
//}
setTimeout("valorizer(ID)",60);
alert(ID);
}
function fundido(opa,pos,id){
//cambia la opacidad de los 2 divs
document.getElementsByName(id)[0].style["opacity"] = opa;
document.getElementsByName(id)[0].style["padding-top"] = pos;
}
function lastCalled(numA,numB){
//segun el valor que se introduzca se devuelve el siguiente que toca
ret = new Array();
if(numA == 1){
ret[0] = 0.9;
ret[1] = 46;
}
alert(numA);
if(numA == 0.9){
ret[0] = 0.8;
ret[1] = 42;
}
if(numA == 0.8){
ret[0] = 0.7;
ret[1] = 42;
}
if(numA == 0.7){
ret[0] = 0.6;
ret[1] = 38;
}
if(numA == 0.6){
ret[0] = 0.5;
ret[1] = 34;
}
if(numA == 0.5){
ret[0] = 0.4;
ret[1] = 30;
}
if(numA == 0.4){
ret[0] = 0.3;
ret[1] = 26;
}
if(numA == 0.3){
ret[0] = 0.2;
ret[1] = 22;
}
if(numA == 0.2){
ret[0] = 0.1;
ret[1] = 18;
}
if(numA == 0.1){
ret[0] = 0.0;
ret[1] = 14;
}
return ret;
}