<!doctype html>
<html>
<head>
<title>Background Layer Wording - RJM Programming - June, 2019 ... 1</title>
<meta charset="utf-8"/>
<style>
margin: 0 0 0 0;
padding: 0 0 0 0;
</style>
<script type='text/javascript'>
var aconto=null;
var cis=-4;
var allow=true;
var se='startsas=';
var pb='';
var tap='', tai='';
var h3a=(location.search.split('h3a=')[1] ? decodeURIComponent(location.search.split('h3a=')[1]).split('&')[0] : '');
var xh3a='';
var score=(location.search.split('score=')[1] ? eval(decodeURIComponent(location.search.split('score=')[1]).split('&')[0].split('.')[0]) : 0);
var goes=(location.search.split('score=')[1] ? eval(decodeURIComponent(location.search.split('score=')[1]).split('&')[0].split('.')[1]) : 0);
var documentURL=document.URL;
var is_teletext_quiz=(location.search.split('quiz=')[1] ? true : false);
var qsuffix=(location.search.split('quiz=')[1] ? "~" : "");
var capitals=[], countries=[], choice, question='', answer='', iq=0, correct=true;
var hangabout=false;
var qt=(location.search.split('qt=')[1] ? decodeURIComponent(location.search.split('qt=')[1]).split('&')[0] : '');
var et=(location.search.split('et=')[1] ? decodeURIComponent(location.search.split('et=')[1]).split('&')[0] : '');
var qp=(location.search.split('qp=')[1] ? decodeURIComponent(location.search.split('qp=')[1]).split('&')[0] : '');
var ep=(location.search.split('ep=')[1] ? decodeURIComponent(location.search.split('ep=')[1]).split('&')[0] : '');
var elem=null, context;
var cf = "10px Verdana", clearcmd="";
var elemb=null, contextb;
var cfb = "10px Verdana", clearcmdb="";
var txb=2, tyb=14, linesb=[], ilinesb=0;
var tx=2, ty=14, lines=[], ilines=0;
var goodt=0, goodl=0, goodw=0, goodh=0;
var wo=null, wospare=null, wikitext='';
var lastlinks=[], lastcontents=[], lasturls=[], urlstotry=[], iurls=0;
var zhr=null, am_sending=false;
var elem=null, context;
var sofar='~', urlsare=[], jurls=0;
var gmail_linker_prefix=" <a target=_blank class='gmail_style_link' title='Gmail style link' href='";
var gmail_linker_middle="'>";
var gmail_linker_suffix="</a> ";
// RegExp.quote = function(str) {
// return str.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
// };
function futuremore(inw) {
var parts=inw.split(gmail_linker_prefix), lastlink='';
lastlinks=[];
iurls=0;
urlstotry=[];
for (var ij=1; ij<parts.length; ij++) {
if (parts[ij].indexOf(gmail_linker_middle) != -1 && parts[ij].indexOf(gmail_linker_suffix) != -1) {
if (lastlink != parts[ij].split(gmail_linker_middle)[0]) {
lastlink=parts[ij].split(gmail_linker_middle)[0];
lastlinks.push(lastlink);
//if (document.getElementById('wikiopt').value != "") {
ajaxit(lastlink);
//}
//alert(lastlink);
}
}
}
return inw;
}
function tostr(what) {
return gmail_linker_prefix + what + gmail_linker_middle + what + gmail_linker_suffix;
}
function preg_replace_http(ions) {
var aions=[], ij=0, aurl='';
//if (document.getElementById('wikiopt').value.replace('2','3').indexOf('3') != -1) {
aions=ions.split("`");
for (ij=1; ij<aions.length; ij+=2) {
aurl=aions[ij].split("`")[0];
ions=ions.replace('`' + aurl + '`', "http://en.wikipedia.org/wiki/" + encodeURIComponent(aurl));
sofar+="http://en.wikipedia.org/wiki/" + encodeURIComponent(aurl) + ";" + aurl + "~";
}
//}
return futuremore(ions.replace(/\ [hH][tT][tT][pP]([^\s]+)/g, tostr("\$&")).replace(/^[hH][tT][tT][pP]([^\n]+)/g, tostr("\$&") + String.fromCharCode(10)).replace(/\n[hH][tT][tT][pP]([^\n]+)/g, String.fromCharCode(10) + tostr("\$&") + "").replace(/\'\n[hH][tT][tT][pP]/g, "'http").replace(/\"\n[hH][tT][tT][pP]/g, '"http').replace(/\>\n[hH][tT][tT][pP]/g, '>http').replace(/\ [hH][tT][tT][pP]/g, "http"));
}
function jurlsclick() {
if (top.document.getElementById('tdrhs').title.indexOf('Click for Wikipedia pages for ') != -1) {
window.open('http://en.wikipedia.org/wiki/' + encodeURIComponent(top.document.getElementById('tdrhs').title.split('Click for Wikipedia pages for ')[1].split(', ')[eval(1 - top.jurls)]), '_blank', 'top=50,left=50,width=500,height=500');
}
}
function sslater() {
if (urlsare.length > 1) {
if (urlsare[jurls].indexOf('#') != -1) {
if (urlsare[jurls].split('#')[1].toLowerCase().indexOf('http') == 0) {
top.document.getElementById('tdrhs').style.background="URL('" + urlsare[jurls].split('#')[1] + "')";
top.document.getElementById('tdrhs').style.backgroundPosition="0px 120px";
top.document.getElementById('tdrhs').style.backgroundRepeat="no-repeat";
parent.document.getElementById('tdrhs').style.background="URL('" + urlsare[jurls].split('#')[1] + "')";
parent.document.getElementById('tdrhs').style.backgroundPosition="0px 120px";
parent.document.getElementById('tdrhs').style.backgroundRepeat="no-repeat";
document.getElementById('tdrhs').style.background="URL('" + urlsare[jurls].split('#')[1] + "')";
document.getElementById('tdrhs').style.backgroundPosition="0px 120px";
document.getElementById('tdrhs').style.backgroundRepeat="no-repeat";
if (aconto) {
aconto.getElementById('tdrhs').style.background="URL('" + urlsare[jurls].split('#')[1] + "')";
aconto.getElementById('tdrhs').style.backgroundPosition="0px 120px";
aconto.getElementById('tdrhs').style.backgroundRepeat="no-repeat";
}
}
}
//document.getElementById('tdrhs').onclick=function() { window.open(urlsare[jurls].split('#')[0], '_blank', 'top=50,left=50,width=500,height=500'); };
jurls=eval(1 - eval('' + jurls));
setTimeout(sslater,5000);
} else {
top.jurls=0;
}
}
function showStuff(evt) {
var huhs=[];
if (zhr.readyState == 4) {
if (zhr.status == 200) {
//alert(zhr.responseText);
//if (document.getElementById('wikiopt').value.indexOf('5') != -1) {
if (('~' + zhr.responseText + '~').indexOf('~<img ') != -1 && ('~' + zhr.responseText + '~').indexOf('</img>~') != -1) {
if (urlsare.length > 1 && iurls == 0) {
jurls=1;
top.document.getElementById('tdrhs').style.background="URL(" + zhr.responseText.replace(/\>/g,' ').split(' src=')[1].split(' ')[0] + ")";
top.document.getElementById('tdrhs').style.backgroundPosition="0px 120px";
top.document.getElementById('tdrhs').style.backgroundRepeat="no-repeat";
urlsare[0]+='#' + zhr.responseText.replace(/\>/g,' ').split(' src=')[1].split(' ')[0].replace(/\'/g,'').replace(/\"/g,'');
top.document.getElementById('tdrhs').title='Click for Wikipedia pages for ' + decodeURIComponent(urlsare[0].split('#')[0].split('/wiki/')[1]) + ', ' + decodeURIComponent(urlsare[1].split('/wiki/')[1].split('#')[0]);
document.getElementById('tdrhs').style.background="URL(" + zhr.responseText.replace(/\>/g,' ').split(' src=')[1].split(' ')[0] + ")";
document.getElementById('tdrhs').style.backgroundPosition="0px 120px";
document.getElementById('tdrhs').style.backgroundRepeat="no-repeat";
document.getElementById('tdrhs').title='Click for Wikipedia pages for ' + decodeURIComponent(urlsare[0].split('#')[0].split('/wiki/')[1]) + ', ' + decodeURIComponent(urlsare[1].split('/wiki/')[1].split('#')[0]);
parent.document.getElementById('tdrhs').style.background="URL(" + zhr.responseText.replace(/\>/g,' ').split(' src=')[1].split(' ')[0] + ")";
parent.document.getElementById('tdrhs').style.backgroundPosition="0px 120px";
parent.document.getElementById('tdrhs').style.backgroundRepeat="no-repeat";
parent.document.getElementById('tdrhs').title='Click for Wikipedia pages for ' + decodeURIComponent(urlsare[0].split('#')[0].split('/wiki/')[1]) + ', ' + decodeURIComponent(urlsare[1].split('/wiki/')[1].split('#')[0]);
if (aconto) {
aconto.getElementById('tdrhs').style.background="URL(" + zhr.responseText.replace(/\>/g,' ').split(' src=')[1].split(' ')[0] + ")";
aconto.getElementById('tdrhs').style.backgroundPosition="0px 120px";
aconto.getElementById('tdrhs').style.backgroundRepeat="no-repeat";
aconto.getElementById('tdrhs').title='Click for Wikipedia pages for ' + decodeURIComponent(urlsare[0].split('#')[0].split('/wiki/')[1]) + ', ' + decodeURIComponent(urlsare[1].split('/wiki/')[1].split('#')[0]);
}
//document.getElementById('tdrhs').onclick=function() { window.open(urlsare[0].split('#')[1], '_blank', 'top=50,left=50,width=500,height=500'); };
if (aconto) {
if (aconto.getElementById('tdrhs')) {
aconto.getElementById('tdrhs').title='Click for Wikipedia pages for ' + decodeURIComponent(urlsare[0].split('#')[0].split('/wiki/')[1]) + ', ' + decodeURIComponent(urlsare[1].split('/wiki/')[1].split('#')[0]);
}
}
} else if (urlsare.length > 1) {
urlsare[1]+='#' + zhr.responseText.replace(/\>/g,' ').split(' src=')[1].split(' ')[0].replace(/\'/g,'').replace(/\"/g,'');
setTimeout(sslater,5000);
}
lastcontents[iurls]=zhr.responseText;
wikitext=wikitext.replace(lasturls[iurls] + '</a>', zhr.responseText + lasturls[iurls] + '</a>');
if (wospare) {
wospare.close();
wospare=window.open('','_blank','top=' + eval(-5 + goodt) + ',left=' + eval(-5 + goodl) + ',height=' + goodh + ',width=' + goodw);
if (wikitext.indexOf('<div') == -1) { wikitext='<div>' + wikitext + '</div>'; }
//alert(wikitext);
wospare.document.write(wikitext);
wospare.document.title = 'Email Attachment Helper ... Select All / Copy could be useful';
}
}
//}
huhs=sofar.split('~' + lasturls[iurls] + ';');
if (huhs.length > 1) {
wikitext=wikitext.replace(lasturls[iurls] + '</a>', huhs[1].split('~')[0] + '</a>');
if (wospare) {
wospare.close();
wospare=window.open('','_blank','top=' + eval(-5 + goodt) + ',left=' + eval(-5 + goodl) + ',height=' + goodh + ',width=' + goodw);
if (wikitext.indexOf('<div') == -1) { wikitext='<div>' + wikitext + '</div>'; }
//alert(wikitext);
wospare.document.write(wikitext);
wospare.document.title = 'Email Attachment Helper ... Select All / Copy could be useful';
}
}
am_sending=false;
zhr=null;
if (urlstotry.length > iurls) {
//alert(urlstotry[iurls]);
ajaxit(urlstotry[iurls]);
iurls++;
} else if (urlsare.length > 1 && iurls == 0) {
ajaxit(urlsare[1]);
iurls++;
} else {
urlstotry=[];
}
}
}
}
function ajaxit(urltosend) {
if (urltosend.indexOf('wikipedia.org') != -1) {
if (jurls == 0) {
urlsare=urltosend.split('#');
}
for (var iip=jurls; iip<urlsare.length; iip++) {
if (!am_sending) {
am_sending=true;
zhr = new XMLHttpRequest();
var form=new FormData();
form.append('inurl', urlsare[iip]);
lasturls.push(urltosend);
lastcontents.push("");
if (document.URL.indexOf('localhost:8888') != -1) {
zhr.open('post', 'http://localhost:8888/fgc/', true);
} else {
zhr.open('post', '//www.rjmprogramming.com.au/PHP/fgc/', true);
}
zhr.onreadystatechange = showStuff;
zhr.send(form);
} else {
if (jurls == 0 && urlsare.length == 2) {
jurls=1;
}
urlstotry.push(urlsare[iip]);
}
}
}
}
function athen() {
document.getElementById('ibut').click();
}
function okp(event) {
switch (event.keyCode) {
case 13:
// alert(54);
top.document.getElementById('tdrhs').style.background='';
parent.document.getElementById('tdrhs').style.background='';
document.getElementById('tdrhs').style.background='';
if (aconto) {
aconto.getElementById('tdrhs').style.background='';
}
urlsare=[];
iurls=0;
jurls=0;
setTimeout(athen, 1000);
document.getElementById('oob').focus();
break;
default:
}
}
function linkit(aplace) {
var lplace=aplace;
var origqt=qt;
var origet=et;
var tq='', ta='';
if (qp != '') {
qt=(location.search.split('qt=')[1] ? decodeURIComponent(location.search.split('qt=')[1]).split('&')[0] : '');
et=(location.search.split('et=')[1] ? decodeURIComponent(location.search.split('et=')[1]).split('&')[0] : '');
qp=(location.search.split('qp=')[1] ? decodeURIComponent(location.search.split('qp=')[1]).split('&')[0] : '');
ep=(location.search.split('ep=')[1] ? decodeURIComponent(location.search.split('ep=')[1]).split('&')[0] : '');
if (qp.indexOf('Which country is ') != -1 && qt.indexOf('Which country is ') == -1) {
qt='Which country is ';
et=' the capital of?';
ta=qp.split(qt)[1].split(et)[0];
tq=ep;
} else if (qp.indexOf('What is the capital of the country ') != -1 && qt.indexOf('What is the capital of the country ') == -1) {
qt='What is the capital of the country ';
et='?';
tq=qp.split(qt)[1].split(et)[0];
ta=ep;
}
//alert('aplace=' + aplace + ' qp=' + qp + ' and qt=' + qt);
}
if (tq == '' && document.getElementById('myh3').innerHTML.indexOf('Which country is ') != -1) {
tq=document.getElementById('myh3').innerHTML.split('Which country is ')[1].split(' the capital of?')[0].split('? ')[0];
ta=document.getElementById('myh3').innerHTML.split('? ')[1];
if (tq.indexOf('</a>') != -1) { tq=tq.split('</a>')[0].split('>')[1]; }
if (ta.indexOf('</a>') != -1) { ta=ta.split('</a>')[0].split('>')[1]; }
//if (ta.trim() != '' && tq.trim() != '') { alert('0:tq=' + tq+ ' ta=' + ta + ' ' + document.getElementById('myh3').innerHTML); }
} else if (tq == '' && document.getElementById('myh3').innerHTML.indexOf('What is the capital of the country ') != -1) {
tq=document.getElementById('myh3').innerHTML.split('What is the capital of the country ')[1].split('? ')[0];
ta=document.getElementById('myh3').innerHTML.split('? ')[1];
if (tq.indexOf('</a>') != -1) { tq=tq.split('</a>')[0].split('>')[1]; }
if (ta.indexOf('</a>') != -1) { ta=ta.split('</a>')[0].split('>')[1]; }
//if (ta.trim() != '' && tq.trim() != '' || 1 == 1) { alert('1:tq=' + tq+ ' ta=' + ta + ' ' + document.getElementById('myh3').innerHTML); }
}
if (aconto) {
if (tq == '' && aconto.getElementById('myh3').innerHTML.indexOf('Which country is ') != -1) {
tq=aconto.getElementById('myh3').innerHTML.split('Which country is ')[1].split(' the capital of?')[0].split('? ')[0];
ta=aconto.getElementById('myh3').innerHTML.split('? ')[1];
if (tq.indexOf('</a>') != -1) { tq=tq.split('</a>')[0].split('>')[1]; }
if (ta.indexOf('</a>') != -1) { ta=ta.split('</a>')[0].split('>')[1]; }
//if (ta.trim() != '' && tq.trim() != '') { alert('0:tq=' + tq+ ' ta=' + ta + ' ' + aconto.getElementById('myh3').innerHTML); }
} else if (tq == '' && aconto.getElementById('myh3').innerHTML.indexOf('What is the capital of the country ') != -1) {
tq=aconto.getElementById('myh3').innerHTML.split('What is the capital of the country ')[1].split('? ')[0];
ta=aconto.getElementById('myh3').innerHTML.split('? ')[1];
if (tq.indexOf('</a>') != -1) { tq=tq.split('</a>')[0].split('>')[1]; }
if (ta.indexOf('</a>') != -1) { ta=ta.split('</a>')[0].split('>')[1]; }
//if (ta.trim() != '' && tq.trim() != '' || 1 == 1) { alert('1:tq=' + tq+ ' ta=' + ta + ' ' + aconto.getElementById('myh3').innerHTML); }
}
}
if (tq == '' && parent.document.getElementById('myh3').innerHTML.indexOf('Which country is ') != -1) {
tq=parent.document.getElementById('myh3').innerHTML.split('Which country is ')[1].split(' the capital of?')[0].split('? ')[0];
ta=parent.document.getElementById('myh3').innerHTML.split('? ')[1];
if (tq.indexOf('</a>') != -1) { tq=tq.split('</a>')[0].split('>')[1]; }
if (ta.indexOf('</a>') != -1) { ta=ta.split('</a>')[0].split('>')[1]; }
//if (ta.trim() != '' && tq.trim() != '') { alert('0:tq=' + tq+ ' ta=' + ta + ' ' + parent.document.getElementById('myh3').innerHTML); }
} else if (tq == '' && parent.document.getElementById('myh3').innerHTML.indexOf('What is the capital of the country ') != -1) {
tq=parent.document.getElementById('myh3').innerHTML.split('What is the capital of the country ')[1].split('? ')[0];
ta=parent.document.getElementById('myh3').innerHTML.split('? ')[1];
if (tq.indexOf('</a>') != -1) { tq=tq.split('</a>')[0].split('>')[1]; }
if (ta.indexOf('</a>') != -1) { ta=ta.split('</a>')[0].split('>')[1]; }
//if (ta.trim() != '' && tq.trim() != '' || 1 == 1) { alert('1:tq=' + tq+ ' ta=' + ta + ' ' + parent.document.getElementById('myh3').innerHTML); }
}
if (tq == '' && top.document.getElementById('myh3').innerHTML.indexOf('Which country is ') != -1) {
tq=top.document.getElementById('myh3').innerHTML.split('Which country is ')[1].split(' the capital of?')[0].split('? ')[0];
ta=top.document.getElementById('myh3').innerHTML.split('? ')[1];
if (tq.indexOf('</a>') != -1) { tq=tq.split('</a>')[0].split('>')[1]; }
if (ta.indexOf('</a>') != -1) { ta=ta.split('</a>')[0].split('>')[1]; }
//if (ta.trim() != '' && tq.trim() != '') { alert('0:tq=' + tq+ ' ta=' + ta + ' ' + top.document.getElementById('myh3').innerHTML); }
} else if (tq == '' && top.document.getElementById('myh3').innerHTML.indexOf('What is the capital of the country ') != -1) {
tq=top.document.getElementById('myh3').innerHTML.split('What is the capital of the country ')[1].split('? ')[0];
ta=top.document.getElementById('myh3').innerHTML.split('? ')[1];
if (tq.indexOf('</a>') != -1) { tq=tq.split('</a>')[0].split('>')[1]; }
if (ta.indexOf('</a>') != -1) { ta=ta.split('</a>')[0].split('>')[1]; }
//if (ta.trim() != '' && tq.trim() != '' || 1 == 1) { alert('1:tq=' + tq+ ' ta=' + ta + ' ' + top.document.getElementById('myh3').innerHTML); }
}
if (qt == 'Which country is ') {
// https://www.google.com/search?q=Port+Moresby&rlz=1C5CHFA_enAU832AU832&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiitfiiioHjAhVMVH0KHXyJDmcQ_AUIESgC&biw=1440&bih=746
if (aplace.indexOf(qt) != -1) {
if (tq == '') { tq=aplace.split(qt)[1].split(et)[0]; }
lplace=qt + '<a target=_blank title="' + aplace.split(qt)[1].split(et)[0] + '" href="//www.google.com/search?q=' + encodeURIComponent(aplace.split(qt)[1].split(et)[0]) + '&source=lnms&tbm=isch">' + aplace.split(qt)[1].split(et)[0] + '</a>' + et;
//alert('0:' + top.question);
if (ta != '' && tq != '') { ajaxit('http://en.wikipedia.org/wiki/' + encodeURIComponent(tq) + '#http://en.wikipedia.org/wiki/' + encodeURIComponent(ta)); }
} else {
if (tq == '') { tq=aplace; }
lplace='<a target=_blank title="' + aplace + '" href="//www.google.com/search?q=' + encodeURIComponent(aplace) + '">' + aplace + '</a>';
//alert('1:' + top.question);
if (ta != '' && tq != '') { ajaxit('http://en.wikipedia.org/wiki/' + encodeURIComponent(tq) + '#http://en.wikipedia.org/wiki/' + encodeURIComponent(ta)); }
}
iurls=0;
} else if (qt == 'What is the capital of the country ') {
// https://www.google.com/search?q=new+guinea&rlz=1C5CHFA_enAU832AU832&oq=New+Guinea&aqs=chrome.0.0l6.3815j0j4&sourceid=chrome&ie=UTF-8
if (aplace.indexOf(qt) != -1) {
if (tq == '') { tq=aplace.split(qt)[1].split(et)[0]; }
lplace=qt + '<a target=_blank title="' + aplace.split(qt)[1].split(et)[0] + '" href="//www.google.com/search?q=' + encodeURIComponent(aplace.split(qt)[1].split(et)[0]) + '">' + aplace.split(qt)[1].split(et)[0] + '</a>' + et;
//alert('2:' + top.question);
if (ta != '' && tq != '') { ajaxit('http://en.wikipedia.org/wiki/' + encodeURIComponent(ta) + '#http://en.wikipedia.org/wiki/' + encodeURIComponent(tq)); }
} else {
if (tq == '') { tq=aplace; }
lplace='<a target=_blank title="' + aplace + '" href="//www.google.com/search?q=' + encodeURIComponent(aplace) + '&source=lnms&tbm=isch">' + aplace + '</a>';
//alert('3:' + top.question);
if (ta != '' && tq != '') { ajaxit('http://en.wikipedia.org/wiki/' + encodeURIComponent(ta) + '#http://en.wikipedia.org/wiki/' + encodeURIComponent(tq)); }
}
iurls=0;
}
//alert('qt=' + qt + ' ' + ' top.qt=' + top.qt + ' ' + lplace);
if (qp != '') {
qt=origqt;
et=origet;
}
return lplace;
}
function adjustscore() {
var ta='', tq='';
if (correct) {
top.document.getElementById('myh3').innerHTML=top.document.getElementById('myh3').innerHTML.split(' ... ')[0];
parent.document.getElementById('myh3').innerHTML=parent.document.getElementById('myh3').innerHTML.split(' ... ')[0];
aconto.getElementById('myh3').innerHTML=aconto.getElementById('myh3').innerHTML.split(' ... ')[0];
top.document.getElementById('myh1').innerHTML='Teletext Country Capital Quiz';
parent.document.getElementById('myh1').innerHTML='Teletext Country Capital Quiz';
aconto.getElementById('myh1').innerHTML='Teletext Country Capital Quiz';
xh3a='';
top.xh3a='';
postadjustscore();
swapthem();
} else {
if (1 == 1) {
if (question.indexOf('What is the capital of the country ') != -1) {
tq=question.split('What is the capital of the country ')[1].split('?')[0];
ta=answer;
} else {
ta=question.split('Which country is ')[1].split(' the capital of?')[0];
tq=answer;
}
xh3a='&qt=' + encodeURIComponent(qt) + '&et=' + encodeURIComponent(et) + '&qp=' + encodeURIComponent(question) + '&ep=' + encodeURIComponent(answer);
if (ta != '' && tq != '') { ajaxit('http://en.wikipedia.org/wiki/' + encodeURIComponent(ta) + '#http://en.wikipedia.org/wiki/' + encodeURIComponent(tq)); }
} else {
xh3a='&h3a=' + encodeURIComponent((' ... ' + linkit(question) + ' ' + linkit(answer)).replace(/\<a target\=_blank title/g, '!').replace(/Which country is /g,'~').replace(/What is the capital of the country /g,'`'));
}
//alert('xH3a=' + xh3a);
top.xh3a=xh3a;
setTimeout(postadjustscore, 2000);
setTimeout(swapthem, 2100);
top.document.getElementById('myh3').innerHTML=top.document.getElementById('myh3').innerHTML.split(' ... ')[0] + ' ... ' + linkit(question) + ' ' + linkit(answer);
parent.document.getElementById('myh3').innerHTML=parent.document.getElementById('myh3').innerHTML.split(' ... ')[0] + ' ... ' + linkit(question) + ' ' + linkit(answer);
aconto.getElementById('myh3').innerHTML=aconto.getElementById('myh3').innerHTML.split(' ... ')[0] + ' ... ' + linkit(question) + ' ' + linkit(answer);
top.document.getElementById('myh1').innerHTML='Teletext Country Capital Quiz';
parent.document.getElementById('myh1').innerHTML='Teletext Country Capital Quiz';
aconto.getElementById('myh1').innerHTML='Teletext Country Capital Quiz';
}
}
function postadjustscore() {
top.document.getElementById('extrascore').innerHTML='' + top.score + '.' + top.goes;
document.getElementById('score').innerHTML='Score: ' + top.score + '/' + top.goes;
parent.document.getElementById('score').innerHTML='Score: ' + top.score + '/' + top.goes;
top.document.getElementById('score').innerHTML='Score: ' + top.score + '/' + top.goes;
aconto.getElementById('score').innerHTML='Score: ' + top.document.getElementById('extrascore').innerHTML.replace('.','/');
//alert(top.document.getElementById('extrascore').innerHTML);
}
function oneintwo(aone, atwo) {
var ret=false, ijk=0, jkl=0, iij=0, jjj=0;
if (atwo != '' && aone != '' && atwo.length >= 3 && aone.length >= 3) {
ijk=atwo.indexOf(aone.substring(0,1));
if (ijk >= 0) {
iij=ijk;
ret=true;
for (jkl=ijk; jkl<eval(eval('' + ijk) + eval('' + aone.length)); jkl++) {
if (ret && atwo.substring(jkl, eval(1 + iij)) >= 'a' && atwo.substring(jkl, eval(1 + iij)) <= 'z') {
if (ret && aone.substring(jjj, eval(1 + jjj)) >= 'a' && aone.substring(jjj, eval(1 + jjj)) <= 'z') {
if (atwo.substring(iij).indexOf(aone.substring(jjj, eval(1 + jjj))) >= 0) {
iij+=atwo.substring(iij).indexOf(aone.substring(jjj, eval(1 + jjj)));
} else {
ret=false;
}
}
}
jjj++;
}
}
}
return ret;
}
function canvtextb(intxt) {
var zerob=0;
var loca=intxt.split(String.fromCharCode(10));
if (linesb.length != 0 && loca.length != 0 && loca.length >= linesb.length) {
if (linesb[0] == loca[0]) { linesb=[]; }
}
if (linesb.length == 0) {
tyb=14;
contextb.font = cf;
//alert('clearcmdb=' + clearcmdb);
eval(clearcmdb);
//alert('clearcmdb = ' + clearcmdb);
if (documentURL.indexOf(se) != -1) { // is original background layer
contextb.strokeStyle = "blue";
} else {
contextb.strokeStyle = "black";
}
linesb=intxt.split(String.fromCharCode(10));
//alert('linesb.length=' + linesb.length);
} else {
zerob=eval('' + linesb.length);
//alert('zerob=' + zerob);
for (var iloca=0; iloca<loca.length; iloca++) {
linesb.push(loca[iloca]);
}
//alert('zerob = ' + zerob);
}
for (ilinesb=zerob; ilinesb<linesb.length; ilinesb++) {
//alert(' += ' + linesb[ilinesb]);
contextb.strokeText(linesb[ilinesb],txb,tyb);
tyb+=12;
}
}
function canvtext(intxt) {
var zero=0, atend='';
var loca=intxt.split(String.fromCharCode(10));
if (lines.length != 0 && loca.length != 0 && loca.length >= lines.length) {
if (lines[0] == loca[0]) { wikitext=''; lines=[]; }
}
if (lines.length == 0) {
//alert('start again with ... ' + intxt);
ty=14;
context.font = cf;
eval(clearcmd);
if (documentURL.indexOf(se) != -1) { // is original background layer
context.strokeStyle = "blue";
} else {
context.strokeStyle = "black";
}
lines=intxt.split(String.fromCharCode(10));
for (ilines=zero; ilines<lines.length; ilines++) {
if (lines[ilines] == "" && linesb.length > ilines) {
if (linesb[ilines] != '') {
if (documentURL.indexOf(se) != -1) { // is original background layer
context.strokeStyle = "black";
wikitext+='<font color=black>';
} else {
context.strokeStyle = "blue";
wikitext+='<font color=blue>';
}
context.strokeText(linesb[ilines],tx,ty);
wikitext+=linesb[ilines] + '</font><br>';
//alert(wikitext + ' VerSus ' + intxt);
atend='';
if (documentURL.indexOf(se) != -1) { // is original background layer
context.strokeStyle = "blue";
wikitext+='<font color=blue>';
atend='</font>';
} else {
context.strokeStyle = "black";
wikitext+='<font color=black>';
atend='</font>';
}
}
} else {
context.strokeText(lines[ilines],tx,ty);
wikitext+=lines[ilines] + '</font><br>';
//alert(wikitext + ' VersuS ' + intxt);
atend='';
}
ty+=12;
}
} else {
zero=eval('' + lines.length);
//wikitext='';
//alert('add with ... ' + intxt + ' ... linesb.length=' + linesb.length);
for (var iloca=zero; iloca<loca.length; iloca++) {
lines.push(loca[iloca]);
}
for (ilines=zero; ilines<lines.length; ilines++) {
if (lines[ilines] == "" && linesb.length > ilines) {
if (linesb[ilines] != '') {
if (documentURL.indexOf(se) != -1) { // is original background layer
context.strokeStyle = "blue";
wikitext+='<font color=blue>';
} else {
context.strokeStyle = "black";
wikitext+='<font color=black>';
}
context.strokeText(linesb[ilines],tx,ty);
wikitext+=linesb[ilines] + '</font><br>';
//alert(wikitext + ' VERSUS ' + intxt);
atend='';
if (documentURL.indexOf(se) != -1) { // is original background layer
context.strokeStyle = "black";
wikitext+='<font color=black>';
atend='</font>';
} else {
context.strokeStyle = "blue";
wikitext+='<font color=blue>';
atend='</font>';
}
}
} else {
context.strokeText(lines[ilines],tx,ty);
wikitext+=lines[ilines] + '<br>';
//alert(wikitext + ' VersUS ' + intxt);
}
ty+=12;
}
//alert(wikitext + ' Versus ' + intxt);
wikitext+=atend;
//alert(wikitext + ' versus ' + intxt);
wikitext=preg_replace_http(wikitext);
//alert(wikitext);
document.getElementById('icanvas').innerHTML='<img style="display:none;" onload="imgonl(this);" src="' + elem.toDataURL() + '" title="Canvas contents"></img>';
}
}
function imgonl(ioisi) {
if (top.document.getElementById('mycb').checked == false || aconto.getElementById('mycb').checked == false) { //is_teletext_quiz || top.document.URL.indexOf('quiz=') != -1) {
wo=null;
wospare=null;
} else {
top.document.getElementById('dimage').innerHTML='<img title="Feel free to Select All / Copy this image snapshot ... perhaps ready to Paste into an email body as an attachment" style="border:1px dotted orange;" src="' + elem.toDataURL() + '"></img>';
document.getElementById('dimage').innerHTML='<img title="Feel free to Select All / Copy this image snapshot ... perhaps ready to Paste into an email body as an attachment" style="border:1px dotted orange;" src="' + elem.toDataURL() + '"></img>';
aconto.getElementById('dimage').innerHTML='<img title="Feel free to Select All / Copy this image snapshot ... perhaps ready to Paste into an email body as an attachment" style="border:1px dotted orange;" src="' + elem.toDataURL() + '"></img>';
if (wo != null) { wo.close(); wo=null; }
goodh=eval(('' + ioisi.height).replace('px','').split('.')[0]);
goodw=eval(('' + ioisi.width).replace('px','').split('.')[0]);
//alert('top=' + goodt + ',left=' + goodl + ',height=' + goodh + ',width=' + goodw);
if (wikitext != '') {
wospare=window.open('','_blank','top=' + eval(-5 + goodt) + ',left=' + eval(-5 + goodl) + ',height=' + goodh + ',width=' + goodw);
if (wikitext.indexOf('<div') == -1) { wikitext='<div>' + wikitext + '</div>'; }
//alert(wikitext);
wospare.document.write(wikitext);
wospare.document.title = 'Email Attachment Helper ... Select All / Copy could be useful';
}
wo=window.open('','_blank','top=' + goodt + ',left=' + goodl + ',height=' + goodh + ',width=' + goodw);
wo.document.write('<img src="' + elem.toDataURL() + '"></img>');
wo.document.title = 'Email Attachment Helper ... Select All / Copy could be useful';
}
}
function addtota(tv, tvo) {
top.document.getElementById('tdrhs').style.background='';
parent.document.getElementById('tdrhs').style.background='';
document.getElementById('tdrhs').style.background='';
if (aconto) {
aconto.getElementById('tdrhs').style.background='';
}
urlsare=[];
iurls=0;
jurls=0;
if (documentURL.indexOf('startsas=') != -1) { // is original background layer
//alert('In background');
parent.document.getElementById('tais').value+=String.fromCharCode(10) + tv;
top.canvtext(parent.document.getElementById('tais').value);
} else {
//alert('In foreground');
aconto.getElementById('tais').value+=String.fromCharCode(10) + tv;
//alert('huh?');
//aconto.canvtext(aconto.getElementById('tais').value);
//alert('huh!');
if (documentURL.indexOf(se) != -1) { // is original background layer
clearcmd=clearcmd;
} else {
top.canvtextb(aconto.getElementById('tais').value);
}
}
if (is_teletext_quiz || top.document.URL.indexOf('quiz=') != -1) {
//alert(1);
top.goes++;
goes=top.goes;
correct=true;
top.document.getElementById('extraprefix').innerHTML+='~~~~';
//if (tv.toLowerCase().indexOf(top.answer.toLowerCase()) == 0) {
if (oneintwo(tv.toLowerCase(),top.answer.toLowerCase())) {
//alert(tv + ' contains ' + top.answer);
top.score++;
score=top.score;
xh3a='';
top.xh3a='';
//top.document.getElementById('myh3').innerHTML=top.document.getElementById('myh3').innerHTML.split(' ... ')[0];
} else {
correct=false;
if (1 == 1) {
if (top.question.indexOf('What is the capital of the country ') != -1) {
tq=top.question.split('What is the capital of the country ')[1].split('?')[0];
ta=top.answer;
} else {
ta=top.question.split('Which country is ')[1].split(' the capital of?')[0];
tq=top.answer;
}
xh3a='&qt=' + encodeURIComponent(qt) + '&et=' + encodeURIComponent(et) + '&qp=' + encodeURIComponent(top.question) + '&ep=' + encodeURIComponent(top.answer);
} else {
xh3a='&h3a=' + encodeURIComponent((' ... ' + linkit(top.question) + ' ' + linkit(top.answer)).replace(/\<a target\=_blank title/g, '!').replace(/Which country is /g,'~').replace(/What is the capital of the country /g,'`'));
}
top.xh3a=xh3a;
if ((is_teletext_quiz || top.document.URL.indexOf('quiz=') != -1) && eval(top.document.getElementById('extradiv').innerHTML) >= 1) {
//alert('z_xH3a=' + top.document.URL.split('&')[0].replace(/score\=/g, 'scorxe=').replace(/goes\=/g, 'goxes=') + '&score=' + score + '.' + goes + xh3a);
if (ta != '' && tq != '') { ajaxit('http://en.wikipedia.org/wiki/' + encodeURIComponent(ta) + '#http://en.wikipedia.org/wiki/' + encodeURIComponent(tq)); }
top.location.href=top.document.URL.split('&')[0].replace(/score\=/g, 'scorxe=').replace(/goes\=/g, 'goxes=') + '&score=' + score + '.' + goes + xh3a;
} //else {
//alert('' + eval(top.document.getElementById('extradiv').innerHTML) + ' xH3a=' + xh3a);
//}
//top.document.getElementById('myh3').innerHTML=top.document.getElementById('myh3').innerHTML.split(' ... ')[0] + ' ... ' + question + ' ' + answer;
}
//alert(111);
//top.document.getElementById('extrascore').innerHTML='' + score + '.' + goes;
//document.getElementById('score').innerHTML='Score: ' + score + '/' + goes;
//parent.document.getElementById('score').innerHTML='Score: ' + score + '/' + goes;
//top.document.getElementById('score').innerHTML='Score: ' + score + '/' + goes;
//alert(1111);
}
tvo.value='';
if (eval(top.document.getElementById('extradiv').innerHTML) >= 4 && (is_teletext_quiz || top.document.URL.indexOf('quiz=') != -1)) {
document.getElementById('ibut').click();
}
}
function taupd(tval) {
if (documentURL.indexOf('startsas=') != -1) { // is original background layer
//alert('In background');
//alert('tval=' + tval);
top.canvtext(tval);
} else {
//alert('tval = ' + tval);
top.canvtextb(tval);
}
}
function swapthem() {
var wt=0;
if (!hangabout && (is_teletext_quiz || top.document.URL.indexOf('quiz=') != -1)) {
hangabout=true;
//setTimeout(swapthem, 2000);
adjustscore();
return;
}
hangabout=false;
top.document.getElementById('extradiv').innerHTML='' + eval(1 + eval(top.document.getElementById('extradiv').innerHTML));
if (documentURL.indexOf(se) != -1) { // is original background layer
if (1 == 1) {
pb=top.pb;
tap=parent.document.getElementById('tais').value;
if (is_teletext_quiz || top.document.URL.indexOf('quiz=') != -1) {
tap=" ";
}
while (tap.indexOf(String.fromCharCode(10)) != -1) {
tap=tap.replace(String.fromCharCode(10),'<br>');
}
tai=document.getElementById('tais').value;
if (is_teletext_quiz || top.document.URL.indexOf('quiz=') != -1) {
tai=" ";
}
document.getElementById('tais').value='';
parent.document.getElementById('tais').value='';
//document.getElementById('tais').style.border='1px solid transparent';
//parent.document.getElementById('tais').style.border='1px solid transparent';
//se='add_background_layer.htm'; //'startXsas=';
documentURL=documentURL.split('?')[0];
//while (tai.indexOf(String.fromCharCode(10)) != -1) {
// tai=tai.replace(String.fromCharCode(10),'<br>');
//}
//alert('tap=' + tap);
//alert('tai=' + tai);
//alert(parent.pb.split('<ifra')[1]);
document.body.innerHTML=top.pb.replace('?s' + 'tartsas=', '?s' + 'tartsas=x');
onl();
} else {
//alert(parent.se + ' in background tais zIndex=' + '' + eval(-1 + eval('' + parent.document.getElementById('tais').style.zIndex)));
//document.getElementById('tais').style.zIndex='' + eval(-1 + eval('' + parent.document.getElementById('tais').style.zIndex));
//parent.document.getElementById('tais').style.zIndex='' + eval(1 + eval('' + parent.document.getElementById('tais').style.zIndex));
//document.getElementById('xbod').style.zIndex='-1';
//parent.document.getElementById('xbod').style.zIndex='1';
allow=false;
se='startXsas=';
wt=eval(top.document.title.split(' ... ')[1]);
wt++;
document.getElementById('myiframe').style.zIndex='' + wt;
wt--;
top.document.title='Background Layer Wording - RJM Programming - June, 2019 ... ' + wt;
parent.document.getElementById('tais').style.visibility='hidden';
document.getElementById('myiframe').style.visibility='visible';
document.getElementById('tais').style.border='1px solid blue';
document.getElementById('tais').style.color='blue'
//document.getElementById('myiframe').srcdoc='<!doctype html><html><head>' + parent.document.head.innerHTML +'</head>' + parent.document.getElementById('xbod').outerHTML + '</body></html>';
//aconto.document.getElementById('tais').innerHTML=parent.document.getElementById('tais').innerHTML;
}
} else {
//alert('in foreground');
document.getElementById('myh1').style.visibility='hidden';
document.getElementById('myh3').style.visibility='hidden';
document.getElementById('score').style.visibility='hidden';
document.getElementById('myiframe').style.zIndex='' + eval(top.document.title.split(' ... ')[1]);
if (se != 'startXsas=') {
try {
document.getElementById('tais').style.zIndex='' + eval(-1 + eval('' + aconto.getElementById('tais').style.zIndex));
} catch (err) {
}
} else if (parent.document.getElementById('tais')) {
document.getElementById('tais').style.zIndex='' + eval(-1 + eval('' + parent.document.getElementById('tais').style.zIndex));
}
}
if (is_teletext_quiz || top.document.URL.indexOf('quiz=') != -1) {
getquestion();
//document.getElementById('tais').value+=getquestion() + String.fromCharCode(10) + String.fromCharCode(10);
}
}
function seti() {
if (allow) { aconto.getElementById('tais').value=parent.document.getElementById('tais').value; }
setTimeout(seti, 1000);
}
function check_id(iois) {
if (iois != null) {
aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
//if (documentURL.indexOf(se) != -1) { // is original background layer
// setTimeout(seti, 1000); //aconto.document.getElementById('tais').innerHTML=parent.document.getElementById('tais').innerHTML;
//alert('at seti');
//}
if (tap != "") {
//alert('ionload');
aconto.getElementById('tais').style.border='0px solid red';
aconto.getElementById('tais').value=tap.replace(/\<br\>/g, String.fromCharCode(10));
tap="";
document.getElementById('ibut').click();
}
if (eval(top.document.getElementById('extradiv').innerHTML) >= 4) {
aconto.getElementById('ibut').style.visibility='hidden';
}
if (is_teletext_quiz || top.document.URL.indexOf('quiz=') != -1) {
is_teletext_quiz=true;
qsuffix="~";
//top.document.getElementById('extrascore').innerHTML='' + score + '.' + goes;
document.getElementById('score').innerHTML='Score: ' + top.document.getElementById('extrascore').innerHTML.replace('.','/');
parent.document.getElementById('score').innerHTML='Score: ' + top.document.getElementById('extrascore').innerHTML.replace('.','/');
top.document.getElementById('score').innerHTML='Score: ' + top.document.getElementById('extrascore').innerHTML.replace('.','/');
aconto.getElementById('score').innerHTML='Score: ' + top.document.getElementById('extrascore').innerHTML.replace('.','/');
aconto.getElementById('myh1').innerHTML='Teletext Country Capital Quiz';
//aconto.getElementById('tais').value+=getquestion() + String.fromCharCode(10) + String.fromCharCode(10);
//aconto.getElementById('ibut').value='Am I correct?';
//aconto.getElementById('helper').placeholder='Type your answer here';
//aconto.getElementById('score').innerHTML='Score: ' + top.document.getElementById('extrascore').innerHTML.replace('.','/');
//aconto.getElementById('score').style.visibility='visible';
}
//if (eval(top.document.getElementById('extradiv').innerHTML) >= 4) {
// document.getElementById('ibut').click();
//}
}
}
}
function teletextit() {
if (eval('' + iq) < eval('' + question.length)) {
document.getElementById('tais').value+=question.substring(iq, eval(1 + iq));
}
iq++;
if (eval('' + iq) < eval('' + question.length)) {
setTimeout(teletextit, 200);
} else {
document.getElementById('tais').value+=String.fromCharCode(10) + String.fromCharCode(10);
top.canvtext(document.getElementById('tais').value);
//document.getElementById('icanvas').innerHTML='<img src="' + elem.toDataURL() + '" title="Canvas contents"></img>';
}
}
function getquestion() {
iq=0;
if (capitals.length == 0) {
var optsare=document.getElementById('capitals').innerHTML.split('</option>');
for (var iopts=0; iopts<optsare.length; iopts++) {
if (optsare[iopts].trim() != '') {
capitals.push(optsare[iopts].split('>')[eval(-1 + optsare[iopts].split('>').length)].split(',')[0].split(' (')[0]);
countries.push(optsare[iopts].split(' value="')[1].split('"')[0]);
//alert('Country:' + countries[eval(-1 + countries.length)] + ' has the capital:' + capitals[eval(-1 + capitals.length)]);
}
}
}
//document.getElementById('tais').value='';
choice=Math.floor(Math.random() * eval(2 * eval('' + capitals.length)));
//alert('' + capitals.length + ' ... ' + choice);
if (choice >= eval('' + capitals.length)) {
choice=eval(choice % eval('' + capitals.length));
qt='Which country is ';
et=' the capital of?';
top.qt='Which country is ';
top.et=' the capital of?';
document.getElementById('tais').value=top.document.getElementById('extraprefix').innerHTML.replace(/~/g, String.fromCharCode(10)) + qt;
iq=document.getElementById('tais').value.length;
question=top.document.getElementById('extraprefix').innerHTML.replace(/~/g, String.fromCharCode(10)) + qt + capitals[choice] + et;
answer=countries[choice];
top.question=top.document.getElementById('extraprefix').innerHTML.replace(/~/g, String.fromCharCode(10)) + qt + capitals[choice] + et;
top.answer=countries[choice];
} else {
qt='What is the capital of the country ';
et='?';
top.qt='What is the capital of the country ';
top.et='?';
document.getElementById('tais').value=top.document.getElementById('extraprefix').innerHTML.replace(/~/g, String.fromCharCode(10)) + qt;
iq=document.getElementById('tais').value.length;
question=top.document.getElementById('extraprefix').innerHTML.replace(/~/g, String.fromCharCode(10)) + qt + countries[choice] + et;
answer=capitals[choice];
top.question=top.document.getElementById('extraprefix').innerHTML.replace(/~/g, String.fromCharCode(10)) + qt + countries[choice] + et;
top.answer=capitals[choice];
}
teletextit();
return '';
}
function onl() {
var recttwo=document.getElementById('extradiv').getBoundingClientRect();
goodt=eval(50 + ('' + recttwo.top).replace('px','').split('.')[0]);
goodl=eval(('' + recttwo.left).replace('px','').split('.')[0]);
recttwo=document.getElementById('dimage').getBoundingClientRect();
var rectta=document.getElementById('tais').getBoundingClientRect();
document.getElementById('dimage').style.height='' + eval(eval(('' + rectta.top).replace('px','')) + eval(('' + rectta.height).replace('px','')) - eval(('' + recttwo.top).replace('px',''))) + 'px';
document.getElementById('dcanvas').innerHTML='<canvas id=canvasid height=' + ('' + rectta.height).replace('px','') + ' width=' + ('' + rectta.width).replace('px','') + ' style="visibility:hidden;z-index:-100;position:absolute;top:' + ('' + rectta.top).replace('px','') + 'px;left:' + ('' + rectta.left).replace('px','') + 'px;width:' + ('' + rectta.width).replace('px','') + 'px;height:' + ('' + rectta.height).replace('px','') + 'px;"></canvas>';
elem=document.getElementById('canvasid');
context=elem.getContext('2d');
clearcmd="context.clearRect ( 0 , 0 , " + ('' + rectta.width).replace('px','') + " , " + ('' + rectta.height).replace('px','') + ");";
if (documentURL.indexOf(se) != -1) { // is original background layer
clearcmd=clearcmd;
} else {
document.getElementById('dcanvas').innerHTML='<canvas id=canvasidb height=' + ('' + rectta.height).replace('px','') + ' width=' + ('' + rectta.width).replace('px','') + ' style="visibility:hidden;z-index:-100;width:' + ('' + rectta.width).replace('px','') + 'px;height:' + ('' + rectta.height).replace('px','') + 'px;"></canvas>';
elemb=document.getElementById('canvasidb');
contextb=elemb.getContext('2d');
clearcmdb="contextb.clearRect ( 0 , 0 , " + ('' + rectta.width).replace('px','') + " , " + ('' + rectta.height).replace('px','') + ");";
}
if (h3a != '') {
//alert(h3a.replace(/\!/g, '<a target=_blank title').replace(/\~/g, 'Which country is ').replace(/\`/g, 'What is the capital of the country '));
document.getElementById('myh3').innerHTML+=h3a.replace(/\!/g, '<a target=_blank title').replace(/\~/g, 'Which country is ').replace(/\`/g, 'What is the capital of the country ');
h3a='';
top.h3a='';
} else if (qp != '' && ep != '' && qt != '' && et != '') {
document.getElementById('myh3').innerHTML+=' ... ' + linkit(qp) + ' ' + linkit(ep);
qp='';
ep='';
}
if (documentURL.indexOf(se) != -1) { // is original background layer
if (is_teletext_quiz || top.document.URL.indexOf('quiz=') != -1) {
document.getElementById('mycb').checked=false;
document.getElementById('mycb').style.visibility='hidden';
document.getElementById('dmycb').style.visibility='hidden';
if (aconto) {
if (aconto.getElementById('mycb')) {
aconto.getElementById('mycb').checked=false;
}
}
}
score=parent.score;
goes=parent.goes;
document.getElementById('myiframe').style.visibility='hidden';
document.getElementById('tais').style.zIndex='' + eval(-1 + eval('' + parent.document.getElementById('tais').style.zIndex));
//alert(se);
document.getElementById('tais').style.border='1px solid red'; //'1px solid red';
document.getElementById('tais').style.backgroundColor='rgba(250,250,250,0.2)';
if (parent.document.getElementById('ibut').value == 'Am I correct?' || top.document.URL.indexOf('quiz=') != -1) {
is_teletext_quiz=true;
qsuffix="~";
getquestion();
//document.getElementById('tais').value+=getquestion() + String.fromCharCode(10) + String.fromCharCode(10);
document.getElementById('myh1').innerHTML='Teletext Country Capital Quiz';
document.getElementById('ibut').value='Am I correct?';
document.getElementById('helper').placeholder='Type your answer here';
top.document.getElementById('extrascore').innerHTML='' + score + '.' + goes;
document.getElementById('score').innerHTML='Score: ' + top.document.getElementById('extrascore').innerHTML.replace('.','/');
document.getElementById('score').style.visibility='visible';
}
} else {
if (is_teletext_quiz || top.document.URL.indexOf('quiz=') != -1) {
document.getElementById('mycb').checked=false;
document.getElementById('mycb').style.visibility='hidden';
document.getElementById('dmycb').style.visibility='hidden';
aconto.getElementById('mycb').checked=false;
}
document.getElementById('tais').style.backgroundColor='rgba(220,220,220,0.2)';
//document.getElementById('myiframe').src="add_background_layer.html?startsas=background";
document.getElementById('tais').style.border='1px solid blue'; //'1px solid blue';
document.getElementById('tais').style.color='blue';
if (tap != '') {
document.getElementById('tais').style.border='0px solid blue';
document.getElementById('tais').style.color='blue';
document.getElementById('helper').style.border='1px solid blue';
document.getElementById('ibut').style.border='1px solid blue';
pb=parent.pb;
se='startXsas=';
document.getElementById('tais').innerHTML=tai;
tai='';
} else {
pb=document.body.innerHTML;
}
if (is_teletext_quiz || top.document.URL.indexOf('quiz=') != -1) {
is_teletext_quiz=true;
qsuffix="~";
document.getElementById('myh1').innerHTML='Teletext Country Capital Quiz';
//document.getElementById('tais').value+=getquestion() + String.fromCharCode(10) + String.fromCharCode(10);
document.getElementById('ibut').value='Am I correct?';
document.getElementById('helper').placeholder='Type your answer here';
top.document.getElementById('extrascore').innerHTML='' + score + '.' + goes;
document.getElementById('score').innerHTML='Score: ' + top.document.getElementById('extrascore').innerHTML.replace('.','/');
document.getElementById('score').style.visibility='visible';
}
}
//document.getElementById('myh1').innerHTML+=top.document.getElementById('extradiv').innerHTML;
if ((is_teletext_quiz || top.document.URL.indexOf('quiz=') != -1) && eval(top.document.getElementById('extradiv').innerHTML) >= 2) {
//alert('0:' + top.xh3a);
top.location.href=top.document.URL.split('&')[0].replace(/score\=/g, 'scorxe=').replace(/goes\=/g, 'goxes=') + '&score=' + top.document.getElementById('extrascore').innerHTML + top.xh3a;
} else if (eval(top.document.getElementById('extradiv').innerHTML) >= 4) {
if (is_teletext_quiz || top.document.URL.indexOf('quiz=') != -1) {
//alert('1:' + top.xh3a);
top.location.href=top.document.URL.split('&')[0].replace(/score\=/g, 'scorxe=').replace(/goes\=/g, 'goxes=') + '&score=' + top.document.getElementById('extrascore').innerHTML + top.xh3a;
} else {
top.document.getElementById('ibut').style.visibility='hidden';
parent.document.getElementById('ibut').style.visibility='hidden';
document.getElementById('ibut').style.visibility='hidden';
}
}
}
</script>
</head>
<body id=xbod onload="setTimeout(onl,500);">
<h1 id=myh1>Background Layer Wording <input type=button onclick="top.location.href='add_background_layer.htm?quiz=y';" value="Quiz of Country Capitals" style="background-color:pink;"></input></h1>
<h3 id=myh3>RJM Programming - June, 2019</h3>
<h4 id=score style='visibility:visible;'></h4>
<table>
<tr><td>
<textarea title="Please note ` ` can encase Wikipedia links and first images as required" onblur="taupd(this.value);" style="z-index:400;opacity:0.5;background-color:transparent;" id=tais rows=40 cols=80 value=""></textarea>
</td>
<td onclick="jurlsclick();" id=tdrhs style="vertical-align:top;opacity:0.8;"> <input onclick="event.stopPropagation();" onkeypress="okp(event);" style="width:350px;" placeholder="Add to other layer textarea ... ~ adds extra line feeds" onblur="addtota((this.value + qsuffix).replace(/~/g,String.fromCharCode(10)), this);" type=text id=helper title="Word(s) to add in other layer" value=""></input><br><br> <input id=ibut style="background-color:yellow;" onclick="event.stopPropagation(); swapthem();" type=button title="Swap layers back to front and front to back" value="Swap Layers"></input> <div id=dmycb style="visibility:visible;display:inline-block;"><input style="visibility:visible;display:inline-block;" id=mycb type=checkbox checked></input> Periodic Email Attachment Image Share</div><br><div id=extradiv style='visibility:hidden;'>0</div><div id=extrascore style='visibility:hidden;'>0.0</div><div id=extraprefix style='visibility:hidden;'></div><br><div style="overflow:hidden;" id=dimage></div>
</td></tr></table>
<iframe onload=check_id(this); style=z-index:-1;display:block;position:absolute;left:0px;top:0px;width:100%;height:100%; id=myiframe src='add_background_layer.htm?startsas=background'></iframe>
<!--script type='text/javascript'>
if (documentURL.indexOf('startsas=') != -1) { // is original background layer
document.write("<iframe onload=check_id(this); style=z-index:-1;display:block;position:absolute;left:0px;top:0px;width:100%;height:100%; id=myiframe src='add_background_layer.html?startsas=background'></iframe>");
} else {
document.write("<iframe onload=check_id(this); style=z-index:-1;display:block;position:absolute;left:0px;top:0px;width:100%;height:100%; id=myiframe srcdoc=''></iframe>");
}
</script-->
<input id=oob type=text style="position:absolute;top:-200px;left:-200px;" value=""></input>
<select style='display:none;' id=capitals>
<option value="Afghanistan">Kabul</option>
<option value="Albania">Tirana</option>
<option value="Algeria">Algiers</option>
<option value="Andorra">Andorra la Vella</option>
<option value="Angola">Luanda</option>
<option value="Antigua and Barbuda">Saint John's</option>
<option value="Argentina">Buenos Aires</option>
<option value="Armenia">Yerevan</option>
<option value="Australia">Canberra</option>
<option value="Austria">Vienna</option>
<option value="Azerbaijan">Baku</option>
<option value="Bahamas">Nassau</option>
<option value="Bahrain">Manama</option>
<option value="Bangladesh">Dhaka</option>
<option value="Barbados">Bridgetown</option>
<option value="Belarus">Minsk</option>
<option value="Belgium">Brussels</option>
<option value="Belize">Belmopan</option>
<option value="Benin">Porto-Novo</option>
<option value="Bhutan">Thimphu</option>
<option value="Bolivia">La Paz (administrative), Sucre (judicial)</option>
<option value="Bosnia and Herzegovina">Sarajevo</option>
<option value="Botswana">Gaborone</option>
<option value="Brazil">Brasilia</option>
<option value="Brunei">Bandar Seri Begawan</option>
<option value="Bulgaria">Sofia</option>
<option value="Burkina Faso">Ouagadougou</option>
<option value="Burundi">Bujumbura</option>
<option value="Cabo Verde">Praia</option>
<option value="Cambodia">Phnom Penh</option>
<option value="Cameroon">Yaounde</option>
<option value="Canada">Ottawa</option>
<option value="Central African Republic">Bangui</option>
<option value="Chad">N'Djamena</option>
<option value="Chile">Santiago</option>
<option value="China">Beijing</option>
<option value="Colombia">Bogotá</option>
<option value="Comoros">Moroni</option>
<option value="Democratic Republic of the Congo">Kinshasa</option>
<option value="Republic of the Congo">Brazzaville</tr>
<option value="Costa Rica">San Jose</option>
<option value="Cote d'Ivoire">Yamoussoukro</option>
<option value="Croatia">Zagreb</option>
<option value="Cuba">Havana</option>
<option value="Cyprus">Nicosia</option>
<option value="Czech Republic">Prague</option>
<option value="Denmark">Copenhagen</option>
<option value="Djibouti">Djibouti (city)</option>
<option value="Dominica">Roseau</option>
<option value="Dominican Republic">Santo Domingo</option>
<option value="Ecuador">Quito</option>
<option value="Egypt">Cairo</option>
<option value="El Salvador">San Salvador</option>
<option value="Equatorial Guinea">Malabo</option>
<option value="Eritrea">Asmara</option>
<option value="Estonia">Tallinn</option>
<option value="Ethiopia">Addis Ababa</option>
<option value="Fiji">Suva</option>
<option value="Finland">Helsinki</option>
<option value="France">Paris</option>
<option value="Gabon">Libreville</option>
<option value="Gambia">Banjul</option>
<option value="Georgia">Tbilisi</option>
<option value="Germany">Berlin</option>
<option value="Ghana">Accra</option>
<option value="Greece">Athens</option>
<option value="Grenada">Saint George's</option>
<option value="Guatemala">Guatemala City</option>
<option value="Guinea">Conakry</option>
<option value="Guinea-Bissau">Bissau</option>
<option value="Guyana">Georgetown</option>
<option value="Haiti">Port-au-Prince</option>
<option value="Honduras">Tegucigalpa</option>
<option value="Hungary">Budapest</option>
<option value="Iceland">Reykjavik</option>
<option value="India">New Delhi</option>
<option value="Indonesia">Jakarta</option>
<option value="Iran">Tehran</option>
<option value="Iraq">Baghdad</option>
<option value="Ireland">Dublin</option>
<option value="Israel">Jerusalem</option>
<option value="Italy">Rome</option>
<option value="Jamaica">Kingston</option>
<option value="Japan">Tokyo</option>
<option value="Jordan">Amman</option>
<option value="Kazakhstan">Astana</option>
<option value="Kenya">Nairobi</option>
<option value="Kiribati">South Tarawa</option>
<option value="Kosovo">Pristina</option>
<option value="Kuwait">Kuwait City</option>
<option value="Kyrgyzstan">Bishkek</option>
<option value="Laos">Vientiane</option>
<option value="Latvia">Riga</option>
<option value="Lebanon">Beirut</option>
<option value="Lesotho">Maseru</option>
<option value="Liberia">Monrovia</option>
<option value="Libya">Tripoli</option>
<option value="Liechtenstein">Vaduz</option>
<option value="Lithuania">Vilnius</option>
<option value="Luxembourg">Luxembourg</option>
<option value="Macedonia">Skopje</option>
<option value="Madagascar">Antananarivo</option>
<option value="Malawi">Lilongwe</option>
<option value="Malaysia">Kuala Lumpur</option>
<option value="Maldives">Male</option>
<option value="Mali">Bamako</option>
<option value="Malta">Valletta</option>
<option value="Marshall Islands">Majuro</option>
<option value="Mauritania">Nouakchott</option>
<option value="Mauritius">Port Louis</option>
<option value="Mexico">Mexico City</option>
<option value="Micronesia">Palikir</option>
<option value="Moldova">Chisinau</option>
<option value="Monaco">Monaco</option>
<option value="Mongolia">Ulaanbaatar</option>
<option value="Montenegro">Podgorica</option>
<option value="Morocco">Rabat</option>
<option value="Mozambique">Maputo</option>
<option value="Myanmar (Burma)">Naypyidaw</option>
<option value="Namibia">Windhoek</option>
<option value="Nauru">Yaren District</option>
<option value="Nepal">Kathmandu</option>
<option value="Netherlands">Amsterdam</option>
<option value="New Zealand">Wellington</option>
<option value="Nicaragua">Managua</option>
<option value="Niger">Niamey</option>
<option value="Nigeria">Abuja</option>
<option value="North Korea">Pyongyang</option>
<option value="Norway">Oslo</option>
<option value="Oman">Muscat</option>
<option value="Pakistan">Islamabad</option>
<option value="Palau">Ngerulmud</option>
<option value="Palestine">Ramallah</option>
<option value="Panama">Panama City</option>
<option value="Papua New Guinea">Port Moresby</option>
<option value="Paraguay">Asunción</option>
<option value="Peru">Lima</option>
<option value="Philippines">Manila</option>
<option value="Poland">Warsaw</option>
<option value="Portugal">Lisbon</option>
<option value="Qatar">Doha</option>
<option value="Romania">Bucharest</option>
<option value="Russia">Moscow</option>
<option value="Rwanda">Kigali</option>
<option value="Saint Kitts and Nevis">Basseterre</option>
<option value="Saint Lucia">Castries</option>
<option value="Saint Vincent and the Grenadines">Kingstown</option>
<option value="Samoa">Apia</option>
<option value="San Marino">San Marino</option>
<option value="Sao Tome and Principe">São Tomé</option>
<option value="Saudi Arabia">Riyadh</option>
<option value="Senegal">Dakar</option>
<option value="Serbia">Belgrade</option>
<option value="Seychelles">Victoria</option>
<option value="Sierra Leone">Freetown</option>
<option value="Singapore">Singapore</option>
<option value="Slovakia">Bratislava</option>
<option value="Slovenia">Ljubljana</option>
<option value="Solomon Islands">Honiara</option>
<option value="Somalia">Mogadishu</option>
<option value="South Africa">Pretoria (administrative), Cape Town (legislative), Bloemfontein (judicial)</option>
<option value="South Korea">Seoul</option>
<option value="South Sudan">Juba</option>
<option value="Spain">Madrid</option>
<option value="Sri Lanka">Sri Jayawardenepura Kotte</option>
<option value="Sudan">Khartoum</option>
<option value="Suriname">Paramaribo</option>
<option value="Swaziland">Mbabane</option>
<option value="Sweden">Stockholm</option>
<option value="Switzerland">Bern</option>
<option value="Syria">Damascus</option>
<option value="Taiwan">Taipei</option>
<option value="Tajikistan">Dushanbe</option>
<option value="Tanzania">Dodoma</option>
<option value="Thailand">Bangkok</option>
<option value="Timor-Leste">Dili</option>
<option value="Togo">Lomé</option>
<option value="Tonga">Nukuʻalofa</option>
<option value="Trinidad and Tobago">Port of Spain</option>
<option value="Tunisia">Tunis</option>
<option value="Turkey">Ankara</option>
<option value="Turkmenistan">Ashgabat</option>
<option value="Tuvalu">Funafuti</option>
<option value="Uganda">Kampala</option>
<option value="Ukraine">Kyiv</option>
<option value="United Arab Emirates">Abu Dhabi</option>
<option value="United Kingdom">London</option>
<option value="United States of America">Washington, D.C.</option>
<option value="Uruguay">Montevideo</option>
<option value="Uzbekistan">Tashkent</option>
<option value="Vanuatu">Port Vila</option>
<option value="Vatican City (Holy See)">Vatican City</option>
<option value="Venezuela">Caracas</option>
<option value="Vietnam">Hanoi</option>
<option value="Yemen">Sana'a</option>
<option value="Zambia">Lusaka</option>
<option value="Zimbabwe">Harare</option>
</select>
<div id=dcanvas></div>
<div id=dcanvasb></div>
<div id=icanvas></div>
</body>
</html>