// The Weekly Front Page Javascript-science
// by The Weekly Science Combine

// Reinventing the Javascript wheel is always a chore;
// if there's something here that helps, by all means use it.
// You were going to anyway.

function what_is_the_time_please()
{
var localtime = new Date();
var hours = localtime.getHours();
var minutes = localtime.getMinutes();
var timeoffset = 24 - (localtime.getTimezoneOffset()/60);
offsetsuffix = (timeoffset == 0 || timeoffset == 24) ? " (British time)" : " (Foreign time)";
if (hours == 12 && minutes == 0) { document.write("Noon" + offsetsuffix); return; }
if (hours == 0 && minutes == 0) { document.write("Midnight" + offsetsuffix); return; }
var timesuffix = (hours >= 12) ? "pm" : "am";
var why_this_is_the_time = ((hours == 0) ? hours = 12 : (hours > 12) ? hours - 12 : hours);
if (!minutes == 0)
{ why_this_is_the_time += ((minutes < 10) ? " : 0" : " : ") + minutes + " "; }
why_this_is_the_time += timesuffix + offsetsuffix;
document.write(why_this_is_the_time);
}

function is_there_an_address_please(why_let_me_see)
{
if (why_let_me_see.value == "")
{ alert("You are attempting to jape the Science Combine through improper use of a vacuum. These wasteful energies would be better directed to improvement via tasking industry.");
document.sub_up.a.focus(); return false; }
else
if (why_let_me_see.value == "your e-mail")
{ alert("Why, you ought to be featured in the magazine-journals of punning-quippery, sincerely you ought."); document.sub_up.a.focus(); return false; }
else return true;
}

function is_there_a_vote_please(why_let_me_see)
{
var possible_votes = why_let_me_see.length;
var voted = 0;
for (f = 0; f < possible_votes; f ++)
{ if (why_let_me_see[f].checked) { voted = 1; } }

if (voted == 0)
{ alert("You must vote for one resolution."); return false; }
else { return true; }
}

function is_there_something_to_look_for_please(why_let_me_see)
{
if (why_let_me_see.value == "")
{ alert("A search cannot be made for nothing, just as a search cannot be made for everything."); document.amanuensis.e.focus(); return false; }
else
if (why_let_me_see.value == "everything")
{ alert("Most droll."); }
return true;
}

function catch_that_disraeli()
{
document.write('<a href="#f" onclick="please_start_catch_that_disraeli()">Catch That Disraeli</a>');
}

function please_start_catch_that_disraeli()
{
window.open('../3601/catch_that_disraeli', 'disraeli', 'scrollbars=no,status=no,width=320,height=500');
}

function weather_weekly()
{
document.write('<a href="#f" onclick="please_start_weather_weekly()">Weather Weekly</a>');
}

function please_start_weather_weekly()
{
window.open('../3901/weather_weekly', 'weather', 'scrollbars=no,status=no,width=350,height=575');
}

function please_prep_the_reassurance()
{
document.write('<form name="reassurance" method="post" action="javascript:please_pop_the_reassurance()"><font face="verdana" size="2"><input type="submit" value="Reassure me, y\'all"></font></form>');
}

function please_pop_the_reassurance()
{
window.open('../2202/reassure-o-matic', 'reassurance', 'scrollbars=yes,status=no,width=300,height=300');
}