<!doctype html>
<html>
<head>
<title>Body Systems - RJM Programming - August, 2017 ... thanks to HLTAAP001 Recognise healthy body systems TAFE NSW</title>
<style>
td { width: 10%; height: 10%; border: 0px inset red; }
</style>
<script type='text/javascript'>
var b_s=["Cardiovascular:heart,blood,vessels:3_2,3_3,5_2",
"Respiratory:nose,pharynx,trachea,bronchus,bronchiole:4_2",
"Musculoskeletal:muscles,joints,bones:0_6,1_6,2_6,3_6,4_6,5_6,6_6,7_6,8_6,9_6,0_7,1_7,2_7,3_7,4_7,5_7,6_7,7_7,8_7,9_7,0_8,1_8,2_8,3_8,4_8,5_8,6_8,7_8,8_8,9_8,0_9,1_9,2_9,3_9,4_9,5_9,6_9,7_9,8_9,9_9",
"Integumentary:skin:0_5,1_5,2_5,7_5,8_5,9_5",
"Nervous:brain,spinal chord,nerves:0_0,1_0,2_0,3_0,4_0,5_0,6_0,7_0,8_0,9_0",
"Gastrointestinal/Digestive:tongue,oesophagus,stomach,liver,pancreas,gall bladder,small intestine,large intestine:4_3,5_3,4_4,5_4",
"Urinary:kidneys,ureters,bladder,urethra:5_4",
"Reproductive:testes,scrotum,vas deferens,seminal vesicle,prostate,ejaculatory duct,urethra,penis,glans,perineum,ovaries,fallopian tubes,uterus:5_5",
"Endocrine:pituitary gland,hypothalamus gland,pineal gland,parathyroid gland,thyroid gland,adrenal glands,pancreas,ovaries,testes,hormones:4_1,5_1",
"Lymphatic/Immune:lymph glands,lymph vessels,lymph,lymphocytes,T cells,B cells:6_2,6_3,6_4,7_4,3_4"];
var body_part=[], body_system=[], choice=-1, score=0, goes=0;
function check(otd) {
//alert(otd.id);
var osel=document.getElementById('body_part');
goes++;
if (('' + osel.options[osel.selectedIndex].getAttribute("data-title")).indexOf(otd.id.replace('td','')) != -1) {
score++;
document.getElementById('score').innerHTML='Score: ' + score + '/' + goes;
choose();
} else {
document.getElementById('score').innerHTML='Score: ' + score + '/' + goes;
}
}
function pop_bp() {
var i, j, k, found=-1, spare;
for (i=0; i<b_s.length; i++) {
body_system.push(b_s[i].split(':')[0]);
spare=b_s[i].split(':')[1].split(',');
for (j=0; j<spare.length; j++) {
if (body_part.length == 0) {
body_part.push(spare[j] + ':' + b_s[i].split(':')[2]);
} else {
found=-1;
for (k=0; k<body_part.length; k++) {
if (spare[j] == body_part[k].split(':')[0]) found=k;
}
if (found < 0) {
body_part.push(spare[j] + ':' + b_s[i].split(':')[2]);
} else if (body_part[found].indexOf(':') != -1) {
body_part[found]+=',' + b_s[i].split(':')[2];
} else {
body_part[found]+=':' + b_s[i].split(':')[2];
}
}
}
}
for (k=0; k<body_part.length; k++) {
document.getElementById('body_part').innerHTML+='<option data-title="' + body_part[k].split(':')[1] + '" value="' + body_part[k].split(':')[0] + '">' + body_part[k].split(':')[0] + '</option>';
}
choose();
}
function choose() {
choice=Math.floor(Math.random() * body_part.length);
document.getElementById('body_part').value=body_part[choice].split(':')[0];
}
function giveup(selo) {
if (selo.value == "") {
goes++;
document.getElementById('score').innerHTML='Score: ' + score + '/' + goes;
var delim='', suffix='';
for (var i=0; i<b_s.length; i++) {
if (b_s[i].replace(/:/g,',').indexOf(',' + body_part[choice].split(':')[0] + ',') != -1) {
if (delim == ' ') delim=' and ';
suffix+=delim + b_s[i].split(':')[0];
if (delim == '') delim=' ';
}
}
alert(body_part[choice].split(':')[0] + ' is part of ' + suffix + ' system' + delim.replace(' and ','s'));
choose();
} else {
selo.value=body_part[choice].split(':')[0];
}
}
</script>
</head>
<body onload="setTimeout(pop_bp,5000);" style="background: url('body_systems.jpg') no-repeat; background-color: yellow;">
<table style='z-index:-1;background_color:transparent;position:absolute;top:0px;left:0px;width:415px;height:605px;'>
<tr><td id='td0_0' onclick='check(this);'></td><td id='td1_0' onclick='check(this);'></td><td id='td2_0' onclick='check(this);'></td><td id='td3_0' onclick='check(this);'></td><td id='td4_0' onclick='check(this);'></td><td id='td5_0' onclick='check(this);'></td><td id='td6_0' onclick='check(this);'></td><td id='td7_0' onclick='check(this);'></td><td id='td8_0' onclick='check(this);'></td><td id='td9_0' onclick='check(this);'></td></tr>
<tr><td id='td0_1' onclick='check(this);'></td><td id='td1_1' onclick='check(this);'></td><td id='td2_1' onclick='check(this);'></td><td id='td3_1' onclick='check(this);'></td><td id='td4_1' onclick='check(this);'></td><td id='td5_1' onclick='check(this);'></td><td id='td6_1' onclick='check(this);'></td><td id='td7_1' onclick='check(this);'></td><td id='td8_1' onclick='check(this);'></td><td id='td9_1' onclick='check(this);'></td></tr>
<tr><td id='td0_2' onclick='check(this);'></td><td id='td1_2' onclick='check(this);'></td><td id='td2_2' onclick='check(this);'></td><td id='td3_2' onclick='check(this);'></td><td id='td4_2' onclick='check(this);'></td><td id='td5_2' onclick='check(this);'></td><td id='td6_2' onclick='check(this);'></td><td id='td7_2' onclick='check(this);'></td><td id='td8_2' onclick='check(this);'></td><td id='td9_2' onclick='check(this);'></td></tr>
<tr><td id='td0_3' onclick='check(this);'></td><td id='td1_3' onclick='check(this);'></td><td id='td2_3' onclick='check(this);'></td><td id='td3_3' onclick='check(this);'></td><td id='td4_3' onclick='check(this);'></td><td id='td5_3' onclick='check(this);'></td><td id='td6_3' onclick='check(this);'></td><td id='td7_3' onclick='check(this);'></td><td id='td8_3' onclick='check(this);'></td><td id='td9_3' onclick='check(this);'></td></tr>
<tr><td id='td0_4' onclick='check(this);'></td><td id='td1_4' onclick='check(this);'></td><td id='td2_4' onclick='check(this);'></td><td id='td3_4' onclick='check(this);'></td><td id='td4_4' onclick='check(this);'></td><td id='td5_4' onclick='check(this);'></td><td id='td6_4' onclick='check(this);'></td><td id='td7_4' onclick='check(this);'></td><td id='td8_4' onclick='check(this);'></td><td id='td9_4' onclick='check(this);'></td></tr>
<tr><td id='td0_5' onclick='check(this);'></td><td id='td1_5' onclick='check(this);'></td><td id='td2_5' onclick='check(this);'></td><td id='td3_5' onclick='check(this);'></td><td id='td4_5' onclick='check(this);'></td><td id='td5_5' onclick='check(this);'></td><td id='td6_5' onclick='check(this);'></td><td id='td7_5' onclick='check(this);'></td><td id='td8_5' onclick='check(this);'></td><td id='td9_5' onclick='check(this);'></td></tr>
<tr><td id='td0_6' onclick='check(this);'></td><td id='td1_6' onclick='check(this);'></td><td id='td2_6' onclick='check(this);'></td><td id='td3_6' onclick='check(this);'></td><td id='td4_6' onclick='check(this);'></td><td id='td5_6' onclick='check(this);'></td><td id='td6_6' onclick='check(this);'></td><td id='td7_6' onclick='check(this);'></td><td id='td8_6' onclick='check(this);'></td><td id='td9_6' onclick='check(this);'></td></tr>
<tr><td id='td0_7' onclick='check(this);'></td><td id='td1_7' onclick='check(this);'></td><td id='td2_7' onclick='check(this);'></td><td id='td3_7' onclick='check(this);'></td><td id='td4_7' onclick='check(this);'></td><td id='td5_7' onclick='check(this);'></td><td id='td6_7' onclick='check(this);'></td><td id='td7_7' onclick='check(this);'></td><td id='td8_7' onclick='check(this);'></td><td id='td9_7' onclick='check(this);'></td></tr>
<tr><td id='td0_8' onclick='check(this);'></td><td id='td1_8' onclick='check(this);'></td><td id='td2_8' onclick='check(this);'></td><td id='td3_8' onclick='check(this);'></td><td id='td4_8' onclick='check(this);'></td><td id='td5_8' onclick='check(this);'></td><td id='td6_8' onclick='check(this);'></td><td id='td7_8' onclick='check(this);'></td><td id='td8_8' onclick='check(this);'></td><td id='td9_8' onclick='check(this);'></td></tr>
<tr><td id='td0_9' onclick='check(this);'></td><td id='td1_9' onclick='check(this);'></td><td id='td2_9' onclick='check(this);'></td><td id='td3_9' onclick='check(this);'></td><td id='td4_9' onclick='check(this);'></td><td id='td5_9' onclick='check(this);'></td><td id='td6_9' onclick='check(this);'></td><td id='td7_9' onclick='check(this);'></td><td id='td8_9' onclick='check(this);'></td><td id='td9_9' onclick='check(this);'></td></tr>
</table>
<table style='z-index:-1;background_color:transparent;position:absolute;top:605px;left:0px;width:415px;height:60px;'>
<tr><th id='q_a' colspan=10><select id='body_part' onchange='giveup(this);'><option value=''>Please click on relevant Body System arrowhead above (or give up) for ...</option></th></tr>
</table>
<h1 style='z-index:-1;background_color:transparent;position:absolute;top:0px;left:425px;'>Body Systems of Body Part Game</h1>
<h3 style='z-index:-1;background_color:transparent;position:absolute;top:80px;left:425px;'>RJM Programming</h3>
<h3 style='z-index:-1;background_color:transparent;position:absolute;top:130px;left:425px;'>August, 2017</h3>
<h3 style='z-index:-1;background_color:transparent;position:absolute;top:180px;left:425px;'>Thanks to <i>HLTAAP001 Recognise healthy body systems</i> TAFE NSW</h3>
<h4 id='score' style='z-index:-1;background_color:transparent;position:absolute;top:280px;left:425px;'>Score: 0/0</h4>
</body>
</html>