// country_quiz.js // Help out backgrounds of country_flag/currency/capital_quiz.php suite // RJM Programming // November, 2016 var trjm=null; var xsprefix=''; var xuprefix="//www.rjmprogramming.com.au/PHP/GeoChart/geo_chart.php?title=Countries&onclick=y&width=298&height=194&country=Country&popularity=Intensity&guess=&data="; function xselchangeit(osel) { uprefix+=sprefix + '%20[~' + encodeURIComponent(osel.options[osel.selectedIndex].text) + '~,66]%20'; sprefix=','; iframeit(); } function xsetup(ins) { uprefix+=sprefix + '%20[~' + encodeURIComponent(ins.replace(/_/g,' ')) + '~,66]%20'; sprefix=','; iframeit(); } function xiframeit() { document.getElementById('dgeochart').innerHTML=''; } function xcheckforpost(insg, oiframe, owhere) { var outs=insg, fbits=''; if (oiframe == null) { fbits='
'; } else { if (oiframe.name != '') { fbits=''; } else { fbits=''; } } if (insg.length > 950) { var outarr=insg.split('#')[0].split('?'); if (outarr.length > 1) { var outarrtwo=outarr[1].split('&'), oath; for (var im=0; im
you needed for your answer was ' + document.getElementById(countryids[choice]).title;
} else {
suffix=' The country
represented by
you needed for your answer was ' + document.getElementById(countryids[choice]).title;
}
if (document.getElementById('ssuffix')) {
document.gteElementById('ssuffix').innerHTML=suffix; suffix='';
}
document.getElementById('score').innerHTML='Score: ' + score + ' Goes: ' + goes + suffix;
document.getElementById('country').value='';
choose();
}
function capitalcheck(inv) {
if (inv.value != '') {
var suffix='';
goes++;
if (ourcomp(inv.value,document.getElementById('country').value)) {
score++;
} else if (document.getElementById(countryids[choice]).outerHTML.indexOf('
represented by ' + document.getElementById(countryids[choice]).innerHTML + '
has the capital city ' + document.getElementById(countryids[choice]).title;
} else {
suffix=' The country ' + document.getElementById(countryids[choice]).id.replace(/_/g,' ') + '
represented by
has the capital city ' + document.getElementById(countryids[choice]).title;
}
if (document.getElementById('ssuffix')) {
document.gteElementById('ssuffix').innerHTML=suffix; suffix='';
}
document.getElementById('score').innerHTML='Score: ' + score + ' Goes: ' + goes + suffix; choose();
}
}
function currencycheck(inv) {
if (inv.value != '') {
var suffix='';
goes++;
if (ourcomp(inv.value,document.getElementById('country').value)) {
score++;
} else if (document.getElementById(countryids[choice]).outerHTML.indexOf('
represented by ' + document.getElementById(countryids[choice]).innerHTML + '
has the currency ' + document.getElementById(countryids[choice]).title;
} else {
suffix=' The country ' + document.getElementById(countryids[choice]).id.replace(/_/g,' ') + ' (' + countrycodes[choice] + ')
represented by
has the currency ' + document.getElementById(countryids[choice]).title;
}
if (document.getElementById('ssuffix')) {
document.gteElementById('ssuffix').innerHTML=suffix; suffix='';
}
document.getElementById('score').innerHTML='Score: ' + score + ' Goes: ' + goes + suffix; choose();
}
}
function ifon() {
if (trjm != null) {
document.getElementById('iback').style.display='block';
} else {
document.getElementById('iback').style.display='none';
}
}
function ctyifcheck(ziois) {
var kkfound=false, iars=0, iiars=0;
var zaconto = (ziois.contentWindow || ziois.contentDocument);
if (zaconto != null) {
try {
if (zaconto.document) { zaconto = zaconto.document; }
if (zaconto.body.innerHTML.indexOf('>') != -1 && ziois.src.indexOf('highlight=') != -1) {
var arstart=zaconto.getElementsByTagName('area');
var ars=zaconto.getElementsByTagName('div');
for (iiars=0; iiars