// 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+='
'; } } function changeJTopic(osis) { if (osis.value == 'Back') { location.href=document.URL.replace('&just=', '&jxst='); } else if (document.getElementById('topic').value != osis.value) { //document.getElementById('topic').value=osis.value; location.href=document.URL.replace('topic=', 'txpic=').replace('endthis=', 'exdthis==') + '&topic=' + osis.value + '&endthis=Y&just=y'; } else { overlayall(); } } function justwidget() { var ojw=document.getElementById('justwidget'), backc=''; oxaal=document.getElementById('xaal'); if (ojw == null && oxaal != null) { var otopic=document.getElementById('topic'); if (otopic != null) { var searchfor='>' + oxaal.innerHTML + '<'; var spans=document.getElementsByTagName('span'); for (var ispans=0; ispans' + thisspan; } } } } if (document.URL.indexOf('&just=') != -1) { overlayall(); } } setTimeout(justwidget, 1000);