function showToday(){
	var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday",
				"Thursday","Friday","Saturday");

// Array of month Names
	var monthNames = new Array(
		"January","February","March","April","May","June","July",
		"August","September","October","November","December");

	var now = new Date();
	dojo.byId("today").innerHTML = dayNames[now.getDay()] + ", " + monthNames[now.getMonth()] + " " + now.getDate() + ", " + now.getFullYear();
}

function refilter(option){
	if(option == "All Games and Events")
		schedule_grid.setQuery({});
	else if(option == "All Games")
		schedule_grid.setQuery({game:"1"});
	else if(option == "All Events")
		schedule_grid.setQuery({game:"0"});
	else if(option == "Varsity Games")
		schedule_grid.setQuery({team:"v"});
	else if(option == "JV Games")
		schedule_grid.setQuery({team:"jv"});
	else if(option == "10A Games")
		schedule_grid.setQuery({team:"10A"});
	else if(option == "10B Games")
		schedule_grid.setQuery({team:"10B"});
	else if(option == "9A Games")
		schedule_grid.setQuery({team:"9A"});
	else if(option == "9B Games")
		schedule_grid.setQuery({team:"9B"});
	
	dojo.byId("schedSubTitle").innerHTML = option;	
}

function loadSchedules(){
	getSchedMisc();
	dojo.byId("eventSelect").contentEditable=false;	
	schedule_store = new dojo.data.ItemFileWriteStore({url: "ofphp/schedule.php?sort=all"});

	var schedule_layout = 
	[
		[	//header row1
			{
				name: "Starts",
				field: "starttime",
				width: "70px",
				headerStyles: "text-align:center; font-size: 1.7em; font-weight:bold;",
				cellStyles: "font-size: 1.3em; text-align:right",
				editable: false,
				formatter: formatDateTime
			},			
			{
				name: "Event",
				field: "event_name",
				width:"220px",
				headerStyles: "text-align:center; font-size: 1.7em; font-weight:bold;",
				cellStyles: "font-size: 1.3em;",
				editable: false
			},
			{
				name: "Description",
				field: "description",
				width:"260px",
				headerStyles: "text-align:center; font-size: 1.7em; font-weight:bold;",
				cellStyles: "font-size: 1.3em;",
				editable: false
			},
			{
				name: "Location",
				field: "location",
				width:"auto",
				headerStyles: "text-align:center; font-size: 1.7em; font-weight:bold",
				cellStyles: "text-align:center; font-size: 1.3em",
				editable: false,
				formatter: formatLocation
			},
			{
				name: "Contact",
				field: "contact",
				width:"100px",
				headerStyles: "text-align:center; font-size: 1.7em; font-weight:bold",
				cellStyles: "text-align:center; font-size: 1.3em",
				editable: false,
				formatter: formatContact
			},
			{
				name: "Ends",
				field: "endtime",
				width: "70px",
				headerStyles: "text-align:center; font-size: 1.7em; font-weight:bold;",
				cellStyles: "font-size: 1.3em; text-align:right",
				editable: false,
				formatter: formatDateTime
			},
			{
				name: "Game",
				field: "game",
				width:"0px",
				headerStyles: "visibility: hidden",
				cellStyles: "visibility: hidden",
				editable: false
			},	
			{
				name: "Team",
				field: "team",
				width:"0px",
				headerStyles: "visibility: hidden",
				cellStyles: "visibility: hidden",
				editable: false
			},	
			{
				name: "UID",
				field: "uid",
				width:"0px",
				headerStyles: "visibility: hidden",
				cellStyles: "visibility: hidden",
				editable: false
			}	
		]	
	];
	
	schedule_grid = new dojox.grid.DataGrid({
   		store : schedule_store,
    	structure : schedule_layout,
    	columnReordering : "true",
   		rowsPerPage: 20,
   		escapeHTMLInData: "true"},
   		"schedule_node");

	schedule_grid.startup();
}
			
