function formatDate(date) {
	var monthNames = [
		"January", "February", "March",
		"April", "May", "June", "July",
		"August", "September", "October",
		"November", "December"
	];

	var dayNames  = [
		"Sunday","Monday","Tuesday","Wednesday",
		"Thursday","Friday","Saturday"				
	]

	var days = date.getDay();
	var day = date.getDate();
	var monthIndex = date.getMonth();
	var year = date.getFullYear();

	return dayNames[days] + ', ' + monthNames[monthIndex] + ' ' +day + ', ' + year;
}
document.getElementById("datepicker").innerHTML = formatDate(new Date());
