Código HTML:
<html> <head> <title> Costo </title> <script type="text/javascript"> function unoPorUno(){ var f = document.frm; var b = f.getElementsByTagName('b'), i; var trs = new Array(); var index = 0; function inicio(){ trs[index].style.display = 'table-row'; var n = document.getElementById('next'); n.onclick = function(){ if((index+1) < (trs.length)){ trs[index].style.display = 'none'; index++; inicio(); } }; } for(i=0; i<b.length; i++){ var tr = b[i].parentNode.parentNode.parentNode; if(tr.tagName == 'TR'){ tr.style.display = 'none'; trs.push(tr); } } f.reset.onclick = function(){ trs[index].style.display = 'none'; index = 0; inicio() }; inicio(); } var a = 0; function sum(){ var f = document.frm; var b = parseInt(f.text1.value); var c = parseInt(f.text2.value); var d = parseInt(f.text3.value); a = a + (b * 0.035); a = a + (c * 0.3); a = a + (d * 6); var cheks = [3,5,16,17,35,40,40,40,40,150,150,150,150,100,100,100,100,51,41,65,500,20,30,15,10], i; for(i=0;i<cheks.length;i++){ var key = i+1; if(f['chk'+key].checked) a += cheks[i]; } } function decahex(n) { return hexa.charAt(n / 16) + hexa.charAt(n % 16); } function colorHexa(c) { return "#" + decahex(c[0]) + decahex(c[1]) + decahex(c[2]); } function transitar(ini, fin, pasos) { var dato = desglose(ini); var rIni = dato[0]; var gIni = dato[1]; var bIni = dato[2]; var intermedios = new Array(pasos); intermedios[0] = dato; var dato = desglose(fin); intermedios[pasos - 1] = dato; var rFin = dato[0]; var gFin = dato[1]; var bFin = dato[2]; var rMed = (rFin - rIni) / (pasos - 1); var gMed = (gFin - gIni) / (pasos - 1); var bMed = (bFin - bIni) / (pasos - 1); for (var i = 1; i < pasos - 1; i ++) { var rgb = new Array(3); rgb[0] = parseInt(rIni + (rMed * i)); rgb[1] = parseInt(gIni + (gMed * i)); rgb[2] = parseInt(bIni + (bMed * i)); intermedios[i] = rgb; } for (i = 0; i < intermedios.length; i ++) intermedios[i] = colorHexa(intermedios[i]); return intermedios; } function desglose(color) { if (color.length != 6) return "poblema"; else { devolver = new Array(3); devolver[0] = hexadec(color.substr(0, 2)); devolver[1] = hexadec(color.substr(2, 2)); devolver[2] = hexadec(color.substr(4, 2)); } return devolver; } var hexa = "0123456789abcdef"; function hexadec(x) { x = x.toLowerCase(); return parseInt(hexa.indexOf(x.charAt(0))) * 16 + parseInt(hexa.indexOf(x.charAt(1))) } function ini() { var colores = transitar("006633", "FFFFFF", 256); var elFondo = document.getElementById("fondo").style; var ancho = document.body.clientWidth; var alto = 150; elFondo.width = ancho; elFondo.height = alto; var altoCelda = alto / 256; var tabla = "<table cellpadding=0 cellspacing=0 width=100% height=100%>"; for (var i = 0; i < colores.length; i ++) tabla += "<tr><td width=100% height=" + altoCelda + " style='background-color: " + colores[i] + "'></td></tr>"; tabla += "</table>"; document.getElementById("fondo").innerHTML = tabla; } </script> </head> <body style="margin:0" onresize=ini() onload="ini()"> <div style="position: relative"> <div id="fondo" style="position:absolute; top:0; left:0;"></div> <div id="general1" style="position:absolute; top:0; left:0;"> <div id="general2" style="position:relative; top:50; left:100;"> <img src="toplogo.png" width=300 heiht=100 alt="logo"><br><br><br> </div> <div id=general3 style="position:relative; top:20; left:250;"> <form name="frm"> <font face="verdana"> <table border="0"> <tr><td colspan="2"> <div id=general style="position:relative; top:0; left:20;"> <img src="visa.jpg" align="center" width=150 heiht=50><br><br> <img src="flecha.gif"> <b>What kind of CC do you have?</b> </div> <table> <br> <tr><td> <input type="checkbox" name="chk1">US Visa/MasterdCard Classic<br> </td><td> <input type="checkbox" name="chk2">UK Visa/MasterdCard Classic<br> </td></tr> <tr><td> <input type="checkbox" name="chk3">EU Visa/MasterdCard Classic<br> </td><td> <input type="checkbox" name="chk4">LATAM Visa/MasterdCard Classic<br> </td></tr> <tr><td> <input type="checkbox" name="chk5">US American Express<br> </td><td> <input type="checkbox" name="chk6">US Visa Gold/Signature<br> </td></tr> <tr><td> <input type="checkbox" name="chk7">US Visa Platinum/Signature<br> </td><td> <input type="checkbox" name="chk8">US Visa Corporate/Signature<br> </td></tr> <tr><td> <input type="checkbox" name="chk9">US Visa Business/Signature<br> </td><td> <input type="checkbox" name="chk10">EU Visa Gold/Signature<br> </td></tr> <tr><td> <input type="checkbox" name="chk11">EU Visa Platinum/Signature<br> </td><td> <input type="checkbox" name="chk12">EU Visa Corporate/Signature<br> </td></tr> <tr><td> <input type="checkbox" name="chk13">EU Visa Business/Signature<br> </td><td> <input type="checkbox" name="chk14">Other country Visa Gold/Signature<br> </td></tr> <tr><td> <input type="checkbox" name="chk15">Other country Visa Platinum/Signature<br> </td><td> <input type="checkbox" name="chk16">Other country Visa Corporate/Signature<br> </td></tr> <tr><td> <input type="checkbox" name="chk17">Other country Visa Business/Signature<br> </td></tr> </table> </td></tr> <tr><td colspan="2"> <div id=general style="position:relative; top:0; left:20;"> <img src="skype.jpg" align="center" width=150 heiht=50><br><br> <img src="flecha.gif"> <b>Do you have a paid Skype account? What's your current balance in USD?</b><br> </div> <br> $<input type="text" name="text2" size=10 value="0"><br> </td></tr> <tr></tr> <tr><td colspan="2"> <div id=general style="position:relative; top:0; left:20;"> <img src="icq.gif" align="center" width=150 heiht=50><br><br> <img src="flecha.gif"> <b>Do you have an ICQ number with 7 or less digits?</b><br> </div> <br> <input type="checkbox" name="chk23">Yes <input type="checkbox">No<br> </td></tr> <tr></tr> <tr><td colspan="2"> <div id=general style="position:relative; top:0; left:20;"> <img src="pc.jpg" align="center" width=150 heiht=50><br><br> <img src="flecha.gif"> <b>How many PCs do you have with a broadband Internet connection?</b><br> </div> <br> N:<input type="text" name="text3" size=10 value="0"><br> </td></tr> <tr></tr> <tr><td colspan="2"> <div id=general style="position:relative; top:0; left:20;"> <img src="ebay_paypal.jpg" align="center" width=150 heiht=50><br><br> <img src="flecha.gif"> <b>Do you have an account on PayPal or eBay online payment system?</b><br> </div> <br> <input type="checkbox" name="chk24">Yes <input type="checkbox">No<br> </td></tr> <tr></tr> <tr><td colspan="2"> <div id=general style="position:relative; top:0; left:20;"> <img src="msn.jpg" align="center" width=150 heiht=50><br><br> <img src="flecha.gif"> <b>Do you have an IM account? (MSN Messenger, YM, etc.)?</b><br> </div> <br> <input type="checkbox" name="chk25">Yes <input type="checkbox">No<br> </td></tr> <tr></tr> <tr><td colspan="2" align="center"> <div id=general style="position:relative; top:0; left:20;"> <b><font color="#8B0000" size="5">Total:</font></b> $<input type="text" name="text4" size=30><br> </div> <br> <input type="button" value="Total" onClick="sum(); document.frm.text4.value = a"> <input type="reset" value="Reset" name="reset" onClick="sum(); a = 0"> <br><br><br> </td></tr> <tr></tr> <tr><td><br></td></tr> <tr><td colspan="2" align="right"> <p id="next" style="text-align:left"> <img src="flecha1.jpg" onmouseover="src='flecha2.jpg'" onmouseout="src='flecha1.jpg'"> </p> </td></tr> </font> </table> </form> </div> </div> <script> unoPorUno() </script> </body> </html>