Este es html, muchas gracias por echarme una mano, este html se forma a partir de un bucle en php, asi cada id que aparece es puesta en el html mediante php y un template.
Código HTML:
<br>
<table width="530">
<tbody><tr>
<th>Campos utilizados</th>
<th colspan="2">
<font color="#00ff00">351</font> / <font color="#ff0000">366</font> El resto 15 Campos libres
</th>
</tr>
<tr>
<td class="l">
<div name="1" id="1" width="120" height="120" style="padding: 50px; position: absolute; opacity: 1;" align="top"></div>
<a href="infos.php?UniNum=1&gid=1">
<img src="skins/xnova/gebaeude/1.gif" align="top" border="0" height="120" width="120">
</a>
</td>
<td class="l">
<div name="14" id="14" width="120" height="120" style="padding: 50px; position: absolute; opacity: 1;" align="top"></div>
<a href="infos.php?UniNum=1&gid=14">
<img src="skins/xnova/gebaeude/14.gif" align="top" border="0" height="120" width="120">
</a>
</td>
<td class="l">
<a href="infos.php?UniNum=1&gid=14">Centro de Robótica</a> (Nivel 12)<br>
Los centros de robótica se encargan de la produccion de robots especializados en la creación y desarrollo de las infraestructuras .<br>
Requiere : Acero: <b style="color: lime;"> <span class="noresources">8.765.849</span></b> Silicio: <b style="color: lime;"> <span class="noresources">2.629.754</span></b> Tritio: <b style="color: lime;"> <span class="noresources">4.382.924</span></b>
<br>Tiempo : 00h 04m 02s
<br><font color="#7f7f7f">Sobran : Acero: <b style="color: rgb(95, 127, 108);">1.226.697.214.999.779.328</b> Silicio: <b style="color: rgb(95, 127, 108);">1.032.999.029.689.981.861.888</b> Tritio: <b style="color: rgb(95, 127, 108);">44.557.207.039.886.360.576</b> </font>
</td>
<td class="k"><a href="javascript:valorizer(14)"><font color="#00ff00">Subir de Nivel 13</font></a></td>
<td class="l">
<a href="infos.php?UniNum=1&gid=44">Arsenal de misiles</a> (Nivel 75)<br>
El arsenal de misiles es un lugar estratégico donde los misiles son almcenados , para su posterior lanzamiento.<br>
Requiere : Acero: <b style="color: red;"> <t title="-80.254.741.838.371.241.984"><span class="noresources">81.481.439.053.379.780.608</span></t></b> Silicio: <b style="color: lime;"> <span class="noresources">81.481.439.053.379.780.608</span></b> Tritio: <b style="color: lime;"> <span class="noresources">2.037.035.976.334.494.464</span></b>
<br>Tiempo : 40178224385d 0-17h 0-11m 0-55s
<br><font color="#7f7f7f">Sobran : Acero: <b style="color: rgb(127, 95, 96);">-80.254.741.838.371.241.984</b> Silicio: <b style="color: rgb(95, 127, 108);">951.517.590.636.604.686.336</b> Tritio: <b style="color: rgb(95, 127, 108);">42.520.171.063.556.251.648</b> </font>
</td>
<!--ESTO ES EL LINK EN EL QUE EL USER PINCHA Y APARECE LA EVAPORACION-->
<td class="k"><a href="javascript:valorizer(14)"><font color="#00ff00">Subir de Nivel 13</font></a></td>
</tr>
</tbody></table>
<script>
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(function(){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["paddingTop"] = 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;
}
</script>
<br>