// safeDays Counter
// Sean Snead

var monthArray = new Array("January","February","March","April","May","June","July","August","September","October","November","December")

function count(yr, mo, dy)
{
	var myDate = new Date()
	var year = myDate.getYear()
	if (year < 1000)
	year = year + 1900
	var month = myDate.getMonth()
	var day = myDate.getDate()
	var myDatestring = monthArray[month] + " " + day + ", " + year
	var accidentstring = monthArray[mo-1] + " " + dy + ", " + yr
	var diff = (Math.round((Date.parse(myDatestring) - Date.parse(accidentstring))/(24*60*60*1000))*1)
	diff = diff -1
	document.write("EMATS, Inc. has worked" + " " + diff + " " + "consecutive days without a lost time accident.")
}
count(2003,07,08)

