// ha ha our date is better than theirs! ours has prefixes.. ha ha ha

function drawDate() {
	document.getElementById('container').innerHTML = getDateFormat();
}

function getDateFormat() {
	var now = new Date();
	day = now.getDay();
	date = now.getDate();
	month = now.getMonth();
	year = now.getFullYear();
	days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
	months = ['January','Feburary','March','April','May','June','July','August','September','October','November','December'];
	return days[day] + ' ' + date + getDatePrefix(date) + ' ' + months[month] + ' ' + year;
}

function getDatePrefix(n) {
	xnd = [2, 22]; // the nd's
	xst = [1, 21]; // the st's
	xrd = [3, 23]; // the rd's
	// check for nd's
	for (i = 0; i < xnd.length; i++) {
		if (n == xnd[i]) {
			return 'nd';
		}
	}
	// check for st's
	for (i = 0; i < xst.length; i++) {
		if (n == xst[i]) {
			return 'st';
		}
	}
	// check for rd's
	for (i = 0; i < xrd.length; i++) {
		if (n == xrd[i]) {
			return 'rd';
		}
	}
	// otherwise... it's a th
	return 'th';
}