// just.js
// Learning Programming "just" widget
// RJM Programming
// November 2015
var waswords, aq, oaq, qqcnt=0, oxaal;
function qthere(iois) {
var ee, eee, isthere=false, str="", prevw='', isoky=true;
var xxrnum = Math.floor(Math.random() * 1000) + 1;
aq='';
oaq=document.getElementById('justdiv');
try {
if (iois != null) {
var aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
try {
str=aconto.body.innerHTML;
if (str.length > 0) {
if (str.toLowerCase().indexOf(">not found<") == -1 && str.toLowerCase().indexOf("our home page for your perusal") == -1) isthere=true;
if (isthere) {
var answers=aconto.body.innerHTML.split('>Answer: ');
var answer=answers[1].substring(0,1);
var explanationspt=aconto.body.innerHTML.split('>Why');
var explanations=explanationspt[1].split('<');
var explanation='Why' + explanations[0];
waswords=aconto.body.innerHTML; // getElementById('words').innerHTML;
if (isoky) {
waswords=waswords.replace('
' + answer, '
' + answer + '');
for (var iiy=65; iiy<=70; iiy++) {
if (prevw != waswords && String.fromCharCode(iiy) != answer) {
prevw=waswords;
waswords=waswords.replace('
' + String.fromCharCode(iiy), '
' + String.fromCharCode(iiy) + '');
}
}
waswords+='
?';
var ttopic = location.search.split('topic=')[1] ? location.search.split('topic=')[1].split('&')[0] : " ";
if (document.getElementById('topic').value.replace(' ','') != '' || ttopic.replace(' ','') != '') {
if (ttopic.replace(' ','') == '') ttopic = document.getElementById('topic').value;
if (aconto.body.innerHTML.toLowerCase().replace('?',' ').indexOf(' ' + ttopic.toLowerCase().replace('!','') + ' ') == -1 && aconto.body.innerHTML.toLowerCase().replace('?',' ').indexOf(' ' + ttopic.toLowerCase().replace('!','') + ',') == -1 && aconto.body.innerHTML.toLowerCase().replace('?',' ').indexOf('(' + ttopic.toLowerCase().replace('!','') + ')') == -1 && aconto.body.innerHTML.toLowerCase().replace('?',' ').indexOf(' ' + ttopic.toLowerCase().replace('!','') + '.') == -1 && aconto.body.innerHTML.toLowerCase().replace('?',' ').indexOf(' ' + ttopic.toLowerCase().replace('!','') + '<') == -1 && aconto.body.innerHTML.toLowerCase().replace('?',' ').indexOf('>' + ttopic.toLowerCase().replace('!','') + ' ') == -1) {
isoky=false;
qqcnt++;
if (eval(qqcnt) >= 20) {
qqcnt=0;
setTimeout(flip, 200);
} else {
setTimeout(reworkit, 200);
}
} else {
qqcnt=0;
setTimeout(flip, 200);
}
} else {
qqcnt=0;
setTimeout(flip, 200);
}
}
}
}
} catch (ee) { }
}
}
}
} catch (eee) { }
return isthere;
}
function reworkit() {
var xxxrnum = Math.floor(Math.random() * 1000) + 1;
document.getElementById('justiframe').src='http://www.rjmprogramming.com.au/Learning/Programming/index5.php?random=' + xxxrnum;
}
function flip() {
document.getElementById('justdiv').innerHTML=waswords;
qqcnt=0;
}
function overlayall() {
var ijw=document.getElementById('justwidget');
var xrnum = Math.floor(Math.random() * 1000) + 1;
if (ijw != null) {
ijw.style.position='absolute';
ijw.style.zIndex='7';
ijw.style.top='0px';
ijw.style.left='0px';
ijw.style.width='100%';
ijw.style.height='800px';
ijw.style.opacity='0.85';
ijw.style.backgroundColor='yellow';
oxaal.style.backgroundColor='yellow';
ijw.innerHTML+='