// This is my first ever made-from-scratch JavaScript.  It probably shows.
// It reads local time of the client computer, translates it to GMT, then does
// the math to show the time in a few cities around the world.  Feel free
// to use it, and modify it as you see fit; but leave this disclaimer in-
// tact.
//
// Only works on Communicator4, but should be gracefully ignored by lesser
// browsers.
//
// By using this JavaScript, you are acknowledging that the author,
// Stuart Price, can not be held responsible for any damage to hardware
// or software; spelling mistakes; tardiness; or waking your mother at
// 3:00 a.m. because the JavaScript said it was 3:00 p.m. in Denver.
//
//                                        Stuart Price
//                                        Forest Industries
//                                        stuart@4est.com
//                                        http://www.4est.com/

// get the date and change it to GMT string
var date = new Date();
var timegmt = date.toGMTString();

// split the GMT string at spaces
time_string = timegmt.split(' ');

// assign variables
week = time_string[0];
day = time_string[1];
mon = time_string[2];
year = time_string[3];
hms = time_string[4];

// split the time part on colon
hms_string = hms.split(':');

// assign variables
var hour = hms_string[0] - 0;
var min = hms_string[1];

// convert day-of-week variables to numbers
if (week == 'Sun,') {
   week = 1
   }
if (week == 'Mon,') {
   week = 2
   }
if (week == 'Tue,') {
   week = 3
   }
if (week == 'Wed,') {
   week = 4
   }
if (week == 'Thu,') {
   week = 5
   }
if (week == 'Fri,') {
   week = 6
   }
if (week == 'Sat,') {
   week = 7
   }

// make array for days of week
weekly = new Array("Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");



// assign +- hour for San Francisco
var sf_hour = hour - 7;
var sf_week = week;
var sf_ampm = " a.m.";
if (sf_hour < 0) {
   sf_hour += 24
   sf_week -= 1
   }
if (sf_hour > 11) {
    sf_ampm = " p.m."
    }
if (sf_hour > 12) {
   sf_hour -= 12
   }
if (sf_hour == 0) {
   sf_hour = 12
   }

// assign +- hour for Denver
var den_hour = hour - 6;
var den_week = week;
var den_ampm = " a.m.";
if (den_hour < 0) {
   den_hour += 24
   den_week -= 1
   }
if (den_hour > 11) {
    den_ampm = " p.m."
    }
if (den_hour > 12) {
   den_hour -= 12
   }
if (den_hour == 0) {
   den_hour = 12
   }

// assign +- hour for Memphis
var mem_hour = hour - 5;
var mem_week = week;
var mem_ampm = " a.m.";
if (mem_hour < 0) {
   mem_hour += 24
   mem_week -= 1
   }
if (mem_hour > 11) {
    mem_ampm = " p.m."
    }
if (mem_hour > 12) {
   mem_hour -= 12
   }
if (mem_hour == 0) {
   mem_hour = 12
   }

// assign +- hour for New York
var ny_hour = hour - 4;
var ny_week = week;
var ny_ampm = " a.m.";
if (ny_hour < 0) {
   ny_hour += 24
   ny_week -= 1
   }
if (ny_hour > 11) {
    ny_ampm = " p.m."
    }
if (ny_hour > 12) {
   ny_hour -= 12
   }
if (ny_hour == 0) {
   ny_hour = 12
   }

// assign +- hours for London
var lon_hour = hour + 1;
var lon_week = week;
var lon_ampm = " a.m.";
if (lon_hour > 24) {
   lon_hour -= 24
   lon_week += 1
   }
if (lon_hour > 11) {
    lon_ampm = " p.m."
    }
if (lon_hour > 12) {
   lon_hour -= 12
   }
if (lon_hour == 0) {
   lon_hour = 12
   }

// assign +- hours for Paris
var par_hour = hour + 2;
var par_week = week;
var par_ampm = " a.m.";
if (par_hour > 24) {
   par_hour -= 24
   par_week += 1
   }
if (par_hour > 11) {
    par_ampm = " p.m."
    }
if (par_hour > 12) {
   par_hour -= 12
   }
if (par_hour == 0) {
   par_hour = 12
   }

// assign +- hours for Moscow
var mos_hour = hour + 3;
var mos_week = week;
var mos_ampm = " a.m.";
if (mos_hour > 24) {
   mos_hour -= 24
   mos_week += 1
   }
if (mos_hour > 11) {
    mos_ampm = " p.m."
    }
if (mos_hour > 12) {
   mos_hour -= 12
   }
if (mos_hour == 0) {
   mos_hour = 12
   }

// assign +- hours for Moscow
var ban_hour = hour + 7;
var ban_week = week;
var ban_ampm = " a.m.";
if (ban_hour > 24) {
   ban_hour -= 24
   ban_week += 1
   }
if (ban_hour > 11) {
    ban_ampm = " p.m."
    }
if (ban_hour > 12) {
   ban_hour -= 12
   }
if (ban_hour == 0) {
   ban_hour = 12
   }

// assign +- hours for Tokyo
var tok_hour = hour + 9;
var tok_week = week;
var tok_ampm = " a.m.";
if (tok_hour > 24) {
   tok_hour -= 24
   tok_week += 1
   }
if (tok_hour > 11) {
    tok_ampm = " p.m."
    }
if (tok_hour > 12) {
   tok_hour -= 12
   }
if (tok_hour == 0) {
   tok_hour = 12
   }

