// this code displays the formatted time (see note below)
// this code copied from your_time.js & 
// any logic changes should be made there.

// copied from day-month-dd-yyy-headers.js
// really should call it, but faster to copy-and-paste

// Month names ----------------------------------------

function makearray(n) {
	this.length = n
	return this
}
monthname = new makearray(12)
monthname[1] = "January"
monthname[2] = "February"
monthname[3] = "March"
monthname[4] = "April"
monthname[5] = "May"
monthname[6] = "June"
monthname[7] = "July"
monthname[8] = "August"
monthname[9] = "September"
monthname[10] = "October"
monthname[11] = "November"
monthname[12] = "December"

// Day names ------------------------------------------

dayname = new makearray(7)
dayname[1] = "Sunday"
dayname[2] = "Monday"
dayname[3] = "Tuesday"
dayname[4] = "Wednesday"
dayname[5] = "Thursday"
dayname[6] = "Friday"
dayname[7] = "Saturday"

// if navigator, then certain UTC functions don't work
// check which browser is being used
var browser = new Object();
browser.version = parseInt(navigator.appVersion);
browser.isNavigator = false;
browser.isIE = false;
if (navigator.appName.indexOf("Netscape") != -1)
	browser.isNavigator = true;
else if (navigator.appName.indexOf("Microsoft") != -1)
	browser.isIE = true;

// document.write ("browser.isNavigator=", browser.isNavigator,
//  	           " browser.isIE=", browser.isIE);

if (browser.isIE == true) {
// note - none of the following lines are indented	

var curtime = new Date();
var curhour = curtime.getUTCHours(); /* inserted UTC */
/*            ^^^^^^^ ------------ the dateObjectName */
/*                    ^^^^^^^^ --- the method */
var curmin = curtime.getUTCMinutes();
var display_min = "0";
var am_pm;

curhour = curhour + 1;
// add one to the hour when we in the P.T. zone are in daylight time
// otherwise remove the above line

// one digit minute
if (curmin < 10) {
   display_min = "0" + curmin;
   }
else {
   display_min = curmin;
   }

if (curhour >= 12) {
   am_pm = "PM";
   document.write(
   "<b>" + (curhour - 12) + ":" + display_min + " " + am_pm + "</b>" + ","
   );
   }
else {
   am_pm = "AM";
   document.write(curhour + ":" + display_min + " " + am_pm + ",");
   }   
   // note that the AM is not bolded
   // and the trailing comma never is

// note - this is the US format, need to see if locale variable
// will properly display time in the user's chosen format

// this is new (e.g., not copied from your_time.js)

var curday = curtime.getUTCDay();
var curmonth = curtime.getUTCMonth();
var curdate = curtime.getUTCDate();
// var curyear = curtime.getUTCFullYear(); not shown for brevity

// document.write ("curday=", curday);
var theday = dayname[curday + 1];
var themonth = monthname[curmonth + 1]

document.write(" on " + theday + ", " + themonth + " " + curdate + ".");

// document.write(customUTCdatestring(new Date()))
}
else {
		document.write ("available above.");
// note - this .js script is called by another .js script and the
// above write makes sense in that context, because it displays
// a snippet.
		
}; /* end of browser true/false leg */
