<!doctype html>
<html>
<head>
<title>Daylight Saving Time Information - RJM Programming - September, 2015 - Thanks go to http://gomashup.com and https://en.wikipedia.org/wiki/List_of_tz_database_time_zones</title>
<link href='//www.rjmprogramming.com.au/PHP/emboss_h1.css' rel='stylesheet' type='text/css'>
<style> td { text-align: center; } table { border: 5px teal solid; } </style>
<script type='text/javascript'>

var callback=false;
var timezone=0;
var place="";
var region="";
var firsttime=true;
var wois=null;
var gotforced=false;

var aconto;
var bad=false;

var tpurl="https://www.google.com/maps/dir/Sydney+NSW,+Australia/Brisbane+QLD,+Australia"; // /@-30.5802325,147.5907076,6z/data=!3m1!4b1!4m13!4m12!1m5!1m1!1s0x6b129838f39a743f:0x3017d681632a850!2m2!1d151.2069902!2d-33.8674869!1m5!1m1!1s0x6b91579aac93d233:0x402a35af3deaf40!2m2!1d153.0234489!2d-27.4710107";
tpurl="https://www.google.com/maps/dir/Sydney,+Australia/Brisbane,+Australia";

var origtpurl=tpurl;
var isok=-1;

var lastis="";
var lasttitle="";

timezone=location.search.split('timezone=')[1] ? location.search.split('timezone=')[1].split('&')[0] : -99;
place=location.search.split('place=')[1] ? location.search.split('place=')[1].split('&')[0] : place;
region=location.search.split('region=')[1] ? location.search.split('region=')[1].split('&')[0] : region;

if (timezone != -99) firsttime=false;

function prerepos() {
if (isok == -1) {
var r = confirm("Press OK to show places on a Google Map for this session, or Cancel to show Timezone information.");
if (r == true) {
isok=1;
} else {
isok=0;
document.getElementById('thgm').style.display='none';
}
}
document.getElementById('label').value="['Lat',";
document.getElementById('value').value="'Lon', 'Name']";
document.getElementById('data').value+=(lasttitle);
//document.getElementById('data').innerHTML+=decodeURIComponent(lasttitle);
if (isok == 1) {
var mysrc=document.getElementById('myform').action;
mysrc+="?title=" + document.getElementById('title').value;
mysrc+="&label=" + document.getElementById('label').value;
mysrc+="&value=" + document.getElementById('value').value;
mysrc+="&data=" + document.getElementById('data').value;
if (mysrc.length < 600) {
document.getElementById('mapif').style.display='block';
document.getElementById('mapif').src=mysrc;
} else {
document.getElementById('mapsubmit').click();
}
}
return isok;
}

function repos() {
if (isok == 1) {
window.scrollTo(0,0);
}
if (wois != null) {
wois=wois;
}
}

function process() {
var iois=document.getElementById('myiframe');
var disp=true;tzi="", dst="", gmt="";
var i, badresult="Sorry, but no data found, even though we tried looking very very very hard.", stuff, dqstuff;
var tablestuff="<table><thead><tr><th>Time Zone ID</th><th>Daylight Saving Time (Now)</th><th>Greenwich Mean Time(zone)</th></tr></thead><tbody></tbody></table>";
var pt=tablestuff;
try {
if (iois != null) {
aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
//document.getElementById('result').innerHTML="";
stuff=aconto.body.innerHTML.split(" : ");
if (stuff.length > 1) {
for (i=1; i<stuff.length; i+=3) {
dqstuff=stuff[i].split('"');
tzi=dqstuff[1];
dqstuff=stuff[eval(1 + i)].split('"');
dst=dqstuff[1];
dqstuff=stuff[eval(2 + i)].split('"');
gmt=dqstuff[1];
disp=true;
if (region != "") {
if (("~" + tzi).indexOf("~" + region + "-") == -1) disp=false;
}
if (place != "") {
if (tzi.toLowerCase().replace(/_/g,' ').indexOf(place.toLowerCase().replace(/_/g,' ')) == -1) disp=false;
}
if (disp) {
tablestuff=tablestuff.replace("</tbody>", "<tr><td>" + tzi + "</td><td>" + dst + "</td><td>" + gmt + "</td></tr></tbody>");
}
}
}
if (pt != tablestuff) document.getElementById('result').innerHTML=tablestuff;
badresult="";
}
}
}
if (badresult != "") document.getElementById('result').innerHTML=badresult;
} catch (ee) { }
look();
}

function checkforcallback() {
if (timezone == -99) {
timezone=10;
} else {
firsttime=false;
callback=true;
document.getElementById('timezone').value = timezone;
document.getElementById('place').value = place;
document.getElementById('region').value = region;
//alert("./daylight_saving_time.php?url=" + encodeURIComponent('http://gomashup.com/json.php?fds=geo/timezone/gmt/' + timezone + '&jsoncallback=?'));
document.getElementById('myiframe').src="./daylight_saving_time.php?url=" + encodeURIComponent('http://gomashup.com/json.php?fds=geo/timezone/gmt/' + timezone + '&jsoncallback=?');
//setTimeout(process,2000);
}

}

function fixit(tval) {
document.getElementById('url').value='http://gomashup.com/json.php?fds=geo/timezone/gmt/' + tval + '&jsoncallback=?';
populatesel(document.getElementById('lookif'));
}

function look() {
var asis=document.getElementsByTagName("a"), wasgf=gotforced;
for (var ia=0; ia<asis.length; ia++) {
if (asis[ia].className) {
if (asis[ia].className == "onload") {
isok=1;
wasgf=true;
asis[ia].click();
}
}
}
gotforced=wasgf;
}

function goesinto(ourv,intop) {
document.getElementById(intop).value=ourv;
otzmaybe();
}

function populatesel(iois) {
var tpl, afters, disp=true, sfrom=document.getElementById('sfrom').innerHTML, sto=document.getElementById('sto').innerHTML;
if (iois != null) {
aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
sfrom="<option value=''>This (Trip Planner) From place can go in at left</option>";
sto="<option value=''>This (Trip Planner) To place can go in at right</option>";
var thisregion=document.getElementById('region').value;
var thistimezone=document.getElementById('timezone').value.replace("−", "-");
//alert(aconto.body.innerHTML);
var llplaces=aconto.body.innerHTML.split('~');
if (llplaces.length > 1) {
for (var jj=1; jj<llplaces.length; jj+=2) {
disp=true;
tpl=llplaces[jj].split('~');
afters=tpl[0].split('/');
if (thistimezone != "") {
if (llplaces[eval(1 + jj)].replace(".5","").replace(".5","").replace("−", "-").replace("−", "-").indexOf('"GMT" : "' + thistimezone.replace("−", "-") + '"') == -1) disp=false;
}
if (thisregion != "") {
//alert("*" + afters[0].toLowerCase() + "*!" + thisregion.toLowerCase() + "!");
if (afters[0].toLowerCase() != thisregion.toLowerCase()) disp=false;
}
if (disp) {
sfrom+='<option value="' + tpl[0].replace(afters[0] + '/', '') + '">' + tpl[0] + '</option>';
sto+='<option value="' + tpl[0].replace(afters[0] + '/', '') + '">' + tpl[0] + '</option>';
}
}
}
document.getElementById('sfrom').innerHTML=sfrom;
document.getElementById('sto').innerHTML=sto;
}
}
}
}

function otzmaybe() {
var selo, abits, aplace, aval;
if (document.getElementById('place').value != "" && document.getElementById('to').value != "") {
if (document.getElementById('timezone').value == "") {
if (document.getElementById('timezone').innerHTML.indexOf(">Please ") !== -1) {
document.getElementById('timezone').innerHTML=document.getElementById('timezone').innerHTML.replace('>Please ', '>Optionally, please ');
}
}
var titlebit="";
var thing='sfrom';
selo=document.getElementById(thing);
//alert(document.getElementById(thing).value);
if (document.getElementById(thing).value == "") {
thing='place';
aval=document.getElementById(thing).value;
abits=aval.replace(/_/g,"+").replace(/-/g,"+").split('/');
} else {
aval=selo.options[selo.selectedIndex].text;
abits=aval.replace(/_/g,"+").replace(/-/g,"+").split('/');
}
aplace=aval.replace(abits[0] + "/", "");
titlebit=aplace + ", " + abits[0] + " to ";
//alert(document.getElementById(thing).value);
var fromto=aplace + ",+" + abits[0] + "/";
thing='sto';
selo=document.getElementById(thing);
if (document.getElementById(thing).value == "") {
thing='to';
aval=document.getElementById(thing).value;
abits=aval.replace(/_/g,"+").replace(/-/g,"+").split('/');
} else {
aval=selo.options[selo.selectedIndex].text;
abits=aval.replace(/_/g,"+").replace(/-/g,"+").split('/');
}
aplace=aval.replace(abits[0] + "/", "");
titlebit+=aplace + ", " + abits[0] + " via Google Maps directions ... thanks";
fromto+=aplace + ",+" + abits[0];
tpurl=origtpurl.replace("Sydney,+Australia/Brisbane,+Australia", fromto);
document.getElementById('thetrip').innerHTML=document.getElementById('thetrip').innerHTML.replace('->', '-<a style="text-decoration:none; border: 3px purple solid; background-color: yellow;" title="' + titlebit + '" href="#" onclick="window.open(' + "'" + tpurl + "'" + ',' + "'" + "_blank" + "'" + ',' + "'" + "top=550,left=10,width=775,height=250" + "'" + ');">✈</a>');
}
}

</script>
</head>
<body style='background-color: lightgreen;' onload'checkforcallback();'>
<h1 align='center'>Daylight Saving Time Information - RJM Programming - September, 2015</h1>

<h3 align='center'>Check out Timezone Places or Check a Particular Place ... Thanks to <a target=_blank title='Gomashup.com' href='http://www.gomashup.com'>GoMashup</a> and <a target=_blank title='Wikipedia Timezone page ... thanks' href='https://en.wikipedia.org/wiki/List_of_tz_database_time_zones'>Wikipedia</a> and <a target=_blank title='Google Maps (directions) ... thanks' href='http://maps.google.com'>Google</a></h3>

<!--h4 align='center'>Check out Timezone Places or Check a Particular Place</h4-->

<div align='center'>
<form target='myiframe' action='./daylight_saving_time.php' method='GET'>
Timezone (nominal hours from GMT): <select onchange='fixit(this.value);' id='timezone' name='timezone'><option id='otz' value=''>Please select a timezone below ...</option>
<option value='-18'>-18</option>
<option value='-17'>-17</option>
<option value='-16'>-16</option>
<option value='-15'>-15</option>
<option value='-14'>-14</option>
<option value='-13'>-13</option>
<option value='-12'>-12</option>
<option value='-11'>-11</option>
<option value='-10'>-10</option>
<option value='-9'>-9</option>
<option value='-8'>-8</option>
<option value='-7'>-7</option>
<option value='-6'>-6</option>
<option value='-5'>-5</option>
<option value='-4'>-4</option>
<option value='-3'>-3</option>
<option value='-2'>-2</option>
<option value='-1'>-1</option>
<option value='0'>Greenwich Mean Time</option>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
<option value='5'>5</option>
<option value='6'>6</option>
<option value='7'>7</option>
<option value='8'>8</option>
<option value='9'>9</option>
<option value='10'>10</option>
<option value='11'>11</option>
<option value='12'>12</option>
<option value='13'>13</option>
<option value='14'>14</option>
<option value='15'>15</option>
<option value='16'>16</option>
<option value='17'>17</option>
<option value='18'>18</option>
</select><br><div id='tripplanner' style='background-color:pink;' title='Trip Planner?'><br>
Place(s) (optional - can be states): <input onchange='otzmaybe();' type='text' name='place' id='place' value=''></input><div id='d_to_from' style='display:inline;'>  <select id='sfrom' onchange="goesinto(this.value,'place');"><option value=''>This (Trip Planner) From place can go in at left</option></select>  <span id='thetrip'>----->----->--->-->-></span>  <select id='sto' onchange="goesinto(this.value,'to');"><option value=''>This (Trip Planner) To place can go in at right</option></select>  <input onchange='otzmaybe();' type='text' name='to' id='to' value=''></input></div><br><br></div><br>
Region (optional): <select onchange="populatesel(document.getElementById('lookif'));" id='region' name='region'><option value=''>Optionally, please select a region below ...</option>
<option value='Africa'>Africa</option>
<option value='America'>America</option>
<option value='Antarctica'>Antarctica</option>
<option value='Arctic'>Arctic</option>
<option value='Asia'>Asia</option>
<option value='Atlantic'>Atlantic</option>
<option value='Australia'>Australia</option>
<option value='Europe'>Europe</option>
<option value='Indian'>Indian</option>
<option value='Pacific'>Pacific</option>
</select>
<input name='url' id='url' type='hidden' value='http://gomashup.com/json.php?fds=geo/timezone/gmt/&jsoncallback=?'></input>
<br><br><input onclick='setTimeout(process,2000);' style='background-color:orange;' type='submit' value='Show Results Below'></input>
</form> <br><br>
</div>

<iframe name='myiframe' style='display:none;' onload=' if (firsttime) { firsttime=false; } else if (1 == 2) { setTimeout(process,2000); }' style='width:100%;' id='myiframe' src=''></iframe>
<iframe id='lookif' style='display:none;' onload='populatesel(this);' style='width:100%;' src='wbits.html'></iframe>
<div align='center' id='result' style='background-color:yellow;'></div>
</body>
</html>