<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Hangman - RJM Programming - May, 2018 ... curplayer tosolve clue</title>
<!--
How to install the image map:
Copy and paste the img, map and area blocks into the body of your page.

This imagemap is created at Mobilefish.com.
https://www.mobilefish.com/services/image_map/image_map.php
-->
<style>
area { background-color: white; }
</style>
<script type='text/javascript'>

var clickthis=1;
var sofar='';
var cp='1';
var ts='';
var ihsels='';
var strikes=0;
var hscores=[0,0];

function doclick() {
if (document.getElementById('div' + clickthis)) {
document.getElementById('div' + clickthis).click();
clickthis++;
if (document.getElementById('div' + clickthis)) {
if (ts == '') setTimeout(doclick,3000);
} else {
document.getElementById('myimg').src=document.getElementById('myimg').src.replace('.jp','end.jp');
if (ts == '') setTimeout(doclick,3000);
}
} else {
location.href=document.URL;
}
}

function areatodiv() {
var areas=document.getElementsByTagName('area'), coordsare=[];
for (var i=0; i<areas.length; i++) {
if (('' + areas[i].coords).indexOf(',') != -1) {
coordsare=areas[i].coords.split(',');
document.body.innerHTML += "<div onclick=\" document.getElementById(this.id.replace('div','i')).style.zIndex='11'; this.style.zIndex='-9'; this.style.display='transparent';\" id='div" + eval(i + 1) + "' style='border:0px solid red;overflow:hidden;display:block;z-index:3;position:absolute;left:" + eval(-2 + eval(coordsare[0])) + ";top:" + eval(-2 + eval(coordsare[1])) + ";width:" + eval(12 + eval(coordsare[2]) - eval(coordsare[0])) + ";height:" + eval(12 + eval(coordsare[3]) - eval(coordsare[1])) + ";background-color:white;'></div>";
}
}
if (document.URL.indexOf('tosolve=') != -1) {
ts = location.search.split('tosolve=')[1] ? decodeURIComponent(location.search.split('tosolve=')[1].split('&')[0]) : '';
cp = location.search.split('curplayer=')[1] ? decodeURIComponent(location.search.split('curplayer=')[1].split('&')[0]) : '1';
var cl = location.search.split('clue=')[1] ? decodeURIComponent(location.search.split('clue=')[1].split('&')[0]) : '';
//if (ts != '') alert(ts);
//if (parent.document.getElementById('score') != null) alert('0:' + ts);
//if (parent.document.getElementById('shangman') != null) alert('1:' + ts);
if (ts == '' || !parent.document.getElementById('score') || !parent.document.getElementById('shangman')) {
doclick();
} else {
hscores[0]=eval(parent.document.getElementById('score').innerHTML.replace('Score:','').replace('/',',').replace(' ','').split(',')[0]);
hscores[1]=eval(parent.document.getElementById('score').innerHTML.replace('Score:','').replace('/',',').replace(' ','').split(',')[1]);
if (cl != '') {
document.getElementById('clues').innerHTML='Hint: ' + cl;
} else {
document.getElementById('clues').innerHTML=cl;
}
document.getElementById('divs').setAttribute('data-title', ts);
for (var ii=0; ii<ts.length; ii++) {
thisc=ts.substring(ii,eval(1 + ii));
if (thisc.toLowerCase() >= 'a' && thisc.toLowerCase() <= 'z') {
thisc='_';
}
document.getElementById('divs').innerHTML+=thisc;
}
//if (parent.document.getElementById('shangman') != null) alert('2:' + document.getElementById('divs').innerHTML);
document.getElementById('divs').style.display='block';
document.getElementById('clues').style.display='block';
document.getElementById('sels').style.display='block';
ihsels=document.getElementById('sels').innerHTML;
}
} else {
doclick();
}
}

function aten() {
alert('Answer was ' + ts);
parent.document.getElementById('shangman').innerHTML='Score: ' + hscores[0] + '/' + hscores[1];
}

function testletter(thisl) {
if (thisl != '') {
if (sofar.indexOf(thisl.toLowerCase()) == -1) {
sofar+=thisl.toLowerCase();
var ts=document.getElementById('divs').getAttribute('data-title');
var prevts=document.getElementById('divs').innerHTML;
var morec='', thisc='', found=false;
for (var ii=0; ii<ts.length; ii++) {
thisc=ts.substring(ii,eval(1 + ii));
if (thisc.toLowerCase() == thisl.toLowerCase()) {
morec+=thisc;
found=true;
} else {
morec+=prevts.substring(ii,eval(1 + ii));
}
}
document.getElementById('divs').innerHTML=morec;
if (morec.indexOf('_') == -1) {
if (cp == '1') {
hscores[1]+=morec.length;
} else {
hscores[0]+=morec.length;
}
parent.document.getElementById('shangman').innerHTML='Score: ' + hscores[0] + '/' + hscores[1];
} else if (!found) {
doclick();
strikes++;
if (strikes >= 10) {
doclick();
if (cp == '1') {
hscores[1]-=morec.length;
} else {
hscores[0]-=morec.length;
}
setTimeout(aten,100);
}
}
}
}
}

</script>
</head>
<body onload='areatodiv(); '>
<!--table><tbody><tr><td style='vertical-align:top;' id='tdr'>
</td><td-->
<!-- START COPY -->
<img id="myimg" src="hangman_bg.jpg" usemap="#iq40989" width="1280" height="800" alt="click map" border="0" />
<map id="iq40989" name="iq40989">
<!-- Region 1 head -->
<area id="i1" shape="rect" alt="head" title="head" coords="47,187,330,332" nohref target="_self" onclick="document.getElementById(this.id.replace('i','div')).style.backgroundColor='transparent';" />
<!-- Region 2 body -->
<area id="i2" shape="rect" alt="body" title="body" coords="177,335,189,485" nohref target="_self" onclick="document.getElementById(this.id.replace('i','div')).style.backgroundColor='transparent';" />
<!-- Region 3 rightarm -->
<area id="i3" shape="rect" alt="rightarm" title="rightarm" coords="42,353,178,431" nohref target="_self" onclick="document.getElementById(this.id.replace('i','div')).style.backgroundColor='transparent';" />
<!-- Region 4 leftarm -->
<area id="i4" shape="rect" alt="leftarm" title="leftarm" coords="195,349,414,424" nohref target="_self" onclick="document.getElementById(this.id.replace('i','div')).style.backgroundColor='transparent';" />
<!-- Region 5 rightleg -->
<area id="i5" shape="rect" alt="rightleg" title="rightleg" coords="53,496,194,643" nohref target="_self" onclick="document.getElementById(this.id.replace('i','div')).style.backgroundColor='transparent';" />
<!-- Region 6 leftleg -->
<area id="i6" shape="rect" alt="leftleg" title="leftleg" coords="194,496,347,647" nohref target="_self" onclick="document.getElementById(this.id.replace('i','div')).style.backgroundColor='transparent';" />
<!-- Region 7 rope -->
<area id="i7" shape="rect" alt="rope" title="rope" coords="170,114,236,183" nohref target="_self" onclick="document.getElementById(this.id.replace('i','div')).style.backgroundColor='transparent';" />
<!-- Region 8 beam -->
<area id="i8" shape="rect" alt="beam" title="beam" coords="185,99,670,112" nohref target="_self" onclick="document.getElementById(this.id.replace('i','div')).style.backgroundColor='transparent';" />
<!-- Region 9 stand -->
<area id="i9" shape="rect" alt="stand" title="stand" coords="561,99,578,693" nohref target="_self" onclick="document.getElementById(this.id.replace('i','div')).style.backgroundColor='transparent';" />
<!-- Region 10 base -->
<area id="i10" shape="rect" alt="base" title="base" coords="19,676,941,699" nohref target="_self" onclick="document.getElementById(this.id.replace('i','div')).style.backgroundColor='transparent';" />
<area id="i0" shape="default" nohref alt="" />
</map>
<!-- END COPY -->
<!--/td>
</tr></tbody></table-->
<div style='display:none;z-index:20;position:absolute;left:10px;top:10px;font-size:44px;' id='divs'></div><br>
<div style='display:none;z-index:20;position:absolute;left:10px;top:70px;font-size:14px;' id='clues'></div><br>
<select style='border:2px solid blue;display:none;z-index:20;position:absolute;left:10px;top:100px;font-size:18px;' size=27 id='sels' onchange=' if (this.value.length == 1) { testletter(this.value); this.innerHTML=ihsels; } '>
<option value=''>?</option>
<option value='a'>a</option>
<option value='b'>b</option>
<option value='c'>c</option>
<option value='d'>d</option>
<option value='e'>e</option>
<option value='f'>f</option>
<option value='g'>g</option>
<option value='h'>h</option>
<option value='i'>i</option>
<option value='j'>j</option>
<option value='k'>k</option>
<option value='l'>l</option>
<option value='m'>m</option>
<option value='n'>n</option>
<option value='o'>o</option>
<option value='p'>p</option>
<option value='q'>q</option>
<option value='r'>r</option>
<option value='s'>s</option>
<option value='t'>t</option>
<option value='u'>u</option>
<option value='v'>v</option>
<option value='w'>w</option>
<option value='x'>x</option>
<option value='y'>y</option>
<option value='z'>z</option>
</select>
</body>
</html>