
// Week of the Semester Script for Simon Fraser University SURREY semester system.
// Script written by Brian Quan of Interactive Arts & Technology.
// Tells what Week of Which semester it is.
// (C) May 2007 Brian Quan.

//
//
//var today = new Date();
//var semester;
//
//function sem_week() {
//	var sem_elapsed = today - find_start();
//	var currentWeek;
//	currentWeek = Math.floor(sem_elapsed.valueOf() / (1000*60*60*24*7)) +1;
//	if(currentWeek >= 1 && currentWeek <= 15) {
//		document.getElementById('thisweek').innerHTML = "It's Week "+currentWeek+" of the "+semester+" Term";
//	} else if(currentWeek > 15) {
//		document.getElementById('thisweek').innerHTML = "The "+semester+" Term is Finished. Go Have Some Fun!";
//	} else {
//		document.getElementById('thisweek').innerHTML = "The "+semester+" Term is Starting in "+(Math.floor(sem_elapsed.valueOf() / (1000*60*60*24))*-1)+" Days";
//	}
//}
//
//function find_start() {
//  var firstDay;
//  //firstDay.setFullYear(today.getFullYear());
//  if(today.getMonth() < 4) 	//4=May
//  {
//	semester = "Spring";
//	//assuming Spring semester starts on first Monday after Jan 2nd.
//	//Set firstDay to January 2nd midnight
//	firstDay = new Date("January 2, "+today.getFullYear()+" 00:00:00");
//		//firstDay.setMonth(0);	//january=0
//		//firstDay.setDate(2);	//2nd
//		//firstDay.setHours(0);	//midnight
//		//firstDay.setMinutes(0);
//	//7days+1, calculating for a Monday start
//	//may need to be changed for 2011
//	firstDay.setDate( (7 - firstDay.getDay()+1) + firstDay.getDate() );
//  } else if(today.getMonth() < 8) 	//8=September
//  {
//	semester = "Summer";
//	//assuming Summer semester starts on first Monday in May.
//	//Set firstDay to May 1st midnight
//	firstDay = new Date("May 1, "+today.getFullYear()+" 00:00:00");
//		//firstDay.setMonth(4);	//May=4
//		//firstDay.setDate(1);	//1st
//		//firstDay.setHours(0);	//midnight
//		//firstDay.setMinutes(0);
//	if(firstDay.getDay() == 0)	//If May 1st is a Sunday
//		firstDay.setDate(2);	//May 2nd is first Monday of semester
//	else {
//		//7days+1, calculating for a Monday start
//		//******** may need to be changed for 2011 if semester doesnt start on the 2nd ********
//		firstDay.setDate( (7 - firstDay.getDay()+1) + firstDay.getDate() );
//	}
//  } else	//Fall semester
//  {
//	semester = "Fall";
//	//assuming Summer semester starts on first(Tues)day after labour day in Sept.
//	firstDay = new Date("September 1, "+today.getFullYear()+" 00:00:00");
//		//firstDay.setMonth(8);	//September=8
//		//firstDay.setDate(1);	//1st
//		//firstDay.setHours(0);	//midnight
//		//firstDay.setMinutes(0);
//	//7days+1 +1(for tues), calculating for a Tuesday start
//	//may need to be changed in future if semester doesnt start on first tuesday of sept.
//	if(firstDay.getDay() <= 1)	//If Sept 1st is Sunday or Monday
//		firstDay.setDate(firstDay.getDate() + (2-firstDay.getDay()));
//	else {	
//		firstDay.setDate( (7 - firstDay.getDay()+1) + firstDay.getDate() +1); 
//	}
//
//  }
//  return(firstDay);
//}
//

