









































































// I M I R A G E
//
// Fitness Plaza Schedule Display
// Author: Brion Updegrove (updegroveb@imirage.com)
// Date: 10/15/03
// Description: Display the day and schedule on the homepage

// this function is called onLoad of body and gets the day of the week
function getDayOfWeek()
{
	var dayArray = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');

	var thisTime = new Date();
	var thisDay = thisTime.getDay();
	var today = dayArray[thisDay];
	return today;
}

// this function gets the day of week number 0 - 6
function getDayNumOfWeek()
{
	var thisTime = new Date();
	var thisDay = thisTime.getDay();
	return thisDay;
}

//this function is called onLoad of body and displays schedule based on day
function scheduleDisplay()
{
	// schedule arrays
	var sunSched = new Array("9:00","Member's Choice 90 minutes (Room #2)","9:00","Power Pacing (Room #1)","10:30","Zumba (50 minutes)");
	var monSched = new Array("5:05","Step / Interval","8:30","Power Pacing 55 minutes (Room #1)","9:30","Power Toning 90 minutes (Room #1)","9:30","Modified Asthanga Yoga 85 minutes (Room #2)","11:00","Light N Easy","5:30","Simply Step 60 minutes","6:30","Power Pacing 55 minutes (Room #1)");
	var tueSched = new Array("6:05","Fit Step","8:00","Zumba","9:30","Pilates Mat 60 minutes (Room #2)","10:30","Gentle Flow Yoga (Room #1)","12:00","Power Pacing- 45 minutes (Room #1)","4:30","Total Body Fitness (Room #1)","5:30","Gentle Flow Yoga (Room #2)","5:30","Members Choice w/ Abs (Room #2)","6:45","Zumba");
    var wedSched = new Array("6:00","AM Power Stretch (Room #1)","8:30","Power Pacing 45 minutes (Room #1)","9:30","Cycle Pump (Room #1)","9:30","Modified Asthanga Yoga 85 minutes (Room #2)","10:30","Zumba Express (45 minutes)","4:30","Pilates","5:25","Light N Up (Room #2)","5:30","Member's Choice 60 minutes","6:30","Power Pacing (Room #1)","6:45","Zumba (50 minutes Room #2)");
	var thuSched = new Array("6:05","Bike and Box (Room #2)","9:30","Your Bodies (Room #2)","9:30","Cardio Blast (Room #1)","12:00","Power Pacing 55 minutes (Room #1)","4:30","Zumba (Room #1)","5:15","Vinyasa Flow Yoga (Room #2)","5:30","Boot Camp 75 minutes","6:45","Pilates");
	var friSched = new Array("5:05","Member's Choice","6:00","Power Pacing 45 minutes (Room #1)","7:00","Modified Asthanga Yoga","8:30","Power Pacing 55 minutes (Room #1)","9:30","Power Toning 90 minutes (Room #1)","9:30","Vinyasa Flow Yoga 85 minutes (Room #2)");
	var satSched = new Array("8:00","Power Pacing 55 minutes (Room #1)","8:00","Member's Choice (Room #2)","9:00","Instructor's Choice Yoga 60 minutes (Room #2)","9:30","Zumba (Room #1)","10:00","Light-N-Fit (Room #2)");
	
	//2 Dimensional Array of schedule arrays
	var weekSched = new Array(sunSched,monSched,tueSched,wedSched,thuSched,friSched,satSched);

	// get day of week number
	var dayNum = getDayNumOfWeek();

	// create beginning of output string
	var outputString = "<TABLE WIDTH=\"368\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"1\">";
	
	// rowflag is needed because the row colors alternate
	var rowflag = 0;

	// accessing the correct day array from the week array for schedule output
	for (x = 0; x < ((weekSched[dayNum].length) - 1); x++) 
	{
		if (rowflag == 0)
		{
			outputString += "<TR><TD WIDTH=\"2\"></TD><TD WIDTH=\"40\">" + weekSched[dayNum][x] + "</TD><TD WIDTH=\"1\"></TD><TD WIDTH=\"2\"></TD><TD WIDTH=\"347\">" + weekSched[dayNum][x+1] + "</TD></TR>";
			rowflag = 1;
			x++;
		}
		else
		{
			outputString += "<TR><TD WIDTH=\"2\" BGCOLOR=\"#CCCC99\"></TD><TD WIDTH=\"40\" BGCOLOR=\"#CCCC99\">" + weekSched[dayNum][x] + "</TD><TD WIDTH=\"1\"></TD><TD WIDTH=\"2\" BGCOLOR=\"#CCCC99\"></TD><TD WIDTH=\"347\" BGCOLOR=\"#CCCC99\">" + weekSched[dayNum][x+1] + "</TD></TR>";
			rowflag = 0;
			x++;
		}
	}
	outputString += "</TABLE>";

	// calling getDayOfWeek to output into day span
	document.getElementById("day").innerHTML=getDayOfWeek();

	// outputting sched table to sched span
	document.getElementById("sched").innerHTML=outputString;
}

