<html>
<head>
<title>Country Languages Auto-completion Ajax Primer Tutorial</title>
<meta charset="utf-8">
<style>
body, #myCountrySearchField {
font: 1.2em verdana, arial, helvetica, sans-serif;
}
.mysuggestions {
background-color: #ffffff;
padding: 2px 6px;
border: 1px solid #000000;
}
.mysuggestions:hover {
background-color: #69F69F;
}
#mypopups {
position: absolute;
}
.myCountrySearchField.myerror {
background-color: #FFCFFC;
}
td {
vertical-align: top;
}
</style>
<script type="text/javascript">
window.onload = initAll;
var known_already="";
var lhcandidate='';
var lhready=false;
var overcnt=0;
var mtcis='';
var idname='';
var selois=null;
var intstuff='';
var countryeq='?country=';
var one=-1;
var is_capital=false;
var lhcandidate='';
var lhready=false;
var lc_CC='';
var prefix='';
var bitsbetween="";
var bhuh="~";
var myxhr = false;
var myCountriesArray = new Array();
var myCodesArray = new Array();
var myCapitalsArray = new Array();
var myCapitalsVArray = new Array();
var cis = "";
var xmlDoc=loadXMLDoc("languages.xml");
var myThisC = '';
var myThisLanguageCode = "";
var myThisLanguage = "";
var myThisCapital = "";
var uprefix="//www.rjmprogramming.com.au/PHP/GeoChart/geo_chart.php?title=Countries&onclick=y&width=298&height=194&country=Country&popularity=Intensity&guess=&data="; // %20[~AU~,34]
var gcurl="";
var ospan=null;
var stopoffs="~";
function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
{
xhttp=new XMLHttpRequest();
}
else
{
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",dname,false);
xhttp.send();
return xhttp.responseXML;
}
function lastdiviframe(invl) {
if (invl != '') {
if (document.getElementById("mypopups")) {
document.getElementById("mypopups").innerHTML = "";
}
if (document.getElementById('revisits').innerHTML == '') {
document.getElementById('revisits').style.backgroundColor='#f0f0f0';
document.getElementById('revisits').innerHTML='<hr><a id=backfromtop href="#myh1" title="Back to top">Back to top</a><br><iframe id=calledi style="width:100%;height:700px;" src="' + invl + '"></iframe>';
if (document.getElementById('dbut')) {
if (document.getElementById('dbut').innerHTML.indexOf('checkbox') != -1) {
location.href='#backfromtop';
}
} else {
location.href='#backfromtop';
}
} else {
document.getElementById('calledi').src=invl;
if (document.getElementById('dbut')) {
if (document.getElementById('dbut').innerHTML.indexOf('checkbox') != -1) {
location.href='#backfromtop';
}
} else {
location.href='#backfromtop';
}
}
}
}
function sadd(inih) {
var purlis='', psuffix='';
if (inih.indexOf("'s the capital city of ") != -1) {
if (inih.indexOf('#') != -1) { psuffix=' (' + inih.split('#')[1] + ')'; }
purlis=document.URL.split('#')[0].split('?')[0] + '?capital=' + encodeURIComponent(inih.split('#')[0].split(' (')[0].split("'s ")[0].replace(', ',',_').replace(/\ /g,'_')) + '#' + encodeURIComponent(inih.split("'s the capital city of ")[1].replace(', ',',_').replace(/\ /g,'_') + psuffix);
} else if (inih.indexOf("'s capital city is ") != -1) {
purlis=document.URL.split('#')[0].split('?')[0] + '?country=' + encodeURIComponent(inih.split('#')[0].split(' (')[0].split("'s ")[0].replace(', ',',_').replace(/\ /g,'_')) + '#' + encodeURIComponent(inih.split("'s capital city is ")[1].replace(', ',',_').replace(/\ /g,'_') + psuffix);
} else if (inih != '') {
purlis=document.URL.split('#')[0].split('?')[0] + '?country=' + encodeURIComponent(inih.split('#')[0].split(' (')[0].split("'s ")[0].replace(', ',',_').replace(/\ /g,'_'));
}
if (purlis != '') {
var wasih=document.getElementById('expands').innerHTML;
if (wasih.indexOf('<') == -1) {
stopoffs="~";
document.getElementById('expands').innerHTML='<select id=divselect style="display:inline-block;width:' + ('' + ospan.width).replace('px','') + 'px;" onchange="lastdiviframe(this.value);"><option value="">Trip Planning ' + wasih + '</option><option' + idname + ' value="' + purlis + '">' + inih.split('#')[0] + '</option></select> <div style=display:inline-block; id=dbut><font size=2>Trip Mode: </font><input style=display:inline-block; type=checkbox onchange="document.getElementById(' + "'" + 'divselect' + "'" + ').multiple=true; document.getElementById(' + "'" + 'dbut' + "'" + ').innerHTML=' + "'" + '<input style=display:inline-block; onclick=tripplan(1,selois); type=button value=Capital></input> <input style=display:inline-block; onclick=tripplan(0,selois); type=button value=Country Trip></input>' + "'" + ';"></input></div>';
selois=document.getElementById('divselect');
} else if (document.getElementById('divselect').innerHTML.indexOf(purlis) == -1) {
document.getElementById('divselect').innerHTML+='<option' + idname + ' value="' + purlis + '">' + inih.split('#')[0] + '</option>';
}
}
return inih.split('#')[0];
}
function tripplan(iscapitaltrip,sin) {
//alert(stopoffs);
var i=0, j=0, retval='', aot, tripurl='', dcity='', dctry='',dcs=[];
var totalsel=sin.innerHTML.split('</option>'), sofarsel=stopoffs.split('~'), selsel=[];
selsel.push("");
for (i=0; i<sin.options.length; i++) {
if (sin.options[i].selected) {
if (sin.options[i].value != '') {
//alert(sin.options[i].outerHTML);
dcity='';
dctry='';
dcs=sin.options[i].outerHTML.split(' data-capitalgeo="');
if (dcs.length > 1) { dcity=dcs[1].split('"')[0]; }
dcs=sin.options[i].outerHTML.split(' data-countrygeo="');
if (dcs.length > 1) { dctry=dcs[1].split('"')[0]; }
// data-capitalgeo="-16.500,-68.150" data-countrygeo="-16.712,-64.666"
//aot=sin.options[i].text.split('(')[eval(-1 + sin.options[i].text.replace(')','').split('(').length)].replace(')','').split(':');
selsel.push(sin.options[i].value + '#0000' + dcity);
for (j=0; j<sofarsel.length; j++) {
if (sofarsel[j].split('#')[0] == sin.options[i].value.split('#')[0]) { sofarsel[j]+='#00' + i; if (dcity != '') { sofarsel[j]+='#0000' + dcity; } }
}
}
}
}
selsel.push("");
if (selsel.length == sofarsel.length) {
// eg. http://localhost:8888/Ajax/AutoCompletion/auto_language_complete.html?capital=La_Paz#Bolivia%23BO%20(BO)#001
// //www.rjmprogramming.com.au/PHP/tz_places.php?iso=GB&iso2=AU&iso3=NZ
if (iscapitaltrip == 0) {
tripurl='//www.rjmprogramming.com.au/PHP/tz_places.php?iso=' + sofarsel[1].split('%23')[1].split('(')[1].split(')')[0];
} else { // Sydney,+New+South+Wales
if (sofarsel[1].indexOf('capital=') != -1) {
if (sofarsel[1].indexOf('#0000') != -1) {
tripurl='//www.google.com/maps/dir/' + sofarsel[1].split('#0000')[1].split('#')[0].replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
} else if (sofarsel[1].indexOf('#00') != -1) {
tripurl='//www.google.com/maps/dir/' + sin.options[eval(sofarsel[1].split('#00')[1].split('#')[0])].id.replace(/\_/g,'+') + ',' + sin.options[eval(sofarsel[1].split('#00')[1].split('#')[0])].name.replace(/\_/g,'+'); // .replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
}
} else if (sofarsel[1].indexOf('country=') != -1) {
if (sofarsel[1].indexOf('#0000') != -1) {
tripurl='//www.google.com/maps/dir/' + sofarsel[1].split('#0000')[1].split('#')[0].replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
} else if (sofarsel[1].indexOf('#00') != -1) {
tripurl='//www.google.com/maps/dir/' + sin.options[eval(sofarsel[1].split('#00')[1].split('#')[0])].id.replace(/\_/g,'+') + ',' + sin.options[eval(sofarsel[1].split('#00')[1].split('#')[0])].name.replace(/\_/g,'+'); // .replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
}
}
}
for (i=2; i<sofarsel.length; i++) {
if (sofarsel[i] != '') {
if (iscapitaltrip == 0) {
tripurl+='&iso' + i + '=' + sofarsel[i].split('%23')[1].split('(')[1].split(')')[0];
} else {
if (sofarsel[i].indexOf('capital=') != -1) {
if (sofarsel[i].indexOf('#0000') != -1) {
tripurl+='/' + sofarsel[i].split('#0000')[1].split('#')[0].replace(/\ /g,'');
window.open(tripurl, "_blank", "left=" + eval(10 + i) + ",top=330,width=1300,height=470");
tripurl='//www.google.com/maps/dir/' + sofarsel[i].split('#0000')[1].split('#')[0].replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
} else if (sofarsel[i].indexOf('#00') != -1) {
tripurl+='/' + sin.options[eval(sofarsel[i].split('#00')[1].split('#')[0])].id.replace(/\_/g,'+') + ',' + sin.options[eval(sofarsel[1].split('#00')[1].split('#')[0])].name.replace(/\_/g,'+'); // .replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
window.open(tripurl, "_blank", "left=" + eval(10 + i) + ",top=330,width=1300,height=470");
tripurl='//www.google.com/maps/dir/' + sin.options[eval(sofarsel[i].split('#00')[1].split('#')[0])].id.replace(/\_/g,'+') + ',' + sin.options[eval(sofarsel[1].split('#00')[1].split('#')[0])].name.replace(/\_/g,'+'); // .replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
}
} else if (sofarsel[i].indexOf('country=') != -1) {
if (sofarsel[1].indexOf('#0000') != -1) {
tripurl+='/' + sofarsel[i].split('#0000')[1].split('#')[0].replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
window.open(tripurl, "_blank", "left=" + eval(10 + i) + ",top=330,width=1300,height=470");
tripurl='//www.google.com/maps/dir/' + sofarsel[i].split('#0000')[1].split('#')[0].replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
} else if (sofarsel[i].indexOf('#00') != -1) {
tripurl+='/' + sin.options[eval(sofarsel[i].split('#00')[1].split('#')[0])].id.replace(/\_/g,'+') + ',' + sin.options[eval(sofarsel[1].split('#00')[1].split('#')[0])].name.replace(/\_/g,'+'); // .replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
window.open(tripurl, "_blank", "left=" + eval(10 + i) + ",top=330,width=1300,height=470");
tripurl='//www.google.com/maps/dir/' + sin.options[eval(sofarsel[i].split('#00')[1].split('#')[0])].id.replace(/\_/g,'+') + ',' + sin.options[eval(sofarsel[1].split('#00')[1].split('#')[0])].name.replace(/\_/g,'+'); // .replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
}
}
}
//alert(sofarsel[i]);
}
}
window.open(tripurl, "_blank", "left=10,top=330,width=1300,height=470");
} else {
if (iscapitaltrip == 0) {
tripurl='//www.rjmprogramming.com.au/PHP/tz_places.php?iso=' + selsel[1].split('%23')[1].split('(')[1].split(')')[0];
} else { // Sydney,+New+South+Wales
if (selsel[1].indexOf('capital=') != -1) {
if (selsel[1].indexOf('#0000') != -1) {
tripurl='//www.google.com/maps/dir/' + selsel[1].split('#0000')[1].split('#')[0].replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
} else if (selsel[1].indexOf('#00') != -1) {
tripurl='//www.google.com/maps/dir/' + sin.options[eval(selsel[1].split('#00')[1].split('#')[0])].id.replace(/\_/g,'+') + ',' + sin.options[eval(selsel[1].split('#00')[1].split('#')[0])].name.replace(/\_/g,'+'); // .replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
}
} else if (selsel[1].indexOf('country=') != -1) {
if (selsel[1].indexOf('#0000') != -1) {
tripurl='//www.google.com/maps/dir/' + selsel[1].split('#0000')[1].split('#')[0].replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
} else if (selsel[1].indexOf('#00') != -1) {
tripurl='//www.google.com/maps/dir/' + sin.options[eval(selsel[1].split('#00')[1].split('#')[0])].id.replace(/\_/g,'+') + ',' + sin.options[eval(selsel[1].split('#00')[1].split('#')[0])].name.replace(/\_/g,'+'); // .replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
}
}
}
for (i=2; i<selsel.length; i++) {
if (selsel[i] != '') {
if (iscapitaltrip == 0) {
tripurl+='&iso' + i + '=' + selsel[i].split('%23')[1].split('(')[1].split(')')[0];
} else {
if (selsel[i].indexOf('capital=') != -1) {
if (selsel[i].indexOf('#0000') != -1) {
tripurl+='/' + selsel[i].split('#0000')[1].split('#')[0].replace(/\ /g,'');
window.open(tripurl, "_blank", "left=" + eval(10 + i) + ",top=330,width=1300,height=470");
tripurl='//www.google.com/maps/dir/' + selsel[i].split('#0000')[1].split('#')[0].replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
} else if (selsel[i].indexOf('#00') != -1) {
tripurl+='/' + sin.options[eval(selsel[i].split('#00')[1].split('#')[0])].id.replace(/\_/g,'+') + ',' + sin.options[eval(selsel[1].split('#00')[1].split('#')[0])].name.replace(/\_/g,'+'); // .replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
window.open(tripurl, "_blank", "left=" + eval(10 + i) + ",top=330,width=1300,height=470");
tripurl='//www.google.com/maps/dir/' + sin.options[eval(selsel[i].split('#00')[1].split('#')[0])].id.replace(/\_/g,'+') + ',' + sin.options[eval(selsel[1].split('#00')[1].split('#')[0])].name.replace(/\_/g,'+'); // .replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
}
} else if (selsel[i].indexOf('country=') != -1) {
if (selsel[1].indexOf('#0000') != -1) {
tripurl+='/' + selsel[i].split('#0000')[1].split('#')[0].replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
window.open(tripurl, "_blank", "left=" + eval(10 + i) + ",top=330,width=1300,height=470");
tripurl='//www.google.com/maps/dir/' + selsel[i].split('#0000')[1].split('#')[0].replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
} else if (selsel[i].indexOf('#00') != -1) {
tripurl+='/' + sin.options[eval(selsel[i].split('#00')[1].split('#')[0])].id.replace(/\_/g,'+') + ',' + sin.options[eval(selsel[1].split('#00')[1].split('#')[0])].name.replace(/\_/g,'+'); // .replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
window.open(tripurl, "_blank", "left=" + eval(10 + i) + ",top=330,width=1300,height=470");
tripurl='//www.google.com/maps/dir/' + sin.options[eval(selsel[i].split('#00')[1].split('#')[0])].id.replace(/\_/g,'+') + ',' + sin.options[eval(selsel[1].split('#00')[1].split('#')[0])].name.replace(/\_/g,'+'); // .replace(/\ /g,''); // + '/' + jiplace + '+' + jicont;
}
}
}
//alert(selsel[i]);
}
}
window.open(tripurl, "_blank", "left=10,top=330,width=1300,height=470");
}
}
function populatelccc() {
lc_CC=document.getElementById('sellccc').innerHTML;
}
function initAll() {
ospan=document.getElementById('expands').getBoundingClientRect();
is_capital=false;
known_already=('' + (location.search.split('country=')[1] ? decodeURIComponent(location.search.split('country=')[1].split('&')[0]) : '')).replace(/\_/g,' ');
if (known_already == '') {
known_already=('' + (location.search.split('capital=')[1] ? decodeURIComponent(location.search.split('capital=')[1].split('&')[0]) : '')).replace(/\_/g,' ');
if (known_already != '') {
is_capital=true;
}
}
setTimeout(populatelccc, 2000);
setTimeout(postinitAll,1000);
}
function postinitAll() {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
bitsbetween="m/translate";
bhuh="|";
}
document.getElementById("myCountrySearchField").onkeyup = searchHelpout;
document.getElementById("myCountrySearchField").onkeypress = presearchHelpout;
if (window.XMLHttpRequest) {
myxhr = new window.XMLHttpRequest;
}
else {
try {
myxhr = new ActiveXObject("Msxml2.XMLHTTP");
} catch (othermicrosoft) {
try {
myxhr = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
myxhr = false;
}
}
}
if (myxhr) {
//console.log("prehere");
myxhr.onreadystatechange = setCountriesArray;
myxhr.open("GET", "countries_attributed.xml", true);
myxhr.send(null);
} else {
alert("Not able to create XMLHttpRequest ... sadly.");
}
if (known_already != "") {
document.getElementById("myCountrySearchField").value=known_already;
setTimeout(atw, 2000);
}
}
function atw() {
var iii=0;
if (known_already != "") {
document.getElementById("myCountrySearchField").value=known_already;
if (is_capital) {
iii=myCapitalsArray.indexOf(known_already);
known_already="";
if (iii >= 0) {
document.getElementById('atload').setAttribute('data-title', myCodesArray[iii] + ';' + myCountriesArray[iii]);
document.getElementById('atload').title=myCapitalsVArray[iii]; //myCodesArray[iii] + ';' + myCountriesArray[iii];
document.getElementById('atload').className="mysuggestions";
document.getElementById('atload').innerHTML=myCapitalsArray[iii].split(' (')[0];
lhcandidate=document.getElementById('atload');
lhready=true;
overcnt=1;
setTimeout(searchHelpout,800); // setTimeout(makeSelection,800);
}
} else {
iii=myCountriesArray.indexOf(known_already);
known_already="";
if (iii >= 0) {
document.getElementById('atload').setAttribute('data-title', myCodesArray[iii] + ';' + myCapitalsArray[iii]);
document.getElementById('atload').title=myCountriesArray[iii]; //myCodesArray[iii] + ';' + myCapitalsArray[iii];
document.getElementById('atload').className="mysuggestions";
document.getElementById('atload').innerHTML=myCountriesArray[iii];
lhcandidate=document.getElementById('atload');
lhready=true;
overcnt=1;
setTimeout(makeSelection,800);
}
}
}
}
function setCountriesArray() {
if (myxhr.readyState == 4) {
if (myxhr.status == 200) {
//console.log("here");
if (myxhr.responseXML) {
var myAllCountries = myxhr.responseXML.getElementsByTagName("country");
var myCapitalsBackup=document.getElementById('capitalinfo').innerHTML;
for (var myi=0; myi<myAllCountries.length; myi++) {
//console.log("ahere");
//console.log("yeshere at " + myAllCountries[myi].getAttribute("name"));
if (1 == 1) {
myCountriesArray[myi] = myAllCountries[myi].getAttribute("name");
//alert(65);
myCodesArray[myi] = myAllCountries[myi].getAttribute("code");
try {
myCapitalsArray[myi] = myAllCountries[myi].getAttribute("capital");
if (('' + myCapitalsArray[myi]).replace('null','') == '') {
if (myCapitalsBackup.indexOf(' value="' + myCountriesArray[myi] + '"') != -1) {
myCapitalsVArray[myi] = myCapitalsBackup.split(' value="' + myCountriesArray[myi] + '"')[1].split('>')[1].split('<')[0];
myCapitalsArray[myi] = myCapitalsBackup.split(' value="' + myCountriesArray[myi] + '"')[1].split('>')[1].split('<')[0].split(' (')[0];
} else {
console.log('No match For ' + myCountriesArray[myi]);
//alert('No match For ' + myCountriesArray[myi]);
}
}
} catch (ert) {
if (myCapitalsBackup.indexOf(' value="' + myCountriesArray[myi] + '"') != -1) {
myCapitalsVArray[myi] = myCapitalsBackup.split(' value="' + myCountriesArray[myi] + '"')[1].split('>')[1].split('<')[0];
myCapitalsArray[myi] = myCapitalsBackup.split(' value="' + myCountriesArray[myi] + '"')[1].split('>')[1].split('<')[0].split(' (')[0];
} else {
console.log('No match for ' + myCountriesArray[myi]);
//alert('No match for ' + myCountriesArray[myi]);
}
}
} else {
myCountriesArray[myi] = myAllCountries[myi].getElementsByTagName("name")[0].firstChild;
myCodesArray[myi] = myAllCountries[myi].getElementsByTagName("code")[0].firstChild;
try {
myCapitalsVArray[myi] = myAllCountries[myi].getElementsByTagName("capital")[0].firstChild;
myCapitalsArray[myi] = ('' + myAllCountries[myi].getElementsByTagName("capital")[0].firstChild).split(' (')[0];
if (('' + myCapitalsArray[myi]).replace('null','') == '') {
if (myCapitalsBackup.indexOf(' value="' + myCountriesArray[myi] + '"') != -1) {
myCapitalsVArray[myi] = myCapitalsBackup.split(' value="' + myCountriesArray[myi] + '"')[1].split('>')[1].split('<')[0];
myCapitalsArray[myi] = myCapitalsBackup.split(' value="' + myCountriesArray[myi] + '"')[1].split('>')[1].split('<')[0].split(' (')[0];
} else {
console.log('No Match For ' + myCountriesArray[myi]);
//alert('No Match For ' + myCountriesArray[myi]);
}
}
} catch (erty) {
if (myCapitalsBackup.indexOf(' value="' + myCountriesArray[myi] + '"') != -1) {
myCapitalsVArray[myi] = myCapitalsBackup.split(' value="' + myCountriesArray[myi] + '"')[1].split('>')[1].split('<')[0];
myCapitalsArray[myi] = myCapitalsBackup.split(' value="' + myCountriesArray[myi] + '"')[1].split('>')[1].split('<')[0].split(' (')[0];
} else {
console.log('No Match for ' + myCountriesArray[myi]);
//alert('No Match for ' + myCountriesArray[myi]);
}
}
}
}
}
} else {
//console.log("Problem: " + myxhr.status);
alert("Problem: " + myxhr.status);
}
}
}
function presearchHelpout(evt) {
var ifound=-1;
if ((evt.which || evt.keyCode) == 8) {
evt=evt;
} else if ((evt.which || evt.keyCode) == 186 || (evt.which || evt.keyCode) == 900000016) {
evt=evt;
} else if ((evt.which || evt.keyCode) < 46) { // || (evt.which || evt.keyCode) > 58) {
evt=evt;
} else if (document.getElementById("myCountrySearchField").value.length == 0 && String.fromCharCode((evt.which || evt.keyCode)) >= 'A' && String.fromCharCode((evt.which || evt.keyCode)) <= 'Z') {
document.getElementById('ddcapital').innerHTML='';
document.getElementById('dcapital').innerHTML='';
lhcandidate='';
lhready=false;
overcnt=0;
is_capital=false;
} else if (document.getElementById("myCountrySearchField").value.length == 0 && String.fromCharCode((evt.which || evt.keyCode)) >= 'a' && String.fromCharCode((evt.which || evt.keyCode)) <= 'z') {
document.getElementById('ddcapital').innerHTML='';
document.getElementById('dcapital').innerHTML='';
lhcandidate='';
lhready=false;
overcnt=0;
is_capital=true;
} else if (document.getElementById("myCountrySearchField").value.length > 0 && document.getElementById("myCountrySearchField").value.substring(0,1) >= 'A' && document.getElementById("myCountrySearchField").value.substring(0,1) <= 'Z') {
document.getElementById('ddcapital').innerHTML='';
document.getElementById('dcapital').innerHTML='';
lhcandidate='';
lhready=false;
overcnt=0;
is_capital=false;
if (document.getElementById("myCountrySearchField").value.length == 1) {
ifound=myCodesArray.indexOf(document.getElementById("myCountrySearchField").value + String.fromCharCode((evt.which || evt.keyCode)));
if (ifound != -1) {
document.getElementById("myCountrySearchField").value=myCountriesArray[ifound];
one=1;
return false;
}
}
} else if (document.getElementById("myCountrySearchField").value.length > 0 && document.getElementById("myCountrySearchField").value.substring(0,1) >= 'a' && document.getElementById("myCountrySearchField").value.substring(0,1) <= 'z') {
document.getElementById('ddcapital').innerHTML='';
document.getElementById('dcapital').innerHTML='';
lhcandidate='';
lhready=false;
overcnt=0;
is_capital=true;
}
return true;
}
function searchHelpout() {
var xfound=false; // new ideas from May, 2015 here
var thefirst=true;
var pdelim='';
var smtc = "", mtc = "";
var mystr = document.getElementById("myCountrySearchField").value;
if (one <= 0) { one=mystr.length; }
var myThisCode = "";
if (document.getElementById('atload').innerHTML == '') {
if (document.getElementById("myCountrySearchField").value.length > 0 && document.getElementById("myCountrySearchField").value.substring(0,1) >= 'A' && document.getElementById("myCountrySearchField").value.substring(0,1) <= 'Z') {
is_capital=false;
} else if (document.getElementById("myCountrySearchField").value.length > 0 && document.getElementById("myCountrySearchField").value.substring(0,1) >= 'a' && document.getElementById("myCountrySearchField").value.substring(0,1) <= 'z') {
is_capital=true;
}
}
//document.title='' + is_capital;
myThisLanguageCode = "";
myThisLanguage = "";
myThisCapital = "";
var mySpareThisLanguageCode = "";
var mySpareThisLanguage = "";
var mySpareThisCapital = "";
document.getElementById("myCountrySearchField").className = "";
if (mystr != "") {
prefix='';
document.getElementById("mypopups").innerHTML = "";
if (is_capital) {
for (var myi=0; myi<myCapitalsArray.length; myi++) {
//console.log(myCountriesArray[myi]);
if (myCapitalsArray[myi]) {
myThisCapital = myCapitalsVArray[myi]; //.nodeValue;
} else {
myThisCapital = " ";
}
if (myThisCapital.toLowerCase().indexOf(mystr.toLowerCase().substring(0,one)) == 0) {
var myThisCountry = myCountriesArray[myi]; //.nodeValue;
myThisCode = myCodesArray[myi];
myThisC=myThisCode;
myThisCapital = myCapitalsVArray[myi];
mtc = myThisCountry;
var myTempDiv = document.createElement("div");
myTempDiv.setAttribute('data-title', myCodesArray[myi] + ';' + myThisCountry);
myTempDiv.title = myThisCapital + ' is capital city of ' + myThisCountry; //myCodesArray[myi] + ';' + myThisCountry;
myTempDiv.innerHTML = myThisCapital.split(' (')[0];
myTempDiv.onmouseover = overmakeSelection;
myTempDiv.onmouseout = outmakeSelection;
myTempDiv.onclick = makeSelection;
myTempDiv.className = "mysuggestions";
if (thefirst) { thefirst=false; myTempDiv.id='thefirstone'; }
if (one == 1 && mystr.length != one && mystr.toLowerCase() == myThisCountry.toLowerCase()) { myTempDiv.id='divtheone'; }
if (document.getElementById('ddcapital').innerHTML != '') { document.getElementById('ddcapital').innerHTML=''; }
document.getElementById("mypopups").appendChild(myTempDiv);
if (one == 1 && mystr.length != one && mystr.toLowerCase() == myThisCountry.toLowerCase()) { document.getElementById('divtheone').click(); mystr=''; }
}
}
} else {
for (var myi=0; myi<myCountriesArray.length; myi++) {
//console.log(myCountriesArray[myi]);
var myThisCountry = myCountriesArray[myi]; //.nodeValue;
if (myThisCountry.toLowerCase().indexOf(mystr.toLowerCase().substring(0,one)) == 0) {
myThisCode = myCodesArray[myi];
myThisC=myThisCode;
myThisCapital = myCapitalsVArray[myi];
mtc = myThisCountry;
var myTempDiv = document.createElement("div");
myTempDiv.setAttribute('data-title', myCodesArray[myi] + ';' + myThisCapital.split(' (')[0]);
myTempDiv.title = myThisCountry + ' has a capital city of ' + myThisCapital; //myCodesArray[myi] + ';' + myThisCapital;
myTempDiv.innerHTML = myThisCountry;
myTempDiv.onmouseover = overmakeSelection;
myTempDiv.onmouseout = outmakeSelection;
myTempDiv.onclick = makeSelection;
myTempDiv.className = "mysuggestions";
if (thefirst) { thefirst=false; myTempDiv.id='thefirstone'; }
if (one == 1 && mystr.length != one && mystr.toLowerCase() == myThisCountry.toLowerCase()) { myTempDiv.id='divtheone'; }
if (document.getElementById('ddcapital').innerHTML != '') { document.getElementById('ddcapital').innerHTML=''; }
document.getElementById("mypopups").appendChild(myTempDiv);
if (one == 1 && mystr.length != one && mystr.toLowerCase() == myThisCountry.toLowerCase()) { document.getElementById('divtheone').click(); mystr=''; }
}
}
}
var myFoundCt = document.getElementById("mypopups").childNodes.length;
if (myFoundCt == 0) {
document.getElementById("myCountrySearchField").className = "myerror";
}
if (myFoundCt == 1) {
//if (is_capital) { alert('quito'); }
if (is_capital) {
//var xcv=document.getElementById("myCountrySearchField").value;
//document.getElementById("mypopups").firstChild.innerHTML=document.getElementById("mypopups").firstChild.title.split(';')[1];
//document.getElementById("myCountrySearchField").value = document.getElementById("mypopups").firstChild.title.split(';')[1];
//document.getElementById("mypopups").firstChild.title=document.getElementById("mypopups").firstChild.title.split(';')[0] + xcv;
//is_capital=false;
document.getElementById("myCountrySearchField").value = document.getElementById("mypopups").firstChild.innerHTML;
if (('' + document.getElementById("mypopups").firstChild.getAttribute('data-title')) != '') {
cis = document.getElementById("mypopups").firstChild.getAttribute('data-title').split(';')[1];
//alert('cis=' + cis);
} else {
cis = document.getElementById("mypopups").firstChild.title.split(';')[1];
//alert('ciS=' + cis);
}
mtcis = cis;
document.getElementById("thefirstone").click();
document.getElementById("mypopups").innerHTML = "";
} else {
document.getElementById("myCountrySearchField").value = document.getElementById("mypopups").firstChild.innerHTML;
cis = document.getElementById("mypopups").firstChild.innerHTML;
//alert('Cis=' + cis);
document.getElementById("thefirstone").click();
document.getElementById("mypopups").innerHTML = "";
}
//alert("cis=" + cis);
//var xmlDoc=loadXMLDoc("languages.xml");
var myAllLanguages = xmlDoc.getElementsByTagName("language");
for (var myj=0; myj<myAllLanguages.length; myj++) {
//console.log(myAllLanguages[myj].getAttribute("code").toLowerCase() + " vs " + myThisCode.toLowerCase());
if (myAllLanguages[myj].getAttribute("code").toLowerCase().indexOf(myThisCode.toLowerCase()) == 0) {
myThisLanguageCode = myAllLanguages[myj].getAttribute("code");
myThisLanguage = myAllLanguages[myj].getAttribute("name");
}
if (myAllLanguages[myj].getAttribute("name").toLowerCase().indexOf(myThisCode.toLowerCase()) == 0) {
mySpareThisLanguageCode = myAllLanguages[myj].getAttribute("code");
mySpareThisLanguage = myAllLanguages[myj].getAttribute("name");
mySpareThisCapital = myThisCapital;
if (1 == 4) xfound=true;
} //else { // new ideas from May, 2015 here
//document.title=prefix + myAllLanguages[myj].getAttribute("name").toLowerCase() + "/" + myAllLanguages[myj].getAttribute("code").toLowerCase() + " not with " + myThisCode.toLowerCase();
//}
}
smtc = myThisCode;
if (1 == 1 && !xfound && prefix == '' && lc_CC != '' && mtc != '') { // new ideas from May, 2015 here
//document.title=myTempDiv.title;
//prefix=mtc; //'Y ';
if (lc_CC != '') {
//prefix='Q ';
if (lc_CC.indexOf('"' + mtc + '"') != -1) {
var xiprefs, xendofs, xprefs=lc_CC.split('"' + mtc + '"');
for (xiprefs=1; xiprefs<xprefs.length; xiprefs++) {
xendofs=xprefs[xiprefs].substring(1).split("_");
if (xendofs[0].length == 2 && prefix.indexOf(xendofs[0]) == -1) {
prefix = prefix + pdelim + xendofs[0].replace("zh", "zh-CN,zh-TW");
myThisLanguageCode=""; //xendofs[0];
mySpareThisLanguageCode = ""; //
mySpareThisCapital = ""; //
}
pdelim=',';
}
} else if (lc_CC.indexOf('"' + mtc + ' ') != -1) {
var xiprefs, xendofs, xprefs=lc_CC.split('"' + mtc + '"');
for (xiprefs=1; xiprefs<xprefs.length; xiprefs++) {
xendofs=xprefs[xiprefs].substring(1).split("_");
if (xendofs[0].length == 2 && prefix.indexOf(xendofs[0]) == -1) {
prefix = prefix + pdelim + xendofs[0].replace("zh", "zh-CN,zh-TW");
myThisLanguageCode=""; //xendofs[0];
mySpareThisLanguageCode = ""; //
mySpareThisCapital = ""; //
}
pdelim=',';
}
}
}
//document.title=prefix;
if (prefix != '') xfound=true;
}
if (!xfound && prefix == '' && lc_CC != '' && smtc != '') { // new ideas from May, 2015 here
//document.title=myTempDiv.title;
//prefix='Y ';
if (lc_CC != '') {
//prefix='Q ';
if (lc_CC.indexOf("_" + smtc + "<") != -1) {
var xiprefs, xendofs, xprefs=lc_CC.split("_" + smtc + "<");
for (xiprefs=0; xiprefs<xprefs.length; xiprefs++) {
xendofs=xprefs[xiprefs].split(">");
if (xendofs[xendofs.length - 1].length == 2 && prefix.indexOf(xendofs[xendofs.length - 1]) == -1) prefix = prefix + pdelim + xendofs[xendofs.length - 1].replace("zh", "zh-CN,zh-TW");
pdelim=',';
}
}
}
//document.title=mtc;
}
if (myThisLanguageCode == "" && mySpareThisLanguageCode != "") {
myThisLanguageCode = mySpareThisLanguageCode;
myThisLanguage = mySpareThisLanguage;
myThisCapital = mySpareThisCapital;
}
if (myThisLanguageCode != "" && prefix.indexOf(myThisLanguageCode) == -1) {
prefix=prefix + pdelim + myThisLanguageCode;
}
if (myThisLanguageCode != "" && 1 == 2) {
var wo_wo=window.open("http://translate.google.com/" + bitsbetween + "#en|" + myThisLanguageCode + "|Hello%20from%20Sydney%20in%20Australia.".replace(bhuh,"/").replace(bhuh,"/"), myThisLanguageCode, "left=500,top=10,width=800,height=380");
//wo_wo.document.title+=' ... Capital City is ' + myThisCapital;
myThisLanguageCode = "";
myThisLanguage = "";
myThisCapital = "";
}
}
}
}
// http://localhost:8888/fgc/?tdinto=ctrytd&inurl=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FBolivia
function overandout() {
if (lhcandidate != '' && overcnt == 1) {
overcnt=0;
lhready=true;
makeSelection(null);
}
}
function overmakeSelection(evt) {
overcnt++;
if (evt) {
lhcandidate = evt.target;
} else {
lhcandidate = window.event.srcElement;
}
setTimeout(overandout, 2000);
}
function outmakeSelection(evt) {
if (overcnt > 0) { overcnt--; }
lhcandidate='';
lhready=false;
}
function huhint() {
if (1 == 5) { alert(intstuff); }
}
function domore(incd) {
// <iframe style="width:460px;height:360px;" src="' + gcurl + '"></iframe>
setTimeout(huhint,8000);
if (('' + document.URL).toLowerCase().indexOf('rjmprogramming.com.au') != -1) {
document.getElementById('disotwo').innerHTML="<iframe onload=internationalize(this); style=display:none; id=isotwo src='//www.rjmprogramming.com.au/PHP/fgc/?iso2=" + encodeURIComponent(incd) + "'></iframe>";
} else {
document.getElementById('disotwo').innerHTML="<iframe onload=internationalize(this); style=display:none; id=isotwo src='../../fgc/?iso2=" + encodeURIComponent(incd) + "'></iframe>";
}
return '" name=canbetz id=canbetz></iframe><br><a target=canbetz href="//www.rjmprogramming.com.au/PHP/tz_places.php?iso=' + incd + '" title="Timezone Places">Show Timezone Places</a>';
}
function makeSelection(evt) {
var xfound=false; // new ideas from May, 2015 here
var pdelim='';
var smtc = "", mtc = "";
var myThisCode = "";
myThisLanguageCode = "";
myThisLanguage = "";
myThisCapital = "";
var mySpareThisLanguageCode = "";
var mySpareThisLanguage = "";
var mySpareThisCapital = "";
if (lhcandidate != '' && lhready) {
var myThisDiv = lhcandidate;
} else if (evt) {
var myThisDiv = evt.target;
} else {
var myThisDiv = window.event.srcElement;
}
document.getElementById("myCountrySearchField").value = myThisDiv.innerHTML;
if (('' + myThisDiv.getAttribute('data-title')) != '') {
myThisCode = myThisDiv.getAttribute('data-title').split(';')[0];
myThisC=myThisCode;
} else {
myThisCode = myThisDiv.title.split(';')[0];
myThisC=myThisCode;
}
if (myThisDiv.title.indexOf(';') != -1 || ('' + myThisDiv.getAttribute('data-title')).indexOf(';') != -1) {
if (('' + myThisDiv.getAttribute('data-title')) != '') {
myThisCapital = myThisDiv.getAttribute('data-title').split(';')[1];
//alert('myThisCapital=' + myThisCapital);
} else {
myThisCapital = myThisDiv.title.split(';')[1];
}
}
mtcis=myThisCapital;
if (is_capital) {
idname=" onclick=\"if (stopoffs.indexOf(this.value) != -1) { stopoffs='~'; } stopoffs+=this.value + '~';\" name=\"" + myThisCapital.toLowerCase().split(' (')[0].replace(/\ /g,'_') + "\" id=\"" + myThisDiv.innerHTML.toLowerCase().split(' (')[0].replace(/\ /g,'_') + "\" ";
} else {
idname=" onclick=\"if (stopoffs.indexOf(this.value) != -1) { stopoffs='~'; } stopoffs+=this.value + '~';\" id=\"" + myThisCapital.toLowerCase().split(' (')[0].replace(/\ /g,'_') + "\" name=\"" + myThisDiv.innerHTML.toLowerCase().split(' (')[0].replace(/\ /g,'_') + "\" ";
}
gcurl=uprefix.replace('Countries',encodeURIComponent(document.getElementById("myCountrySearchField").value)) + "%20[~" + myThisCode.toUpperCase() + "~,66]" + domore(myThisCode.toUpperCase());
if (lhcandidate != '' && lhready) {
document.getElementById('ddcapital').innerHTML='<table id=textras cellpadding=20><tr><td id=tdgc><iframe style="width:460px;height:390px;" src="' + gcurl + '</td><td id=ctrytd></td><td id=citytd></td></tr></table>';
} else {
document.getElementById('mytableideas').innerHTML='<table id=textras cellpadding=20><tr><td id=tdgc><iframe style="width:460px;height:390px;" src="' + gcurl + '</td><td id=ctrytd></td><td id=citytd></td></tr></table>';
}
if (('' + document.URL).toLowerCase().indexOf('rjmprogramming.com.au') != -1) {
if (is_capital) {
document.getElementById('ifsrc').title="capitalid=" + myThisDiv.innerHTML.toLowerCase().split(' (')[0].replace(/\ /g,'_');
document.getElementById('ifsrctwo').title="countryname=" + myThisCapital.toLowerCase().split(' (')[0].replace(/\ /g,'_') + "~" + myThisDiv.innerHTML.toLowerCase().split(' (')[0].replace(/\ /g,'_');
} else {
document.getElementById('ifsrctwo').title="capitalid=" + myThisCapital.toLowerCase().split(' (')[0].replace(/\ /g,'_');
document.getElementById('ifsrc').title="countryname=" + myThisDiv.innerHTML.toLowerCase().split(' (')[0].replace(/\ /g,'_') + "~" + myThisCapital.toLowerCase().split(' (')[0].replace(/\ /g,'_');
}
document.getElementById('ifsrc').src='//www.rjmprogramming.com.au/PHP/fgc/?tdinto=ctrytd&inurl=' + encodeURIComponent('http://en.wikipedia.org/wiki/' + encodeURIComponent(document.getElementById("myCountrySearchField").value.split(' (')[0].replace(', ',',_').replace(/\ /g,'_')));
document.getElementById('ifsrctwo').src='//www.rjmprogramming.com.au/PHP/fgc/?tdinto=citytd&inurl=' + encodeURIComponent('http://en.wikipedia.org/wiki/' + encodeURIComponent(myThisCapital.split(' (')[0].replace(', ',',_').replace(/\ /g,'_')));
} else {
if (is_capital) {
document.getElementById('ifsrc').title="capitalid=" + myThisDiv.innerHTML.toLowerCase().split(' (')[0].replace(/\ /g,'_');
document.getElementById('ifsrctwo').title="countryname=" + myThisCapital.toLowerCase().split(' (')[0].replace(/\ /g,'_') + "~" + myThisDiv.innerHTML.toLowerCase().split(' (')[0].replace(/\ /g,'_');
} else {
document.getElementById('ifsrctwo').title="capitalid=" + myThisCapital.toLowerCase().split(' (')[0].replace(/\ /g,'_');
document.getElementById('ifsrc').title="countryname=" + myThisDiv.innerHTML.toLowerCase().split(' (')[0].replace(/\ /g,'_') + "~" + myThisCapital.toLowerCase().split(' (')[0].replace(/\ /g,'_');
}
document.getElementById('ifsrc').src='http://localhost:8888/fgc/?tdinto=ctrytd&inurl=' + encodeURIComponent('http://en.wikipedia.org/wiki/' + encodeURIComponent(document.getElementById("myCountrySearchField").value.split(' (')[0].replace(', ',',_').replace(/\ /g,'_')));
document.getElementById('ifsrctwo').src='http://localhost:8888/fgc/?tdinto=citytd&inurl=' + encodeURIComponent('http://en.wikipedia.org/wiki/' + encodeURIComponent(myThisCapital.split(' (')[0].replace(', ',',_').replace(/\ /g,'_')));
}
cis = myThisDiv.innerHTML;
//alert("Cis=" + cis);
if (lhcandidate == '' || !lhready) { document.getElementById("mypopups").innerHTML = ""; }
//var xmlDoc=loadXMLDoc("languages.xml");
var myAllLanguages = xmlDoc.getElementsByTagName("language");
for (var myj=0; myj<myAllLanguages.length; myj++) {
//console.log("2: " + myAllLanguages[myj].getAttribute("code").toLowerCase() + " vs " + myThisCode.toLowerCase());
if (myAllLanguages[myj].getAttribute("code").toLowerCase().indexOf(myThisCode.toLowerCase()) == 0) {
myThisLanguageCode = myAllLanguages[myj].getAttribute("code");
myThisLanguage = myAllLanguages[myj].getAttribute("name");
}
if (myAllLanguages[myj].getAttribute("name").toLowerCase().indexOf(myThisCode.toLowerCase()) == 0) {
mySpareThisLanguageCode = myAllLanguages[myj].getAttribute("code");
mySpareThisLanguage = myAllLanguages[myj].getAttribute("name");
}
}
smtc = myThisCode;
if (1 == 1 && !xfound && prefix == '' && lc_CC != '' && mtc != '') { // new ideas from May, 2015 here
//document.title=myTempDiv.title;
//prefix=mtc; //'Y ';
if (lc_CC != '') {
//prefix='Q ';
if (lc_CC.indexOf('"' + mtc + '"') != -1) {
var xiprefs, xendofs, xprefs=lc_CC.split('"' + mtc + '"');
for (xiprefs=1; xiprefs<xprefs.length; xiprefs++) {
xendofs=xprefs[xiprefs].substring(1).split("_");
if (xendofs[0].length == 2 && prefix.indexOf(xendofs[0]) == -1) {
prefix = prefix + pdelim + xendofs[0].replace("zh", "zh-CN,zh-TW");
myThisLanguageCode=""; //xendofs[0];
mySpareThisLanguageCode = ""; //
}
pdelim=',';
}
} else if (lc_CC.indexOf('"' + mtc + ' ') != -1) {
var xiprefs, xendofs, xprefs=lc_CC.split('"' + mtc + '"');
for (xiprefs=1; xiprefs<xprefs.length; xiprefs++) {
xendofs=xprefs[xiprefs].substring(1).split("_");
if (xendofs[0].length == 2 && prefix.indexOf(xendofs[0]) == -1) {
prefix = prefix + pdelim + xendofs[0].replace("zh", "zh-CN,zh-TW");
myThisLanguageCode=""; //xendofs[0];
mySpareThisLanguageCode = ""; //
}
pdelim=',';
}
}
}
//document.title=prefix;
if (prefix != '') xfound=true;
}
if (!xfound && prefix == '' && lc_CC != '' && smtc != '') { // new ideas from May, 2015 here
//document.title=myTempDiv.title;
//prefix='Y ';
if (lc_CC != '') {
//prefix='Q ';
if (lc_CC.indexOf("_" + smtc + "<") != -1) {
var xiprefs, xendofs, xprefs=lc_CC.split("_" + smtc + "<");
for (xiprefs=0; xiprefs<xprefs.length; xiprefs++) {
xendofs=xprefs[xiprefs].split(">");
if (xendofs[xendofs.length - 1].length == 2 && prefix.indexOf(xendofs[xendofs.length - 1]) == -1) prefix = prefix + pdelim + xendofs[xendofs.length - 1].replace("zh", "zh-CN,zh-TW");
pdelim=',';
}
}
}
//document.title=mtc;
}
if (myThisLanguageCode == "" && mySpareThisLanguageCode != "") {
myThisLanguageCode = mySpareThisLanguageCode;
myThisLanguage = mySpareThisLanguage;
myThisCapital = mySpareThisCapital;
}
if (myThisLanguageCode != "" && prefix.indexOf(myThisLanguageCode) == -1) {
prefix=prefix + pdelim + myThisLanguageCode;
}
if (myThisLanguageCode != "" && 1 == 2) {
//alert(56);
var wo_wo_wo=window.open("https://translate.google.com/" + bitsbetween + "#en|" + myThisLanguageCode + "|Hello%20from%20Sydney%20in%20Australia.".replace(bhuh,"/").replace(bhuh,"/"), myThisLanguageCode, "left=500,top=10,width=800,height=360");
//alert(156);
wo_wo_wo.document.title+=' ... Capital City is ' + myThisCapital;
//alert(256);
myThisLanguageCode = "";
myThisLanguage = "";
myThisCapital = "";
}
//if (lhcandidate != '' && lhready) {
//xgbit();
//} else {
gbit();
//}
}
// <option value="http://localhost:8888/Ajax/AutoCompletion/auto_language_complete.html?capital=Accra">Accra's the capital city of Ghana</option>
function gbit() {
if (document.getElementById("myCountrySearchField").value != "" && cis != "") {
if (is_capital) {
countryeq='?capital=';
} else {
countryeq='?country=';
}
document.getElementById('semail').innerHTML="<a style='cursor:pointer;text-decoration:none;' href='mailto:?subject=" + encodeURIComponent(document.getElementById("myCountrySearchField").value + " Information ...") + '&body=' + encodeURIComponent(document.URL.split('#')[0].split('?')[0] + countryeq + encodeURIComponent(document.getElementById("myCountrySearchField").value)) + "' title='Email about " + document.getElementById("myCountrySearchField").value + "'>📧</a>";
if (lhcandidate == '' || !lhready) { document.getElementById('ddcapital').innerHTML=''; }
if (document.getElementById('atload').innerHTML != '') {
lhcandidate='';
lhready=false;
document.getElementById('atload').innerHTML='';
}
//document.getElementById("mygi").style.display = "block";
//alert(myThisCapital + "https://maps.google.com/maps?q=" + cis + '&hl=en&hnear=' + cis + '&t=m&z=5');
if (lhcandidate == '' || !lhready) {
var wo_wo_wo_wo=window.open("https://maps.google.com/maps?q=" + cis.split(' (')[0], cis, "left=10,top=330,width=1300,height=470"); //,'mygi');
//wo_wo_wo_wo.document.title+=' ... Capital City is ' + myThisCapital;
}
if (('' + myThisCapital).replace('null','') == '' && !is_capital) {
document.getElementById('dcapital').innerHTML=' ' + sadd(document.getElementById("myCountrySearchField").value);
} else if (is_capital) {
document.getElementById('dcapital').innerHTML=' ' + sadd(document.getElementById("myCountrySearchField").value + "'s the capital city of " + mtcis + '#' + myThisC);
} else {
document.getElementById('dcapital').innerHTML=' ' + sadd(document.getElementById("myCountrySearchField").value + "'s capital city is " + myThisCapital + '#' + myThisC);
}
cis = "";
if (myThisLanguageCode != "" && prefix == '') {
if (lhcandidate == '' || !lhready) { window.open("https://translate.google.com/" + bitsbetween + "#en|" + myThisLanguageCode + "|Hello%20from%20Sydney%20in%20Australia.".replace(bhuh,"/").replace(bhuh,"/"), myThisLanguageCode, "left=500,top=10,width=800,height=360"); }
if (("," + prefix + ",").indexOf("," + myThisLanguageCode + ",") != -1) {
prefix=prefix.replace(myThisLanguageCode, "");
}
myThisLanguageCode = "";
myThisLanguage = "";
}
if (prefix.replace(/,/g,'') != '') {
var imylangs, mylangs=prefix.split(",");
for (imylangs=0; imylangs<mylangs.length; imylangs++) {
if ((lhcandidate == '' || !lhready) && mylangs[imylangs] != '') { window.open("https://translate.google.com/" + bitsbetween + "#en|" + mylangs[imylangs] + "|Hello%20from%20Sydney%20in%20Australia.".replace(bhuh,"/").replace(bhuh,"/"), mylangs[imylangs], "left=500,top=" + eval((imylangs + 1) * 2) + "10,width=800,height=360"); }
}
}
myThisLanguageCode = "";
myThisLanguage = "";
} else {
document.getElementById("mygi").style.display = "none";
}
prefix='';
lhcandidate='';
lhready=false;
overcnt=0;
}
function internationalize(iois) {
//if (iois.src != '' && iois.src.indexOf('.htm') == -1) {
var aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
intstuff=aconto.body.innerHTML;
}
//}
}
function loadifsrc(iois) {
var xintstuff='', latlong='';
//if (iois.src != '' && iois.src.indexOf('.htm') == -1) {
if (iois.src != '') {
var aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (iois.src.indexOf('tdinto=') != -1) {
xintstuff=document.getElementById(iois.src.split('tdinto=')[1].split('&')[0]).innerHTML;
} else {
xintstuff=aconto.body.innerHTML;
}
//alert(xintstuff);
if (xintstuff.indexOf(' data-geo="') != -1) {
latlong=xintstuff.split(' data-geo="')[1].split('"')[0];
if (('' + iois.title).indexOf('countryname=') != -1 && ('' + iois.title).indexOf('~') != -1) {
document.getElementById(('' + iois.title).split('~')[1]).setAttribute('data-countrygeo', latlong);
} else if (('' + iois.title).indexOf('capitalid=') != -1) {
document.getElementById(('' + iois.title).split('capitalid=')[1]).setAttribute('data-capitalgeo', latlong);
}
}
}
//}
}
}
function loadifsrctwo(iois) {
var xintstuff='', latlong='';
//if (iois.src != '' && iois.src.indexOf('.htm') == -1) {
if (iois.src != '') {
var aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (iois.src.indexOf('tdinto=') != -1) {
xintstuff=document.getElementById(iois.src.split('tdinto=')[1].split('&')[0]).innerHTML;
} else {
xintstuff=aconto.body.innerHTML;
}
//alert("1:" + xintstuff);
if (xintstuff.indexOf(' data-geo="') != -1) {
latlong=xintstuff.split(' data-geo="')[1].split('"')[0];
if (('' + iois.title).indexOf('countryname=') != -1 && ('' + iois.title).indexOf('~') != -1) {
document.getElementById(('' + iois.title).split('~')[1]).setAttribute('data-countrygeo', latlong);
} else if (('' + iois.title).indexOf('capitalid=') != -1) {
document.getElementById(('' + iois.title).split('capitalid=')[1]).setAttribute('data-capitalgeo', latlong);
}
}
}
//}
}
}
</script>
</head>
<body>
<h1 id=myh1>Country or Capital <span id=expands>Information</span></h1>
<h3>RJM Programming <span id=semail>-</span> December 2013</h3>
<form action="#">
Please enter your country or capital name: <input style="width:400px;background-color:yellow;" placeholder="Lowercase for capitals (go figure)" onclick="if (this.value.length == 0) { is_capital=false; } lhcandidate=''; lhready=false; overcnt=0; document.getElementById('ddcapital').innerHTML=''; document.getElementById('dcapital').innerHTML=''; document.getElementById('mytableideas').innerHTML='';" type="text" name="myCountrySearchField" id="myCountrySearchField" autocomplete="off" onblur="gbit();" /><div id=dcapital style='display:inline-block;'></div><div id=ddcapital style='float:right;'></div><br>
<div id="mytableideas"></div>
<div id="mypopups"> </div>
<br><iframe id='mygi' src='javascript:false;' style='display:none;width:100%;height:550px;'></iframe>
</form>
<select id='sellccc' style='display:none;'></select>
<iframe id='mylccc' src='lc_CC.php' style='display:none;width:100%;height:550px;'></iframe>
<select id=capitalinfo style='display:none;'>
<option value="Afghanistan">Kabul</option>
<option value="Åland Islands">Mariehamn</option>
<option value="Albania">Tirana</option>
<option value="Algeria">Algiers</option>
<option value="American Samoa">Pago Pago</option>
<option value="Andorra">Andorra la Vella</option>
<option value="Angola">Luanda</option>
<option value="Anguilla">The Valley</option>
<option value="Antigua and Barbuda">Saint John's</option>
<option value="Argentina">Buenos Aires</option>
<option value="Armenia">Yerevan</option>
<option value="Aruba">Oranjestad</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="Bermuda">Hamilton</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="British Indian Ocean Territory">Camp Justice</option>
<option value="Brunei">Bandar Seri Begawan</option>
<option value="Brunei Darussalam">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="Cape Verde">Praia</option>
<option value="Cayman Islands">George Town</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="Christmas Island">Flying Fish Cove</option>
<option value="Cocos (Keeling) Islands">West Island</option>
<option value="Colombia">Bogotá</option>
<option value="Comoros">Moroni</option>
<option value="Cook Islands">Avarua District</option>
<option value="Côte d'Ivoire">Yamoussoukro<option>
<option value="Democratic Republic of the Congo">Kinshasa</option>
<option value="Congo, The Democratic Republic Of The">Kinshasa</option>
<option value="Republic of the Congo">Brazzaville</tr>
<option value="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="Falkland Islands (Malvinas)">Stanley</option>
<option value="Faroe Islands">Tórshavn</option>
<option value="Fiji">Suva</option>
<option value="Finland">Helsinki</option>
<option value="France">Paris</option>
<option value="French Guiana">Cayenne</option>
<option value="French Polynesia">Pape'ete</option>
<option value="French Southern Territories">Saint Pierre</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="Gibraltar">Gibraltar</option>
<option value="Greece">Athens</option>
<option value="Greenland">Nuuk</option>
<option value="Grenada">Saint George"s</option>
<option value="Guam">Hagåtña</option>
<option value="Guadeloupe">Basse Terre</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="Holy See (Vatican City State)">Vatican City</option>
<option value="Honduras">Tegucigalpa</option>
<option value="Hong Kong">Central</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="Iran, Islamic Republic Of">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="Korea, Democratic People's Republic Of">Pyongyang</option>
<option value="Korea, Republic Of">Seoul</option>
<option value="Kosovo">Pristina</option>
<option value="Kuwait">Kuwait City</option>
<option value="Kyrgyzstan">Bishkek</option>
<option value="Laos">Vientiane</option>
<option value="Lao People's Democratic Republic">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="Libyan Arab Jamahiriya">Tripoli</option>
<option value="Liechtenstein">Vaduz</option>
<option value="Lithuania">Vilnius</option>
<option value="Luxembourg">Luxembourg</option>
<option value="Macedonia">Skopje</option>
<option value="Macedonia, The Former Yugoslav Republic Of">Skopje</option>
<option value="Macao">Macau</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="Martinique">Fort-de-France Bay</option>
<option value="Mauritania">Nouakchott</option>
<option value="Mauritius">Port Louis</option>
<option value="Mayotte">Mamoudzou</option>
<option value="Mexico">Mexico City</option>
<option value="Micronesia">Palikir</option>
<option value="Micronesia, Federated States Of">Palikir</option>
<option value="Moldova">Chisinau</option>
<option value="Moldova, Republic Of">Chisinau</option>
<option value="Monaco">Monaco</option>
<option value="Mongolia">Ulaanbaatar</option>
<option value="Montenegro">Podgorica</option>
<option value="Montserrat">Plymouth</option>
<option value="Morocco">Rabat</option>
<option value="Mozambique">Maputo</option>
<option value="Myanmar (Burma)">Naypyidaw</option>
<option value="Myanmar">Naypyitaw</option>
<option value="Namibia">Windhoek</option>
<option value="Nauru">Yaren District</option>
<option value="Nepal">Kathmandu</option>
<option value="Netherlands">Amsterdam</option>
<option value="Netherlands Antilles">Willemstad</option>
<option value="New Caledonia">Noumea</option>
<option value="New Zealand">Wellington</option>
<option value="Nicaragua">Managua</option>
<option value="Niger">Niamey</option>
<option value="Nigeria">Abuja</option>
<option value="Niue">Alofi</option>
<option value="Norfolk Island">Kingston</option>
<option value="North Korea">Pyongyang</option>
<option value="Northern Mariana Islands">Capitol Hill</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="Palestinian Territory, Occupied">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="Pitcairn">Adamstown</option>
<option value="Poland">Warsaw</option>
<option value="Portugal">Lisbon</option>
<option value="Puerto Rico">San Juan</option>
<option value="Qatar">Doha</option>
<option value="Reunion">Saint-Denis</option>
<option value="Romania">Bucharest</option>
<option value="Russia">Moscow</option>
<option value="Russian Federation">Moscow</option>
<option value="Rwanda">Kigali</option>
<option value="Saint Helena">Jamestown</option>
<option value="Saint Kitts and Nevis">Basseterre</option>
<option value="Saint Lucia">Castries</option>
<option value="Saint Pierre and Miquelon">Saint-Pierre</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="Serbia and Montenegro">Podgorica</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 Georgia and the South Sandwich Islands">King Edward Point</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="Svalbard and Jan Mayen">Longyearbyen</option>
<option value="Swaziland">Mbabane</option>
<option value="Sweden">Stockholm</option>
<option value="Switzerland">Bern</option>
<option value="Syria">Damascus</option>
<option value="Syrian Arab Republic">Damascus</option>
<option value="Taiwan">Taipei</option>
<option value="Taiwan, Province of China">Taipei</option>
<option value="Tajikistan">Dushanbe</option>
<option value="Tanzania">Dodoma</option>
<option value="Tanzania, United Republic Of">Dodoma</option>
<option value="Thailand">Bangkok</option>
<option value="Timor-Leste">Dili</option>
<option value="Togo">Lomé</option>
<option value="Tokelau">Nukunonu</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="Turks and Caicos Islands">Cockburn Town</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">Washington, D.C.</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="Virgin Islands, British">Road Town</option>
<option value="Virgin Islands, U.S.">Charlotte Amalie</option>
<option value="Wallis and Futuna">Matā'utu</option>
<option value="Western Sahara">Laayoune</option>
<option value="Yemen">Sana'a</option>
<option value="Zambia">Lusaka</option>
<option value="Zimbabwe">Harare</option>
</select>
<iframe onload="loadifsrc(this);" title="" style=display:none; id=ifsrc src=></iframe>
<iframe onload="loadifsrctwo(this);" title="" style=display:none; id=ifsrctwo src=></iframe>
<div id=disotwo style=display:none;></div>
<div id=atload style=display:none;></div>
<div id=revisits></div>
</body>
</html>