<!doctype html>
<html>
<head>
<title>Fill in English Phrase - RJM Programming - March, 2018</title>
<script type='text/javascript'>

var ourphrase='';
var score=0;
var goes=0;

function check(iois) {
if (iois != null) {
if (iois.src != '') {
var aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
try {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body.innerHTML != '') {
ourphrase=aconto.body.innerHTML;
//alert(ourphrase);
var prefix=ourphrase.split(' ')[0].split('-')[0], suffix='';
//alert(prefix);
for (var ij=0; ij<ourphrase.length; ij++) {
if (ij < prefix.length) {
suffix+='?';
} else {
suffix+=ourphrase.substring(ij, eval(1 + ij));
}
//alert(suffix);
document.getElementById('danswer').innerHTML=suffix;
}
}
} catch(eee) { }
}
}
}
}

function getword() {
ourphrase='';
var lis=eval(Math.floor(Math.random() * 21) + 3);
if (document.URL.toLowerCase().indexOf('rjmprogramming.com.au') != -1) {
document.getElementById('myiframehastobe').src='//www.rjmprogramming.com.au/PHP/surprise.php?min=' + lis + '&max=' + lis + '&phrase=y&youllneverfindthis=y';
} else {
document.getElementById('myiframehastobe').src='PHP/surprise.php?min=' + lis + '&max=' + lis + '&phrase=y&youllneverfindthis=y';
}
}

function dcheck(diois) {
if (ourphrase != '') {
goes++;
if (diois.innerHTML.toLowerCase() == ourphrase.toLowerCase()) {
score++;
document.getElementById('score').innerHTML='Score: ' + score + '/' + goes;
} else {
document.getElementById('score').innerHTML='Score: ' + score + '/' + goes;
var huhx=prompt('No, sorry, but going okay will go and try to find out more. English phrase we were looking for is ' + ourphrase + '.', ourphrase);
ourphrase='';
if (huhx != null) {
if (huhx != '') {
window.open("//www.thefreedictionary.com/" + huhx.replace(/\ /g,'+'), '_blank');
}
}
}
ourphrase='';
getword();
}
}


</script>
</head>
<body onload='getword();'>
<h1 title='Click here to give up' onclick="dcheck(document.getElementById('danswer'));">Fill in English Phrase</h1>
<h3 title='Click here to give up' onclick="dcheck(document.getElementById('danswer'));">RJM Programming - March, 2018</h3>
<h4 title='Click here to give up' onclick="dcheck(document.getElementById('danswer'));">Change ?'s to letters of English phrase</h4>
<h4 title='Click here to give up' onclick="dcheck(document.getElementById('danswer'));" id='score'>Score: 0/0</h4>

<div title="Change ?'s to letters of English phrase" onblur='dcheck(this);' contenteditable=true id='danswer' style='border: 5px solid pink; background-color: yellow; font-size: 42px;'></div>
<iframe style='display:none;' onload='check(this);' id='myiframehastobe' src=''></iframe>
<input type=text style="position:absolute;top:-120px;left:-120px;" value=""></input>
</body>
</html>