/* Occupation Counter */

d = new Array("SUN","MON",
	"TUE","WED",
	"THU","FRI",
	"SAT"
	);
m = new Array("JAN", "FEB",
	"MAR", "APR",
	"MAY", "JUN",
	"JUL", "AUG",
	"SEP", "OCT",
	"NOV", "DEC"
	);

var today, day, date, month, year, dispdate, occdays;
today = new Date();
day = today.getDay();
day = d[day];
date = today.getDate();
if ((date == 1) || (date == 21 ) || (date == 31)) { date = date + "st";} 
else if ((date == 2) || (date == 22 )) { date = date + "nd";} 
else if ((date == 3) || (date == 23 )) { date = date + "rd";}
else { date = date + "th";}
month = today.getMonth();
month = m[month];
year = today.getYear();
if (year < 1900) { year = year + 1900;}
dispdate = day + ", " + date + " " + month + " " + year;

// Set date1temp to 09/04/2003 (start of occupation)
// date1temp = new Date("04/09/2003 00:00:00");
date1temp = new Date();
date1temp.setTime(1049842800000);
// Find how many days have passed since start of occupation
date2temp = new Date();
timediff = Math.abs(date2temp.getTime() - date1temp.getTime());
occdays = Math.floor(timediff / (1000 * 60 * 60 * 24));

var topmsg
var mindate
mindate = new Date("06/05/2004 00:00:00");
if (today > mindate) { topmsg = "<span class=\"occdays\">" + occdays + " days of occupation</span>"; }
else { topmsg = "<span class=\"date\">For info, contact: <a href=\"mailto:info@vitw.org\" >info@vitw.org</a></span>";}