<?php
require_once('../Geographicals/place_latlong.php');
// Coriolis Force on Earth at Latitude calculation from RJM Programming  
// November 2013
// Thanks to:
//   http://www.msrc.sunysb.edu/~chang/atm205/Notes/Chapter_8_txtb.pdf
//   http://www.somas.stonybrook.edu/~chang/atm205/HWsolutions/Homework_7_sol.htm
//   http://homepage.ntu.edu.tw/~suizx/course/HS6053_9301/ch1.pdf

$zero = "0";
$disp = "none";
$ilatd = "<select onclick='ca();' id='latd'><option value='+27.9861'>+27.9861 Degrees</option>";
$ilatm = "<select onclick='ca();' id='latm'><option value='0.0'>Minutes</option>";
$ilats = "<select onclick='ca();' id='lats'><option value='0.0'>Seconds</option>";
$ilongd = "<select onclick='ca();' id='longd'><option value='+86.9230'>+86.9230 Degrees</option>";
$ilongm = "<select onclick='ca();' id='longm'><option value='0.0'>Minutes</option>";
$ilongs = "<select onclick='ca();' onchange='cha(this.value,this.id);' id='longs'><option value='0.0'>Seconds++</option><option onmouseover='cha(this.value,this.id);' value='-0.0'>Get Weather</option>";
$jlatd = "<select onclick='ca();' id='tald'><option value='+27.9861'>+27.9861 Degrees</option>";
$jlatm = "<select onclick='ca();' id='talm'><option value='0.0'>Minutes</option>";
$jlats = "<select onclick='ca();' id='tals'><option value='0.0'>Seconds</option>";
$jlongd = "<select onclick='ca();' id='gnold'><option value='+86.9230'>+86.9230 Degrees</option>";
$jlongm = "<select onclick='ca();' id='gnolm'><option value='0.0'>Minutes</option>";
$jlongs = "<select onclick='ca();' onchange='cha(this.value,this.id);' id='gnols'><option value='0.0'>Seconds++</option><option onmouseover='cha(this.value,this.id);' value='-0.0'>Get Weather</option>";
$exbit = "";
$ssplatd = "";
$ssplatm = "";
$ssplongd = "";
$ssplongm = "";

$fromselectedchangefrom = "youllneverfindthis";
$fromselectedchangeto = "youllneverfindthis";

$latxprefix = "";
$longxprefix = "";



exec("curl http://www.timeanddate.com/worldclock/sunearth.html > " . dirname(__FILE__) . "/sun_angle_data.txt");
if (!file_exists(dirname(__FILE__) . "/sun_angle_data.txt")) {
header("Location: http://www.rjmprogramming.com.au/NoWayJose/");
exit();
} else {
$fhuh = fopen(dirname(__FILE__) . "/sun_angle_data.txt", "r");
$cont = "";
$thing = "<h2>Position of the Sun</h2><p>On ";
while (($buffer = fgets($fhuh, 4096)) !== false) {
         $cont .= $buffer;
}
fclose($fhuh);
unlink(dirname(__FILE__) . "/sun_angle_data.txt");
$onp = strpos($cont, $thing);

if ($onp === false) {
header("Location: http://www.rjmprogramming.com.au/nowayjose/");
exit();
} else {
$rest = substr($cont, ($onp + strlen($thing)));
$restx = substr($cont, ($onp + strlen($thing)), 300);
if (strpos($restx, "South") !== false) $latxprefix = "-";
if (strpos($restx, "West") !== false) $longxprefix = "-";

$rest = str_replace("<", "&lt;", $rest);
$rest = str_replace(">", "&gt;", $rest);
$onp2 = strpos($rest, "UTC");
$onp3 = strpos($rest, "td class=r");
if ($onp2 === false || $onp3 == false) {
header("Location: http://www.rjmprogramming.com.au/no_way_jose/");
exit();
} else {
$todayis = substr($rest, 0, ($onp2 + 3));
//$todayis = $rest;
$rest = substr($rest, $onp3);
$onp3 = strpos($rest, "td class=r");
$iijj = strlen("td class=r") + 4;
$ssplatd = $latxprefix;
while (substr($rest, ($onp3 + $iijj), 1) == "-" || (substr($rest, ($onp3 + $iijj), 1) >= "0" && substr($rest, ($onp3 + $iijj), 1) <= "9")) {
  $ssplatd .= substr($rest, ($onp3 + $iijj), 1);
  $iijj += 1;
}
while (substr($rest, ($onp3 + $iijj), 1) < "0" || substr($rest, ($onp3 + $iijj), 1) > "9") {
  $iijj += 1;
}
while (substr($rest, ($onp3 + $iijj), 1) == "-" || (substr($rest, ($onp3 + $iijj), 1) >= "0" && substr($rest, ($onp3 + $iijj), 1) <= "9")) {
  $ssplatm .= substr($rest, ($onp3 + $iijj), 1);
  $iijj += 1;
}
$rest = substr($rest, ($onp3 + $iijj));
$onp3 = strpos($rest, "td class=r");
$iijj = strlen("td class=r") + 4;
$ssplongd = $longxprefix;
while (substr($rest, ($onp3 + $iijj), 1) == "-" || (substr($rest, ($onp3 + $iijj), 1) >= "0" && substr($rest, ($onp3 + $iijj), 1) <= "9")) {
  $ssplongd .= substr($rest, ($onp3 + $iijj), 1);
  $iijj += 1;
}
while (substr($rest, ($onp3 + $iijj), 1) < "0" || substr($rest, ($onp3 + $iijj), 1) > "9") {
  $iijj += 1;
}
while (substr($rest, ($onp3 + $iijj), 1) == "-" || (substr($rest, ($onp3 + $iijj), 1) >= "0" && substr($rest, ($onp3 + $iijj), 1) <= "9")) {
  $ssplongm .= substr($rest, ($onp3 + $iijj), 1);
  $iijj += 1;
}
}

}
}

$ssplats = "";
$ssplongs = "";
$pssplatd = "";
$pssplatm = "";
$pssplats = "";
$pssplongd = "";
$pssplongm = "";
$pssplongs = "";
if (isset($_GET['latd'])) $pssplatd = $_GET['latd'];
if (isset($_GET['latm'])) $pssplatm = $_GET['latm'];
if (isset($_GET['lats'])) $pssplats = $_GET['lats'];
if (isset($_GET['longd'])) $pssplongd = $_GET['longd'];
if (isset($_GET['longm'])) $pssplongm = $_GET['longm'];
if (isset($_GET['longs'])) $pssplongs = $_GET['longs'];
if (isset($_POST['latd'])) $pssplatd = $_POST['latd'];
if (isset($_POST['latm'])) $pssplatm = $_POST['latm'];
if (isset($_POST['lats'])) $pssplats = $_POST['lats'];
if (isset($_POST['longd'])) $pssplongd = $_POST['longd'];
if (isset($_POST['longm'])) $pssplongm = $_POST['longm'];
if (isset($_POST['longs'])) $pssplongs = $_POST['longs'];


if (isset($_GET['latd'])) {
  $fromselectedchangefrom = 'place=' . $_GET['place'] . '"';
  $fromselectedchangeto = $fromselectedchangefrom . ' selected="selected"';
} else if (isset($_POST['latd'])) {
  $fromselectedchangefrom = 'place=' . $_POST['place'] . '"';
  $fromselectedchangeto = $fromselectedchangefrom . ' selected="selected"';
}


echo '<html>';
echo '<head>';
echo '<title>Coriolis Force on Earth at Latitude and Longitude via RJM Programming</title>';
echo '<meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1" />';
echo "\n <style>";
echo "\n .groundnsky { ";
echo "\n height: 70px; ";
echo "\n width: 70px; ";
echo "\n -moz-border-radius: 35px; ";
echo "\n border-radius: 35px; ";
echo "\n } ";
//$todayis .= " lat " . $ssplatd . " " . $ssplatm . " long " . $ssplongd . " " . $ssplongm;

for ($ilat=-90; $ilat <= -1; $ilat++) {
   $pexbit = "";
   $exbit = "";
   if ("$pssplatd" == "$ilat") $pexbit = ' selected="selected"';
   $ilatd .= "<option value='" . $ilat . ".0'" . $pexbit . ">" . $ilat . "</option>";
   if ("$ssplatd" == "$ilat") $exbit = ' selected="selected"';
   $jlatd .= "<option value='" . $ilat . ".0'" . $exbit . ">" . $ilat . "</option>";
}
for ($ilat=0; $ilat <= 90; $ilat++) {
echo "\n #mydodah" . $ilat;
echo "\n { ";
 echo "transform: rotate(" . $ilat . "deg); \n";
 echo "-ms-transform: rotate(" . $ilat . "deg); /* IE 9 */ \n";
 echo "-webkit-transform: rotate(" . $ilat . "deg); /* Safari and Chrome */ \n";
echo "\n } ";

   $pexbit = "";
   $pexmbit = "";
   $pexsbit = "";
   $exbit = "";
   $exmbit = "";
   $exsbit = "";
   if ("$pssplatd" == "$ilat") $pexbit = ' selected="selected"';
   $ilatd .= "<option value='+" . $ilat . ".0'" . $pexbit . ">+" . $ilat . "</option>";
   if ("$ssplatd" == "$ilat") $exbit = ' selected="selected"';
   $jlatd .= "<option value='+" . $ilat . ".0'" . $exbit . ">+" . $ilat . "</option>";
   if ($ilat <= 59) {
    if ("$pssplatm" == "$ilat") $pexmbit = ' selected="selected"';
    if ("$pssplats" == "$ilat") $pexsbit = ' selected="selected"';
    $ilatm .= "<option value='" . $ilat . ".0'" . $pexmbit . ">" . $ilat . "</option>";
    $ilats .= "<option value='" . $ilat . ".0'" . $pexsbit . ">" . $ilat . "</option>";
    if ("$ssplatm" == "$ilat") $exmbit = ' selected="selected"';
    if ("$ssplats" == "$ilat") $exsbit = ' selected="selected"';
    $jlatm .= "<option value='" . $ilat . ".0'" . $exmbit . ">" . $ilat . "</option>";
    $jlats .= "<option value='" . $ilat . ".0'" . $exsbit . ">" . $ilat . "</option>";
   }
}
for ($ilong=-180; $ilong <= -1; $ilong++) {
   $pexbit = "";
   $exbit = "";
   if ("$pssplongd" == "$ilong") $pexbit = ' selected="selected"';
   $ilongd .= "<option value='" . $ilong . ".0'" . $pexbit . ">" . $ilong . "</option>";
   if ("$ssplongd" == "$ilong") $exbit = ' selected="selected"';
   $jlongd .= "<option value='" . $ilong . ".0'" . $exbit . ">" . $ilong . "</option>";
}
for ($ilong=0; $ilong <= 180; $ilong++) {
   $pexbit = "";
   $pexmbit = "";
   $pexsbit = "";
   $exbit = "";
   $exmbit = "";
   $exsbit = "";
   if ("$pssplongd" == "$ilong") $pexbit = ' selected="selected"';
   $ilongd .= "<option value='+" . $ilong . ".0'" . $pexbit . ">+" . $ilong . "</option>";
   if ("$ssplongd" == "$ilong") $exbit = ' selected="selected"';
   $jlongd .= "<option value='+" . $ilong . ".0'" . $exbit . ">+" . $ilong . "</option>";
   if ($ilong <= 59) {
    if ("$pssplongm" == "$ilong") $pexmbit = ' selected="selected"';
    if ("$pssplongs" == "$ilong") $pexsbit = ' selected="selected"';
    $ilongm .= "<option value='" . $ilong . ".0'" . $pexmbit . ">" . $ilong . "</option>";
    $ilongs .= "<option value='" . $ilong . ".0'" . $pexsbit . ">" . $ilong . "</option>";
    if ("$ssplongm" == "$ilong") $exmbit = ' selected="selected"';
    if ("$ssplongs" == "$ilong") $exsbit = ' selected="selected"';
    $jlongm .= "<option value='" . $ilong . ".0'" . $exmbit . ">" . $ilong . "</option>";
    $jlongs .= "<option value='" . $ilong . ".0'" . $exsbit . ">" . $ilong . "</option>";
   }
}
$ilatd .= "</select>";
$ilongd .= "</select>";
$ilatm .= "</select>";
$ilongm .= "</select>";
$ilats .= "</select>";
$ilongs .= "</select>";
$jlatd .= "</select>";
$jlongd .= "</select>";
$jlatm .= "</select>";
$jlongm .= "</select>";
$jlats .= "</select>";
$jlongs .= "</select>";
echo "\n </style>";

?>
<script>
function cha(iamvalue, iamid) {
  if (iamvalue.indexOf("-0") != -1) {
  var latd=document.getElementById("latd");
  var latm=document.getElementById("latm");
  var lats=document.getElementById("lats");
  var longd=document.getElementById("longd");
  var longm=document.getElementById("longm");
  var longs=document.getElementById("longs");
  
     if (iamid == "gnols") {
  latd=document.getElementById("tald");
  latm=document.getElementById("talm");
  lats=document.getElementById("tals");
  longd=document.getElementById("gnold");
  longm=document.getElementById("gnolm");
  longs=document.getElementById("gnols");
     }

  var latsign = "+";
  if (latd.value.replace("-", "") != latd.value) latsign = "-";
  var longsign = "+";
  if (longd.value.replace("-", "") != longd.value) longsign = "-";
  var alat = eval(latd.value);
  alat = Math.abs(alat);
  var alatsuffix = 0;
  var along = eval(longd.value);
  along = Math.abs(along);
  var alongsuffix = 0;
  if (latm.value != "0" || lats.value != "0") {
    alatsuffix = eval((latm.value) / 60.0);
    alatsuffix = eval(alatsuffix + (lats.value) / 3600.0);
  } else if (latd.value.replace(".", "") != latd.value) {
    alatsuffix = 0;
  }
  if (longm.value != "0" || longs.value != "0") {
    alongsuffix = eval((longm.value) / 60.0);
    alongsuffix = eval(alongsuffix + (longs.value) / 3600.0);
  } else if (longd.value.replace(".", "") != longd.value) {
    alongsuffix = 0;
  }
  
  var lata = eval(alatsuffix + alat);
  var latis=latsign + lata;
  var xlatis = latis.replace("-", "").replace("+", "");
  if (xlatis == latis) latis = "+" + latis;
  var longa = eval(alongsuffix + along);
  var longis=longsign + longa;
  var retis = ["", ""];

  // if (iamid == "gnols") {
      document.getElementById("weather").style.display = 'block';
      retis = find_nearest(latis, longis);
      //alert(retis[0] + " then " + retis[1]);
      document.getElementById("weather").src = retis[1] + "#ct_wxs";
  // } else if (iamid == "longs") {
  //    document.getElementById("weather").style.display = 'block';
  //    retis = find_nearest(latis, longis);
  //    document.getElementById("weather").src = retis[1];
  // }
  }
}

function ca() {
  var mya=document.getElementById("mya");
  mya.innerHTML = "Calculate Coriolis Force For";
  mya.style.borderColor = "red";
  mya.style.backgroundColor = "yellow";
}

function anothergo() {
  var latd=document.getElementById("latd");
  var latm=document.getElementById("latm");
  var lats=document.getElementById("lats");
  var longd=document.getElementById("longd");
  var longm=document.getElementById("longm");
  var longs=document.getElementById("longs");

  var tald=document.getElementById("tald");
  var talm=document.getElementById("talm");
  var tals=document.getElementById("tals");
  var gnold=document.getElementById("gnold");
  var gnolm=document.getElementById("gnolm");
  var gnols=document.getElementById("gnols");


  var latsign = "+";
  if (latd.value.replace("-", "") != latd.value) latsign = "-";
  var longsign = "+";
  if (longd.value.replace("-", "") != longd.value) longsign = "-";
  var alat = eval(latd.value);
  alat = Math.abs(alat);
  var alatsuffix = 0;
  var along = eval(longd.value);
  along = Math.abs(along);
  var alongsuffix = 0;
  if (latm.value != "0" || lats.value != "0") {
    alatsuffix = eval((latm.value) / 60.0);
    alatsuffix = eval(alatsuffix + (lats.value) / 3600.0);
  } else if (latd.value.replace(".", "") != latd.value) {
    alatsuffix = 0;
  }
  if (longm.value != "0" || longs.value != "0") {
    alongsuffix = eval((longm.value) / 60.0);
    alongsuffix = eval(alongsuffix + (longs.value) / 3600.0);
  } else if (longd.value.replace(".", "") != longd.value) {
    alongsuffix = 0;
  }
  
  var lata = eval(alatsuffix + alat);
  var latis=latsign + lata;
<?php
  if (!isset($_GET['done']) && !isset($_POST['done'])) echo 'latis=prompt("Please enter decimal degrees of Latitude 1", latsign + lata); ' . "\n";
?>

  var xlatis = latis.replace("-", "").replace("+", "");
  if (xlatis == latis) latis = "+" + latis;
  var longa = eval(alongsuffix + along);
  var longis=longsign + longa;
<?php
  if (!isset($_GET['done']) && !isset($_POST['done'])) echo 'longis=prompt("Please enter decimal degrees of Longitude 1", longsign + longa); ' . "\n";
?>
  var xlongis = longis.replace("-", "").replace("+", "");
  if (xlongis == longis) longis = "+" + longis;
  

  latsign = "+";
  if (tald.value.replace("-", "") != tald.value) latsign = "-";
  longsign = "+";
  if (gnold.value.replace("-", "") != gnold.value) longsign = "-";
  alat = eval(tald.value);
  
  var cfactor = 0.0; 
  var dirc = " deflection from &rightarrow; West to &rightarrow; East for each ms<sup>-1</sup> of Southerly &uparrow; wind";
  if (latis < 0) {
    dirc = " deflection to &leftarrow; West from &leftarrow; East for each ms<sup>-1</sup> of Southerly &uparrow; wind";
  }
  cfactor = 0.0001458 * eval(Math.sin(latis * Math.PI / 180.0));
  //alert(cfactor);
  
  alat = Math.abs(alat);
  alatsuffix = 0;
  along = eval(gnold.value);
  along = Math.abs(along);
  alongsuffix = 0;
  if (talm.value != "0" || tals.value != "0") {
    alatsuffix = eval((talm.value) / 60.0);
    alatsuffix = eval(alatsuffix + (tals.value) / 3600.0);
  } else if (tald.value.replace(".", "") != tald.value) {
    alatsuffix = 0;
  }
  if (gnolm.value != "0" || gnols.value != "0") {
    alongsuffix = eval((gnolm.value) / 60.0);
    alongsuffix = eval(alongsuffix + (gnols.value) / 3600.0);
  } else if (gnold.value.replace(".", "") != gnold.value) {
    alongsuffix = 0;
  }
  
  var tala = eval(alatsuffix + alat);
  var talis=latsign + tala; // prompt("Please enter decimal degrees of Latitude 2", latsign + tala);
  var xtalis = talis.replace("-", "").replace("+", "");
  if (xtalis == talis) talis = "+" + talis;
  var gnola = eval(alongsuffix + along);
  var gnolis=longsign + gnola;  //prompt("Please enter decimal degrees of Longitude 2", longsign + gnola);
  var xgnolis = gnolis.replace("-", "").replace("+", "");
  if (xgnolis == gnolis) gnolis = "+" + gnolis;
  
  var zenith_angle = 0.0;
  if ((talis >= 0.0 && latis >= 0.0) || (talis <= 0.0 && latis <= 0.0) || 1 == 1) {
    zenith_angle = eval((latis)-(talis));
  } else {
    zenith_angle = eval((latis)+(talis));
  }
  var ourang = 90.0 - Math.abs(zenith_angle);
  if (ourang < 0) ourang = 0;
  
  var osg = document.getElementById("sandg");
  osg.style.display = 'block';
  var omyh2 = document.getElementById("mydodah");
  omyh2.style.display = 'block';
  var xourang = ourang.toString();
  var ipf=xourang.indexOf(".");
  var pourang = xourang;
  if (ipf != -1) {
   pourang = xourang.substring(0, ipf);
   pourang = pourang.replace(".", "");
   omyh2.innerHTML = '<div id="mydodah' + pourang + '" style="height:100px; width: 100px;"><h2 class="groundnsky" style="color: yellow;" id="myh2">----&gt;<br>----&gt;<br>----&gt;</h2></div>';
   xourang = xourang.substring(0, (ipf + 2));
  } else {
   omyh2.innerHTML = '<div id="mydodah' + ourang + '" style="height:100px; width: 100px;"><h2 class="groundnsky" style="color: yellow;" id="myh2">----&gt;<br>----&gt;<br>----&gt;</h2></div>';
  }
  var mya=document.getElementById("mya");
  var tis=document.getElementById("todayis");
<?php
  if (isset($_GET['place'])) {
  echo "\n" . ' mya.innerHTML = "Earth Coriolis Force for ' . $_GET['place'] . ' in ' . $_GET['country'] . ' represents a " + Math.abs(cfactor.toPrecision(3)).toExponential() + " ms<sup>-2</sup> " + dirc; ';
  } else if (isset($_POST['place'])) {
  echo "\n" . ' mya.innerHTML = "Earth Coriolis Force for ' . $_POST['place'] . ' in ' . $_POST['country'] . ' represents a " + Math.abs(cfactor.toPrecision(3)).toExponential() + " ms<sup>-2</sup>  " + dirc; ';
  } else {
  echo "\n" . ' mya.innerHTML = "Earth Coriolis Force for Latitude,Longitude below represents a " + Math.abs(cfactor.toPrecision(3)).toExponential() + " ms<sup>-2</sup>  " + dirc; ';
  }
  if (isset($_GET['place'])) {
  echo "\n" . ' myb.innerHTML = "Earth Noon Sun Angle on ' . substr($todayis,0,(strlen($todayis) - 15)) . ' for ' . $_GET['place'] . ' in ' . $_GET['country'] . ' is " + xourang + " degrees"; ';
  } else if (isset($_POST['place'])) {
  echo "\n" . ' myb.innerHTML = "Earth Noon Sun Angle on ' . substr($todayis,0,(strlen($todayis) - 15)) . ' for ' . $_POST['place'] . ' in ' . $_POST['country'] . ' is " + xourang + " degrees"; ';
  } else {
  echo "\n" . ' myb.innerHTML = "Earth Noon Sun Angle on ' . substr($todayis,0,(strlen($todayis) - 15)) . ' for Latitude,Longitude below is " + xourang + " degrees"; ';
  }
  echo "\n" . " tis.style.display = 'none'; ";
?>

  var oif=document.getElementById("oif");
  var latbitmore = "";
  var longbitmore = "";
  if (xlatis.replace(".", "") == xlatis) latbitmore = ".0";
  if (xlongis.replace(".", "") == xlongis) longbitmore = ".0";
  //alert("https://maps.google.com/maps?saddr=" + latis + "," + longis + "&daddr=" + talis + "," + gnolis);
  //oif.innerHTML = '<iframe width="940px;" height="550px;" id="if" src="' + "https://maps.google.com/maps?saddr=" + latis + "," + longis + "&daddr=" + talis + "," + gnolis + '" title="Thanks Google Maps"></iframe>';
  if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { // thanks to https://gearside.com/easily-link-to-locations-and-directions-using-the-new-google-maps/
  window.open("https://www.google.com/maps/dir/" + latis + "," + longis + "/" + latis + "," + eval(0.001 + longis), "_blank", "left=120,top=330,width=830,height=430");
  } else {
  window.open("https://maps.google.com/maps?saddr=" + latis + "," + longis + "&daddr=" + talis + "," + gnolis, "_blank", "left=120,top=330,width=830,height=430");
  }
}

</script>

</head>
<body>
<table style="background-color: lightblue;">
<tr><td style="border: solid 3px green; padding: 3px 3px 3px 3px;">
<p id="todayis"><?php echo "At ... "; ?></p><a id='mya' style="border: solid 2px white; padding: 2px 2px 2px 2px;" onclick='anothergo();' title='Another Coriolis Force calculation?' href='#'>Another Coriolis Force calculation?  </a><br><p id='myb'></p>
<hr></hr> Latitude 1: <?php echo $ilatd; ?><?php echo $ilatm; ?><?php echo $ilats; ?> Longitude 1: <?php echo $ilongd; ?></select><?php echo $ilongm; ?><?php echo $ilongs; ?>&nbsp;&nbsp;<a href='#' onclick='cha("-0", "longs");' onmouseover='cha("-0", "longs");'><img style='height: 20px; width: 20px;' src='weather.jpg' alt='weather' title='Get weather' /></a>&nbsp;&nbsp;<?php echo str_replace($fromselectedchangefrom, $fromselectedchangeto, str_replace("&xxlat", "&fromlat", str_replace("&xxlong", "&fromlong", str_replace("?latd=", "?done=y&latd=", str_replace("?xxlong", "?xxfromlong", str_replace("&xxplace", "&fromplace", geography_dropdowns(-2))))))); ?> 
<div id='subsolar_point' style='display:none;'><br> Latitude 2: <?php echo $jlatd; ?><?php echo $jlatm; ?><?php echo $jlats; ?> Longitude 2: <?php echo $jlongd; ?></select><?php echo $jlongm; ?><?php echo $jlongs; ?></div>
</td></tr><tr><td id="oif">
</td></tr></table>
<table><tr><td>
<div class="groundnsky" id="sandg" style="background-color: orange; display: none;"></div>
<div id="mydodah" style="background-color: ochre; display: none; height:100px; width: 100px; border-bottom: 5px solid green; ">
</div>
</td><td>
<?php
if (isset($_GET['latd']) || isset($_POST['latd'])) echo "\n<script> anothergo(); </script>\n";
echo '<iframe id="weather" style="background-color: lightgray; display: none; height: 460px; width: 500px;" src="javascript: false;"></iframe>';
?>
</td></tr></table>
</body>
</html>
