<?php
// craters.php
// Craters on Earth
// RJM Programming
// Thanks to https://en.wikipedia.org/wiki/List_of_impact_craters_on_Earth
// params=58_27_N_109_30_W_&amp;title=Carswell

 $geo='GeoChart/geo_chart.php'; //IntensityChart/intensity_chart.php
 $twobit='1';
 $addbit=''; //',3';
 $selo='';
 $nohselo='';
 $hselo='';
 $hnoselo='';
 $postselo="";
 $tv="";
 $url='//en.wikipedia.org/wiki/List_of_impact_craters_on_Earth';
 $lasttitleis='';
 $selt='';
 $imgsare=[];

 $titleplus='Meteorite| Crater|s on Earth';
 if (isset($_GET['titleplus'])) {
   $titleplus=str_replace("+"," ",urldecode($_GET['titleplus']));
   if (strpos(($titleplus . "^"), " ^") !== false) {
    $tv="y";
   }
 } else if (isset($_POST['titleplus'])) {
   $titleplus=str_replace("+"," ",urldecode($_POST['titleplus']));
   if (strpos(($titleplus . "^"), " ^") !== false) {
    $tv="y";
   }
 }

 if (isset($_GET['url'])) {
   $url=str_replace("https:","",str_replace("http:","",str_replace("+"," ",urldecode($_GET['url']))));
   $selo=" document.getElementById('selo').value='" . str_replace("https:","",str_replace("http:","",str_replace("+"," ",urldecode($_GET['url'])))) . "'; "; 
   if (strpos($url, "?isocode=") !== false) {
     $selo.=" document.getElementById('region').value='" . explode("#",explode("&",explode("?isocode=", $url)[1])[0])[0] . "'; "; // 145
   }
   $nohselo=str_replace("https:","",str_replace("http:","",str_replace("+"," ",urldecode($_GET['url'])))); 
   $hselo=explode('#', str_replace("https:","",str_replace("http:","",str_replace("+"," ",urldecode($_GET['url'])))))[0] . '#'; 
   $hnoselo=explode('#', str_replace("https:","",str_replace("http:","",str_replace("+"," ",urldecode($_GET['url'])))))[0]; 
   if (strpos($_GET['url'], "Turkey") !== false) {
     $selo.=" document.getElementById('region').value='TR'; "; // 145
     $selo.=" document.getElementById('text').value='" . $tv . "'; ";
   } else if (strpos($_GET['url'], "Japan") !== false) {
     $selo.=" document.getElementById('region').value='JP'; "; 
     $twobit='1';
     $selo.=" document.getElementById('text').value='" . $tv . "'; ";
   } else if (strpos($_GET['url'], "Australia") !== false) {
     $selo.=" document.getElementById('region').value='AU'; "; 
     $selo.=" document.getElementById('text').value='" . $tv . "'; ";
   } else if (strpos($_GET['url'], "Philippines") !== false) {
     $selo.=" document.getElementById('region').value='PH'; "; 
     $selo.=" document.getElementById('text').value='" . $tv . "'; ";
   } else if (strpos($_GET['url'], "Argentina") !== false) {
     $selo.=" document.getElementById('region').value='AR'; "; 
     $selo.=" document.getElementById('text').value='" . $tv . "'; ";
   } else if (strpos($_GET['url'], "Pacific") !== false) {
     $selo.=" document.getElementById('region').value='021'; "; 
     $selo.=" document.getElementById('text').value='" . $tv . "'; ";
   } else if (strpos($_GET['url'], "Africa") !== false) {
     $selo.=" document.getElementById('region').value='ZA'; "; 
     $selo.=" document.getElementById('text').value='" . $tv . "'; ";
   }
 } else if (isset($_POST['url'])) {
   $url=str_replace("https:","",str_replace("http:","",str_replace("+"," ",urldecode($_POST['url']))));
   $selo=" document.getElementById('selo').value='" . str_replace("https:","",str_replace("http:","",str_replace("+"," ",urldecode($_POST['url'])))) . "'; "; 
   if (strpos($url, "?isocode=") !== false) {
     $selo.=" document.getElementById('region').value='" . explode("#",explode("&",explode("?isocode=", $url)[1])[0])[0] . "'; "; // 145
   }
   $nohselo=str_replace("https:","",str_replace("http:","",str_replace("+"," ",urldecode($_POST['url'])))); 
   $hselo=explode('#', str_replace("https:","",str_replace("http:","",str_replace("+"," ",urldecode($_POST['url'])))))[0] . '#'; 
   $hnoselo=explode('#', str_replace("https:","",str_replace("http:","",str_replace("+"," ",urldecode($_POST['url'])))))[0]; 
   if (strpos($_POST['url'], "Turkey") !== false) {
     $selo.=" document.getElementById('region').value='TR'; "; // 145
     $selo.=" document.getElementById('text').value='" . $tv . "'; ";
   } else if (strpos($_GET['url'], "Japan") !== false) {
     $selo.=" document.getElementById('region').value='JP'; "; 
     $twobit='1';
     $selo.=" document.getElementById('text').value='" . $tv . "'; ";
   } else if (strpos($_GET['url'], "Australia") !== false) {
     $selo.=" document.getElementById('region').value='AU'; "; 
     $selo.=" document.getElementById('text').value='" . $tv . "'; ";
   } else if (strpos($_GET['url'], "Philippines") !== false) {
     $selo.=" document.getElementById('region').value='PH'; "; 
     $selo.=" document.getElementById('text').value='" . $tv . "'; ";
   } else if (strpos($_GET['url'], "Argentina") !== false) {
     $selo.=" document.getElementById('region').value='AR'; "; 
     $selo.=" document.getElementById('text').value='" . $tv . "'; ";
   } else if (strpos($_GET['url'], "Pacific") !== false) {
     $selo.=" document.getElementById('region').value='021'; "; 
     $selo.=" document.getElementById('text').value='" . $tv . "'; ";
   } else if (strpos($_GET['url'], "Africa") !== false) {
     $selo.=" document.getElementById('region').value='ZA'; "; 
     $selo.=" document.getElementById('text').value='" . $tv . "'; ";
   }
 }

 if (strpos(($titleplus . "^"), " ^") !== false) {
  $titleplus=trim($titleplus);
  $postselo=" document.getElementById('text').value='y'; ";
 }

 $suffix='_craters';
 if (strpos($titleplus, "|") !== false) {
   $suffix=strtolower(str_replace(" ","_",explode("|", trim($titleplus))[1]));
 } else {
   $suffix='';
 }
 $title=str_replace("|", "",trim($titleplus));
 $ltitle='List of impact craters on Earth - Wikipedia';

 //file_put_contents('wurl.is', $url);
 $cont=str_replace("♠","",str_replace('<a href="#', '<a HREF="#', file_get_contents("http:" . str_replace("https:","",str_replace("http:","",$url)))));
 //file_put_contents('wurl.cont', $cont);
 
 $swrd=' src';
 $selt='';
 $bckidea='';
 $aone=1;
 $imgsare=explode('<img src="', $cont);
 if (sizeof($imgsare) < 5 && sizeof(explode('<img alt="', $cont)) >= 5) { $swrd=' alt'; $imgsare=explode('<img alt="', $cont); } 
 $atestis='start?type=';
 $tries=1;
 if (sizeof($imgsare) >= 5) { while (strpos($atestis, 'start?type=') !== false && $tries < 50) { $tries++; $aone=rand(1, (-3 + sizeof($imgsare))); if (strpos(explode('>', $imgsare[$aone])[0], 'start?type=') === false) { $atestis=' '; } else if ($tries >= 50) { $aone=1;  $atestis=' ';   }  }  }
 if (strpos($cont, '<img' . $swrd . '="') !== false) {
   if ($swrd == ' alt' && strpos($imgsare[$aone], ' src="') !== false) {
     $imgsare[$aone]=explode(' src="', $imgsare[$aone])[1];
   }
   $bckidea="background-image:linear-gradient(rgba(255,255,255,0.6),rgba(255,255,255,0.6)),url(" . explode('"', $imgsare[$aone])[0] . ");background-repeat:repeat;background-size:contain;";
   $selt=' title="' . explode('"', $imgsare[$aone])[0] . '" ';
   if (strpos($selt, '/') !== false) {
     $selt=' title="' . explode('"', explode('/', $selt)[-1 + sizeof(explode('/', $selt))])[0] . '" ';
   }
   if (strpos(explode('>', $imgsare[$aone])[0], ' title="') !== false) {
     $selt=' title="' . explode('"', explode(' title="', $imgsare[$aone])[1])[0] . '" ';
   }
 }
 //file_put_contents('wurl.was', $bckidea);
 
 if (strpos($cont, '</title>') !== false) {
   $ltitle=explode("title>", explode("</title>", $cont)[0])[1];
 } else {
   $ltitle=$title;
 }

 $junk="";
 $areg="";
 $delm="";
 $altf="";
 
 $datais="";
 $dataarray=explode("&amp;title=", $cont);
 
 if (sizeof($dataarray) == 1) {
   $dataarray=explode("&title=", $cont);
 }
 if (sizeof($dataarray) == 1) {
   if (sizeof(explode('&amp;params=', $cont)) > 1) {
     $altf='&amp;params=';
     $dataarray=explode($altf, $cont);
//echo "01:" . $altf;
//exit;
  } else if (sizeof(explode('_W_"><span', $cont)) > 1) {
     $altf='_W_"><span';
     $dataarray=explode($altf, $cont);
//echo "02:" . '_W_' . ' ' . sizeof($dataarray);
//exit;
   } else if (sizeof(explode('&amp;params=', $cont)) > 1) {
     $altf='&amp;params=';
     $dataarray=explode($altf, $cont);
//echo "01:" . $altf;
//exit;
   } else if (sizeof(explode('_W_"><span', $cont)) > 1) {
     $altf='_W_"><span';
     $dataarray=explode($altf, $cont);
//echo "02:" . $altf;
//exit;
   } else if (sizeof(explode('_E_"><span', $cont)) > 1) {
     $altf='_E_"><span';
     $dataarray=explode($altf, $cont);
//echo "03:" . $altf;
//exit;
   } else if (sizeof(explode('_W_', $cont)) > 1) {
     $altf='_W_';
     $dataarray=explode($altf, $cont);
   } else if (sizeof(explode('_E_', $cont)) > 1) {
     $altf='_E_';
     $dataarray=explode($altf, $cont);
   }
 }
 
 // <p><b><a href="/wiki/Antigua" title="Antigua">Antigua</a></b><sup><span class="plainlinks nourlexpansion"><a class="external text" href="//tools.wmflabs.org/geohack/geohack.php?pagename=List_of_Caribbean_islands
 // &amp;params=17_5_0_N_61_48_0_W_">
 //file_put_contents('wurl.was0', $bckidea);
 
 for ($i=1; $i<sizeof($dataarray); $i++) {
   if (strpos((isset($_GET['url']) ? $_GET['url'] : ''), "olcanoes") !== false && $lasttitleis == 'Italy') {
   $lasttitleis='';
   } else {
   if (strpos($altf,'params') !== false) {
 //file_put_contents('wurl.was00', $bckidea);
   $rest=explode('"', $dataarray[$i])[0];
 //file_put_contents('wurl.was00a', $rest);
   $xtitleis=explode('<a href=', $dataarray[-1 + $i])[-1 + sizeof(explode('<a href=', $dataarray[-1 + $i]))];
 //file_put_contents('wurl.was00b', $xtitleis);
   $titleis=str_replace("'","`",str_replace("_"," ",explode(">", explode("</", $xtitleis)[0])[-1 + sizeof(explode(">", explode("</", $xtitleis)[0]))]));
 //file_put_contents('wurl.was00c', $titleis);
//echo "1:" . $rest;
//exit;
   } else if (strpos($altf, '_W_') !== false) {
 //file_put_contents('wurl.was000', $bckidea);
   $rest=explode('=', $dataarray[-1 + $i])[-1 + sizeof(explode('=', $dataarray[-1 + $i]))] . '_W_';
   $xtitleis=explode('<a href=', $dataarray[-1 + $i])[-1 + sizeof(explode('<a href=', $dataarray[-1 + $i]))];
   $titleis=str_replace("'","`",str_replace("_"," ",explode(">", explode("</", $xtitleis)[0])[-1 + sizeof(explode(">", explode("</", $xtitleis)[0]))]));
//echo "2:" . $titleis;
//exit;
   } else if (strpos($altf, '_E_') !== false) {
 //file_put_contents('wurl.was0000', $bckidea);
   $rest=explode('=', $dataarray[-1 + $i])[-1 + sizeof(explode('=', $dataarray[-1 + $i]))] . '_E_';
   $xtitleis=explode('<a href=', $dataarray[-1 + $i])[-1 + sizeof(explode('<a href=', $dataarray[-1 + $i]))];
//echo "3:" . $xtitleis;
//exit;
   $titleis=str_replace("'","`",str_replace("_"," ",explode(">", explode("</", $xtitleis)[0])[-1 + sizeof(explode(">", explode("</", $xtitleis)[0]))]));
   } else {
 //file_put_contents('wurl.was00000', $bckidea);
   $titleis=str_replace("'","`",str_replace("_"," ",explode('"', $dataarray[$i])[0]));
   $rest=explode('=', $dataarray[-1 + $i])[-1 + sizeof(explode('=', $dataarray[-1 + $i]))];
   }
   $nlats=explode('_N_', $rest);
   if (sizeof($nlats) > 1) {
     $lbits=explode('_', $nlats[0]);
     $factor=1.0;
     $latis=0.0;
     for ($ii=0; $ii<sizeof($lbits); $ii++) {
      $latis += ($lbits[$ii] / ($factor));
      $factor *= 60.0;
     }
     $rest=$nlats[1] . " ";
   } else {
     $lbits=explode('_', explode('_S_', $rest)[0]);
     $factor=-1.0;
     $latis=0.0;
     for ($ii=0; $ii<sizeof($lbits); $ii++) {
      $latis += ($lbits[$ii] / ($factor));
      $factor *= 60.0;
     }
     $rest=explode('_S_', $rest)[1] . " ";
   }
 //file_put_contents('wurl.was000000', $bckidea);

   $nlongs=explode('_E_', $rest);
   if (sizeof($nlongs) > 1) {
     $lbits=explode('_', $nlongs[0]);
     $factor=1.0;
     $longis=0.0;
     for ($ii=0; $ii<sizeof($lbits); $ii++) {
      $longis += ($lbits[$ii] / ($factor));
      $factor *= 60.0;
     }
   } else {
     $lbits=explode('_', explode('_W_', $rest)[0]);
     $factor=-1.0;
     $longis=0.0;
     for ($ii=0; $ii<sizeof($lbits); $ii++) {
      $longis += ($lbits[$ii] / ($factor));
      $factor *= 60.0;
     }
   }
 //file_put_contents('wurl.was0000000', $bckidea);

 
   if ($i < 7 || 1 == 1) {
 //file_put_contents('wurl.was5', $titleis);
     $junk .= $delm . str_replace("%2B","%20",str_replace("+","%20",urlencode($titleis))) . $suffix;
     //$areg .= $delm . "http." . str_replace("%2B","%20",str_replace("+","%20",urlencode($titleis))) . $suffix;
 //file_put_contents('wurl.was6', $tv);
     //if (($tv != "" && strpos((isset($_GET['url']) ? $_GET['url'] : ''), "olcanoes") === false) || strpos((isset($_GET['url']) ? $_GET['url'] : ''), "Japan") !== false || strpos((isset($_GET['url']) ? $_GET['url'] : ''), "Australia") !== false) { // || strpos((isset($_GET['url']) ? $_GET['url'] : ''), "olcanoes") !== false) {
     if ($tv != "" || strpos((isset($_GET['url']) ? $_GET['url'] : ''), "Japan") !== false || strpos((isset($_GET['url']) ? $_GET['url'] : ''), "Australia") !== false || strpos((isset($_GET['url']) ? $_GET['url'] : ''), "olcanoes") !== false) {
 //file_put_contents('wurl.was66', $junk);
     $areg .= $delm . "hTtP." . str_replace("%2B","_",str_replace("+","_",urlencode($titleis))) . $suffix;
 //file_put_contents('wurl.was666', $areg);
     } else {
     $areg .= $delm . "http." . str_replace("%2B","_",str_replace("+","_",urlencode($titleis))) . $suffix;
     }
     if (($i + 1) < sizeof($dataarray)) {
 //file_put_contents('wurl.was77', $titleis . ' ' . $altf . ' ' . sizeof($dataarray) . ' with ' . $i . ' next ' . $dataarray[$i + 1]);
     }
     //$datais .= str_replace('333333333','33',str_replace('666666667','67',", [" . str_replace("+","",$latis) . "," . str_replace("+","",$longis) . ",~" . str_replace('"','`',str_replace("'","`",str_replace(" ","%20",str_replace("%2B","%20",str_replace("+","%20",urldecode($titleis)))))) . "~]"));
     $datais .= ", [" . str_replace("+","",$latis) . "," . str_replace("+","",$longis) . ",~" . str_replace('"','`',str_replace("'","`",str_replace(" ","%20",str_replace("%2B","%20",str_replace("+","%20",urldecode($titleis)))))) . "~]";
 //file_put_contents('wurl.was777', $datais);
     $delm=",";
     $lasttitleis=$titleis;
   }
   }
 }

//echo "001:" . $datais;
//exit;
//bad <input type=hidden name=data value=' [-25.37|-129.27|~Adams%20Seamount~,2], [35.08|-12.55|~Ampere%20Seamount~,2], [45.55|-130|~Axial%20Seamount~,2], [3.138|125.491|~Banua%20Wuhu~,2], [39.92|-67.4|~Bear%20Seamount~,2], [-25.1833333333|-129.383333333|~Bounty%20Seamount~,2], [53.3|-135.63|~Bowie%20Seamount~,2], [38.23|-26.63|~Dom%20Jo%C3%A3o%20de%20Castro%20Bank~,2], [-6.62|124.22|~Emperor%20of%20China~,2], [-34.98|-179|~Healy~,2], [38.48|-63.59|~Kelvin%20Seamount~,2], [12.3|-61.64|~Kick%20%27em%20Jenny~,2], [-16.85|168.52|~Kuwae~,2], [18.92|-155.27|~Loihi%20Seamount~,2], [39.25|14.3944444444|~Marsili~,2], [37.6|-25.88|~Monaco%20Bank~,2], [-25.887|-177.188|~Monowai%20Seamount~,2], [-13.225|96.125|~Muirfield%20Seamount~,2], [-6.6|124.675|~Nieuwerkerk~,2], [-62.433334|-58.400002|~Orca%20Seamount~,2], [-35.5|178.9|~Rumble%20I~,2], [-35.4|178.6|~Rumble%20II~,2], [-35.745|178.478|~Rumble%20III~,2], [-36.13|178.05|~Rumble%20IV~,2], [-36.139|178.197|~Rumble%20V~,2], [3.97|124.17|~Submarine%201922~,2], [20.13|145.1|~Supply%20Reef~,2], [20.13|125.3375|~Taney%20Seamounts~,2], [36.6882|-130.9|~Tuzo%20Wilson%20Seamounts~,2], [39.86|12.59|~Vavilov%20%28Mediterranean%20Sea%29~,2], [20.33|121.75|~Unnamed%20volcano%20%28Ibugos%29~,2], [-7.53|123.95|~Yersey~,2], [-15.1|-173.75|~West%20Mata~,2]'></input>
//ok  <input type=hidden name=data value=' [13.59|-89.834|~Acajutla~,2], [12.483|-87.183|~Corinto~,2], [8.967|-79.55|~Panama%20City%252C%20Panama~,2], [9.967|-84.833|~Puntarenas~,2], [8.65|-83.15|~Golfito~,2], [61.238|-149.895|~Anchorage~,2], [33.74|-118.21|~Long%20Beach~,2], [33.777|-118.241|~Los%20Angeles~,2], [37.822|-122.308|~Oakland~,2], [45.479|-122.665|~Portland~,2], [32.708|-117.178|~San%20Diego~,2], [37.807|-122.399|~San%20Francisco~,2], [47.588|-122.359|~Seattle~,2], [47.29|-122.452|~Tacoma~,2], [61.125|-146.346|~Valdez~,2], [60.748|-151.314|~Nikiski~,2], [58.351|-134.512|~Juneau~,2], [55.348|-131.664|~Ketchikan~,2], [54.312|-130.327|~Prince%20Rupert%20Harbour~,2], [49.292|-123.127|~Coal%20Harbour~,2], [49.277|-123.121|~Vancouver~,2], [49.234|-124.805|~Port%20Alberni~,2], [49.207|-122.911|~Fraser%20River~,2], [49.183|-123.983|~Nanaimo~,2], [49.167|-123.133|~North%20Fraser~,2], [49.019|-123.16|~Roberts%20Bank%20Superport~,2], [33.777|-118.241|~Los%20Angeles~,2], [46.06|-122.57|~Longview~,2], [37.505|-122.214|~Redwood%20City~,2], [37.924|-122.374|~Richmond~,2], [38.113|-122.236|~Vallejo~,2], [48.75|-122.475|~Bellingham~,2], [47.985|-122.229|~Everett~,2], [48.496|-122.6|~Anacortes~,2], [48.131|-123.453|~Port%20Angeles~,2], [47.57|-122.653|~Bremerton~,2], [47.068|-122.909|~Olympia~,2], [46.904|-124.176|~Grays%20Harbor~,2], [46.02|-122.863|~Kalama~,2], [45.622|-122.681|~Vancouver%252C%20Washington~,2], [46.189|-123.821|~Astoria~,2], [43.364|-124.21|~Coos%20Bay~,2], [40.79|-124.163|~Eureka~,2], [31.783|-116.6|~Ensenada~,2], [20.667|-105.833|~Puerto%20Vallarta~,2], [18.92|-103.88|~Manzanillo~,2], [14.717|-92.417|~Puerto%20Madero~,2]'></input>
 //file_put_contents('wurl.was1', $title);
  
 $htmlis="<!doctype html>
<html>
<head>
<title>" . $title . " - RJM Programming - October, 2018 - Thanks to " . $url . "</title>
<meta charset='UTF-8'/>
<style>
 #tdnmap #nmap { width: 450px; }
 #tdgmap #gmap { calc(100% - 450px); }
</style>
<script type='text/javascript'>
  var nohselo='" .  $nohselo . "';
  var hselo='" .  $hselo . "';
  var hnoselo='" .  $hnoselo . "';
  var htitle=('" .  $hnoselo . "').split('/')[eval(-1 + ('" .  $hnoselo . "').split('/').length)].split('?isocode=')[0].split('?')[0].split('#')[0].replace(/\_/g,' ');
  function predowh() {
    var one=1, ii, jj=0;
    while (document.getElementById('o' + one)) {
      one++;
    }
    jj=one;
    //alert(one);
    for (ii=1; ii<one; ii++) {
      document.getElementById('selo').innerHTML+=document.getElementById('o' + ii).outerHTML.replace('o' + ii, 'o' + eval(-1 + ii + one)).replace('\" value=', ' \" value=').replace('\">', '#\">').replace('</option>', ' - Fast Text Only</option>');
      jj++;
    }
    if (nohselo != '') {
      if (document.getElementById('selo').innerHTML.indexOf(hnoselo) == -1) {
      if (nohselo.indexOf(hselo) != -1) {
        document.getElementById('selo').innerHTML+=\"<option id=o\" + jj + \" title='\" + htitle + \"' value='\" + hnoselo + \"'>\" + htitle + \"</option>\";
        jj++;
        document.getElementById('selo').innerHTML+=\"<option id=o\" + jj + \" title='\" + htitle + \" ' value='\" + nohselo + \"'>\" + htitle + \" - Fast Text Only</option>\";
        jj++;
      } else {
        document.getElementById('selo').innerHTML+=\"<option id=o\" + jj + \" title='\" + htitle + \"' value='\" + hnoselo + \"'>\" + htitle + \"</option>\";
        jj++;
        document.getElementById('selo').innerHTML+=\"<option id=o\" + jj + \" title='\" + htitle + \" ' value='\" + hselo + \"'>\" + htitle + \" - Fast Text Only</option>\";
        jj++;
      }
      }
    }
    document.getElementById('selo').innerHTML+=\"<option id=o\" + jj + \" title='Your Own' value=''>Your Own Wikipedia Geodata URL</option>\";
  }
  function dowh() {
    var rwis=document.body.getBoundingClientRect();
    var wis=Math.floor(eval(rwis.right) - eval(rwis.left) - 450);
    document.getElementById('height').value='' + Math.floor(eval('312.0') * eval(('' + wis).replace('px','')) / eval('500.0'));
    document.getElementById('width').value='' + Math.floor(eval('500.0') * eval(('' + wis).replace('px','')) / eval('500.0'));
    document.getElementById('gmap').style.width='' + document.getElementById('width').value + 'px';
    document.getElementById('tdgmap').style.width='' + document.getElementById('width').value + 'px';
    document.getElementById('tdmiddle').scrollIntoView(); // location.href='#tdmiddle'; //'#tab';
  }
  
  function setup(osel) {
    var one=1, tp='', oselvalue=osel.value;
    if (osel.value == '') {
    var proposed=prompt('Enter suitable geodata Wikipedia URL ... optionally append by ?isocode=[ISO2LetterCountryCode] for zoomed in look ... and optionally last append # for Fast Text Only mode eg. http://en.wikipedia.org/wiki/List_of_islands_of_Argentina?isocode=AR#', 'http://en.wikipedia.org/wiki/List_of_{concept}_of_{Region}');
    if (proposed != null) {
      if (proposed != '') {
        if (proposed.indexOf('{') == -1) {
          oselvalue=proposed.replace(/http\:/g,'').replace(/https\:/g,'');
          tp=oselvalue.split('#')[0].split('?')[0].split('/')[eval(-1 + oselvalue.split('#')[0].split('?')[0].split('/').length)].replace(/\_/g,' ');
          if (oselvalue.indexOf('#') != -1) { tp=tp + ' '; }
        }
      }
    }
    } else {
    while (document.getElementById('o' + one)) {
      if (document.getElementById('o' + one).value == osel.value) {
        tp=document.getElementById('o' + one).title;
      }
      one++;
    }
    }
    if (oselvalue != '') {
    location.href=document.URL.split('#')[0].split('?')[0] + '?url=' + encodeURIComponent(oselvalue) + '&titleplus=' + encodeURIComponent(tp);
    }
  }
</script>
</head>
<body onload=\" predowh(); " . $selo . $postselo . " dowh(); document.getElementById('isubmit').click(); document.body.style.cursor='progress'; setTimeout(function(){ document.getElementById('jsubmit').click(); }, 20000); \">
<select " . $selt . "style='" . $bckidea . "max-width:90%;font-size:52px;font-weight:bold;' id=selo onchange='setup(this);'><option id=o1 title='Meteorite| Crater|s on Earth' value='//en.wikipedia.org/wiki/List_of_impact_craters_on_Earth'>Meteorite Craters on Earth</option><option id=o2 title='List of lighthouses in South Africa' value='//en.wikipedia.org/wiki/List_of_lighthouses_in_South_Africa'>Lighthouses in South Africa</option><option id=o3 title='Airports in Japan' value='//en.wikipedia.org/wiki/List_of_airports_in_Japan'>Airports in Japan</option><option id=o4 title='List of Dams in Eastern Australia' value='//en.wikipedia.org/wiki/List_of_dams_and_reservoirs_in_Australia'>Dams in Eastern Australia</option><option id=o5 title='Mountains in Turkey' value='//en.wikipedia.org/wiki/List_of_mountains_in_Turkey'>Mountains in Turkey</option><option id=o6 title='Ports and Harbours of NE Pacific Ocean' value='//en.wikipedia.org/wiki/List_of_ports_and_harbors_of_the_Pacific_Ocean'>Ports and Harbours of NE Pacific Ocean</option><option id=o7 title='Submarine Volcanoes on Earth' value='//en.wikipedia.org/wiki/List_of_submarine_volcanoes'>Submarine Volcanoes on Earth</option><option id=o8 title='Islands of the Philippines' value='//en.wikipedia.org/wiki/List_of_islands_of_the_Philippines'>Islands of the Philippines</option></select>
<h3>RJM Programming - October, 2018 - Thanks to <a target=_blank href='" . $url . "' title='" . $ltitle . "'>" . $ltitle . "</a></h3>
<form onsubmit=\"document.getElementById('tab').style.display='table'; document.getElementById('tdgmap').style.display='table-cell'; document.getElementById('gmap').style.display='inline-block'; return true;\" style='display:none;' target='gmap' method='POST' id='mygform' action='//www.rjmprogramming.com.au/PHP/" . $geo . "'>
<input type=hidden id=title name=title value='" . $title . "'></input>
<input type=hidden name=onclick value='y'></input>
<input type=hidden name=wouldlikeyoutoseekpermission value='y'></input>
<input type=hidden name=arexplaces value='y'></input>
<input type=hidden id=text name=text value='" . $tv . "'></input>
<input type=hidden id=region name=region value=''></input>
<input type=hidden id=aregeographicals name=aregeographicals value='" . $areg . "'></input>
<input type=hidden id=junk name=junk value='" . $junk . "'></input>
<input type=hidden id=country name=country value='Places'></input>
<input type=hidden id=popularity name=popularity value=''></input>
<input type=hidden id=population name=population value=''></input>
<input type=hidden id=area name=area value=''></input>
<input type=hidden id=width name=width value=\"500\"></input>
<input type=hidden id=height name=height value=\"312\"></input>
<input type=hidden name=data value='" . str_replace("]","," . $twobit . $addbit . "]",str_replace("]|","],",str_replace(",","|",substr($datais,1)))) . "'></input>
<input style=display:none; type='submit' id='jsubmit' value='Show'></input>
</form>
<form onsubmit=\"document.getElementById('tab').style.display='table'; document.getElementById('tdnmap').style.display='table-cell'; document.getElementById('nmap').style.display='inline-block'; return true;\" style='display:none;' target='nmap' method='POST' id='mynform' action='//www.rjmprogramming.com.au/PHP/Map/map.php'>
<input type=hidden id=title name=title value='" . $title . "'></input>
<input type=hidden name=onclick value='y'></input>
<input type=hidden name=wouldlikeyoutoseekpermission value='y'></input>
<input type=hidden id=label name=label value=\"['Lat',\"></input>
<input type=hidden id=value name=value value=\"'Lon','Name']\"></input>
<input type=hidden name=data value='" . $datais . "'></input>
<input style=display:none; type='submit' id='isubmit' value='Show'></input>
</form>
<table id='tab' style='display:none;width:100%;height:900px;'><tr><td id='tdgmap' style='display:none;height:900px;'>
<iframe onload=\"document.body.style.cursor='pointer';\" name='gmap' id='gmap' style='display:none;height:900px;' src='//www.rjmprogramming.com.au/About_Us.html'></iframe>
</td><td id=tdmiddle style=vertical-align:top;></td><a href='#selo' title='Other Wikipedia based options above'>&#128285;</a></td><td id='tdnmap' style='display:none;width:450px;width:100%;height:900px;'>
<iframe name='nmap' id='nmap' style='display:none;width:450px;height:900px;' src='//www.rjmprogramming.com.au/About_Us.html'></iframe>
</td></tr></table>
</body>
</html>
";
 
 
 
 echo $htmlis;
 
?>

 
