// JavaScript Document
<!-- hide it

// 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
   }

// fix mac version communicator bug
function checkOS() {
          if (navigator.appVersion.indexOf("Mac") > 0) return "Macintosh";
          else return "other";
}
var check = checkOS();
    if (check == "Macintosh") {
    week -= 1
   }


// make array for days of week
weekly = new Array("Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");



// assign +- hour for Milan
var ny_hour = hour + 2;
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
   }


//-->
