<!--
// ===================================================================
//  Purpose:    To display the current date and time, where ever the 
//              function is called on a page.
//  Developed:  Tina Barfield 5/01/2007
//  Use: In Head <script src="/universal/scripts/datetimestamp.js" language="Javascript" type="text/javascript"></script>
//	     In Body <script>datetimestamp();</script>  Be sure to rap it in whatever style fits
// ===================================================================

function datetimestamp() {
	var Days = new Array('Sunday','Monday','Tuesday','Wednesday',
	    'Thursday','Friday','Saturday');
	var Months = new Array('January','February','March','April','May','June',
	    'July','August','September','October','November','December');

	
	var d = new Date();
	var t_date = leadZero(d.getDate());         // Returns the day of the month
    var t_mon = leadZero(d.getMonth());         // Returns the month as a digit
    var t_year = d.getFullYear();               // Returns 4 digit year
    var t_hour = d.getHours();                  // Returns hours
    var t_min = leadZero(d.getMinutes());                 // Returns minutes
    var t_sec = d.getSeconds();                 // Returns seocnds
    var t_mil = d.getMilliseconds;              // Returns Milliseconds
    var dayName = Days[d.getDay()];
    var monthName = Months[d.getMonth()];
    var ampm = "a.m.";
    
    if (t_hour > 11)
    	ampm = "p.m.";
    if (t_hour  > 12)
	    t_hour -= 12;
    if (t_hour == 0) t_hour = 12;
    t_hour  = leadZero(t_hour);
    
    
    function leadZero(nr) {
	    if (nr < 10) nr = "0" + nr;
	    return nr;
    }
    document.write(t_hour + ':' + t_min + ' ' + ampm + ', ' + monthName + ' ' + t_date + ', ' + t_year + '<br />');
    
    } 
 //-->