<!doctype html>
<html>
<head>
<title>Creature Body Parts - RJM Programming - February, 2018 ... thanks to Science Puzzles for Young Einsteins by Helene Hovanec ISBN: 0-8069-3542-1</title>


<style>
#middle {
width: 40px;
background: -moz-linear-gradient(left, pink 20px, cyan 40px);
background: -o-linear-gradient(left, pink 20px, cyan 40px);
background: -webkit-linear-gradient(left, pink 20px, cyan 40px);
background: linear-gradient(left, pink 20px, cyan 40px);
}
</style>
<script type='text/javascript'>

var score=0;
var goes=0;
var choice=0;

var answers=["LOCUST STOMACH",
"JAGUAR ARMS",
"GIRAFFE FEET",
"CRAB ABDOMEN",
"TURKEY EYEBROW",
"WHALE LEGS",
"SWAN ANKLE",
"SARDINE NECK",
"FINCH CHIN",
"WASP SPINE",
"IGUANA NAVEL",
"MOTH THIGH",
"MOSQUITO TOES",
"TERMITE TEETH",
"TOAD ADENOIDS"
];

function chooseone() {
var words=[], i, j;
while (words.length != 2) {
choice=Math.floor(Math.random() * answers.length);
words=answers[choice].split(' ');
}
document.getElementById('L0').innerHTML=words[0].substring(0,eval(-2 + words[0].length));
document.getElementById('R0').innerHTML=words[1].substring(2,eval(0 + words[1].length));
document.getElementById('midsel').value=' ';
}

function checkthis() {
goes++;
var ris=0, lis=0, ouranswer='';
while (document.getElementById('L' + lis)) {
ouranswer+=document.getElementById('L' + lis).innerHTML;
lis++;
}
ouranswer+=document.getElementById('midsel').value + ' ' + document.getElementById('midsel').value;
while (document.getElementById('R' + ris)) {
ouranswer+=document.getElementById('R' + ris).innerHTML;
ris++;
}
if (ouranswer == answers[choice]) {
score++;
document.getElementById('score').innerHTML='Score: ' + score + '/' + goes + " ... " + answers[choice];
} else {
document.getElementById('score').innerHTML='Score: ' + score + '/' + goes;
alert('Sorry, the answer was ' + answers[choice] + ' rather than your answer of ' + ouranswer);
document.getElementById('score').innerHTML='Score: ' + score + '/' + goes + " ... " + answers[choice];
}
chooseone();
}

</script>
</head>
<body onload="chooseone();">
<h1 id=myh1>Creature Body Parts</h1>
<h3>RJM Programming - February, 2018</h3>
<h3>Thanks to Science Puzzles for Young Einsteins by Helene Hovanec ISBN: 0-8069-3542-1</h3>
<h4 id=score>Score: 0/0</h4>

<table style="width:100%;text-align:center;" border=20>
<tbody>
<tr><th>Creature</th><th>-><-</th><th>Body Part</th><th></th></tr>
<tr><td id='left' style='background-color:pink;'><p id=L0></p></td><td id='middle'><select size=16 id=midsel>
<option value=' '> </option>
<option value='AB'>AB</option>
<option value='AD'>AD</option>
<option value='AN'>AN</option>
<option value='AR'>AR</option>
<option value='CH'>CH</option>
<option value='EY'>EY</option>
<option value='FE'>FE</option>
<option value='LE'>LE</option>
<option value='NA'>NA</option>
<option value='NE'>NE</option>
<option value='SP'>SP</option>
<option value='ST'>ST</option>
<option value='TE'>TE</option>
<option value='TH'>TH</option>
<option value='TO'>TO</option>
</select></td><td id='right' style='background-color:cyan;'><p id=R0></p></td><td><input type=button onclick='checkthis();' value='Check Answer' title='Check Answer' style='background-color:yellow;'></input></td></tr>
</tbody>
</table>

</body>
</html>