/* /////////////////////////////////////////////////////////////////////
#
#    mycourse.js
#
#    This is a Javascript file that supports my classes
#
#    Copyright 2001 Christopher C. Ferguson
#    All rights reserved. This program may not be copied, duplicated or
#    emulated without the expressed written consent of Christopher C. Ferguson
#
#
#    Last Update: Jan 31 2009
#
#/////////////////////////////////////////////////////////////////////   */

baseURL = "http://www.canyons.edu"
baseHREF = baseURL + "/departments/comp_sci/ferguson/"

officeHours = "TTH 11:00 - 11:59 AM Room# Hasley Hall 331 (or by appt.)"
lessonNumber = 13
semName = "Fall 2009"
doSurvey = "no"
message = ""
aspurl = baseHREF + "js/weeklynotes.asp"
startsec =  1235073343395 - 604800000 - 604800000  //1219315749500  //1201808882375   //  1187975099171  //1170358999359 //
springbreak = 0             // 1 means NO springbreak adjustment, 0 means adjust weeks for springbreak


courseInfo = new Array ("111","282","235","182","236","232","190","191")

courseTimes = new Array ("Lecture TTH 8:00-9:20 AM, Lab TTH  9:30 - 10:50 AM,  HSLH-133<BR><B>Evening Section:</B> Lecture TTH 7:00-8:20 PM, Lab TTH 8:30-9:50 PM HSLH-133 ",
             "TTH 5:30 - 6:50 PM , HSLH-133",
             "TTH 11:00 AM - 12:15 PM, HSLH-133",
             "Lecture MW 5:30 AM - 6:50 PM, Lab MW 4:00 PM - 5:20 PM, HSLH-133",
             "TTH 5:00 - 6:15 PM, HSLH-133",
             "MW 5:30 - 6:50 PM, HSLH-133"
             )

courseNames = new Array ("Introduction to Algorithms and Programming: Java",
             "Advanced Data Structures",
             "Programming C",
             "Data Structures and Program Design",
             "Object Oriented Programming C++",
             "Concepts of Programming Languages",
             "Web Programming: Javascript",
             "CGI Programming: Perl")

bookNames = new Array (
             "Introduction to Java Programming, Brief Version 7th Ed., Author: Liang, ISBN: 0-13-604258-9",
             "",
             "",
             "",
             "",
             "",
             "")

testNames = new Array ("Quiz 1",
             "Midterm",
             "Quiz 2",
             "Final")

testDates = new Array ("Sept. 17 (thurs)",
             "October 15 (thurs)",
             "November 12 (thurs)",
             "December 10 (thurs)")

finalDates = new Array ("December 10 (thurs)",
             "December 10 (thurs)",
             "December 10 (thurs)",
             "December 10 (thurs)",
             "December 10 (thurs)",
             "December 10 (thurs)")


/* -------------------------------------------------------------------------------------  */

function instructor() {
   document.write('<B><P>Instructor: </B>Chris Ferguson, Office Hours:   ' + officeHours)
   document.write('<BR>Call or email for an appointment, Phone: (661) 362 - 3473 (email is better)')
   document.write('<P>Email: <A HREF="mailto:chris.ferguson@canyons.edu"><FONT SIZE=2>chris.ferguson@canyons.edu</FONT></A> </P>')
   document.write('<p>Web Page: <a href=' + baseURL + '/departments/comp_sci/ferguson>'+ baseURL + '/departments/comp_sci/ferguson</a><br>')
}  // end instructor()

function bookinfo(coursenum) {
   if (coursenum == '111')
     document.write(bookNames[0])

}  // end bookinfo()

function instructor() {
   document.write('<B><P>Instructor: </B>Chris Ferguson, Office Hours:   ' + officeHours)
   document.write('<BR>Call or email for an appointment, Phone: (661) 362 - 3473 (email is better)')
   document.write('<P>Email: <A HREF="mailto:chris.ferguson@canyons.edu"><FONT SIZE=2>chris.ferguson@canyons.edu</FONT></A> </P>')
   document.write('<p>Web Page: <a href=' + baseURL + '/departments/comp_sci/ferguson>'+ baseURL + '/departments/comp_sci/ferguson</a><br>')
}  // end instructor()

function broadcastmessage() {
   now = new Date()
   seconds = now.getTime()
   
   document.write("<B><FONT SIZE=+2 COLOR=red>" + message + "</FONT></B><BR>")
 }  // end broadcastmessage()

function getSemName() {
   document.write(semName)
}  // end getSemName()

function notes(coursenum) {
   document.write('<TABLE WIDTH=100% BORDER=0><TR><TD>\n')
   now = new Date ()
   // startsec = startsec - 604800000
   seconds = now.getTime()
   //alert(seconds + ' ' + (seconds - startsec));
   weeknum = Math.floor((seconds - startsec)  / 604800000)  + springbreak
   //document.write('weeknum is '+weeknum+ 'seconds  is '+ seconds  + 'startsec is '+startsec+ '</TR></TD><TR><TD>\n')
   if ( weeknum > lessonNumber && weeknum < 17 ) { 
       lessonNumber = weeknum
   }
   for(i=lessonNumber; i>=1; i--) {
         document.write('<li><a href=' + aspurl + '?week=' + i + '&coursenum=' + coursenum + '>Lecture Notes - Week ' + i + '</a></li>\n');
   }
   document.write('</TD></TR></TABLE>\n\n')
}  // end notes()

function whenwhere(coursenum) {
   for (i=0; i < courseInfo.length; i++ ) {
     if ( courseInfo[i] == coursenum ) {
      document.write('<B>When and Where:</B> ')
      document.write(courseTimes[i])
     }
   }

}  // end whenwhere(coursenum)

function getCourseName(coursenum) {
   for (i=0; i < courseInfo.length; i++ ) {
     if ( courseInfo[i] == coursenum ) {
      document.write('<B>' + courseNames[i] + '</B> ')
     }
   }

}  // end getCourseName(coursenum)


function getTestTime(testname) {
   for (i=0; i < testNames.length; i++ ) {
     if ( testNames[i] == testname ) {
      document.write(testname + '&nbsp; - &nbsp;<B>' + testDates[i] + '</B> <BR>')
     }
   }

}  // end getTestTime(testname)

function getFinalTime(coursenum) {
   for (i=0; i < courseInfo.length; i++ ) {
     if ( courseInfo[i] == coursenum ) {
      document.write('<B>Final: ' + finalDates[i] + '</B> ')
     }
   }

}  // end getFinalTime(coursenum)


function ShowSurvey(coursenum) {
     if ( doSurvey == "yes" ) {
        if (coursenum == "112")  { document.write("<b>Evening Section:</b> ")}
      document.write('<A HREF='+ baseHREF+ 'cs' + coursenum + '/cs' + coursenum + 'Survey.html>Survey</A>')
     }

}  // end ShowSurvey(coursenum)

function showBaseHREF() {

      document.write('<BASE HREF='+ baseHREF + '>')


}  // end showBaseURL()
