// Set up names of libraries and other labels

var tjlib = 'Jefferson / Mercantile';
var mercrr = 'Mercantile Reading Room';
var barneslib = 'Ward Barnes';
var WHMC = 'WHMC / UMSL Archives';

// Set up array for TJ Open and Close times by day of week number (0 = Sunday)

var tjhours = new Array();
tjhours[0] = new Array('12:00pm','08:00pm');  // Sunday
tjhours[1] = new Array('7:30am','10:30pm'); // Monday
tjhours[2] = new Array('8:00am','8:00pm'); // Tuesday
tjhours[3] = new Array('8:00am','5:00pm'); // Wednesday
tjhours[4] = new Array('CLOSED','-'); // Thursday
tjhours[5] = new Array('CLOSED','-');  // Friday
tjhours[6] = new Array('8:00am','4:00pm');  // Saturday

// Set up array for Barnes Open and Close times by day of week number (0 = Sunday)

var barneshours = new Array();
barneshours[0] = new Array('2:00pm','10:00pm');  // Sunday
barneshours[1] = new Array('8:00am','10:00pm'); // Monday
barneshours[2] = new Array('8:00am','8:00pm'); // Tuesday
barneshours[3] = new Array('8:00am','5:00pm'); // Wednesday
barneshours[4] = new Array('CLOSED','-'); // Thursday
barneshours[5] = new Array('CLOSED','-');  // Friday
barneshours[6] = new Array('10:00am','6:00pm');  // Saturday

// Set up array for Mercantile Reading Room Open and Close times by day of week number (0 = Sunday)

var mercrrhours = new Array();
mercrrhours[0] = new Array('CLOSED','-');  // Sunday
mercrrhours[1] = new Array('12:30pm','4:00pm'); // Monday
mercrrhours[2] = new Array('9:00am','4:00pm');  // Tuesday
mercrrhours[3] = new Array('9:00am','4:00pm');  // Wednesday
mercrrhours[4] = new Array('CLOSED','-');  // Thursday
mercrrhours[5] = new Array('CLOSED','-'); // Friday
mercrrhours[6] = new Array('CLOSED','-');  // Saturday

// Set up array for WHMC Open and Close times by day of week number (0 = Sunday)

var WHMChours = new Array();

WHMChours[0] = new Array('CLOSED','-'); // Sunday
WHMChours[1] = new Array('8:00am','4:45pm'); // Monday
WHMChours[2] = new Array('8:00am','9:00pm'); // Tuesday
WHMChours[3] = new Array('8:00am','4:45pm'); // Wednesday
WHMChours[4] = new Array('CLOSED','-'); // Thursday
WHMChours[5] = new Array('CLOSED','-'); // Friday
WHMChours[6] = new Array('CLOSED','-'); // Saturday

// Set up array to hold names of days of the week

var dayofweekname = [];
dayofweekname[0] = 'Sunday';
dayofweekname[1] = 'Monday';
dayofweekname[2] = 'Tuesday';
dayofweekname[3] = 'Wednesday';
dayofweekname[4] = 'Thursday';
dayofweekname[5] = 'Friday';
dayofweekname[6] = 'Saturday';

// Set up array to hold names of months of the year

var monthname = [];
monthname[0] = 'Jan.';
monthname[1] = 'Feb.';
monthname[2] = 'Mar.';
monthname[3] = 'Apr.';
monthname[4] = 'May';
monthname[5] = 'Jun.';
monthname[6] = 'Jul.';
monthname[7] = 'Aug.';
monthname[8] = 'Sep.';
monthname[9] = 'Oct.';
monthname[10] = 'Nov.';
monthname[11] = 'Dec.';

// Retrieve individual elements from current.Date system variable

var currentDate = new Date();

  var dayofweeknum = currentDate.getDay();
  var dayofmonthnum = currentDate.getDate();
  var monthnum = currentDate.getMonth();
  var year = currentDate.getFullYear();

document.write('<b>');
document.write('<font color=\"red\" style=\"font-size:smaller\">Hours for '+ dayofweekname[dayofweeknum] + ', ' + monthname[monthnum] + ' ' + dayofmonthnum  + ' / <a href=\"http://www.umsl.edu/library/about_libraries/hours.html\" target=\"_self\" style=\"color:#0000ff;text-decoration:underline\">More Info</a></font>');
document.write('</b>');
document.write('<table cellpadding=\"0\" style=\"font-size:smaller\">');
document.write('<tr><td><b>' + tjlib     + ': </b></td><td align=\"right\"><b>' +     tjhours[dayofweeknum][0] + ' - ' +     tjhours[dayofweeknum][1] + '</b></td></tr>');
document.write('<tr><td><b>' + barneslib + ': </b></td><td align=\"right\"><b>' + barneshours[dayofweeknum][0] + ' - ' + barneshours[dayofweeknum][1] + '</b></td></tr>');
document.write('<tr><td><b>' + mercrr + ': </b></td><td align=\"right\"><b>' + mercrrhours[dayofweeknum][0] + ' - ' + mercrrhours[dayofweeknum][1] + '</b></td></tr>');
document.write('<tr><td><b>' + WHMC + ': </b></td><td align=\"right\"><b>' + WHMChours[dayofweeknum][0] + ' - ' + WHMChours[dayofweeknum][1] + '</b></td></tr>');
document.write('<tr><td colspan=\"2\" style=\"color:#ff0000\">Computer labs close 30 minutes before libraries.</td></tr>');
document.write('</table>');