// JavaScript Document

function docketDates() {
	var month = new Array(12);
	month[0] = "January";
	month[1] = "February";
	month[2] = "March";
	month[3] = "April";
	month[4] = "May";
	month[5] = "June";
	month[6] = "July";
	month[7] = "August";
	month[8] = "September";
	month[9] = "October";
	month[10] = "November";
	month[11] = "December";
	
	var day = new Array(7);
	day[0] = "Sunday";
	day[1] = "Monday";
	day[2] = "Tuesday";
	day[3] = "Wednesday";
	day[4] = "Thursday";
	day[5] = "Friday";
	day[6] = "Saturday";
	
	var today = new Date();
	var x = (day[today.getDay()]);
	var msperday = 1000 * 60 * 60 * 24;
	
	
	

	var pdftoday="today.pdf";
	var pdftomorrow="tomorrow.pdf";	
	var docsection ="Boston";
	
	var surl = window.location+"-";

	
	
	if(surl.indexOf("boston-calendar") > 0)
	{
		pdftoday = "today.pdf";
		pdftomorrow = "tomorrow.pdf";
		docsection ="Boston";
	}
	if(surl.indexOf("springfield-calendar")>0)
	{
		pdftoday = "todaysfd.pdf";
		pdftomorrow = "tomorrowsfd.pdf";
		docsection ="Springfield";
	}
	if(surl.indexOf("worcester-calendar")>0)
	{
		pdftoday = "todaywor.pdf";
		pdftomorrow = "tomorrowwor.pdf";
		docsection ="Worcester";
	}

document.write("<li><a href='http://www.mad.uscourts.gov/inet/" + pdftoday + "'>" + docsection +" Courtlist For: " + day[today.getDay()] + ", " + month[today.getMonth()]+ " " + today.getDate() + ", " + today.getFullYear() + "</a> <img src='../utils/images/misc/pdfIcon.gif' border='0' /></li>");
	
	if (x == "Friday") {
		var next = today.getTime() + 3 * msperday;
	}
	else {
		var next = today.getTime() + 1 * msperday;
	}
	
	var tomorrow = new Date(next);
	
	document.write("<li><a href='http://www.mad.uscourts.gov/inet/" + pdftomorrow + "'>" + docsection +"  Courtlist For: " + day[tomorrow.getDay()] + ", " + month[tomorrow.getMonth()]+ " " + tomorrow.getDate() + ", " + tomorrow.getFullYear() + "</a> <img src='../utils/images/misc/pdfIcon.gif' border='0' /></li>");

	
}