// Get the current year (the +1900 business is necessary for Mozilla)
var today = new Date();
var thisYear = today.getYear();
if (thisYear < 2000) { 
	thisYear = thisYear + 1900;
	}

// Determine copyright info to display
function addCopyright () {
		var x = document.documentElement;
		var startDate = x.getAttribute('startdate');		
		if (thisYear != startDate) {
			var dateLine = startDate + "-" + thisYear;
			} else { 
			var dateLine = thisYear;
			}	
		var dateText = document.createTextNode(dateLine);		
		document.getElementById('cdate').appendChild(dateText);	
		var dateText2 = dateText.cloneNode(true);
		if (document.getElementById('cdate2')) {
			document.getElementById('cdate2').appendChild(dateText2);	
			}		
		}
		
// Get URL
function addURL() {
	var urlLine = "URL: " + document.URL;
	var urlText = document.createTextNode(urlLine);
	if (document.getElementById('urlspot')) { 
		document.getElementById('urlspot').appendChild(urlText);
		}
	}
	
addEventSimple(window,'load',addCopyright);

addEventSimple(window,'load',addURL);
	
function addEventSimple(obj,evt,fn) {
	if (obj.addEventListener) 
		obj.addEventListener(evt,fn,false);
	else if (obj.attachEvent) 
		obj.attachEvent ('on'+evt,fn);
	}	
	
// From here down, use month to determine which New gifs display.

// Get the current month (Jan. = 0, etc.)
var thisMonth = today.getMonth();

// Set this month with a value 1-12 
var thisMonth = thisMonth + 1;

// Find last month
if(thisMonth == 1) {
	lastMonth = 12; 
	} else { 
	lastMonth = thisMonth - 1;
	}

// Find month before last
if(thisMonth == 2) {
	monthBefore = 12;
	} else {
	monthBefore = lastMonth - 1;
	}
	
// Array of month names
monthNames = new Array(12);
monthNames[1] = "jan";
monthNames[2] = "feb";
monthNames[3] = "mar";
monthNames[4] = "apr";
monthNames[5] = "may";
monthNames[6] = "jun";
monthNames[7] = "jul";
monthNames[8] = "aug";
monthNames[9] = "sep";
monthNames[10] = "oct";
monthNames[11] = "nov";
monthNames[12] = "dec";

// Generate style declarations for new gifs
var monthBeforeNew = "span.new#" + monthNames[monthBefore] + " { display: inline; }";
var lastMonthNew = "span.new#" + monthNames[lastMonth] + " { display: inline; }";
var thisMonthNew = "span.new#" + monthNames[thisMonth] + " { display: inline; }";
document.write("<Style type='text/css'>" + monthBeforeNew);
document.write(lastMonthNew);
document.write(thisMonthNew + "</style>");

// Generate variables for whatsnew divs
var monthBeforeDiv = "#" + monthNames[monthBefore];
var lastMonthDiv = "#" + monthNames[lastMonth];
var thisMonthDiv = "#" + monthNames[thisMonth];

