<!doctype html>
<html>
<head>
<title>Missing Two - RJM Programming - December, 2018 ... Thanks to https://www.igismap.com/formula-to-find-bearing-or-heading-angle-between-two-points-latitude-longitude/</title>
<script type='text/javascript'>
var eles=['latf','longf','brg','dist','latt','longt'];
var cwhat=[false,false,false,false,true,true];
var decided=false;
var isokformore='';
var jsokformore='';
var trid='trgraphics';
var elev=2.0;
var dok=true;
var viastart=false;
var gllentry='';
var gllonesuffix='f';
var faux=false;
var cfok=true;
var lastclick='';
var fplacen=location.search.split('fplacen=')[1] ? (' ' + decodeURIComponent(location.search.split('fplacen=')[1].split('&')[0]).replace(/\+/g,' ')) : '';
var tplacen=location.search.split('tplacen=')[1] ? (' ' + decodeURIComponent(location.search.split('tplacen=')[1].split('&')[0]).replace(/\+/g,' ')) : '';
var tdid='tdfrom';
var divid='dfrom';
var gc='//www.rjmprogramming.com.au/PHP/GeoChart/geo_chart.php?title=Earth%20Places&aregexographicals=y&aregeographicals=HTTP.From%2Chttp.To' +
'&peninfo=latfrom|longfrom|127968_From,latto|longto|128205_To,nearestlat|nearestlong|nearestplace' +
'&width=417&height=260&country=Places&popularity=' +
'&data=%20[latfrom|longfrom|~From~,2]%20,%20[latto|longto|~To~,2]%20,%20[nearestlat|nearestlong|~nearestplace~,2]';
var mu="//www.rjmprogramming.com.au/PHP/Map/map.php?title=London&onclick=y&label=['Lat',&value='Lon','Name']&data=,[51.5072,-0.1275,~London~]";
var tpurl="https://www.google.com/maps/dir/Sydney+NSW,+Australia/Brisbane+QLD,+Australia";
var origtpurl=tpurl;
function great_circle_distance(talis, gnolis, latis, longis) {
var ourdist=0.0;
var rgnol=eval((gnolis) * Math.PI / 180.0);
var rtal=eval((talis) * Math.PI / 180.0);
var rlong=eval((longis) * Math.PI / 180.0);
var rlat=eval((latis) * Math.PI / 180.0);
var deltalong = Math.abs(eval(((gnolis)-(longis)) * Math.PI / 180.0));
var acof = eval(Math.sin(rtal) * Math.sin(rlat)) + (Math.cos(rtal) * Math.cos(rlat) * Math.cos(deltalong)); // via http://en.wikipedia.org/wiki/Great-circle_distance ... thanks
ourdist = eval(Math.round((Math.acos(acof) * 6371000.0) + 0.00001) * 100) / 100;
return ourdist;
}
function nextplease() {
var i;
console.log('nextplease 1');
if ((isokformore + jsokformore) != '' && 1 == 1) {
console.log('nextplease 11');
if (1 == 1) {
window.open(document.URL.split('?')[0].split('?')[0], '_blank');
} else {
document.getElementById('outofthisworld').value='slong';
window.scrollTo(0,0); //location.href='#dtop';
}
} else {
console.log('nextplease 111');
for (i=0; i<eles.length; i++) {
document.getElementById(eles[i]).value='0.0000000';
document.getElementById(eles[i]).style.backgroundColor='white';
}
eles=['latf','longf','brg','dist','latt','longt'];
cwhat=[false,false,false,false,true,true];
decided=false;
}
console.log('nextplease 2');
}
function calcit() {
var i, ourbrg=0.0, ourdist=0.0, j;
if (jsokformore != '') {
document.getElementById('latf').type='text';
document.getElementById('longf').type='text';
document.getElementById('latt').type='text';
document.getElementById('longt').type='text';
document.getElementById('brg').type='text';
document.getElementById('dist').type='text';
} else {
if ((isokformore + jsokformore) != '') {
document.getElementById('outofthisworld').value='ifill';
} else {
if (!cwhat[0] && !cwhat[1] && !cwhat[2] && !cwhat[3] && !cwhat[4] && !cwhat[5]) {
if (Math.abs(eval('' + document.getElementById(eles[4]).value)) < 0.00000004 && Math.abs(eval('' + document.getElementById(eles[5]).value)) < 0.00000004) {
cwhat[4]=true;
cwhat[5]=true;
} else if (Math.abs(eval('' + document.getElementById(eles[2]).value)) < 0.00000004 && Math.abs(eval('' + document.getElementById(eles[3]).value)) < 0.00000004) {
cwhat[2]=true;
cwhat[3]=true;
}
}
//alert(('' + cwhat[0]) + ('' + cwhat[1]) + ('' + cwhat[2]) + ('' + cwhat[3]) + ('' + cwhat[4]) + ('' + cwhat[5]));
if (jsokformore != '' || (cwhat[0] && cwhat[1] || (!cwhat[0] && !cwhat[1] && !cwhat[2] && !cwhat[3] && !cwhat[4] && !cwhat[5]))) {
isokformore=' ';
if (('' + document.getElementById('mysel').value) == '1') {
ourbrg=eval(eval(540.0 + 180.0 + eval('' + document.getElementById(eles[2]).value)) % 360.0);
} else {
ourbrg=eval('' + document.getElementById(eles[2]).value);
}
for (j=eval(('' + document.getElementById('mysel').value)); j>=1; j--) {
ourdist=eval('' + document.getElementById(eles[3]).value);
document.getElementById(eles[0]).value='' +
eval(eval(eval(180.0 / Math.PI) * Math.asin(
eval(eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value))) *
eval('' + Math.cos(eval(eval('' + ourdist) / 6371000.0)))) +
eval(eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value))) *
eval('' + Math.sin(eval(eval('' + ourdist) / 6371000.0))) *
eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + ourbrg)))))));
document.getElementById(eles[1]).value=eval(eval(180.0 / Math.PI) * eval(eval(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[5]).value)) +
Math.atan2(
eval(eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + ourbrg)) *
eval('' + Math.sin(eval(eval('' + ourdist) / 6371000.0)))) *
eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value)))),
eval(eval('' + Math.cos(eval(eval('' + ourdist) / 6371000.0))) -
eval(eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value)))) *
eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value)))))));
if (document.getElementById(eles[0]).value.indexOf('e-') != -1) { document.getElementById(eles[0]).value='0.0000000'; }
if (document.getElementById(eles[1]).value.indexOf('e-') != -1) { document.getElementById(eles[1]).value='0.0000000'; }
if (j != 1) {
ourbrg=eval(eval(360.0 + eval(eval(eval(180.0 / Math.PI) * Math.atan2(
eval(eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value))) *
eval('' + Math.sin(eval(Math.PI / 180.0) * eval(eval('' + document.getElementById(eles[5]).value) - eval('' + document.getElementById(eles[1]).value))))),
eval(eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value))) *
eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value)))) -
eval(eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value))) *
eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value))) *
eval('' + Math.cos(eval(Math.PI / 180.0) * eval(eval('' + document.getElementById(eles[5]).value) - eval('' + document.getElementById(eles[1]).value)))))
)))) % 360.0);
//ourbrg=eval(eval(540.0 + eval('' + document.getElementById(eles[2]).value)) % 360.0);
document.getElementById(eles[2]).value='' + ourbrg;
document.getElementById('mysel').value='1';
//alert(ourbrg);
}
}
document.getElementById(eles[0]).style.backgroundColor='lightgreen';
document.getElementById(eles[1]).style.backgroundColor='lightgreen';
document.getElementById('goagain').style.display='block'; // setTimeout(nextplease,10000);
} else if (cwhat[2] && cwhat[3]) {
isokformore=' ';
ourdist=great_circle_distance(document.getElementById(eles[0]).value,document.getElementById(eles[1]).value,document.getElementById(eles[4]).value,document.getElementById(eles[5]).value);
document.getElementById(eles[3]).value='' + ourdist;
//Let ‘R’ be the radius of Earth,
//‘L’ be the longitude,
//‘θ’ be latitude,
//‘β‘ be Bearing.
//Bearing from point A to B, can be calculated as,
//β = atan2(X,Y),
//where, X and Y are two quantities and can be calculated as:
//X = cos θb * sin ∆L
//Y = cos θa * sin θb – sin θa * cos θb * cos ∆L
ourbrg=eval(eval(360.0 + eval(eval(eval(180.0 / Math.PI) * Math.atan2(
eval(eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value))) *
eval('' + Math.sin(eval(Math.PI / 180.0) * eval(eval('' + document.getElementById(eles[5]).value) - eval('' + document.getElementById(eles[1]).value))))),
eval(eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value))) *
eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value)))) -
eval(eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value))) *
eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value))) *
eval('' + Math.cos(eval(Math.PI / 180.0) * eval(eval('' + document.getElementById(eles[5]).value) - eval('' + document.getElementById(eles[1]).value)))))
)))) % 360.0);
document.getElementById('mysel').value='2';
document.getElementById(eles[2]).value='' + ourbrg;
document.getElementById(eles[2]).style.backgroundColor='lightgreen';
document.getElementById(eles[3]).style.backgroundColor='lightgreen';
document.getElementById('goagain').style.display='block'; // setTimeout(nextplease,10000);
} else if (cwhat[4] && cwhat[5]) {
isokformore=' ';
if (('' + document.getElementById('mysel').value) == '2') {
ourbrg=eval(eval(540.0 + 180.0 + eval('' + document.getElementById(eles[2]).value)) % 360.0);
} else {
ourbrg=eval('' + document.getElementById(eles[2]).value);
}
for (j=eval(3 - eval(('' + document.getElementById('mysel').value))); j>=1; j--) {
ourdist=eval('' + document.getElementById(eles[3]).value);
//Let first point latitude be la1,
///longitude as lo1,
//d be distance,
//R as radius of Earth,
//Ad be the angular distance i.e d/R and
//θ be the bearing,
//Here is the formula to find the second point, when first point, bearing and distance is known:
//latitude of second point = la2 = asin(sin la1 * cos Ad + cos la1 * sin Ad * cos θ), and
//longitude of second point = lo2 = lo1 + atan2(sin θ * sin Ad * cos la1 , cos Ad – sin la1 * sin la2)
document.getElementById(eles[4]).value='' +
eval(eval(eval(180.0 / Math.PI) * Math.asin(
Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value)) *
Math.cos(eval(eval('' + ourdist) / 6371000.0)) +
Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value)) *
Math.sin(eval(eval('' + ourdist) / 6371000.0)) *
Math.cos(eval(Math.PI / 180.0) * eval('' + ourbrg)))));
//Let first point latitude be la1,
//longitude as lo1,
//d be distance,
//R as radius of Earth,
//Ad be the angular distance i.e d/R and
//θ be the bearing,
// longitude of second point = lo2 = lo1 + atan2(sin θ * sin Ad * cos la1 , cos Ad – sin la1 * sin la2)
document.getElementById(eles[5]).value=eval(eval(180.0 / Math.PI) * eval(eval(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[1]).value)) +
Math.atan2(
eval(eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + ourbrg)) *
eval('' + Math.sin(eval(eval('' + ourdist) / 6371000.0)))) *
eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value)))),
eval(eval('' + Math.cos(eval(eval('' + ourdist) / 6371000.0))) -
eval(eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value)))) *
eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value)))))));
if (j != 1) {
ourbrg=eval(eval(360.0 + eval(eval(eval(180.0 / Math.PI) * Math.atan2(
eval(eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value))) *
eval('' + Math.sin(eval(Math.PI / 180.0) * eval(eval('' + document.getElementById(eles[1]).value) - eval('' + document.getElementById(eles[5]).value))))),
eval(eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value))) *
eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value)))) -
eval(eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value))) *
eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value))) *
eval('' + Math.cos(eval(Math.PI / 180.0) * eval(eval('' + document.getElementById(eles[1]).value) - eval('' + document.getElementById(eles[5]).value)))))
)))) % 360.0);
//ourbrg=eval(eval(540.0 + eval('' + document.getElementById(eles[2]).value)) % 360.0);
document.getElementById(eles[2]).value='' + ourbrg;
document.getElementById('mysel').value='2';
//alert(ourbrg);
}
}
if (document.getElementById(eles[4]).value.indexOf('e-') != -1) { document.getElementById(eles[4]).value='0.0000000'; }
if (document.getElementById(eles[5]).value.indexOf('e-') != -1) { document.getElementById(eles[5]).value='0.0000000'; }
document.getElementById(eles[4]).style.backgroundColor='lightgreen';
document.getElementById(eles[5]).style.backgroundColor='lightgreen';
document.getElementById('goagain').style.display='block'; // setTimeout(nextplease,10000);
} else {
alert('Oops! Cannot calculate this mix, sorry.');
nextplease();
}
if ((isokformore + jsokformore) != '') {
document.getElementById('slong').style.cursor='pointer';
document.getElementById('slong').style.textDecoration='underline';
document.getElementById('slong').title='Click for another leg of a trip, perhaps?';
document.getElementById('slong').innerHTML='+';
isokformore='?latf=' + encodeURIComponent(document.getElementById('latt').value) + '&longf=' + encodeURIComponent(document.getElementById('longt').value);
window.scrollTo(0,0); //location.href='#dtop';
setTimeout(bthen, 3000);
} else {
window.scrollTo(0,0); //location.href='#dtop';
setTimeout(bthen, 3000);
}
}
}
}
// 38.627089
// -90.200203
// 96.51262423499941 279.26239975009173
// 382900
function mapit(ao) {
if ((isokformore + jsokformore) != '' && !faux) {
console.log('ao.id=' + ao.id);
//alert(isokformore + ' ... ' + top.document.getElementById('ltt').value);
if (ao.id.toLowerCase().indexOf('from') != -1) {
document.getElementById('outofthisworld').value=ao.id + '|' + top.document.getElementById('ltf').value + ',' + top.document.getElementById('lgf').value;
top.document.getElementById('outofthisworld').value=ao.id + '|' + top.document.getElementById('ltf').value + ',' + top.document.getElementById('lgf').value;
} else if (ao.id.toLowerCase().indexOf('to') != -1) {
document.getElementById('outofthisworld').value=ao.id + '|' + top.document.getElementById('ltt').value + ',' + top.document.getElementById('lgt').value;
top.document.getElementById('outofthisworld').value=ao.id + '|' + top.document.getElementById('ltt').value + ',' + top.document.getElementById('lgt').value;
} else {
document.getElementById('outofthisworld').value=ao.id;
}
} else {
trid='trgraphics';
tdid='td' + ao.id.replace('td','').replace('a','');
divid='d' + ao.id.replace('td','').replace('a','');
var htt='http:';
if (document.URL.toLowerCase().indexOf('https:') == 0) { htt='https:'; }
console.log('tdid=' + tdid);
if (tdid == 'tdfrom') {
if (('' + document.getElementById(ao.id.replace('td','a')).href).replace('undefined','') == '') {
document.getElementById(ao.id.replace('td','a')).setAttribute('data-href',htt + '//www.rjmprogramming.com.au/PHP/tz_places.php?place=&latitude=' + encodeURIComponent(document.getElementById('latf').value) + '&longitude=' + encodeURIComponent(document.getElementById('longf').value));
//document.getElementById(ao.id.replace('td','a')).target='_blank';
//alert(document.getElementById(ao.id.replace('td','a')).href);
//} else {
//alert(('' + document.getElementById(ao.id.replace('td','a')).href));
}
if (1 == 1) {
if (!faux) { top.document.getElementById('nearestif').src='//www.rjmprogramming.com.au/PHP/tz_places.php?place=&latitude=' + encodeURIComponent(document.getElementById('latf').value) + '&longitude=' + encodeURIComponent(document.getElementById('longf').value); }
} else {
top.document.getElementById('latitude').value=document.getElementById('latf').value;
top.document.getElementById('longitude').value=document.getElementById('longf').value;
if (!faux) { top.document.getElementById('inearest').click(); }
}
} else if (tdid == 'tdto') {
if (('' + document.getElementById(ao.id.replace('td','a')).href).replace('undefined','') == '') {
document.getElementById(ao.id.replace('td','a')).setAttribute('data-href',htt + '//www.rjmprogramming.com.au/PHP/tz_places.php?place=&latitude=' + encodeURIComponent(document.getElementById('latt').value) + '&longitude=' + encodeURIComponent(document.getElementById('longt').value));
//document.getElementById(ao.id.replace('td','a')).target='_blank';
//alert(document.getElementById(ao.id.replace('td','a')).href);
//} else {
//alert(('' + document.getElementById(ao.id.replace('td','a')).href));
}
if (1 == 1) {
if (!faux) { top.document.getElementById('nearestif').src='//www.rjmprogramming.com.au/PHP/tz_places.php?place=&latitude=' + encodeURIComponent(document.getElementById('latt').value) + '&longitude=' + encodeURIComponent(document.getElementById('longt').value); }
} else {
top.document.getElementById('latitude').value=document.getElementById('latt').value;
top.document.getElementById('longitude').value=document.getElementById('longt').value;
if (!faux) { top.document.getElementById('inearest').click(); }
}
}
}
window.scrollTo(0,document.body.scrollHeight); //location.href='#ifill';
faux=false;
}
function athen() {
if (top.document.getElementById('dto')) {
if (top.document.getElementById('dto').innerHTML.indexOf(' size="3"') != -1) {
top.document.getElementById('dto').innerHTML=top.document.getElementById('dto').innerHTML.replace(' size="3"', ' size="4"');
}
}
if (top.document.getElementById('dfrom')) {
if (top.document.getElementById('dfrom').innerHTML.indexOf(' size="3"') != -1) {
top.document.getElementById('dfrom').innerHTML=top.document.getElementById('dfrom').innerHTML.replace(' size="3"', ' size="4"');
}
}
window.scrollTo(0,document.body.scrollHeight); //location.href='#ifill';
}
function bthen() {
if (top.document.getElementById('dto')) {
if (top.document.getElementById('dto').innerHTML.indexOf(' size="3"') != -1) {
top.document.getElementById('dto').innerHTML=top.document.getElementById('dto').innerHTML.replace(' size="3"', ' size="4"');
}
}
if (top.document.getElementById('dfrom')) {
if (top.document.getElementById('dfrom').innerHTML.indexOf(' size="3"') != -1) {
top.document.getElementById('dfrom').innerHTML=top.document.getElementById('dfrom').innerHTML.replace(' size="3"', ' size="4"');
}
}
top.window.scrollTo(0,0); //location.href='#ifill';
}
function checknp(oiis) {
var i, j, k, plist='', ogc='';
// www.rjmprogramming.com.au/PHP/GeoChart/geo_chart.php
//?title=Earth%20Places
//&aregexographicals=y
//&aregeographicals=HTTP.From%2Chttp.To%2Chttp.Lome
//&peninfo=75.57|-92.28|127968_From,64.04|-18.15|128205_To,-16.30|151.44|Lome
//&width=417
//&height=260
//&country=Places
//&popularity=
//&data=%20[75.57|-92.28|~From~,2]%20,%20[64.04|-18.15|~To~,2]%20,%20[-16.30|151.44|~Lome~,2]
// <select size="4" id="snearest" style="background-color:olive;" onchange=" alert(this.options[this.selectedIndex].title + String.fromCharCode(32) + this.options[this.selectedIndex].text); "><option title="" value="">Please see Nearest TimeZone Places below ...</option>
// <option data-ll="(5.55,-0.21667)" title="Nearest" value="Africa/Accra">Africa/Accra in Ghana is 617.6km (+0) from (0.0000000,0.0000000)</option>
// <option data-ll="(6.13333,1.21666)" title="Next Nearest" value="Africa/Lome">Africa/Lome in Togo is 695.234km (+0) from (0.0000000,0.0000000)</option>
// <option data-ll="(5.31666,-4.03334)" title="Third Nearest" value="Africa/Abidjan">Africa/Abidjan in Cote d'Ivoire is 741.662km (+0) from (0.0000000,0.0000000)</option>
// </select>
// www.rjmprogramming.com.au/PHP/GeoChart/geo_chart.php?title=Earth%20Places&aregexographicals=y&aregeographicals=HTTP.From%2Chttp.To%2Chttp.Lome&peninfo=75.57|-92.28|127968_From,64.04|-18.15|128205_To,-16.30|151.44|Lome&width=417&height=260&country=Places&popularity=&data=%20[75.57|-92.28|~From~,2]%20,%20[64.04|-18.15|~To~,2]%20,%20[-16.30|151.44|~Lome~,2]
var altolat='', altolong='';
if (document.getElementById('nearest')) {
//alert('hereIS');
if (document.getElementById('nearest').innerHTML != '' && document.getElementById('nearest').innerHTML.trim() == document.getElementById('nearest').innerHTML) {
//alert(top.document.getElementById('outofthisworld').value);
document.getElementById('nearest').innerHTML+=' ';
setTimeout(athen, 3000);
if (top.document.getElementById('outofthisworld').value.indexOf('|') != -1) {
if (top.document.getElementById('outofthisworld').value.split('|')[1] != '') {
altolat=top.document.getElementById('outofthisworld').value.split('|')[1].split(',')[0];
altolong=top.document.getElementById('outofthisworld').value.split('|')[1].split(',')[1];
//alert(top.document.getElementById('outofthisworld').value);
tdid='td' + top.document.getElementById('outofthisworld').value.split('|')[0].replace('a','');
divid='d' + top.document.getElementById('outofthisworld').value.split('|')[0].replace('a','');
top.document.getElementById('outofthisworld').value=top.document.getElementById('outofthisworld').value.split('|')[0];
}
}
document.getElementById(divid).style.display='table-cell';
document.getElementById(divid).innerHTML=document.getElementById('nearest').innerHTML.replace('position:','background-color:lightblue;').replace('absolute;','').replace('top:','').replace('left:','').replace('70px;','').replace('350px;','');
//var dbits=document.getElementById(divid).innerHTML=document.getElementById('nearest').innerHTML.split(' data-ll=');
//var vbits=document.getElementById(divid).innerHTML=document.getElementById('nearest').innerHTML.replace(' value=',' Value=').split(' value=');
//alert(top.document.getElementById('nearest').innerHTML);
var dbits=top.document.getElementById('nearest').innerHTML.split(' data-ll=');
var vbits=top.document.getElementById('nearest').innerHTML.replace(' value=',' Value=').split(' value=');
if (dbits.length > 1) {
ogc='//www.rjmprogramming.com.au/PHP/GeoChart/geo_chart.php?title=Earth%20Places&aregexographicals=y&aregeographicals=HTTP.From%2Chttp.To' +
'&peninfo=latfrom|longfrom|127968_From,latto|longto|128205_To,nearestlat|nearestlong|nearestplace' +
'&width=417&height=260&country=Places&popularity=' +
'&data=%20[latfrom|longfrom|~From~,2]%20,%20[latto|longto|~To~,2]%20,%20[nearestlat|nearestlong|~nearestplace~,2]';
if (tdid.toLowerCase().indexOf('from') != -1) {
//alert(altolat + ' ... ' + altolong + ' ___ ' + document.getElementById(divid).innerHTML);
if (altolat != '' && altolong != '') {
ogc=ogc.replace('latfrom', altolat).replace('latfrom', altolat);
ogc=ogc.replace('longfrom', altolong).replace('longfrom', altolong);
} else {
ogc=ogc.replace('latfrom', document.getElementById('latf').value).replace('latfrom', document.getElementById('latf').value);
ogc=ogc.replace('longfrom', document.getElementById('longf').value).replace('longfrom', document.getElementById('longf').value);
}
plist='';
for (i=1; i<vbits.length; i++) {
plist+='%2Chttp.' + encodeURIComponent(vbits[i].substring(1).split(vbits[i].substring(0,1))[0].split('/')[eval(-1 + vbits[i].substring(1).split(vbits[i].substring(0,1))[0].split('/').length)].replace(/\_/g,' '));
}
ogc=ogc.replace('%2Chttp.To', plist);
plist='';
for (i=1; i<dbits.length; i++) {
plist+='%20,%20[' + dbits[i].substring(2).split(dbits[i].substring(0,1))[0].replace(')','').split(',')[0] + '|' + dbits[i].substring(2).split(dbits[i].substring(0,1))[0].replace(')','').split(',')[1] + '|~' + encodeURIComponent(vbits[i].substring(1).split(vbits[i].substring(0,1))[0].split('/')[eval(-1 + vbits[i].substring(1).split(vbits[i].substring(0,1))[0].split('/').length)].replace(/\_/g,' ')) + '~]';
}
ogc=ogc.replace('%20,%20[latto|longto|~To~,2]%20,%20[nearestlat|nearestlong|~nearestplace~,2]', plist);
plist='';
for (i=1; i<dbits.length; i++) {
plist+=',' + dbits[i].substring(2).split(dbits[i].substring(0,1))[0].replace(')','').split(',')[0] + '|' + dbits[i].substring(2).split(dbits[i].substring(0,1))[0].replace(')','').split(',')[1] + '|' + encodeURIComponent(vbits[i].substring(1).split(vbits[i].substring(0,1))[0].split('/')[eval(-1 + vbits[i].substring(1).split(vbits[i].substring(0,1))[0].split('/').length)].replace(/\_/g,' ')) + '';
}
ogc=ogc.replace(',latto|longto|128205_To,nearestlat|nearestlong|nearestplace', plist);
} else if (tdid.toLowerCase().indexOf('to') != -1) {
ogc='//www.rjmprogramming.com.au/PHP/GeoChart/geo_chart.php?title=Earth%20Places&aregexographicals=y&aregeographicals=HTTP.To%2Chttp.From' +
'&peninfo=latto|longto|128205_To,latfrom|longfrom|127968_From,nearestlat|nearestlong|nearestplace' +
'&width=417&height=260&country=Places&popularity=' +
'&data=%20[latto|longto|~To~,2]%20,%20[latfrom|longfrom|~From~,2]%20,%20[nearestlat|nearestlong|~nearestplace~,2]';
if (altolat != '' && altolong != '') {
ogc=ogc.replace('latto', altolat).replace('latto', altolat);
ogc=ogc.replace('longto', altolong).replace('longto', altolong);
//alert(altolat + ' .#. ' + altolong + ' ___ ' + ogc);
} else {
ogc=ogc.replace('latto', document.getElementById('latt').value).replace('latto', document.getElementById('latt').value);
ogc=ogc.replace('longto', document.getElementById('longt').value).replace('longto', document.getElementById('longt').value);
}
plist='';
for (i=1; i<vbits.length; i++) {
plist+='%2Chttp.' + encodeURIComponent(vbits[i].substring(1).split(vbits[i].substring(0,1))[0].split('/')[eval(-1 + vbits[i].substring(1).split(vbits[i].substring(0,1))[0].split('/').length)].replace(/\_/g,' '));
}
//alert(plist + ' ... ' + ogc.replace('%2Chttp.From', plist) + ' via ' + ogc);
ogc=ogc.replace('%2Chttp.From', plist);
plist='';
for (i=1; i<dbits.length; i++) {
plist+='%20,%20[' + dbits[i].substring(2).split(dbits[i].substring(0,1))[0].replace(')','').split(',')[0] + '|' + dbits[i].substring(2).split(dbits[i].substring(0,1))[0].replace(')','').split(',')[1] + '|~' + encodeURIComponent(vbits[i].substring(1).split(vbits[i].substring(0,1))[0].split('/')[eval(-1 + vbits[i].substring(1).split(vbits[i].substring(0,1))[0].split('/').length)].replace(/\_/g,' ')) + '~]';
}
//alert(plist + ' ... ' + ogc.replace('%20,%20[latfrom|longfrom|~From~,2]%20,%20[nearestlat|nearestlong|~nearestplace~,2]', plist) + ' via ' + ogc);
ogc=ogc.replace('%20,%20[latfrom|longfrom|~From~,2]%20,%20[nearestlat|nearestlong|~nearestplace~,2]', plist);
plist='';
for (i=1; i<dbits.length; i++) {
plist+=',' + dbits[i].substring(2).split(dbits[i].substring(0,1))[0].replace(')','').split(',')[0] + '|' + dbits[i].substring(2).split(dbits[i].substring(0,1))[0].replace(')','').split(',')[1] + '|' + encodeURIComponent(vbits[i].substring(1).split(vbits[i].substring(0,1))[0].split('/')[eval(-1 + vbits[i].substring(1).split(vbits[i].substring(0,1))[0].split('/').length)].replace(/\_/g,' ')) + '';
}
//alert(plist + ' ... ' + ogc.replace(',latfrom|longfrom|127968_From,nearestlat|nearestlong|nearestplace', plist) + ' via ' + ogc);
ogc=ogc.replace(',latfrom|longfrom|127968_From,nearestlat|nearestlong|nearestplace', plist);
}
document.getElementById(trid).style.display='table-row';
if (document.getElementById(tdid).innerHTML.indexOf(ogc) == -1 && ogc.indexOf('nearestlat') == -1) {
document.getElementById(tdid).innerHTML+='<iframe style=display:inline-block;height:300px;width:450px; src="' + ogc + '"></iframe>';
}
} else if (tdid.toLowerCase().indexOf('from') != -1) {
document.getElementById(trid).style.display='table-row';
if (altolat == '') { altolat=top.document.getElementById('ltf').value; }
if (altolong == '') { altolong=top.document.getElementById('lgf').value; }
document.getElementById(tdid).innerHTML+='<iframe style=display:inline-block;height:300px;width:450px; src="' + '//www.rjmprogramming.com.au/PHP/GeoChart/geo_chart.php?title=Earth%20Places&aregexographicals=y&aregeographicals=HTTP.From' +
'&peninfo=' + altolat + '|' + altolong + '|127968_From' +
'&width=417&height=260&country=Places&popularity=' +
'&data=%20[' + altolat + '|' + altolong + '|~From~,2]' + '"></iframe>';
} else if (tdid.toLowerCase().indexOf('to') != -1) {
document.getElementById(trid).style.display='table-row';
if (altolat == '') { altolat=top.document.getElementById('ltt').value; }
if (altolong == '') { altolong=top.document.getElementById('lgt').value; }
document.getElementById(tdid).innerHTML+='<iframe style=display:inline-block;height:300px;width:450px; src="' + '//www.rjmprogramming.com.au/PHP/GeoChart/geo_chart.php?title=Earth%20Places&aregexographicals=y&aregeographicals=HTTP.To' +
'&peninfo=' + altolat + '|' + altolong + '|128205_To' +
'&width=417&height=260&country=Places&popularity=' +
'&data=%20[' + altolat + '|' + altolong + '|~To~,2]' + '"></iframe>';
}
}
}
}
function moreifok() {
//alert('add row here');
if (cfok) {
cfok=false;
if (isokformore.trim() != '') {
document.getElementById('next1').style.display='table-row';
document.getElementById('niframe').style.backgroundColor='yellow';
document.getElementById('niframe').src=document.URL.split('#')[0].split('?')[0] + isokformore;
isokformore=' ';
}
}
}
function myselit(oso) {
if (oso.value == '1') {
document.getElementById('brg').value='' + eval(eval(180.0 + eval(('' + document.getElementById('brg').value).replace('~0.','.').replace('~',''))) % 360.0);
}
oso.value='2';
}
function moremaybe() {
var ofplacen=fplacen;
var otplacen=tplacen;
if (document.getElementById('gform')) {
if (document.URL.indexOf('https:') != -1) { document.getElementById('gform').action=document.getElementById('gform').action.replace('http:','https:'); }
}
var latto=location.search.split('latf=')[1] ? decodeURIComponent(location.search.split('latf=')[1].split('&')[0]) : '';
var longto=location.search.split('longf=')[1] ? decodeURIComponent(location.search.split('longf=')[1].split('&')[0]) : '';
var clatto=location.search.split('latt=')[1] ? decodeURIComponent(location.search.split('latt=')[1].split('&')[0]) : '';
var clongto=location.search.split('longt=')[1] ? decodeURIComponent(location.search.split('longt=')[1].split('&')[0]) : '';
var cbrg=location.search.split('brg=')[1] ? decodeURIComponent(location.search.split('brg=')[1].split('&')[0]) : '';
var cdist=location.search.split('dist=')[1] ? decodeURIComponent(location.search.split('dist=')[1].split('&')[0]) : '';
var mysel=location.search.split('mysel=')[1] ? decodeURIComponent(location.search.split('mysel=')[1].split('&')[0]) : '2';
var dosms=location.search.split('sms=')[1] ? decodeURIComponent(location.search.split('sms=')[1].split('&')[0]) : '';
if (fplacen != '') {
document.getElementById('ssf').innerHTML=fplacen;
fplacen='';
}
if (tplacen != '') {
document.getElementById('sst').innerHTML=tplacen;
tplacen='';
}
if (latto != '' && longto != '') {
nextplease();
top.document.getElementById('goagain').style.display='block';
document.getElementById('latf').value=latto;
document.getElementById('latf').style.backgroundColor="pink";
cwhat[0]=false;
cwhat[1]=false;
if (!decided) {
if (!cwhat[5]) {
cwhat[5]=true;
}
if (!cwhat[4]) {
cwhat[4]=true;
}
decided=true;
}
top.document.getElementById("ltf").value=latto;
document.getElementById('longf').value=longto;
document.getElementById('longf').style.backgroundColor="pink";
cwhat[0]=false;
cwhat[1]=false;
if (!decided) {
if (!cwhat[5]) {
cwhat[5]=true;
}
if (!cwhat[4]) {
cwhat[4]=true;
}
decided=true;
}
top.document.getElementById("lgf").value=longto;
document.getElementById('dtop').style.display='none';
document.getElementById('trhead').style.display='none';
document.getElementById('trfoot').style.display='none';
document.getElementById('myt').border=0;
var recti=parent.document.getElementById('niframe').getBoundingClientRect();
parent.document.getElementById('niframe').height=eval(200 + eval(('' + recti.height).replace('px',''))) + 'px';
if (parent.document.getElementById('niframe') != top.document.getElementById('niframe')) {
var trecti=top.document.getElementById('niframe').getBoundingClientRect();
top.document.getElementById('niframe').height=eval(200 + eval(('' + trecti.height).replace('px',''))) + 'px';
}
setTimeout(checkfill, 500);
parent.document.getElementById("slong").innerHTML=":";
parent.document.getElementById("slong").title="";
parent.document.getElementById("slong").style.textDecoration="none";
//top.document.title+=' started ';
}
if (latto != '' && longto != '' && clatto != '' && clongto != '' && cbrg != '' && cdist != '') {
document.getElementById('gform').action=document.URL.split('?')[0].split('#')[0];
document.getElementById('latf').type='text';
document.getElementById('longf').type='text';
document.getElementById('latt').type='text';
document.getElementById('longt').type='text';
document.getElementById('brg').type='text';
document.getElementById('dist').type='text';
document.getElementById('latf').value=('' + latto).replace('~0.','.').replace('~','');
document.getElementById('longf').value=('' + longto).replace('~0.','.').replace('~','');
document.getElementById('latt').value=('' + clatto).replace('~0.','.').replace('~','');
document.getElementById('longt').value=('' + clongto).replace('~0.','.').replace('~','');
if (('' + mysel) == '1') {
document.getElementById('brg').value='' + eval(eval(180.0 + eval(('' + cbrg).replace('~0.','.').replace('~',''))) % 360.0);
} else {
document.getElementById('brg').value=('' + cbrg).replace('~0.','.').replace('~','');
}
document.getElementById('dist').value=('' + cdist).replace('~0.','.').replace('~','');
document.getElementById('dtop').style.display='block';
document.getElementById('myt').border='10';
document.getElementById('myt').cellspacing='2';
document.getElementById('myt').cellpadding='2';
document.getElementById('trhead').style.display='table-row';
document.getElementById('trfoot').style.display='table-row';
document.getElementById('ifill').style.display='block';
document.getElementById('ifill').type='submit';
//cwhat=[false,false,true,true,true,true];
calcit();
if (document.getElementById('latf').value.indexOf('0.000') != 0) { document.getElementById('latf').focus(); document.getElementById('latf').value+=' '; }
if (document.getElementById('longf').value.indexOf('0.000') != 0) { document.getElementById('longf').focus(); document.getElementById('longf').value+=' '; }
if (document.getElementById('latt').value.indexOf('0.000') != 0) { document.getElementById('latt').focus(); document.getElementById('latt').value+=' '; }
if (document.getElementById('longt').value.indexOf('0.000') != 0) { document.getElementById('longt').focus(); document.getElementById('longt').value+=' '; }
if (document.getElementById('brg').value.indexOf('0.000') != 0) { document.getElementById('brg').focus(); document.getElementById('brg').value+=' '; }
if (document.getElementById('dist').value.indexOf('0.000') != 0) { document.getElementById('dist').focus(); document.getElementById('dist').value+=' '; }
decided=true;
document.getElementById('latf').value=document.getElementById('latf').value.trim();
document.getElementById('longf').value=document.getElementById('longf').value.trim();
document.getElementById('latt').value=document.getElementById('latt').value.trim();
document.getElementById('longt').value=document.getElementById('longt').value.trim();
document.getElementById('brg').value=document.getElementById('brg').value.trim();
document.getElementById('dist').value=document.getElementById('dist').value.trim();
document.getElementById('latf').focus();
cwhat=[true,true,false,false,true,true];
jsokformore=' ';
isokformore=' ';
console.log(cwhat);
faux=true;
mapit(document.getElementById('tdfrom'));
console.log(document.getElementById('afrom').href);
console.log('tdto');
faux=true;
mapit(document.getElementById('tdto'));
console.log(document.getElementById('ato').href);
if (dosms != '') { setTimeout(clicksms, 2000); }
}
if (ofplacen != '' && otplacen == '') {
fplacen=ofplacen;
tpurl=origtpurl;
mu=mu.replace('[51.5072,','[' + document.getElementById('latf').value + ',');
mu=mu.replace(',-0.1275,',',' + document.getElementById('longf').value + ',');
mu=mu.replace('=LonJunkdon','=' + encodeURIComponent(fplacen)).replace(',~London~]',',~' + encodeURIComponent(fplacen) + '~],[051.5072,-00.1275,~LonDon~]');
tpurl=tpurl.replace("Sydney+NSW,+Australia",encodeURIComponent(fplacen));
viastart=true;
//alert(146);
if (document.URL.indexOf('&brg=0.0000001&') != -1) {
//setTimeout(predfillablemaybe, 2000); //dfillablemaybe(document.getElementById('dist'));
dfillablemaybe(document.getElementById('dist'));
} else {
fillablemaybe(document.getElementById('brg'));
}
//alert(246);
} else if (ofplacen != '' && otplacen != '') {
mu=mu.replace('[51.5072,','[' + document.getElementById('latf').value + ',');
mu=mu.replace(',-0.1275,',',' + document.getElementById('longf').value + ',');
mu=mu.replace('=LonJunkdon','=' + encodeURIComponent(fplacen)).replace(',~London~]',',~' + encodeURIComponent(ofplacen) + '~],[051.5072,-00.1275,~LonDon~]');
tpurl=origtpurl;
tpurl=tpurl.replace("Sydney+NSW,+Australia",encodeURIComponent(ofplacen));
mu=mu.replace('[051.5072,','[' + '' + document.getElementById('latt').value + ',');
mu=mu.replace(',-00.1275,',',' + '' + document.getElementById('longt').value + ',');
mu=mu.replace(',~LonDon~]',',~' + encodeURIComponent(otplacen) + '~]');
mu=mu.replace('=London','=' + encodeURIComponent(ofplacen + ' to ' + otplacen));
tpurl=tpurl.replace("Brisbane+QLD,+Australia",encodeURIComponent(otplacen));
document.getElementById('tdmid').innerHTML='<details id=dftif open><summary id=sftif><a target=_blank title="' + ofplacen + '" href="//en.wikipedia.org/wiki/' + encodeURIComponent(ofplacen) + '">' + ofplacen + '</a> <a target=_blank title="Google Maps Directions" href="' + tpurl.replace('https:','') + '">to</a> <a target=_blank title="' + otplacen + '" href="//en.wikipedia.org/wiki/' + encodeURIComponent(otplacen) + '">' + otplacen + '</a> (' + eval(eval('' + great_circle_distance(document.getElementById(eles[0]).value,document.getElementById(eles[1]).value,document.getElementById(eles[4]).value,document.getElementById(eles[5]).value)) / 1000.000) + ' kilometres)</summary><iframe id=iftif src="' + mu + '" style="width:100%;height:700px;"></iframe></details>';
}
}
function clicksms() {
document.getElementById('ssms').click();
}
function filltwo() {
document.getElementById('latf').type='text';
document.getElementById('longf').type='text';
document.getElementById('latt').type='text';
document.getElementById('longt').type='text';
document.getElementById('brg').type='text';
document.getElementById('dist').type='text';
document.getElementById('ifill').type='submit';
}
function checkfill() {
if (!cfok) {
console.log('not cfok');
top.document.getElementById('outofthisworld').value='';
//top.document.title+=' finished ';
} else if (jsokformore == '' && ('' + document.getElementById('latf').value).indexOf('0.000') == -1 && ('' + document.getElementById('longf').value).indexOf('0.000') == -1 && ('' + document.getElementById('latt').value).indexOf('0.000') == -1 && ('' + document.getElementById('longt').value).indexOf('0.000') == -1 && ('' + document.getElementById('brg').value).indexOf('0.000') == -1 && ('' + document.getElementById('dist').value).indexOf('0.000') == -1) {
if (jsokformore == '') { console.log('not cfok two'); top.document.getElementById('outofthisworld').value=''; } else { console.log('huh'); }
//top.document.title+=' finished ';
} else if (top.document.getElementById('outofthisworld').value != '') {
console.log('click ' + top.document.getElementById('outofthisworld').value);
if (lastclick != top.document.getElementById('outofthisworld').value.split('|')[0]) {
lastclick=top.document.getElementById('outofthisworld').value.split('|')[0];
if (!faux) {
if (top.document.getElementById('outofthisworld').value.indexOf('from') != -1) {
document.getElementById('nearestif').src='//www.rjmprogramming.com.au/PHP/tz_places.php?place=&latitude=' + encodeURIComponent(document.getElementById('latf').value) + '&longitude=' + encodeURIComponent(document.getElementById('longf').value); checknp(null); //mapit(document.getElementById('afrom')); //top.document.getElementById('nearestif').src='//www.rjmprogramming.com.au/PHP/tz_places.php?place=&latitude=' + encodeURIComponent(document.getElementById('latf').value) + '&longitude=' + encodeURIComponent(document.getElementById('longf').value);
} else if (top.document.getElementById('outofthisworld').value.indexOf('to') != -1) {
document.getElementById('nearestif').src='//www.rjmprogramming.com.au/PHP/tz_places.php?place=&latitude=' + encodeURIComponent(document.getElementById('latt').value) + '&longitude=' + encodeURIComponent(document.getElementById('longt').value); checknp(null); //mapit(document.getElementById('ato')); //top.document.getElementById('nearestif').src='//www.rjmprogramming.com.au/PHP/tz_places.php?place=&latitude=' + encodeURIComponent(document.getElementById('latt').value) + '&longitude=' + encodeURIComponent(document.getElementById('longt').value);
}
}
document.getElementById(top.document.getElementById('outofthisworld').value.split('|')[0]).click();
}
if (top.document.getElementById('outofthisworld').value.split('|')[0] == 'slong' && ('' + document.getElementById('latf').value).indexOf('0.000') == -1 && ('' + document.getElementById('longf').value).indexOf('0.000') == -1 && ('' + document.getElementById('latt').value).indexOf('0.000') == -1 && ('' + document.getElementById('longt').value).indexOf('0.000') == -1 && ('' + document.getElementById('brg').value).indexOf('0.000') == -1 && ('' + document.getElementById('dist').value).indexOf('0.000') == -1) {
top.document.getElementById('outofthisworld').value='';
//top.document.title+=' finished ';
} else if (top.document.getElementById('outofthisworld').value.indexOf('|') != -1) {
if (top.document.getElementById('outofthisworld').value.split('|')[1] == '') {
if (top.document.getElementById('outofthisworld').value.toLowerCase().indexOf('from') != -1) {
top.document.getElementById('outofthisworld').value+=document.getElementById('latf').value.trim() + ',' + document.getElementById('longf').value.trim();
} else if (top.document.getElementById('outofthisworld').value.toLowerCase().indexOf('to') != -1) {
top.document.getElementById('outofthisworld').value+=document.getElementById('latt').value.trim() + ',' + document.getElementById('longt').value.trim();
}
}
setTimeout(checkfill, 500);
} else {
top.document.getElementById('outofthisworld').value='';
setTimeout(checkfill, 500);
}
} else if (jsokformore == '' && ('' + document.getElementById('latf').value).indexOf('0.000') == -1 && ('' + document.getElementById('longf').value).indexOf('0.000') == -1 && ('' + document.getElementById('latt').value).indexOf('0.000') == -1 && ('' + document.getElementById('longt').value).indexOf('0.000') == -1 && ('' + document.getElementById('brg').value).indexOf('0.000') == -1 && ('' + document.getElementById('dist').value).indexOf('0.000') == -1) {
top.document.getElementById('outofthisworld').value='';
//top.document.title+=' finished ';
} else {
setTimeout(checkfill, 500);
}
}
function toize(defe) {
var suffbits='?latf=' + encodeURIComponent(document.getElementById('latf').value) + '&longf=' + encodeURIComponent(document.getElementById('longf').value) + '&latt=' + encodeURIComponent(document.getElementById('latt').value) + '&longt=' + encodeURIComponent(document.getElementById('longt').value) + '&brg=' + encodeURIComponent(document.getElementById('brg').value) + '&dist=' + encodeURIComponent(document.getElementById('dist').value);
var em='';
if (defe.trim() != '') {
em=defe
} else {
em=prompt('SMS to?', '');
}
if (em == null) { em=''; }
if (em.trim() != '') {
//document.getElementById('from').value=em;
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('asms').href='sms:' + em + '&body=' + dummyencodeURIComponent(encodeURIComponent(document.URL.split('#')[0].split('?')[0] + suffbits)); // + '?gradient=' + encodeURIComponent(encodeURIComponent(document.getElementById('dfix').innerHTML.replace('background: ','').replace('background:','').replace(');',')').replace(';',''))));
} else {
document.getElementById('asms').href='sms:' + em + '&body=' + encodeURIComponent(encodeURIComponent(document.URL.split('#')[0].split('?')[0] + suffbits)); // + '?gradient=' + encodeURIComponent(encodeURIComponent(document.getElementById('dfix').innerHTML.replace('background: ','').replace('background:','').replace(');',')').replace(';',''))));
}
document.getElementById('asms').click();
}
return true;
}
function preemailit(ine) {
if (ine.indexOf('@') != -1) {
emailit(ine);
} else if (ine != '') {
toize(ine);
}
}
function dummyencodeURIComponent(invl) {
return invl;
}
function emailit(defe) {
//document.getElementById('ih').value=document.getElementById('tdlook').innerHTML.replace(/\<br\>/g,String.fromCharCode(10));
var lastfis='youllneverfindthis';
var lasttis='';
var lasteis='youllneverfindthis';
var lastenow='';
var lastsis='youllneverfindthis';
var lastsnow='';
var lasteis2='youllneverfindthis';
var lastenow2='';
var lastsis2='youllneverfindthis';
var lastsnow2='';
var em='';
var suffbits='?latf=' + encodeURIComponent(document.getElementById('latf').value) + '&longf=' + encodeURIComponent(document.getElementById('longf').value) + '&latt=' + encodeURIComponent(document.getElementById('latt').value) + '&longt=' + encodeURIComponent(document.getElementById('longt').value) + '&brg=' + encodeURIComponent(document.getElementById('brg').value) + '&dist=' + encodeURIComponent(document.getElementById('dist').value);
if (defe.indexOf('@') != -1) {
em=defe
} else {
em=prompt('Email to? (all uppercase uses client email else sends an Inline HTML Email Form)', '');
}
if (em == null) { em=''; }
if (em.indexOf('@') != -1) {
//document.getElementById('from').value=em;
if (document.URL.toLowerCase().indexOf('rjmprogramming.com.au') != -1 && em != em.toUpperCase()) {
document.getElementById('asms').href='mailto:' + em.trim() + '?subject=' + encodeURIComponent('Missing Two') + '&body=' + encodeURIComponent(document.URL.split('#')[0].split('?')[0] + suffbits); // + '?missingtwo=' + encodeURIComponent(encodeURIComponent(document.getElementById('dfix').innerHTML.replace('background: ','').replace('background:','').replace(');',')').replace(';',''))));
var xzhr = new XMLHttpRequest();
var xform=new FormData();
xform.append('inline','');
xform.append('to',em.trim());
var flatf=document.getElementById('latf').outerHTML;
var flongf=document.getElementById('longf').outerHTML;
var flatt=document.getElementById('latt').outerHTML;
var flongt=document.getElementById('longt').outerHTML;
var fbrg=document.getElementById('brg').outerHTML;
var fdist=document.getElementById('dist').outerHTML;
var tlatf='<input type=text name=latf id=latf value="' + document.getElementById('latf').value + '"></input>';
var tlongf='<input type=text name=longf id=longf value="' + document.getElementById('longf').value + '"></input>';
var tlatt='<input type=text name=latt id=latt value="' + document.getElementById('latt').value + '"></input>';
var tlongt='<input type=text name=longt id=longt value="' + document.getElementById('longt').value + '"></input>';
var tbrg='<input type=text name=brg id=brg value="' + document.getElementById('brg').value + '"></input>';
var tdist='<input type=text name=dist id=dist value="' + document.getElementById('dist').value + '"></input>';
//if (from.indexOf('@') != -1) { xform.append('cc',from.trim()); }
console.log('tdfrom');
faux=true;
mapit(document.getElementById('tdfrom'));
console.log(document.getElementById('afrom').href);
console.log('tdto');
faux=true;
mapit(document.getElementById('tdto'));
console.log(document.getElementById('ato').href);
if (document.body.innerHTML.indexOf('<tr id="trfoot"') != -1) {
lastfis='<tr id="trfoot"' + document.body.innerHTML.split('<tr id="trfoot"')[1].split('</tr>')[0] + '</tr>';
if (document.getElementById('asms').href.indexOf('sms:') != -1) {
lasteis='<span ';
lastenow='<a target=_blank href="mailto:?subject=' + dummyencodeURIComponent(encodeURIComponent('Missing%20Two')) + '&body=' + dummyencodeURIComponent(encodeURIComponent(document.getElementById('asms').href.split('&body=')[1])) + '" ';
lasteis2='</span>';
lastenow2='</a>';
lastsis='<span ';
lastsnow='<a target=_blank href="' + document.getElementById('asms').href.split('&')[0] + '&body=' + dummyencodeURIComponent(encodeURIComponent(document.getElementById('asms').href.split('&body=')[1])) + '" ';
lastsis2='</span>';
lastsnow2='</a>';
} else if (document.getElementById('asms').href.indexOf('mailto:') != -1) {
lastsis='<span ';
lastsis=document.getElementById('ssms').outerHTML.split('>')[0] + '>';
lastsnow='<a target=_blank href="sms:&body=' + dummyencodeURIComponent(encodeURIComponent(document.getElementById('asms').href.split('&body=')[1])) + '" ';
lastsnow='<input type=submit title=SMS name=sms id=ssms value="';
lastsis2='</span>';
lastsnow2='</a>';
lastsnow2='"></input>';
lasteis='<span ';
lastenow='<a target=_blank href="mailto:' + em.trim() + '?subject=' + dummyencodeURIComponent(encodeURIComponent('Missing%20Two')) + '&body=' + dummyencodeURIComponent(encodeURIComponent(document.getElementById('asms').href.split('&body=')[1])) + '" ';
lasteis2='</span>';
lastenow2='</a>';
}
}
if (em.trim() != em) {
xform.append('subj','Missing Two');
//var cbgtd=document.getElementById('tdlook').getBoundingClientRect();
xform.append('body','<body>' + document.body.innerHTML.replace(/\ id\=\"mysel\"/g, ' name="mysel" id="mysel"').replace(/\ size\=\"3\"/g, ' size="4"').replace(/\ data\-href\=/g, ' target=_blank href=').replace('</form>', '<br><br><input style=background-color:lightgreen; type=submit value=Solve></input></form>').replace('DISPLAY:table-row','DISPLAY:none').replace(lastfis,lasttis).replace(lasteis,lastenow).replace(lasteis2,lastenow2).replace(lastsis,lastsnow).replace(lastsis2,lastsnow2).replace('absolute;','absolute;display:none;').replace(flatf,tlatf).replace(flongf,tlongf).replace(flatt,tlatt).replace(flongt,tlongt).replace(fbrg,tbrg).replace(fdist,tdist) + '</body>');
} else {
xform.append('subj','Missing Two');
xform.append('body','<body>' + document.body.innerHTML.replace(/\ id\=\"mysel\"/g, ' name="mysel" id="mysel"').replace(/\ size\=\"3\"/g, ' size="4"').replace(/\ data\-href\=/g, ' target=_blank href=').replace('</form>', '<br><br><input style=background-color:lightgreen; type=submit value=Solve></input></form>').replace('DISPLAY:table-row','DISPLAY:none').replace(lastfis,lasttis).replace(lasteis,lastenow).replace(lasteis2,lastenow2).replace(lastsis,lastsnow).replace(lastsis2,lastsnow2).replace('absolute;','absolute;display:none;').replace(flatf,tlatf).replace(flongf,tlongf).replace(flatt,tlatt).replace(flongt,tlongt).replace(fbrg,tbrg).replace(fdist,tdist) + '</body>');
}
xzhr.open('post','//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php',true);
xzhr.send(xform);
} else {
document.getElementById('asms').href='mailto:' + em.trim() + '?subject=' + encodeURIComponent('Missing Two') + '&body=' + encodeURIComponent(document.URL.split('#')[0].split('?')[0] + suffbits); // + '?missingtwo=' + encodeURIComponent(encodeURIComponent(document.getElementById('dfix').innerHTML.replace('background: ','').replace('background:','').replace(');',')').replace(';',''))));
document.getElementById('asms').click();
}
}
}
function askit() {
var ourdist=0.0, ourbrg=0.0;
//alert(gllentry);
if (gllentry.indexOf(',') != -1) {
if ((1 == 2 && gllonesuffix == 'f') || document.getElementById('spfr').innerHTML == 'from') {
tpurl=origtpurl;
document.getElementById('latf').focus();
document.getElementById('latf').value=gllentry.split(',')[0];
//var mu="//www.rjmprogramming.com.au/PHP/Map/map.php?title=London&label=['Lat',&value='Lon','Name']&data=,[51.5072,-0.1275,~London~]";
mu=mu.replace('[51.5072,','[' + gllentry.split(',')[0] + ',');
document.getElementById('longf').focus();
document.getElementById('longf').value=gllentry.split(',')[1];
mu=mu.replace(',-0.1275,',',' + gllentry.split(',')[1] + ',');
document.getElementById('latf').focus();
gllonesuffix = 't';
document.getElementById('spfr').innerHTML=document.getElementById('spfr').innerHTML.replace('from','to<input type=hidden name=fplacen value="' + gllentry.split(',')[2].replace(/\;/g,',') + '"></input>');
fplacen=gllentry.split(',')[2].replace(/\;/g,',');
document.getElementById('ssf').innerHTML=' ' + gllentry.split(',')[2].replace(/\;/g,',');
mu=mu.replace('=LonJunkdon','=' + encodeURIComponent(gllentry.split(',')[2].replace(/\;/g,','))).replace(',~London~]',',~' + encodeURIComponent(gllentry.split(',')[2].replace(/\;/g,',')) + '~],[051.5072,-00.1275,~LonDon~]');
tpurl=tpurl.replace("Sydney+NSW,+Australia",encodeURIComponent(gllentry.split(',')[2].replace(/\;/g,',')));
if (document.getElementById('sftif') && document.getElementById('iftif')) {
document.getElementById('iftif').src=document.getElementById('iftif').src.replace('&',encodeURIComponent(' from ' + gllentry.split(',')[2].replace(/\;/g,',')) + '&') + ',[' + gllentry.replace(',' + gllentry.split(',')[1] + ',', ',' + gllentry.split(',')[1] + ',~').replace(/\ /g,'%20') + '~]';
document.getElementById('sftif').innerHTML+=' from <a target=_blank title="' + gllentry.split(',')[2].replace(/\;/g,',') + '" href="//en.wikipedia.org/wiki/' + encodeURIComponent(gllentry.split(',')[2].replace(/\;/g,',')) + '">' + gllentry.split(',')[2].replace(/\;/g,',') + '</a>';
document.getElementById('brg').value='0.0000000';
document.getElementById('dist').value='0.000';
document.getElementById('brg').style.backgroundColor='white';
document.getElementById('dist').style.backgroundColor='white';
cwhat=[false,false,true,true,false,false];
ourdist=great_circle_distance(document.getElementById(eles[0]).value,document.getElementById(eles[1]).value,document.getElementById(eles[4]).value,document.getElementById(eles[5]).value);
document.getElementById(eles[3]).value='' + ourdist;
//Let ‘R’ be the radius of Earth,
//‘L’ be the longitude,
//‘θ’ be latitude,
//‘β‘ be Bearing.
//Bearing from point A to B, can be calculated as,
//β = atan2(X,Y),
//where, X and Y are two quantities and can be calculated as:
//X = cos θb * sin ∆L
//Y = cos θa * sin θb – sin θa * cos θb * cos ∆L
ourbrg=eval(eval(360.0 + eval(eval(eval(180.0 / Math.PI) * Math.atan2(
eval(eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value))) *
eval('' + Math.sin(eval(Math.PI / 180.0) * eval(eval('' + document.getElementById(eles[5]).value) - eval('' + document.getElementById(eles[1]).value))))),
eval(eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value))) *
eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value)))) -
eval(eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value))) *
eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value))) *
eval('' + Math.cos(eval(Math.PI / 180.0) * eval(eval('' + document.getElementById(eles[5]).value) - eval('' + document.getElementById(eles[1]).value)))))
)))) % 360.0);
document.getElementById('mysel').value='2';
document.getElementById(eles[2]).value='' + ourbrg;
document.getElementById(eles[2]).style.backgroundColor='lightgreen';
document.getElementById(eles[3]).style.backgroundColor='lightgreen';
}
} else {
mu=mu.replace('=London','=' + encodeURIComponent(fplacen));
document.getElementById('brg').focus();
document.getElementById('dist').focus();
document.getElementById('latt').focus();
document.getElementById('latt').value=gllentry.split(',')[0];
mu=mu.replace('[051.5072,','[' + gllentry.split(',')[0] + ',');
document.getElementById('longt').focus();
document.getElementById('longt').value=gllentry.split(',')[1];
mu=mu.replace(',-00.1275,',',' + gllentry.split(',')[1] + ',');
document.getElementById('latt').focus();
gllonesuffix = 'f';
document.getElementById('spfr').innerHTML=document.getElementById('spfr').innerHTML.replace('to','from<input type=hidden name=tplacen value="' + gllentry.split(',')[2].replace(/\;/g,',') + '"></input>');
document.getElementById('sst').innerHTML=' ' + gllentry.split(',')[2].replace(/\;/g,',');
mu=mu.replace(',~LonDon~]',',~' + encodeURIComponent(gllentry.split(',')[2].replace(/\;/g,',')) + '~]');
tpurl=tpurl.replace("Brisbane+QLD,+Australia",encodeURIComponent(gllentry.split(',')[2].replace(/\;/g,',')));
if (document.getElementById('sftif') && document.getElementById('iftif')) {
document.getElementById('iftif').src=document.getElementById('iftif').src.replace('&',encodeURIComponent(' to ' + gllentry.split(',')[2].replace(/\;/g,',')) + '&') + ',[' + gllentry.replace(',' + gllentry.split(',')[1] + ',', ',' + gllentry.split(',')[1] + ',~').replace(/\ /g,'%20') + '~]';
document.getElementById('sftif').innerHTML+=' <a target=_blank title="Google Maps Directions" href="' + tpurl.replace('https:','') + '">to</a> <a target=_blank title="' + gllentry.split(',')[2].replace(/\;/g,',') + '" href="//en.wikipedia.org/wiki/' + encodeURIComponent(gllentry.split(',')[2].replace(/\;/g,',')) + '">' + gllentry.split(',')[2].replace(/\;/g,',') + '</a> (' + eval(eval('' + great_circle_distance(document.getElementById(eles[0]).value,document.getElementById(eles[1]).value,document.getElementById(eles[4]).value,document.getElementById(eles[5]).value)) / 1000.000) + ' kilometres)';
document.getElementById('brg').style.backgroundColor='white';
document.getElementById('dist').style.backgroundColor='white';
cwhat=[false,false,true,true,false,false];
ourdist=great_circle_distance(document.getElementById(eles[0]).value,document.getElementById(eles[1]).value,document.getElementById(eles[4]).value,document.getElementById(eles[5]).value);
document.getElementById(eles[3]).value='' + ourdist;
//Let ‘R’ be the radius of Earth,
//‘L’ be the longitude,
//‘θ’ be latitude,
//‘β‘ be Bearing.
//Bearing from point A to B, can be calculated as,
//β = atan2(X,Y),
//where, X and Y are two quantities and can be calculated as:
//X = cos θb * sin ∆L
//Y = cos θa * sin θb – sin θa * cos θb * cos ∆L
ourbrg=eval(eval(360.0 + eval(eval(eval(180.0 / Math.PI) * Math.atan2(
eval(eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value))) *
eval('' + Math.sin(eval(Math.PI / 180.0) * eval(eval('' + document.getElementById(eles[5]).value) - eval('' + document.getElementById(eles[1]).value))))),
eval(eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value))) *
eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value)))) -
eval(eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value))) *
eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value))) *
eval('' + Math.cos(eval(Math.PI / 180.0) * eval(eval('' + document.getElementById(eles[5]).value) - eval('' + document.getElementById(eles[1]).value)))))
)))) % 360.0);
document.getElementById('mysel').value='2';
document.getElementById(eles[2]).value='' + ourbrg;
document.getElementById(eles[2]).style.backgroundColor='lightgreen';
document.getElementById(eles[3]).style.backgroundColor='lightgreen';
}
}
document.getElementById('ipn').placeholder=gllentry.split(',')[2].replace(/\;/g,',');
}
gllentry='';
document.getElementById('placegeo').value='';
}
function lookforg() {
if (document.getElementById('placegeo').value != '') {
gllentry=document.getElementById('placegeo').value + ',' + decodeURIComponent(document.getElementById('ifplacegeo').src.split('?placegeo=')[1]).replace(/\,/g,';');
askit();
} else {
setTimeout(lookforg,1000);
}
}
function checkit(iois) {
if (iois != null) {
if (iois.src.indexOf('?placegeo=') != -1) {
//alert(1);
var aconto = (iois.contentWindow || iois.contentDocument);
//alert(11);
if (aconto != null) {
//alert(111);
if (aconto.document) { aconto = aconto.document; }
//alert(1111);
if (aconto.body != null) {
//alert(2);
document.body.style.cursor='pointer';
if (document.getElementById('placegeo').value != '') {
//alert(3);
gllentry=document.getElementById('placegeo').value + ',' + decodeURIComponent(iois.src.split('?placegeo=')[1]).replace(/\,/g,';');
askit();
} else {
//alert(8);
setTimeout(lookforg,1000);
}
}
}
}
}
}
function lkwk(oiis) {
if (oiis.value.trim() != '') {
var ois=oiis.value.trim().split(';');
document.getElementById('ifplacegeo').src=document.getElementById('ifplacegeo').src.split('?')[0].split('#')[0] + '?placegeo=' + encodeURIComponent(ois[0]);
if (eval('' + ois.length) > 1) { elev=eval('' + ois[1]); evel=Math.max(elev, 2.0); }
oiis.value='';
document.body.style.cursor='progress';
}
}
function fillablemaybe(brgo) {
if (('' + brgo.value).replace(/0/g,'').replace('.','') != '') {
//alert('356:' + document.getElementById('dist').value);
if (('' + document.getElementById('dist').value).replace(/0/g,'').replace('.','') == '' || (fplacen != '' && tplacen == '')) {
//alert(456);
if (('' + document.getElementById('latt').value).replace(/0/g,'').replace('.','') == '' || (fplacen != '' && tplacen == '')) {
//alert(556);
if (('' + document.getElementById('longt').value).replace(/0/g,'').replace('.','') == '' || (fplacen != '' && tplacen == '')) {
//alert(656);
if (('' + document.getElementById('ssf').innerHTML) != '') {
//alert(756);
if (!viastart) {
dok=false;
document.getElementById('dist').focus();
if (1 == 1) { // assume 2m elevation ... thanks to https://en.wikipedia.org/wiki/Horizon
document.getElementById('dist').value='' + Math.floor(Math.pow(eval(eval(2.0 * eval('' + elev)) * 6371000.0), 0.5)) + '.000';
} else {
document.getElementById('dist').value='5000.000';
}
elev=2.0;
brgo.focus();
}
if (mu.indexOf('[051.5072,') != -1) {
//alert(856);
if (!viastart) {
document.getElementById('ifill').click();
}
mu=mu.replace('[051.5072,','[' + document.getElementById('latt').value + ',');
mu=mu.replace(',-00.1275,',',' + document.getElementById('longt').value + ',');
mu=mu.replace(',~LonDon~]',',~' + encodeURIComponent(fplacen + ' looking out at bearing ' + brgo.value + ' degrees towards horizon') + '~]');
mu=mu.replace('=London','=' + encodeURIComponent(fplacen + ' looking out at bearing ' + brgo.value + ' degrees towards horizon'));
//alert('956:' + mu);
//document.getElementById('hplacen').innerHTML='<input type=hidden name=fplacen value="' + mu + '"></input>';
document.getElementById('tdmid').innerHTML='<iframe src="' + mu + '" style="width:100%;height:700px;"></iframe>';
if (viastart) {
fplacen='';
}
}
}
}
}
}
}
}
function predfillablemaybe() {
dfillablemaybe(document.getElementById('dist'));
}
function dfillablemaybe(brgo) {
if (!dok) { return ''; }
var i, ourbrg=0.0, ourdist=0.0, j, dvlat='', dvlong='';
if (('' + brgo.value).replace(/0/g,'').replace('.','') != '') {
//alert('356:' + document.getElementById('dist').value);
if (('' + document.getElementById('dist').value).replace(/0/g,'').replace('.','') == '' || (fplacen != '' && tplacen == '')) {
//alert(456);
if (('' + document.getElementById('latt').value).replace(/0/g,'').replace('.','') == '' || (fplacen != '' && tplacen == '')) {
//alert(556);
if (('' + document.getElementById('longt').value).replace(/0/g,'').replace('.','') == '' || (fplacen != '' && tplacen == '')) {
//alert(656);
if (('' + document.getElementById('ssf').innerHTML) != '') {
//alert(756);
if (!viastart) {
//document.getElementById('brg').focus();
document.getElementById('brg').value='0.0000001';
//brgo.focus();
}
if (mu.indexOf('[051.5072,') != -1) {
//alert(856);
if (!viastart) {
//alert(1);
document.getElementById('ifill').click();
//alert(11);
}
mu=mu.replace('[051.5072,','[' + eval('' + document.getElementById('latt').value).toFixed(3) + ',');
mu=mu.replace(',-00.1275,',',' + eval('' + document.getElementById('longt').value).toFixed(3) + ',');
if (('' + brgo.value).indexOf('000.000') != -1) {
//mu=mu.replace(encodeURIComponent('looking out North'), encodeURIComponent(('' + brgo.value).split('000.000')[0] + 'km Ring'));
mu=mu.replace(',~LonDon~]',',~' + encodeURIComponent(fplacen + ' looking North') + '~]');
mu=mu.replace('=London','=' + encodeURIComponent(fplacen + (' ' + brgo.value).split('000.000')[0] + 'km Ring'));
} else {
mu=mu.replace(',~LonDon~]',',~' + encodeURIComponent(fplacen + ' looking North') + '~]');
mu=mu.replace('=London','=' + encodeURIComponent(fplacen + ' looking out North'));
}
//mu=mu.replace(',~LonDon~]',',~' + encodeURIComponent(fplacen + ' looking North') + '~]');
//mu=mu.replace('=London','=' + encodeURIComponent(fplacen + ' looking out North'));
//alert('956:' + mu);
//document.getElementById('hplacen').innerHTML='<input type=hidden name=fplacen value="' + mu + '"></input>';
//document.getElementById('tdmid').innerHTML='<iframe src="' + mu + '" style="width:100%;height:700px;"></iframe>';
if (viastart) {
for (var dbrg=30; dbrg<=330; dbrg+=30) {
//document.getElementById('brg').value='' + dbrg + '.0000000';
if (('' + document.getElementById('mysel').value) == '2') {
ourbrg=eval(eval(540.0 + 180.0 + eval('' + document.getElementById(eles[2]).value)) % 360.0);
} else {
ourbrg=eval('' + document.getElementById(eles[2]).value);
}
ourbrg=eval('' + dbrg);
for (j=eval(3 - eval(('' + document.getElementById('mysel').value))); j>=1; j--) {
ourdist=eval('' + document.getElementById(eles[3]).value);
//Let first point latitude be la1,
///longitude as lo1,
//d be distance,
//R as radius of Earth,
//Ad be the angular distance i.e d/R and
//θ be the bearing,
//Here is the formula to find the second point, when first point, bearing and distance is known:
//latitude of second point = la2 = asin(sin la1 * cos Ad + cos la1 * sin Ad * cos θ), and
//longitude of second point = lo2 = lo1 + atan2(sin θ * sin Ad * cos la1 , cos Ad – sin la1 * sin la2)
dvlat='' +
eval(eval(eval(180.0 / Math.PI) * Math.asin(
Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value)) *
Math.cos(eval(eval('' + ourdist) / 6371000.0)) +
Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value)) *
Math.sin(eval(eval('' + ourdist) / 6371000.0)) *
Math.cos(eval(Math.PI / 180.0) * eval('' + ourbrg)))));
//Let first point latitude be la1,
//longitude as lo1,
//d be distance,
//R as radius of Earth,
//Ad be the angular distance i.e d/R and
//θ be the bearing,
// longitude of second point = lo2 = lo1 + atan2(sin θ * sin Ad * cos la1 , cos Ad – sin la1 * sin la2)
dvlong='' + eval(eval(180.0 / Math.PI) * eval(eval(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[1]).value)) +
Math.atan2(
eval(eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + ourbrg)) *
eval('' + Math.sin(eval(eval('' + ourdist) / 6371000.0)))) *
eval('' + Math.cos(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value)))),
eval(eval('' + Math.cos(eval(eval('' + ourdist) / 6371000.0))) -
eval(eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[0]).value)))) *
eval('' + Math.sin(eval(Math.PI / 180.0) * eval('' + document.getElementById(eles[4]).value)))))));
mu+=',[' + eval('' + dvlat).toFixed(3) + ',' + eval('' + dvlong).toFixed(3) + ',~' + dbrg + '~]';
}
}
document.getElementById('tdmid').innerHTML='<iframe src="' + mu + '" style="width:100%;height:700px;"></iframe>';
fplacen='';
}
}
}
}
}
}
}
}
</script>
</head>
<body onload='moremaybe();'>
<form id=gform method=GET action='//www.rjmprogramming.com.au/HTMLCSS/missing_two.html'><div id=hplacen></div>
<div id=dtop style=display:block;>
<h1 id=myh1 style='display:block;'>Missing Two (<font size=1>optional</font> <span onclick="this.value=this.value.replace('to','From').replace('from','to').replace('From','from'); " id=spfr title='Click me to toggle between from and to' style='cursor:pointer;'>from</span> <input title='Optionally semicolon separate an elevation affecting horizon distance used for Place Name/Bearing (where Compass app might show you this elevation value) input scenarios. Note that a Place Name/Distance scenario shows a Locality Distance Ring map.' onblur='lkwk(this);' style='display:inline-block;width:250px;' placeholder='Place Name' id=ipn value='' type=text></input>) in a Table Column <span data-onfocus="document.getElementById('semail').innerHTML='';" data-title='Email to (append a space to just show the table cell with the gradient)?' data-contenteditable=true data-onblur=preemail(this.innerHTML); onclick=emailit(''); id=semail title=Email>📧</span> <span data-onfocus="document.getElementById('semail').innerHTML='';" data-title='SMS to?' data-contenteditable=true data-onblur=preemail(this.innerHTML); onclick=toize(''); id=ssms title=SMS>📟</span></h1>
<h3 id=myh3 style='display:block;'>RJM Programming - December, 2018</h3>
<h3>Thanks to <a target=_blank title='Thanks' href='//www.igismap.com/formula-to-find-bearing-or-heading-angle-between-two-points-latitude-longitude/'>https://www.igismap.com/formula-to-find-bearing-or-heading-angle-between-two-points-latitude-longitude/</a></title>
</div>
<table border=10 cellspacing=2 cellpadding=2 style='width:100%;' id=myt>
<tbody id=tdlook>
<tr id=trhead style='display:table-row;'><th style='width:30%;text-align:left;background-color:#f0e0d0;'><a title='Show nearest TimeZone places' id=afrom onclick=mapit(this); style='cursor:pointer;text-decoration:underline;'>From</a><span id=ssf></span> <div id=dfrom style='display:none;'></div></th><th style='width:30%;text-align:left;background-color:#e0d0f0;'> ... On The Way ...</th><th style='text-align:left;background-color:#d0f0e0;'><a title='Show nearest TimeZone places' id=ato onclick=mapit(this); style='cursor:pointer;text-decoration:underline;'>To</a><span id=sst></span> <div id=dto style='display:none;'></div></th></tr>
<tr id=trorig style='display:table-row;'><td id='from'>
Latitude (decimal degrees): <br> <input title='' style='width:90px;' onchange='this.style.backgroundColor="pink";cwhat[0]=false; cwhat[1]=false; if (!decided) { if (!cwhat[5]) { cwhat[5]=true; } if (!cwhat[4]) { cwhat[4]=true; } decided=true; } top.document.getElementById("ltf").value=this.value; ' onblur='this.style.backgroundColor="pink";cwhat[0]=false; cwhat[1]=false; if (!decided) { if (!cwhat[5]) { cwhat[5]=true; } if (!cwhat[4]) { cwhat[4]=true; } decided=true; } top.document.getElementById("ltf").value=this.value; ' id=latf name=latf type=number min=-90.0000000 max=90.0000000 step=0.0000010 value='0.0000000'></input><br>
Longitude (decimal degrees):<br> <input title='' style='width:90px;' onchange='this.style.backgroundColor="pink"; cwhat[0]=false; cwhat[1]=false; if (!decided) { if (!cwhat[5]) { cwhat[5]=true; } if (!cwhat[4]) { cwhat[4]=true; } decided=true; } top.document.getElementById("lgf").value=this.value; ' onblur='this.style.backgroundColor="pink"; cwhat[0]=false; cwhat[1]=false; if (!decided) { if (!cwhat[5]) { cwhat[5]=true; } if (!cwhat[4]) { cwhat[4]=true; } decided=true; } top.document.getElementById("lgf").value=this.value; ' id=longf name=longf type=number min=-180.0000000 max=180.0000000 step=0.0000010 value='0.0000000'></input>
</td><td id='ontheway'>
Bearing <select id="mysel" onchange="myselit(this);"><option value='2'>From->To</option><option value='1'>To->From</option></select> (decimal degrees): <input style='width:90px;' onchange='this.style.backgroundColor="pink"; cwhat[3]=false; cwhat[2]=false; if (!decided) { decided=true; } ' onblur='this.style.backgroundColor="pink"; cwhat[3]=false; cwhat[2]=false; if (!decided) { decided=true; } fillablemaybe(this); ' id=brg name=brg type=number min=-360.0000000 max=360.0000000 step=0.0000010 value='0.0000000'></input><br>
Distance (metres): <input style='width:90px;' onchange='this.style.backgroundColor="pink"; cwhat[3]=false; cwhat[2]=false; if (!decided) { decided=true; } ' onblur='this.style.backgroundColor="pink"; cwhat[3]=false; cwhat[2]=false; if (!decided) { decided=true; } dfillablemaybe(this); ' id=dist name=dist type=number min=0.000 step=0.001 value='0.000'></input>
</td><td id='to'>
Latitude (decimal degrees): <br> <input title='' style='width:90px;' onchange='this.style.backgroundColor="pink"; cwhat[4]=false; cwhat[5]=false; if (!decided) { if (!cwhat[1]) { cwhat[1]=true; } if (!cwhat[0]) { cwhat[0]=true; } decided=true; } top.document.getElementById("ltt").value=this.value; ' onblur='this.style.backgroundColor="pink"; cwhat[4]=false; cwhat[5]=false; if (!decided) { if (!cwhat[1]) { cwhat[1]=true; } if (!cwhat[0]) { cwhat[0]=true; } decided=true; } top.document.getElementById("ltt").value=this.value; ' id=latt name=latt type=number min=-90.0000000 max=90.0000000 step=0.0000010 value='0.0000000'></input><br>
Longitude (decimal degrees)<span onclick='moreifok();' id=slong>:</span><br> <input title='' style='width:90px;' onchange='this.style.backgroundColor="pink"; cwhat[5]=false; cwhat[4]=false; if (!decided) { if (!cwhat[1]) { cwhat[1]=true; } if (!cwhat[0]) { cwhat[0]=true; } decided=true; } top.document.getElementById("lgt").value=this.value; ' onblur='this.style.backgroundColor="pink"; cwhat[4]=false; cwhat[5]=false; if (!decided) { if (!cwhat[1]) { cwhat[1]=true; } if (!cwhat[0]) { cwhat[0]=true; } decided=true; } top.document.getElementById("lgt").value=this.value; ' id=longt name=longt type=number min=-180.0000000 max=180.0000000 step=0.0000010 value='0.0000000'></input>
</td></tr>
<tr id=next1 style='display:none;'><td id='nfromonthewayto' colspan=3><iframe style='width:100%;' id=niframe src=''></iframe></td></tr>
<tr id=trgraphics style='display:none;'><td id=tdfrom></td><td id=tdmidh></td><td id=tdto></td></tr>
<tr id="trfoot" style='DISPLAY:table-row;'><td><input id=ifill style='background-color:yellow;font-size:24px;display:block;' onclick="calcit(); filltwo();" type=button value='Fill'></input></td><td id=tdmid></td><td><input id=goagain style='display:none;background-color:lightgreen;font-size:24px;' onclick="nextplease(); this.style.display='none';" type=button value='Go Again'></input></td></tr>
</tbody>
</table>
</form>
<input id=outofthisworld style='position:absolute;top:-200px;left:-200px;' type='text' value=''></input>
<iframe onload='checknp(this);' id=nearestif name=nearestif style=display:none; src=about:none></iframe>
<div id=nearest style=display:none;></div><div id=getmell style=display:none;></div>
<form style='display:none;' target=nearestif action=//www.rjmprogramming.com.au/PHP/tz_places.php method=GET>
Place: <input onblur=" if (this.value.length > 0) { document.getElementById('nearestif').src='//www.rjmprogramming.com.au/PHP/tz_places.php?latitude=&longitude=&place=' + encodeURIComponent(this.value); } " type=text name=place value=></input>
Latitude: <input type=number id=latitude name=latitude value=0.0000 max=90.0000 min=-90.0000 step=0.0001></input>
Longitude: <input type=number id=longitude name=longitude value=0.0000 max=180.0000 min=-180.0000 step=0.0001></input><br>
<input type=submit id=inearest value='Nearest TimeZone Places'></input></form>
<input type=hidden value='' id=ltf></input><input type=hidden value='' id=lgf></input><input type=hidden value='' id=ltt></input><input type=hidden value='' id=lgt></input>
<a target=_top href='sms:' id=asms style=display:none;>SMS</a>
<iframe onload='checkit(this);' style='display:none;' id=ifplacegeo src='../PHP/fgc/index.php'></iframe>
<input type=hidden id=placegeo value=''></input>
</body>
</html>