home *** CD-ROM | disk | FTP | other *** search
/ Magazyn WWW 1999 July / www_07_1999.iso / prez / amiga / KidHTML1_25.lha / KidHTML1.25 / Script / radioativecalc.js < prev    next >
Text File  |  1998-08-25  |  1KB  |  54 lines

  1.  
  2.  
  3. <!-- TWO STEPS TO INSTALL RADIOACTIVE CALCULATOR:
  4.  
  5.    1.  Copy the first code into the BODY of your HTML document
  6.    2.  Put the last code into the BODY of your HTML document  -->
  7.  
  8. <!-- STEP ONE: Copy this code into the HEAD of your HTML document  -->
  9.         
  10. <HEAD>
  11.  
  12. <SCRIPT LANGUAGE="JavaScript">
  13.  
  14. <!-- This script and many more are available online from -->
  15. <!-- The JavaScript Source!! http://javascriptsource.com -->
  16.  
  17. <!-- Begin
  18. function computeamount(h,a,t){  
  19. h = document.forms[0].h.value  
  20. a = document.forms[0].a.value  
  21. t = document.forms[0].t.value  
  22. document.forms[0].result1.value=eval(a*Math.exp((Math.log(0.5)/h)*t));  
  23. document.forms[0].result2.value=eval((document.forms[0].result1.value/a)*100);    
  24. }
  25. // End -->
  26. </SCRIPT>
  27.  
  28. <!-- STEP TWO: Copy this code into the BODY of your HTML document  -->
  29.  
  30. <BODY>
  31.  
  32. <CENTER> 
  33. <TABLE border=1> 
  34. <TR> 
  35. <TD>Halflife</TD> 
  36. <TD>Amount</TD> 
  37. <TD>Time</TD> 
  38. </TR> 
  39. <TR> 
  40. <TD><FORM><input name="h" size=10 ></TD> 
  41. <TD><input name="a" size=10 ></TD> 
  42. <TD><input name="t" size=10 ></TD> 
  43. <TD><input type="button" value="Calculate Amount Left" onclick="computeamount()"></TD> 
  44. </TR> 
  45. </TABLE>
  46. </CENTER>
  47. <BR>The amount remaining is: 
  48. <input name="result1" size=22> or 
  49. <input name="result2" size=5> percent of the original sample.
  50. <input type="reset" value="Reset Form">
  51. </FORM>
  52.  
  53. <!-- Script Size:  1.37 KB  -->
  54.