= 0) { setTimeout(function(){ if (('' + location.hash).replace(/^\#/g,'').indexOf('show') == 0) { location.hash='#'; document.getElementById('wi').click(); // ronclk('wi'); document.getElementById('icurrency').value=firstinfoin.toUpperCase() + ' '; check(document.getElementById('icurrency')); setTimeout(function(){ document.getElementById('score').innerHTML=document.getElementById('score').innerHTML.replace('Goes: 1', 'Goes: 0'); goes=0; }, 3000); } }, 5000); } else { location.hash='#'; } } else { location.hash='#'; } } if (betterguess >= 0) { return betterguess; } return inch; } "; $isSafari=true; //false; $user_agent = $_SERVER['HTTP_USER_AGENT']; if (stripos( $user_agent, 'Chrome') !== false) { $isSafari=true; //$isSafari; } elseif (stripos( $user_agent, 'Safari') !== false) { $isSafari=true; } $lastcc=''; $foundcc=''; $iso_country_codes=['AF','Afghanistan', 'ax','Aland Islands', 'Al','Albania', 'DZ','Algeria', 'as','American Samoa', 'ad','Andorra', 'AO','Angola', 'ai','Anguilla', 'AQ','Antarctica', 'ag','Antigua and Barbuda', 'AR','Argentina', 'AM','Armenia', 'aw','Aruba', 'AU','Australia', 'At','Austria', 'AZ','Azerbaijan', 'bs','Bahamas', 'Bh','Bahrain', 'BD','Bangladesh', 'bb','Barbados', 'BY','Belarus', 'BE','Belgium', 'BZ','Belize', 'BJ','Benin', 'bm','Bermuda', 'Bt','Bhutan', 'BO','Bolivia', 'Ba','Bosnia and Herzegovina', 'Bw','Botswana', 'bv','Bouvet Island (Bouvetoya)', 'BR','Brazil', 'io','British Indian Ocean Territory (Chagos Archipelago)', 'vg','British Virgin Islands', 'Bn','Brunei Darussalam', 'BG','Bulgaria', 'BF','Burkina Faso', 'bi','Burundi', 'KH','Cambodia', 'CM','Cameroon', 'CA','Canada', 'cv','Cape Verde', 'ky','Cayman Islands', 'CF','Central African Republic', 'TD','Chad', 'CL','Chile', 'CN','China', 'cx','Christmas Island', 'cc','Cocos (Keeling) Islands', 'CO','Colombia', 'km','Comoros', 'CD','Democratic Republic of the Congo', 'CG','Republic of the Congo', 'ck','Cook Islands', 'CR','Costa Rica', 'CI',"Cote d'Ivoire", 'HR','Croatia', 'CU','Cuba', 'Cy','Cyprus', 'CZ','Czech Republic', 'dK','Denmark', 'Dj','Djibouti', 'DM','Dominica', 'DO','Dominican Republic', 'EC','Ecuador', 'EG','Egypt', 'SV','El Salvador', 'GQ','Equatorial Guinea', 'ER','Eritrea', 'Ee','Estonia', 'ET','Ethiopia', 'FO','Faroe Islands', 'FK','Falkland Islands', 'fJ','Fiji', 'FI','Finland', 'FR','France', 'GF','French Guiana', 'pf','French Polynesia', 'tf','French Southern Territories', 'GA','Gabon', 'GM','Gambia the', 'GE','Georgia', 'DE','Germany', 'GH','Ghana', 'gi','Gibraltar', 'gR','Greece', 'GL','Greenland', 'gd','Grenada', 'gp','Guadeloupe', 'gu','Guam', 'GT','Guatemala', 'gg','Guernsey', 'GN','Guinea', 'GW','Guinea-Bissau', 'GY','Guyana', 'HT','Haiti', 'hm','Heard Island and McDonald Islands', 'va','Holy See (Vatican City State)', 'HN','Honduras', 'hk','Hong Kong', 'HU','Hungary', 'is','Iceland', 'IN','India', 'ID','Indonesia', 'IR','Iran', 'IQ','Iraq', 'IE','Ireland', 'im','Isle of Man', 'Il','Israel', 'IT','Italy', 'Jm','Jamaica', 'JP','Japan', 'JE','Jersey', 'Jo','Jordan', 'KZ','Kazakhstan', 'KE','Kenya', 'kI','Kiribati', 'KP','North Korea', 'KR','South Korea', 'KW','Kuwait', 'KG','Kyrgyz Republic', 'kg','Kyrgyzstan', 'LA','Laos', 'Lv','Latvia', 'Lb','Lebanon', 'ls','Lesotho', 'LR','Liberia', 'LY','Libya', 'li','Liechtenstein', 'Lt','Lithuania', 'lu','Luxembourg', 'mo','Macao', 'MK','North Macedonia', 'Mk','Macedonia', 'MG','Madagascar', 'MW','Malawi', 'MY','Malaysia', 'mv','Maldives', 'ML','Mali', 'MT','Malta', 'mh','Marshall Islands', 'mq','Martinique', 'MR','Mauritania', 'mu','Mauritius', 'yt','Mayotte', 'MX','Mexico', 'fm','Micronesia', 'MD','Moldova', 'mc','Monaco', 'MN','Mongolia', 'Me','Montenegro', 'ms','Montserrat', 'MA','Morocco', 'MZ','Mozambique', 'MM','Myanmar (Burma)', 'NA','Namibia', 'nr','Nauru', 'NP','Nepal', 'an','Netherlands Antilles', 'NL','Netherlands', 'nc','New Caledonia', 'nZ','New Zealand', 'NI','Nicaragua', 'NE','Niger', 'NG','Nigeria', 'nu','Niue', 'NF','Norfolk Island', 'mp','Northern Mariana Islands', 'NO','Norway', 'om','Oman', 'PK','Pakistan', 'pw','Palau', 'ps','Palestine', 'PA','Panama', 'PG','Papua New Guinea', 'PY','Paraguay', 'PE','Peru', 'PH','Philippines', 'pn','Pitcairn Islands', 'PL','Poland', 'PT','Portugal', 'pr','Puerto Rico', 'qa','Qatar', 're','Reunion', 'RO','Romania', 'RU','Russia', 'Rw','Rwanda', 'bl','Saint Barthelemy', 'sh','Saint Helena', 'kn','Saint Kitts and Nevis', 'lc','Saint Lucia', 'mf','Saint Martin', 'pm','Saint Pierre and Miquelon', 'vc','Saint Vincent and the Grenadines', 'ws','Samoa', 'sm','San Marino', 'st','Sao Tome and Principe', 'SA','Saudi Arabia', 'SN','Senegal', 'RS','Serbia', 'sc','Seychelles', 'SL','Sierra Leone', 'sg','Singapore', 'SK','Slovakia', 'Si','Slovenia', 'SB','Solomon Islands', 'SO','Somalia', 'ZA','South Africa', 'gs','South Georgia and the South Sandwich Islands', 'ES','Spain', 'LK','Sri Lanka', 'SD','Sudan', 'SR','Suriname', 'sj','Svalbard & Jan Mayen Islands', 'sz','Swaziland', 'SE','Sweden', 'Ch','Switzerland', 'Sy','Syria', 'Tw','Taiwan', 'TJ','Tajikistan', 'TZ','Tanzania', 'TH','Thailand', 'tl','Timor-Leste', 'TG','Togo', 'tk','Tokelau', 'td','Tonga', 'tt','Trinidad and Tobago', 'TN','Tunisia', 'TR','Turkey', 'TM','Turkmenistan', 'tc','Turks and Caicos Islands', 'tV','Tuvalu', 'UG','Uganda', 'UA','Ukraine', 'AE','United Arab Emirates', 'GB','United Kingdom', 'US','United States of America', 'UM','United States Minor Outlying Islands', 'vi','United States Virgin Islands', 'UY','Uruguay, Eastern Republic of', 'UZ','Uzbekistan', 'vu','Vanuatu', 'VE','Venezuela', 'VN','Vietnam', 'wf','Wallis and Futuna', 'EH','Western Sahara', 'YE','Yemen', 'ZM','Zambia', 'ZW','Zimbabwe']; // Eg. BahamasNassau ... thanks //$capbits=@file_get_contents("https://www.countries-ofthe-world.com/capitals-of-the-world.html"); $capbits=" CountryCapital city A AfghanistanKabul AlbaniaTirana AlgeriaAlgiers AndorraAndorra la Vella AngolaLuanda Antigua and BarbudaSaint John's ArgentinaBuenos Aires ArmeniaYerevan AustraliaCanberra AustriaVienna AzerbaijanBaku B BahamasNassau BahrainManama BangladeshDhaka BarbadosBridgetown BelarusMinsk BelgiumBrussels BelizeBelmopan BeninPorto-Novo BhutanThimphu BoliviaLa Paz (administrative), Sucre (judicial) Bosnia and HerzegovinaSarajevo BotswanaGaborone BrazilBrasilia BruneiBandar Seri Begawan BulgariaSofia Burkina FasoOuagadougou BurundiBujumbura C Cabo VerdePraia CambodiaPhnom Penh CameroonYaounde CanadaOttawa Central African RepublicBangui ChadN'Djamena ChileSantiago ChinaBeijing ColombiaBogotá ComorosMoroni Democratic Republic of the CongoKinshasa Republic of the CongoBrazzaville Costa RicaSan Jose Cote d'IvoireYamoussoukro CroatiaZagreb CubaHavana CyprusNicosia Czech RepublicPrague D DenmarkCopenhagen DjiboutiDjibouti (city) DominicaRoseau Dominican RepublicSanto Domingo E EcuadorQuito EgyptCairo El SalvadorSan Salvador Equatorial GuineaMalabo EritreaAsmara EstoniaTallinn EthiopiaAddis Ababa F FijiSuva FinlandHelsinki FranceParis G GabonLibreville GambiaBanjul GeorgiaTbilisi GermanyBerlin GhanaAccra GreeceAthens GrenadaSaint George's GuatemalaGuatemala City GuineaConakry Guinea-BissauBissau GuyanaGeorgetown H HaitiPort-au-Prince HondurasTegucigalpa HungaryBudapest I IcelandReykjavik IndiaNew Delhi IndonesiaJakarta IranTehran IraqBaghdad IrelandDublin IsraelJerusalem ItalyRome J JamaicaKingston JapanTokyo JordanAmman K KazakhstanAstana KenyaNairobi KiribatiSouth Tarawa KosovoPristina KuwaitKuwait City KyrgyzstanBishkek L LaosVientiane LatviaRiga LebanonBeirut LesothoMaseru LiberiaMonrovia LibyaTripoli LiechtensteinVaduz LithuaniaVilnius LuxembourgLuxembourg "; function cursym($isocc,$hascurcc) { return ''; } function yourflag($incn) { global $iso_country_codes, $foundcc; for ($jk=1; $jk 1) { $ctryiss=explode("'", $ctrys[1]); $huhbits=explode($ctryiss[0] . "", str_replace("
CountryCapital city
M
MacedoniaSkopje
MadagascarAntananarivo
MalawiLilongwe
MalaysiaKuala Lumpur
MaldivesMale
MaliBamako
MaltaValletta
Marshall IslandsMajuro
MauritaniaNouakchott
MauritiusPort Louis
MexicoMexico City
MicronesiaPalikir
MoldovaChisinau
MonacoMonaco
MongoliaUlaanbaatar
MontenegroPodgorica
MoroccoRabat
MozambiqueMaputo
Myanmar (Burma)Naypyidaw
N
NamibiaWindhoek
NauruYaren District
NepalKathmandu
NetherlandsAmsterdam
New ZealandWellington
NicaraguaManagua
NigerNiamey
NigeriaAbuja
North KoreaPyongyang
NorwayOslo
O
OmanMuscat
P
PakistanIslamabad
PalauNgerulmud
PalestineRamallah
PanamaPanama City
Papua New GuineaPort Moresby
ParaguayAsunción
PeruLima
PhilippinesManila
PolandWarsaw
PortugalLisbon
Q
QatarDoha
R
RomaniaBucharest
RussiaMoscow
RwandaKigali
S
Saint Kitts and NevisBasseterre
Saint LuciaCastries
Saint Vincent and the GrenadinesKingstown
SamoaApia
San MarinoSan Marino
Sao Tome and PrincipeSão Tomé
Saudi ArabiaRiyadh
SenegalDakar
SerbiaBelgrade
SeychellesVictoria
Sierra LeoneFreetown
SingaporeSingapore
SlovakiaBratislava
SloveniaLjubljana
Solomon IslandsHoniara
SomaliaMogadishu
South AfricaPretoria (administrative), Cape Town (legislative), Bloemfontein (judicial)
South KoreaSeoul
South OssetiaTskhinvali
South SudanJuba
SpainMadrid
Sri LankaSri Jayawardenepura Kotte
SudanKhartoum
SurinameParamaribo
SwazilandMbabane
SwedenStockholm
SwitzerlandBern
SyriaDamascus
T
TaiwanTaipei
TajikistanDushanbe
TanzaniaDodoma
ThailandBangkok
Timor-LesteDili
TogoLomé
TongaNukuʻalofa
Trinidad and TobagoPort of Spain
TunisiaTunis
TurkeyAnkara
TurkmenistanAshgabat
TuvaluFunafuti
U
UgandaKampala
UkraineKyiv
United Arab EmiratesAbu Dhabi
United KingdomLondon
United States of AmericaWashington, D.C.
UruguayMontevideo
UzbekistanTashkent
V
VanuatuPort Vila
Vatican City (Holy See)Vatican City
VenezuelaCaracas
VietnamHanoi
Y
YemenSana'a
Z
ZambiaLusaka
ZimbabweHarare
","",$curbits)); if (sizeof($huhbits) == 1) $huhbits=explode("(" . $ctryiss[0], str_replace("","",$curbits)); if (sizeof($huhbits) == 1) $huhbits=explode($ctryiss[0] . "/", str_replace("","",$curbits)); if (sizeof($huhbits) > 1) { $ids=explode(' id="', $huhbits[0]); if (sizeof($ids) > 1) { $thiscode=explode('"', $ids[-1 + sizeof($ids)])[0]; } $posthuhbits=explode("", $huhbits[1]); if (sizeof($posthuhbits) > 1) { $bposthuhbits=explode("", $bposthuhbits); $thiscur=str_replace('.', '_', str_replace(' ', '_', str_replace('"', '_', str_replace("'", "_", str_replace("'", "`", $preposthuhbits[0] . " (" . str_replace("\n","",str_replace("","",explode("<",$posthuhbits[2])[0])) . ")"))))); $retcap=str_replace("title='" . $ctryiss[0] . "", "title='" . str_replace("'", "`", $preposthuhbits[0] . " (" . str_replace("\n","",str_replace("","",explode("<",$posthuhbits[2])[0])) . ")") . "", $cincountry); } } } return $retcap; } $num=0; $countries=[]; $currencys=[]; $countryids=[]; $countryccs=[]; $countrycodes=[]; $htmlis="

Country Currency Quiz

Score: 0 Goes: 0

RJM Programming

November, 2016

Country?
"; $scriptis="Country Currency Quiz \n \n \n var choice=-1, score=0, goes=0, num=0, currencys=[], countries=[], countryids=[], countrycodes=[]; " . $sug . " function why(owhy) { if (1 == 1) { return owhy; } else { return owhy.split('(')[0].split('-')[0].replace(/_/g,' ').replace(/-/g,' '); } } function ourcomp(c1,c2) { var xc1=c1.replace(/_/g,' ').replace(/`/g,' '); var xc2=c2.split('-')[1].replace(/_/g,' ').replace(/`/g,' '); if (xc2.toLowerCase().indexOf(xc1.toLowerCase()) != -1 && xc1.toLowerCase().length > 2) { return true; } return false; } \n function precheck() { if (document.getElementById('countrylist')) { if (document.getElementById('country').value != '') { check(document.getElementById('country')); } } } \n function check(inv) { if (inv.value != '') { var suffix=''; goes++; if (ourcomp(inv.value,document.getElementById('country').value)) { score++; } else { suffix=' The country ' + document.getElementById(countryids[choice]).id.replace(/_/g,' ') + ' (' + countrycodes[choice] + ') represented by has the currency ' + document.getElementById(countryids[choice]).getAttribute('data-cursym'); + ' ' + document.getElementById(countryids[choice]).title; } document.getElementById('score').innerHTML='Score: ' + score + ' Goes: ' + goes + suffix; choose(); } } \n function choose() { choice = sug(Math.floor(Math.random() * num)); document.getElementById('country').value=why(countryids[choice] + '-' + currencys[choice]); document.getElementById('icurrency').value=''; setTimeout(fit, 1500); } function fit() { if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) || 8 == 8) { document.getElementById('icurrency').focus(); } } \n"; $scriptis="Country Currency Quiz \n \n \n var choice=-1, score=0, goes=0, num=0, currencys=[], countries=[], countryids=[], countryccs=[], countrycodes=[]; " . $sug . " function why(owhy) { if (1 == 1) { return owhy; } else { return owhy.split('(')[0].split('-')[0].replace(/_/g,' ').replace(/-/g,' '); } } function ourcomp(c1,c2) { var xc1=c1.replace(/_/g,' ').replace(/`/g,' '); var xc2=c2.split('-')[1].replace(/_/g,' ').replace(/`/g,' '); if (xc2.toLowerCase().indexOf(xc1.toLowerCase()) != -1 && xc1.toLowerCase().length > 2) { return true; } return false; } \n function precheck() { if (document.getElementById('countrylist')) { if (document.getElementById('country').value != '') { check(document.getElementById('country')); } } } \n function check(inv) { if (inv.value != '') { var suffix=''; goes++; if (ourcomp(inv.value,document.getElementById('country').value)) { score++; } else { suffix=' The country ' + document.getElementById(countryids[choice]).id.replace(/_/g,' ') + ' (' + countrycodes[choice] + ') represented by ' + document.getElementById(countryids[choice]).innerHTML + ' has the currency ' + document.getElementById(countryids[choice]).title; } document.getElementById('score').innerHTML='Score: ' + score + ' Goes: ' + goes + suffix; choose(); } } \n function choose() { choice = sug(Math.floor(Math.random() * num)); document.getElementById('country').value=why(countryids[choice] + '-' + currencys[choice]); document.getElementById('icurrency').value=''; setTimeout(fit, 1500); } function fit() { if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) || 8 == 8) { document.getElementById('icurrency').focus(); } } \n"; if ($isSafari) { $seloneis=""; } else { $seloneis=""; } $divis="
"; $ctysarr=explode("
", $capbits); if (sizeof($ctysarr) > 1) { for ($ihj=1; $ihj','',str_replace('','',$ctysarr[$ihj]))); if (yourflag($postbits[0]) != '') { $idis=countryid($postbits[0]); $outcurrency=mapcurrency("

" . yourflag($postbits[0])) . "' data-cc='" . $foundcc . "' id='" . $idis . "' title='" . str_replace("_", " ", $postbits[0]) . "'>" . yourflag($postbits[0]) . "

"); if ($outcurrency != "") { $countries[$num]=$postbits[0]; $scriptis=str_replace("", " countries.push(\"" . str_replace("_", " ", $postbits[0]) . "\"); countryids.push(\"" . $idis . "\"); countryccs.push(\"" . $foundcc . "\"); countrycodes.push(\"" . $thiscode . "\"); currencys.push(\"" . $thiscur . "\"); num++; \n", $scriptis); $countryids[$num]=$idis; if ($isSafari) { $seloneis=str_replace("", "", $seloneis); } else { $seloneis=str_replace("", "", $seloneis); } $divis=str_replace("", $outcurrency . "", $divis); $num++; } } } } else { foreach (glob("../tikiwiki/img/flags/*.gif") as $filename) { $bits=explode("/", $filename); $postbits=explode(".", $bits[-1 + sizeof($bits)]); $idis=countryid($postbits[0]); $outcurrency=mapcurrency(""); if ($outcurrency != "") { $countries[$num]=$postbits[0]; $scriptis=str_replace("", " countries.push(\"" . str_replace("_", " ", $postbits[0]) . "\"); countryids.push(\"" . $idis . "\"); countrycodes.push(\"" . $thiscode . "\"); currencys.push(\"" . $thiscur . "\"); num++; \n", $scriptis); $countryids[$num]=$idis; if ($isSafari) { $seloneis=str_replace("", "", $seloneis); } else { $seloneis=str_replace("", "", $seloneis); } $divis=str_replace("", $outcurrency . "", $divis); $num++; } } } echo str_replace("", $divis . "", str_replace("", "" . $scriptis . "", str_replace("