home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magazyn WWW 1999 July
/
www_07_1999.iso
/
prez
/
amiga
/
KidHTML1_25.lha
/
KidHTML1.25
/
Script
/
bodycalc.js
< prev
next >
Wrap
Text File
|
1998-08-25
|
2KB
|
129 lines
<!-- ONE STEP TO INSTALL BODY CALCULATOR:
1. Paste the coding into the BODY of your HTML document -->
<!-- STEP ONE: Copy this code into the BODY of your HTML document -->
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Tomer and Yehuda Shiran
<!-- This script and many more are available online from -->
<!-- The JavaScript Source!! http://javascriptsource.com -->
<!-- Begin
function getHeight(sex, age, height) {
height = Math.round(height)
var height5 = 0
var height50 = 0
if (age == 2) {
height50 = 87
height5 = 82
} else
if (age == 3) {
height50 = 95
height5 = 90
} else
if (age == 4) {
height50 = 102
height5 = 95
} else
if (age == 5) {
height50 = 109
height5 = 101
} else
if (age == 6) {
height50 = 114
height5 = 107
} else
if (age == 7) {
height50 = 120
height5 = 112
} else
if (age == 8) {
height50 = 126
height5 = 118
} else
if (age == 9) {
height50 = 131
height5 = 121
} else
if (age == 10) {
height50 = 137
height5 = 127
} else
if (age == 11) {
height50 = 143
height5 = 131
} else
if (sex == "f") {
if (age == 12) {
height50 = 150
height5 = 140
} else
if (age == 13) {
height50 = 157
height5 = 145
} else
if (age == 14) {
height50 = 160
height5 = 148
} else
if (age == 15) {
height50 = 162
height5 = 150
} else
if (age == 16) {
height50 = 162
height5 = 151
} else
if (age == 17) {
height50 = 163
height5 = 153
} else
if (age == 18) {
height50 = 164
height5 = 154
}
} else
if (age == 12) {
height50 = 150
height5 = 137
} else
if (age == 13) {
height50 = 156
height5 = 142
} else
if (age == 14) {
height50 = 162
height5 = 148
} else
if (age == 15) {
height50 = 168
height5 = 155
} else
if (age == 16) {
height50 = 174
height5 = 160
} else
if (age == 17) {
height50 = 175
height5 = 165
} else
if (age == 18) {
height50 = 176
height5 = 165
}
var percent = (height - height5) * (50 - 5) / (height50 - height5) + 5
return percent
}
function getWeight(sex, age, weight) {
weight = Math.round(weight)
var weight5 = 0
var weight50 = 0
if (age == 2) {
weight50