/**
* @fileoverview<pre>
* tutorial.js
*
* A JavaScript library file for TutorialsOnline.info
*
* ----------------------------------------------------------------------------
* Copyright Notice
* This file contains proprietary information of Alan Kelsey, Ltd.
* Copying or reproduction is only allowed provided Alan Kelsey of
* Alan Kelsey, Ltd. is acknowledged in all code and in any copyright notice.
* The software in this file is not guaranteed to perform as specified but
* Alan Kelsey, Ltd. has done its best to ensure that it does behave as specified.
* Copyright (c) 2007
* ----------------------------------------------------------------------------
*
* <b>Alan Kelsey, Ltd.</b>
*
* www.RareHome.com
*
* @author				Alan Kelsey
* @version 				2.1
* @date  				May 23, 2010
*</pre>
*/

/**
*<p>
*Revision History
*</p>
*
*<dl>
*<dt>1.7</dt>
*<dd>Added quizInfo[ ] object</dd>
*
*<dt>1.8</dt>
*<dd>Expanded to allow for blended classes</dd>
*
*<dt>1.9</dt>
*<dd>Differentiated the prePost dates for blended classes and for blended Homework postings</dd>
*
*<dt>2.1</dt>
*<dd>Employed jQuery and AJAX extensively</dd>
*
*</dl>
*/
/*********************************************************************************/

/*********************************************************************************/
/********************   JavaScript Cookie Object and Methods   *******************/
/*********************************************************************************/
function CookieHandler() {
    /*   SetCookie (myCookieVar, cookieValueVar, null, "/myPath", null, true);   */
    this.setCookie = function (name, value, expr, path, domain, secure) {
        document.cookie = name + "=" + escape(value) +
            ((expr) ? "; expires=" + expr.toGMTString() : "") +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            ((secure) ? "; secure" : "");
        } 

    /*****   Function to return the value of the cookie specified by "name".   ***/
    /*****       name - String object containing the cookie name.      ***********/
    /*****       returns - String object containing the cookie value,  ***********/
    /*****       or null if the cookie does not exist.                 ***********/
    this.getCookie = function (name) {
        name += "=";
        var carray = document.cookie.split(';');
        for(var i=0;i < carray.length;i++) {
            var c = carray[i];
            while (c.charAt(0)==' ') {
                c = c.substring(1,c.length);
                }
            if (c.indexOf(name) == 0) {
                return unescape(c.substring(name.length,c.length));
            }
        }
        return null;
    } 
 
//  Function to delete a cookie. (Sets expiration date to start of epoch)
//    name -   String object containing the cookie name
//    path -   String object containing the path of the cookie to delete.  This MUST
//             be the same as the path used to create the cookie, or null/omitted if
//             no path was specified when creating the cookie.
//    domain - String object containing the domain of the cookie to delete.  This MUST
//             be the same as the domain used to create the cookie, or null/omitted if
//             no domain was specified when creating the cookie.
//
	this.deleteCookie = function (name, path, domain) {
	    var expr = new Date("0/0/0");
	    var value = null;
	    var path = (path) ? "; path=" + path : ""; 
	    var domain = (domain) ? "; domain=" + domain : "";        
	    this.setCookie(name, value, expr, path, domain);
	  }
}

/*     Examples
var CookiesOBJ = new CookieHandler();
var cookieName1 = "someName";
*/
/*     To set a cookie, use
var expDate = new Date("12/30/2009");
CookiesOBJ.setCookie(cookieName1, cookieVal, expDate); 
*/
/*     To get a cookie, use
var cookieVal = CookiesOBJ.getCookie(cookieName);
if (cookeVal == null) {
    alert("null");
    //  place code in here to return a default value
    }
*/
/*     To delete a cookie, use
CookiesOBJ.deleteCookie(cookieName1);
*/
/*********************************************************************************/

/*********************************************************************************/
/******************************   Global variables   *****************************/
/*********************************************************************************/

/*********************   Set the path to the Common folder   *********************/
/***********   Use ./ if one course per domain, ../ if more than one   ***********/
var commonFolder = "./Common/";

var syllPage = false;           //		Boolean - Is this a syllabus page?
var repeatCustomer = false;
var lastVisit = 0;              //		Hold the date & time of previous access
                                //			in GMT milliseconds
var dateAdjustment = 0;         //		Accommodate date bugs on some platforms
var scKey = 298;
var CookiesOBJ = new CookieHandler();
var cookie1 = "lastVisit";
var cookie2 = "nextPrevVisit";
var cookie3 = "class101";
var expires = new Date("2010/07/30");   //  Set the date cookies should expire to two days after the last day of the semester
                                        //  This is used in other calculations

var is_fx = false;
var isNav4, isIE4;
var OK = 0;

/************   This short script gets the date/time from the server   ***********/
/***************   from http://www.mresoftware.com/serverdate.htm   **************/

var nowDay = new Date(); //		Make today's date a global variable
$.ajax( {
    url: "./Common/css_js/time.php",
    success: function(data)
        {
        nowDay = new Date(data);
        },
    async: false
    });


/****************   If server time not passed, use client's time   ***************/
if (typeof nowDay !== "undefined" && nowDay !== "NaN") {
    nowDay = new Date();
    }

var nowDate = nowDay.getDate();
var nowMonth = nowDay.getMonth();
var nowYear = nowDay.getFullYear();
var twoWeeks = false;           //		Set the due date out two weeks, instead of the normal one

var ssDay = new Date();         //		Make the specific class day a global variable
var satDay = new Date();        //		Make the previous Saturday a global variable

var onlineDueDate = new Date(); //      Make online due dates a global variable
var quizToday;                  //		A boolean to say if there is a quiz soon

/*****   evalDate is used to turn on the course evaluation link  *******/
var evalDate = new Date("1/1/2011");
evalDate.setMonth(expires.getMonth() - 1);

var quizLocation = "http://TutorialsOnline.info/cgi-bin/quizTest/";
var quizPDFLocation = "http://TutorialsOnline.info/";

if (document.title.indexOf("Homework") > -1) {
    shortSem = false;
    }

var showIt = false;
var quizNum = -1;               //		Variable to hold the quiz numbers

var courseArray = new Array();  //      ("","","","","","","","","","")
var cookieVal = "";
var cNum;                       //		The course number
var iNum = 1;                   //		The instructor number
var iNumExMenu;                 //		Temp var to hold iNum
var tW = 0;

//  classes start Monday, January 11, 2010
//	classes end May 19, 2010

//  classes start Tuesday, June 1, 2010
//	classes end July 24, 2010

var startYr = 2010;             //		Starting day of class: year
var startMo = 4;                //		Starting day of class: month - 1
var startDy = 30;				        //		The date of the Sunday
                                //			before the start of the semester


var dueDate = new Date(startYr, startMo, startDy); //		Set for summer session
var nextAssn = 2;
var labNum = 0;                  //     Hold the lab numbers if shortSem
var titleFlag = true;
var declareWin;                  //		The popup window used to declare the instructor
var windowStats = new Array();   //		An array to hold popup window parameters
scKey = scKey % 17;
/**********************************************************************************
                We need to calculate an offset from a day of the week
                    that is before the day of the week the semester starts.
***********************************************************************************
***********************************************************************************
If the semester starts on		the offSet is
    Online                          0
    Monday                          1
    Tuesday                         2
    Wednesday                       3
    Thursday                        4
    Friday                          5

    Online courses will have classes on Sundays and
    may "start" before the semester actually begins.
***********************************************************************************/

var startOffSet = 2;

/**********************************************************************************
This prePost variable globally controls how many days before
    the class the links should be active.

This can be set independently for each class
    in the index.shtml files.
***********************************************************************************/
var linkActive = new Function('a', 'return a * 86400000;');

var prePost = linkActive(3.5);          //  When the links become active
var prePostHw = linkActive(4.5);        //  When the Homework links become active
var prePostBlended = linkActive(12.5);   //  When the links become active in a blended class

var CCIS = new Array();         //		class specifics
var InstrButton = new Array();  //		instructors for specific class

/*********************************************************************************/
/*********************************************************************************/
/*****************   The variable cNum sets the specific course   *****************
1 -     HTML
2 -     Advanced HTML
3 -     JavaScript
4 -     Java
5 -     XML
6 -     AJAX
7 -     [extra spot]
8 -     [extra spot]
9 -     admin
**********************************************************************************/
/*****************************   Set up the arrays   *****************************/
/********************************   Directories   ********************************/
var dirs = new Array();
x = 1;
dirs[x++] = "http://HTMLTutorialOnline.info/";
dirs[x++] = "http://CSSTutorialOnline.info/";
dirs[x++] = "http://JavaScriptTutorialOnline.info/";
dirs[x++] = "http://JavaTutorialOnline.info/";
dirs[x++] = "http://XMLTutorialOnline.info/";
dirs[x++] = "http://AJAXTutorialOnline.info/";
dirs[x++] = "http://Orientation.Tutorialsonline.info/";
dirs[x++] = "http://Programming.Tutorialsonline.info/";
dirs[x++] = "admin/";

if (true) {
    //dirs[cNum] = "";
    //alert(dirs[cNum]);
    }

/************************   Set the next arrays to hold   ************************/
/**************   the numbers of the classes offered this semester   *************/
var courses =
    new Array("", "HTML", "Advanced HTML", "JavaScript", "Java", "XML", "AJAX", "", "", "admin", "");
var classesOffered = new Array(0, 1, 2, 3); //, 6, 8);

/**************   Set up a multi-dimensional array of instructors   **************/
/*******************   The first dimension holds which course   ******************/
/****************   The second dimension holds which instructor   ****************/

var MasterInstr = new Array();

for (i = 0; i < x; i++) {
    MasterInstr[i] = new Array();
    }
/*********************************************************************************/

/*********************************************************************************/
/************************   Create MastrInstr[] objects  *************************/
function makeInstrBasic() {
    x = 0;
    this.CCIS = makeInstrBasic.arguments[x++];
    this.cDesc = makeInstrBasic.arguments[x++];
    this.cPre = makeInstrBasic.arguments[x++];
    }

/*********************************************************************************/
/***********************   Create MastrInstr[][] objects  ************************/
function makeInstr() {
    x = 0;
    this.name = makeInstr.arguments[x++];   //  Instructor's name
    this.clNum = makeInstr.arguments[x++];  //  Number of the day the class meets
    this.clDay = makeInstr.arguments[x++];  //  Name of the day the class meets
    this.email = makeInstr.arguments[x++];  //  Instructor's email
    this.page = makeInstr.arguments[x++];   //  Instructor's syllabus page
    this.hwDay = makeInstr.arguments[x++];  //  Day the homework is due

    if (makeInstr.arguments.length > 6) {
        //  Set the next variable to true if class runs two consecutive days
        this.iTwoTimes = makeInstr.arguments[x++];
        //  If running this class twice a week in a shortened semester
        this.iShortSem = makeInstr.arguments[x++];
        } else {
        //  Set the next variable to true if class runs two consecutive days
        this.iTwoTimes = false;
        //  If running this class twice a week in a shortened semester
        this.iShortSem = false;
        }

    this.blended = false;
    this.hwemail = this.email;

    if (makeInstr.arguments.length > 8) {
        this.blended = makeInstr.arguments[x++];
        }

    if (makeInstr.arguments.length > 9) {
        this.hwemail = makeInstr.arguments[x++];
        }
        
    if (this.clNum === 0) { //		Test if this is an online course
        this.online = true;
        }
    }

/*********************************************************************************/
/*************************   Create quizInfo[] objects   *************************/

var quizInfo = new Array();

for (xmq = 0; xmq < 8; xmq++) {
    quizInfo[xmq] = new Object();
    /*  Put in the same information for all quizzes  */
    quizInfo[xmq].online = true;
    quizInfo[xmq].dayActive = 6;
    quizInfo[xmq].numDays = 9;

    }

/*  Change Quiz 0  */
quizInfo[0].online = true;
quizInfo[0].dayActive = 12;
quizInfo[0].numDays = 12;

/*********************************************************************************/
/*************************   Create makeQuiz[] objects   *************************/
function makeQuizBasic() {
    x = 0;
    this.quizDate = makeQuizBasic.arguments[x++];
    this.quizURL = makeQuizBasic.arguments[x++];
    this.quizOn = makeQuizBasic.arguments[x++];
    this.quizOnline = makeQuizBasic.arguments[x++];
    }

/*********************************************************************************/
/***************************   Set up standard arrays   **************************/

var mos = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
                    "Aug", "Sep", "Oct", "Nov", "Dec");
var months = new Array("January", "February", "March",
                       "April",   "May",      "June",
                       "July",    "August",   "September",
                       "October", "November", "December");
var monthNames = new Array("January", "February", "March",
                           "April",   "May",      "June",
                           "July",    "August",   "September",
                           "October", "November", "December");
var dayNames = new Array("Online",    "Monday",    "Tuesday",
                         "Wednesday", "Thursday",  "Friday",
                         "Saturday",    "Sunday",    "Monday",
                         "Tuesday",   "Wednesday", "Thursday",
                         "Friday",    "Saturday");
var ordinals = new Array("One",      "Two",       "Three",
                         "Four",     "Five",      "Six",
                         "Seven",    "Eight",     "Nine",
                         "Ten",      "Eleven",    "Twelve",
                         "Thirteen", "Fourteen",  "Fifteen",
                         "Sixteen",  "Seventeen", "Eighteen",
                         "Nineteen");

var todayStr = monthNames[nowMonth] + " " + nowDate + ", " + nowYear;

/*********************************************************************************/

/******************   Check Browser Version and Compatibility   ******************/
//
// JavaScript Browser Sniffer
// Eric Krok, Andy King, Michel Plungjan Jan. 31, 2002
// see http://www.webreference.com/ for more information
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//
// please send any improvements to aking@internet.com and we'll
// roll the best ones in
//
// adapted from Netscape's Ultimate client-side JavaScript client sniffer
// and andy king's sniffer
// Revised May 7 99 to add is.nav5up and is.ie5up (see below). (see below).
// Revised June 11 99 to add additional props, checks
// Revised June 23 99 added screen props - gecko m6 doesn't support yet - abk
//                    converted to var is_ from is object to work everywhere
// 990624 - added cookie forms links frames checks - abk
// 001031 - ie4 mod 5.0 -> 5. (ie5.5 mididentified - abk)
//          is_ie4 mod tp work with ie6+ - abk
// 001120 - ns6 released, document.layers false, put back in
//        - is_nav6 test added - abk
// 001121 - ns6+ added, used document.getElementById, better test, dom-compl
// 010117 - actual version for ie3-5.5 by Michel Plungjan
// 010118 - actual version for ns6 by Michel Plungjan
// 010217 - netscape 6/mz 6 ie5.5 onload defer bug docs - abk
// 011107 - added is_ie6 and is_ie6up variables - dmr
// 020128 - added link to netscape's sniffer, on which this is based - abk
//          updated sniffer for aol4-6, ie5mac = js1.4, TVNavigator, AOLTV,
//          hotjava
// 020131 - cleaned up links, added more links to example object detection
// 020131 - a couple small problems with Opera detection. First, when Opera
//          is set to be compatible with other browsers it will contain their
//          information in the userAgent strings. Thus, to be sure we have 
//          Opera we should check for it before checking for the other bigs.
//          (And make sure the others are !opera.) Also corrected a minor
//          bug in the is_opera6up assignment.
// 020214 - Added link for Opera/JS compatibility; added improvements for 
//          windows xp/2000 id in opera and aol 7 id (thanks to Les
//          Hill, Les.Hill@getronics.com, for the suggestion).
// 020531 - Added N6/7 and moz identifiers. 
// 020605 - Added mozilla guessing, Netscape 7 identification, and cleaner
//          identification for Netscape 6. (this comment added after code 
//          changes)
// 020725 - Added is_gecko. -- dmr
// 021205 - Added is_Flash and is_FlashVersion, based on Doc JavaScript code. 
//          Added Opera 7 variables. -- dmr
// 021209 - Added aol8. -- dmr
// 030110 - Added is_safari, added 1.5 js designation for Opera 7. --dmr
// 030128 - Added is_konq, per user suggestion (thanks to Sam Vilain).
//          Removed duplicate Opera checks left over after last revision. - dmr
// 031124 - Added is_fb and version. We report this right after the is_moz
//          report. - dmr
// 040325 - Added is_fx and version. We report this right after the is_moz
//          report. - dmr
// 040421 - Added Debian check to is_moz. Thanks to Patrice Bridoux for
//          reporting this.
// 040517 - Added is_fb/is_fx to plugins based flash detection. Thanks to 
//          Martin Bischoff for pointing out this omission.
// 040617 - On Mac IE, appVersion differs from the version in the ua, 
//          with the UA appearing to be more accurate. As an experiment, 
//          for Mac we'll pull is_minor from the ua instead.
// 040831 - Fixed Opera bug in flash detection logic; when Opera has
//          "enable plugins" unchecked in preferences, the "plugin" 
//          variable is still true, but the "description" property 
//          belonging to it is undefined.
// 051202 - Added ua check for higher versions of Firefox (1.5+), 
//          since vendor/vendorSub is no longer used and the sniffer 
//          was assuming Mozilla. Also belatedly added is_nav8 and 
//          is_nav8up.
// 060919 - Some catchup mods here; adding is_opera8, is_opera9, 
//          and IE7 (thanks to Jonathan Warrington)
// 061009 - Added is_macosx check and safari to Flash checking, per 
//          Michael Hopkins 
//
// Everything you always wanted to know about your JavaScript client
// but were afraid to ask. Creates "is_" variables indicating:
// (1) browser vendor:
//     is_nav, is_ie, is_opera
// (2) browser version number:
//     is_major (integer indicating major version number: 2, 3, 4 ...)
//     is_minor (float   indicating full  version number: 2.02, 3.01, 4.04 ...)
// (3) browser vendor AND major version number
//     is_nav2, is_nav3, is_nav4, is_nav4up, is_nav5, is_nav5up, 
//     is_nav6, is_nav6up, is_ie3, is_ie4, is_ie4up, is_ie5up, is_ie6...
// (4) JavaScript version number:
//     is_js (float indicating full JavaScript version number: 1, 1.1, 1.2 ...)
// (5) OS platform and version:
//     is_win, is_win16, is_win32, is_win31, is_win95, is_winnt, is_win98
//     is_os2
//     is_mac, is_mac68k, is_macppc
//     is_unix
//        is_sun, is_sun4, is_sun5, is_suni86
//        is_irix, is_irix5, is_irix6
//        is_hpux, is_hpux9, is_hpux10
//        is_aix, is_aix1, is_aix2, is_aix3, is_aix4
//        is_linux, is_sco, is_unixware, is_mpras, is_reliant
//        is_dec, is_sinix, is_freebsd, is_bsd
//     is_vms
//
// based in part on 
// http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
// The Ultimate JavaScript Client Sniffer
// and Andy King's object detection sniffer
//
// Note: you don't want your Nav4 or IE4 code to "turn off" or
// stop working when Nav5 and IE5 (or later) are released, so
// in conditional code forks, use is_nav4up ("Nav4 or greater")
// and is_ie4up ("IE4 or greater") instead of is_nav4 or is_ie4
// to check version in code which you want to work on future
// versions. For DOM tests scripters commonly used the 
// is_getElementById test, but make sure you test your code as
// filter non-compliant browsers (Opera 5-6 for example) as some 
// browsers return true for this test, and don't fully support
// the W3C's DOM1.
//

    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();
    var appVer = navigator.appVersion.toLowerCase();

    // *** BROWSER VERSION ***

    var is_minor = parseFloat(appVer);
    var is_major = parseInt(is_minor);

    var is_opera = (agt.indexOf("opera") != -1);
    var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    var is_opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1); // 020128- abk
    var is_opera7 = (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1); // 021205- dmr
    var is_opera8 = (agt.indexOf("opera 8") != -1 || agt.indexOf("opera/8") != -1); // 09-19-2006 jonw 
    var is_opera9 = (agt.indexOf("opera 9") != -1 || agt.indexOf("opera/9") != -1); // 09-19-2006 jonw

    var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);
    var is_opera6up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5); // new020128
    var is_opera7up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6); // new021205 -- dmr
    var is_opera8up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6 && !is_opera7); // 09-19-2006 - jonw
    var is_opera9up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6 && !is_opera7 &&!is_opera8); // 09-19-2006 - jonw

    // Note: On IE, start of appVersion return 3 or 4
    // which supposedly is the version of Netscape it is compatible with.
    // So we look for the real version further on in the string
    // And on Mac IE5+, we look for is_minor in the ua; since 
    // it appears to be more accurate than appVersion - 06/17/2004

    var is_mac = (agt.indexOf("mac")!=-1);
    var iePos  = appVer.indexOf('msie');
    if (iePos !=-1) {
       if(is_mac) {
           var iePos = agt.indexOf('msie');
           is_minor = parseFloat(agt.substring(iePos+5,agt.indexOf(';',iePos)));
       }
       else is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
       is_major = parseInt(is_minor);
    }

    // ditto Konqueror
                                      
    var is_konq = false;
    var kqPos   = agt.indexOf('konqueror');
    if (kqPos !=-1) {                 
       is_konq  = true;
       is_minor = parseFloat(agt.substring(kqPos+10,agt.indexOf(';',kqPos)));
       is_major = parseInt(is_minor);
    }                                 

    var is_getElementById   = (document.getElementById) ? "true" : "false"; // 001121-abk
    var is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false"; // 001127-abk
    var is_documentElement = (document.documentElement) ? "true" : "false"; // 001121-abk

    var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false;
    var is_khtml  = (is_safari || is_konq);

    var is_gecko = ((!is_khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false;
    var is_gver  = 0;
    if (is_gecko) is_gver=navigator.productSub;

    var is_fb = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
                 (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1)  &&
                 (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)     &&
                 (is_gecko) && (navigator.vendor=="Firebird"));
    var is_fx = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
                 (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1)  &&
                 (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)     &&
                 (is_gecko) && ((navigator.vendor=="Firefox")||(agt.indexOf('firefox')!=-1)));
    var is_moz   = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
                    (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1)  &&
                    (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)     &&
                    (is_gecko) && (!is_fb) && (!is_fx) &&
                    ((navigator.vendor=="")||(navigator.vendor=="Mozilla")||(navigator.vendor=="Debian")));
    if ((is_moz)||(is_fb)||(is_fx)) {  // 032504 - dmr
       var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0;
       if(is_fx&&!is_moz_ver) {
           is_moz_ver = agt.indexOf('firefox/');
           is_moz_ver = agt.substring(is_moz_ver+8);
           is_moz_ver = parseFloat(is_moz_ver);
       }
       if(!(is_moz_ver)) {
           is_moz_ver = agt.indexOf('rv:');
           is_moz_ver = agt.substring(is_moz_ver+3);
           is_paren   = is_moz_ver.indexOf(')');
           is_moz_ver = is_moz_ver.substring(0,is_paren);
       }
       is_minor = is_moz_ver;
       is_major = parseInt(is_moz_ver);
    }
   var is_fb_ver = is_moz_ver;
   var is_fx_ver = is_moz_ver;

    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)
                && (!is_khtml) && (!(is_moz)) && (!is_fb) && (!is_fx));

    // Netscape6 is mozilla/5 + Netscape6/6.0!!!
    // Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20001108 Netscape6/6.0
    // Changed this to use navigator.vendor/vendorSub - dmr 060502   
    // var nav6Pos = agt.indexOf('netscape6');
    // if (nav6Pos !=-1) {
    if ((navigator.vendor)&&
        ((navigator.vendor=="Netscape6")||(navigator.vendor=="Netscape"))&&
        (is_nav)) {
       is_major = parseInt(navigator.vendorSub);
       // here we need is_minor as a valid float for testing. We'll
       // revert to the actual content before printing the result. 
       is_minor = parseFloat(navigator.vendorSub);
    }

    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && is_minor >= 4);  // changed to is_minor for
                                                // consistency - dmr, 011001
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );

    var is_nav6   = (is_nav && is_major==6);    // new 010118 mhp
    var is_nav6up = (is_nav && is_minor >= 6); // new 010118 mhp

    var is_nav5   = (is_nav && is_major == 5 && !is_nav6); // checked for ns6
    var is_nav5up = (is_nav && is_minor >= 5);

    var is_nav7   = (is_nav && is_major == 7);
    var is_nav7up = (is_nav && is_minor >= 7);

    var is_nav8   = (is_nav && is_major == 8);
    var is_nav8up = (is_nav && is_minor >= 8);

    var is_ie   = ((iePos!=-1) && (!is_opera) && (!is_khtml));
    var is_ie3  = (is_ie && (is_major < 4));

    var is_ie4   = (is_ie && is_major == 4);
    var is_ie4up = (is_ie && is_minor >= 4);
    
    var is_ie5   = (is_ie && is_major == 5);
    var is_ie5up = (is_ie && is_minor >= 5);
    
    var is_ie5_5  = (is_ie && (agt.indexOf("msie 5.5") !=-1)); // 020128 new - abk
    var is_ie5_5up =(is_ie && is_minor >= 5.5);                // 020128 new - abk
	
    var is_ie6   = (is_ie && is_major == 6);
    var is_ie6up = (is_ie && is_minor >= 6);

    var is_ie7   = (is_ie && is_major == 7);
    var is_ie7up = (is_ie && is_minor >= 7);
    
    var is_ie8   = (is_ie && is_major == 8);
    var is_ie8up = (is_ie && is_minor >= 8);

// KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.

    var is_aol   = (agt.indexOf("aol") != -1);
    var is_aol3  = (is_aol && is_ie3);
    var is_aol4  = (is_aol && is_ie4);
    var is_aol5  = (agt.indexOf("aol 5") != -1);
    var is_aol6  = (agt.indexOf("aol 6") != -1);
    var is_aol7  = ((agt.indexOf("aol 7")!=-1) || (agt.indexOf("aol7")!=-1));
    var is_aol8  = ((agt.indexOf("aol 8")!=-1) || (agt.indexOf("aol8")!=-1));

    var is_webtv = (agt.indexOf("webtv") != -1);
    
    // new 020128 - abk
    
    var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    var is_AOLTV = is_TVNavigator;

    var is_hotjava = (agt.indexOf("hotjava") != -1);
    var is_hotjava3 = (is_hotjava && (is_major == 3));
    var is_hotjava3up = (is_hotjava && (is_major >= 3));

    // end new
	
    // *** JAVASCRIPT VERSION CHECK ***
    // Useful to workaround Nav3 bug in which Nav3
    // loads <SCRIPT LANGUAGE="JavaScript1.2">.
    // updated 020131 by dragle
    var is_js;
    if (is_nav2 || is_ie3) is_js = 1.0;
    else if (is_nav3) is_js = 1.1;
    else if ((is_opera5)||(is_opera6)) is_js = 1.3; // 020214 - dmr
    else if (is_opera7up) is_js = 1.5; // 031010 - dmr
    else if (is_khtml) is_js = 1.5;   // 030110 - dmr
    else if (is_opera) is_js = 1.1;
    else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2;
    else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3;
    else if (is_nav5 && !(is_nav6)) is_js = 1.4;
    else if (is_hotjava3up) is_js = 1.4; // new 020128 - abk
    else if (is_nav6up) is_js = 1.5;

    // NOTE: In the future, update this code when newer versions of JS
    // are released. For now, we try to provide some upward compatibility
    // so that future versions of Nav and IE will show they are at
    // *least* JS 1.x capable. Always check for JS version compatibility
    // with > or >=.

    else if (is_nav && (is_major > 5)) is_js = 1.4;
    else if (is_ie && (is_major > 5)) is_js = 1.3;
    else if (is_moz) is_js = 1.5;
    else if (is_fb||is_fx) is_js = 1.5; // 032504 - dmr
    
    // what about ie6 and ie6up for js version? abk
    
    // HACK: no idea for other browsers; always check for JS version 
    // with > or >=
    else is_js = 0.0;
    // HACK FOR IE5 MAC = js vers = 1.4 (if put inside if/else jumps out at 1.3)
    if ((agt.indexOf("mac")!=-1) && is_ie5up) is_js = 1.4; // 020128 - abk
    
    // Done with is_minor testing; revert to real for N6/7
    if (is_nav6up) {
       is_minor = navigator.vendorSub;
    }

    var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
    // *** PLATFORM ***
    var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
    // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
    //        Win32, so you can't distinguish between Win95 and WinNT.
    var is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));

    // is this a 16 bit compiled version?
    var is_win16 = ((agt.indexOf("win16")!=-1) ||
               (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) ||
               (agt.indexOf("windows 16-bit")!=-1) );

    var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
                    (agt.indexOf("windows 16-bit")!=-1));
	
	var is_winme = ((agt.indexOf("win 9x 4.90")!=-1));    // new 020128 - abk
    var is_win2k = ((agt.indexOf("windows nt 5.0")!=-1) || (agt.indexOf("windows 2000")!=-1)); // 020214 - dmr
    var is_winxp = ((agt.indexOf("windows nt 5.1")!=-1) || (agt.indexOf("windows xp")!=-1)); // 020214 - dmr

    // NOTE: Reliable detection of Win98 may not be possible. It appears that:
    //       - On Nav 4.x and before you'll get plain "Windows" in userAgent.
    //       - On Mercury client, the 32-bit version will return "Win98", but
    //         the 16-bit version running on Win98 will still return "Win95".
    var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
    var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
    var is_win32 = (is_win95 || is_winnt || is_win98 ||
                    ((is_major >= 4) && (navigator.platform == "Win32")) ||
                    (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));

    var is_os2   = ((agt.indexOf("os/2")!=-1) ||
                    (navigator.appVersion.indexOf("OS/2")!=-1) ||
                    (agt.indexOf("ibm-webexplorer")!=-1));

    var is_mac    = (agt.indexOf("mac")!=-1);
    if (is_mac) { is_win = !is_mac; } // dmr - 06/20/2002
    var is_mac68k = (is_mac && ((agt.indexOf("68k")!=-1) ||
                               (agt.indexOf("68000")!=-1)));
    var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) ||
                                (agt.indexOf("powerpc")!=-1)));
    var is_macosx = (is_mac && (agt.indexOf("os x")!=-1));

    var is_sun   = (agt.indexOf("sunos")!=-1);
    var is_sun4  = (agt.indexOf("sunos 4")!=-1);
    var is_sun5  = (agt.indexOf("sunos 5")!=-1);
    var is_suni86= (is_sun && (agt.indexOf("i86")!=-1));
    var is_irix  = (agt.indexOf("irix") !=-1);    // SGI
    var is_irix5 = (agt.indexOf("irix 5") !=-1);
    var is_irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
    var is_hpux  = (agt.indexOf("hp-ux")!=-1);
    var is_hpux9 = (is_hpux && (agt.indexOf("09.")!=-1));
    var is_hpux10= (is_hpux && (agt.indexOf("10.")!=-1));
    var is_aix   = (agt.indexOf("aix") !=-1);      // IBM
    var is_aix1  = (agt.indexOf("aix 1") !=-1);
    var is_aix2  = (agt.indexOf("aix 2") !=-1);
    var is_aix3  = (agt.indexOf("aix 3") !=-1);
    var is_aix4  = (agt.indexOf("aix 4") !=-1);
    var is_linux = (agt.indexOf("inux")!=-1);
    var is_sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
    var is_unixware = (agt.indexOf("unix_system_v")!=-1);
    var is_mpras    = (agt.indexOf("ncr")!=-1);
    var is_reliant  = (agt.indexOf("reliantunix")!=-1);
    var is_dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) ||
           (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) ||
           (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1));
    var is_sinix = (agt.indexOf("sinix")!=-1);
    var is_freebsd = (agt.indexOf("freebsd")!=-1);
    var is_bsd = (agt.indexOf("bsd")!=-1);
    var is_unix  = ((agt.indexOf("x11")!=-1) || is_sun || is_irix || is_hpux ||
                 is_sco ||is_unixware || is_mpras || is_reliant ||
                 is_dec || is_sinix || is_aix || is_linux || is_bsd || is_freebsd);

    var is_vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
// additional checks, abk
	var is_anchors = (document.anchors) ? "true":"false";
	var is_regexp = (window.RegExp) ? "true":"false";
	var is_option = (window.Option) ? "true":"false";
	var is_all = (document.all) ? "true":"false";
	var is_id_not_all = (document.getElementById && !document.all)
// cookies - 990624 - abk
	document.cookie = "cookies=true";
	var is_cookie = (document.cookie) ? "true" : "false";
	var is_images = (document.images) ? "true":"false";
	var is_layers = (document.layers) ? "true":"false"; // gecko m7 bug?
// new doc obj tests 990624-abk
	var is_forms = (document.forms) ? "true" : "false";
	var is_links = (document.links) ? "true" : "false";
	var is_frames = (window.frames) ? "true" : "false";
	var is_screen = (window.screen) ? "true" : "false";

// java
	var is_java = (navigator.javaEnabled());

// Flash checking code adapted from Doc JavaScript information; 
// see http://webref.com/js/column84/2.html

   var is_Flash        = false;
   var is_FlashVersion = 0;

   if ((is_nav||is_opera||is_moz||is_fb||is_fx||is_safari)||
       (is_mac&&is_ie5up)) {
      var plugin = (navigator.mimeTypes && 
                    navigator.mimeTypes["application/x-shockwave-flash"] &&
                    navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) ?
                    navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
//      if (plugin) {
      if (plugin&&plugin.description) {
         is_Flash = true;
         is_FlashVersion = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1));
      }
   }

   if (is_win&&is_ie4up)
   {
      document.write(
         '<scr' + 'ipt language=VBScript>' + '\n' +
         'Dim hasPlayer, playerversion' + '\n' +
         'hasPlayer = false' + '\n' +
         'playerversion = 10' + '\n' +
         'Do While playerversion > 0' + '\n' +
            'On Error Resume Next' + '\n' +
            'hasPlayer = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & playerversion)))' + '\n' +
            'If hasPlayer = true Then Exit Do' + '\n' +
            'playerversion = playerversion - 1' + '\n' +
         'Loop' + '\n' +
         'is_FlashVersion = playerversion' + '\n' +
         'is_Flash = hasPlayer' + '\n' +
         '<\/sc' + 'ript>'
      );
   }

if (is_nav4) {
    alert("This page will not display properly in Navigator4.\nMany functions in this site will not work.\nPlease use a version 5 browser or newer.")
    }

if (is_mac && is_safari) {
    alert("This page will not display properly in Safari.\nThe Safari browser does not support many of the functions used on this site.\nPlease seriously consider downloading, installing, and using the most current version of FireFox.")
    }

if (is_opera) {
    alert("This page will not display properly in Opera.\nThe Opera browser does not support many of the functions used on this site.\nPlease seriously consider downloading, installing, and using the most current version of FireFox.")
    }

/*********************************************************************************/
/****************   Calculate the width and height of the frame   ****************/
function frameDim() {
    if (self.innerWidth && !is_fx && !is_opera && !is_chrome) {
        frameWidth = self.innerWidth;
        frameHeight = self.innerHeight;
        } else if (document.documentElement
        && document.documentElement.clientWidth) {
        frameWidth = document.documentElement.clientWidth;
        frameHeight = document.documentElement.clientHeight;
        } else if (document.body) {
        frameWidth = document.body.clientWidth;
        frameHeight = document.body.clientHeight;
        } else if (is_opera) {
        frameWidth = document.documentElement.scrollLeft
                         + window.innerWidth;
        frameHeight = document.documentElement.scrollTop
                          + window.innerHeight;
        } else if (is_ie || is_fx) {
        frameWidth
            = Math.max(document.documentElement.scrollLeft,
                           document.body.scrollLeft)
                  + (document.documentElement.clientWidth
                        != 0
                        ? document.documentElement.clientWidth
                        : document.body.clientWidth);

        frameHeight
            = Math.max(document.documentElement.scrollTop,
                           document.body.scrollTop)
                  + (document.documentElement.clientHeight
                        != 0
                        ? document.documentElement.clientHeight
                        : document.body.clientHeight);
        }
    }

/*********************************************************************************/

/*********************************************************************************/
/************************  Try to read instructor cookie  ************************/

if (CookiesOBJ.getCookie(cookie3) == null) {
    courseArray[0] = 0;
    } else {
    cookieVal = CookiesOBJ.getCookie(cookie3)

    for (x = 0; x < cookieVal.length; x = x + 2) {
        courseArray[cookieVal.charAt(x)] = cookieVal.charAt(x + 1)
        }
    }


/*********************************************************************************/
/*********************   Create a declaration popup window   *********************/

function changeInstr(cN) {
    var winStats = "";
    windowStats[1] = "height=250px,width=500px,";
    for (i=0; i<windowStats.length; i++) {
        winStats += windowStats[i];
        }

    var newWindCodTitle = "<html><head><title>Change Instructors</title>";
    var chngInstrForm0 = "<h2>Indicate your Instructor</h2>";
    var chngInstrForm1 = "<form action=\"javascript:void(0)\">";
    var chngInstrForm2 = "<input type=\"radio\" name=\"chngInstrGrp\" id=\"chngInstr";
    var chngInstrForm3 = "\" onclick=\"opener.changeInstrClose(";
    var chngInstrForm3b = ")\" />\n";
    var chngInstrForm4 = "<label for=\"chngInstr";
    var chngInstrForm5 = "\">";
    var chngInstrForm6 = "</label><br />\n";
    var chngInstrForm7 = "</form>";
    var chngInstrFormHTML = "<body>" + chngInstrForm0 + chngInstrForm1;


    if (MasterInstr[cN].length > 3) {
        for (x = 1; x < MasterInstr[cN].length; x++) {
            InstrButton[x] = MasterInstr[cN][x].clDay + " - "
                                 + MasterInstr[cN][x].name
                                 + "\n";
            chngInstrFormHTML += chngInstrForm2 + x + chngInstrForm3 + x + chngInstrForm3b;
            chngInstrFormHTML += chngInstrForm4 + x;
            chngInstrFormHTML += chngInstrForm5 + InstrButton[x] + chngInstrForm6;
            }
        chngInstrFormHTML += chngInstrForm7;


        makeNewWindow(winStats, newWindCodTitle);
        newWindow.document.write(newWindCodHead);
        newWindow.document.write(chngInstrFormHTML);
        newWindow.document.write("</body></html>");
        newWindow.document.close();        
        }

    if (MasterInstr[cN].length == 3) {
        iNum = (iNum == 1) ? 2 : 1;
        wrapUp(cN, iNum);
        }
    }

function changeInstrClose(instrNum) {
    iNum = instrNum;
    newWindow.close();
    wrapUp(cNum, iNum);
    }

/*********************************************************************************/

/*********************************************************************************/
/*********************   Create a declaration popup window   *********************/
/********************************   Old version   ********************************

function buildPage(cN) {
    courseNum = cN
    getInstr(cN)

    if (MasterInstr[cN].length > 3) {
        declareWin = window.open(declInstrHtml, "declare", winStats)
        }

    if (MasterInstr[cN].length == 3) {
        iNum = (iNum == 1) ? 2 : 1;
        wrapUp(cN, iNum);
        }
    }
    
*********************************************************************************/    

function wrapUp(cNum, iNum) {
    cookieVal = (CookiesOBJ.getCookie(cookie3) == null)
        ? "" : CookiesOBJ.getCookie(cookie3)

    for (x = 0; x < cookieVal.length; x = x + 2) {
        courseArray[cookieVal.charAt(x)] = cookieVal.charAt(x + 1)
        }

    courseArray[cNum] = iNum;

    cookieVal = "";

    for (x = 0; x < courseArray.length; x++) {
        if (courseArray[x] > 0) {
            cookieVal += x + "" + courseArray[x]
            }
        }
    CookiesOBJ.setCookie(cookie3, cookieVal, expires);

    //if (MasterInstr[cNum][iNum].page.length > 12) {
    	//window.location = MasterInstr[cNum][iNum].page
    //}else{
    	window.location.reload();
    //}

    if (!syllPage) {
        moveOn(cNum);
        }
    }

function moveOn(cN2) {
    iNum = (iNum > 0) ? iNum : courseArray[cN2];
    tmpPage = (iNum > 0) ? MasterInstr[cN2][iNum].page : MasterInstr[cN2][1].page;

    tmp = (tmpPage.indexOf("http") >= 0) ? tmpPage : dirs[cN2] + tmpPage;

    if (declareWin) {
        declareWin.close()
        opener.location.href = tmp;
        }

    location.href = tmp;
    }
/*********************************************************************************/

function readInstr() {
    /*****************************************************************************/
    /**********************  Try to read instructor cookie  **********************/

    if (CookiesOBJ.getCookie(cookie3) == null) {
        courseArray[0] = 0;
        //buildPage(cNum)
        } else {
        cookieVal = CookiesOBJ.getCookie(cookie3)

        for (x = 0; x < cookieVal.length; x = x + 2) {
            courseArray[cookieVal.charAt(x)] = cookieVal.charAt(x + 1)

            if (cookieVal.charAt(x) == cNum) {
                iNum = cookieVal.charAt(x + 1)
                }
            }

        /*************   If the instructor hasn't been declared yet   ************/
        if (courseArray[cNum] < 1) {
            buildPage(cNum)

            /*************   Set Cookie with this instructor number   ************/
            cookieVal = "";
            courseArray[cNum] = iNum;

            for (x = 0; x < courseArray.length; x++) {
                if (courseArray[x] > 0) {
                    cookieVal += x + "" + courseArray[x]
                    }
                }

            CookiesOBJ.setCookie(cookie3, cookieVal, expires)
            }
        }
    }

/*********************************************************************************/

/*********************************************************************************/
/************   Function to start calculation of date after one week   ***********/

function weeksTime(cDay) {
    shortSem = MasterInstr[cNum][iNum].iShortSem;

    cDay += (twoWeeks) ? 1 : 0
    
    wkInMs = firstDay.getTime();
    /** 	Normally, the formula to compute the number of ms in a week is
            wkInMs += 60000 * 60 * 24 * 7 * (cDay -1)
            However, to balance for some servers using standard time vs. DST,
            we adjust the formula slightly. **/
    if (!shortSem) {
        wkInMs += 60100 * 60 * 24 * 7 * (cDay - 1) //		Balanced for CST switch
        }                        //		Class meets once a week

    if (shortSem) {              // Balanced for CST switch
        var numDays = parseInt(((cDay - 1) * 7) + (cDay) % 2) - 1;
        var numDaysMod = numDays % 7;        
        numDays = (numDaysMod > 3) ? numDays + (7 - numDaysMod) : numDays - (numDaysMod);

        wkInMs += 60100 * 60 * 24 * numDays;
        //wkInMs += 60100 * 60 * 24 * (parseInt((((cDay - 1) / 2) * 7) + (cDay) % 2) - 1)
        }

    return wkInMs
    }

/*********************************************************************************/
/**********************   Function to get the proper year   **********************/

function rightYear(gY) {
    if (gY < 1000) {
        gY += 1900;
        }

    return gY
    }


/*********************************************************************************/
/**
 * Add a "0" in front of single digit numbers
 * @param vNumber a single digit number
 * @return If the number was less than 10, it is returned with a leading "0"
 */

function addZero(vNumber) {
    return ((vNumber < 10) ? "0" : "") + vNumber
    }


/*********************************************************************************/
/**
 * Format a date to one of many date formats
 * <p>
 * [Write an explanation here of the various format possibilities ]<br />
 * dd for Date of the month, (currently set for no leading zero)<br />
 * DD for Day name<br />
 * MM for month number,
 * Mon3 for 3 char month,
 * MonFull for full month name,<br />
 * yy or yyyy for Year,<br />
 * hh for hours,
 * mm for minutes,
 * ss for seconds
 * @param vDate the date to be formatted
 * @param vFormat how the date should be formatted
 * @return String of the desired date in the chosen format.
 */

function formatDate(vDate, vFormat) {
    var vDayName = vDate.getDay();
    vDayName = (vDayName > 6) ? dayNames[vDayName] : dayNames[vDayName + 7];
    var vDay0 = addZero(vDate.getDate());
    var vDay = vDate.getDate();
    var vMonNum = addZero(vDate.getMonth() + 1);
    var vMon = mos[vDate.getMonth()];
    var vMonth = months[vDate.getMonth()];
    var vYearLong = addZero(vDate.getFullYear());
    var vYearShort =
            addZero(vDate.getFullYear().toString().substring(3,
                                                             4));
    var vYear = (vFormat.indexOf("yyyy") > -1 ? vYearLong : vYearShort)
    var vHour = addZero(vDate.getHours());
    var vMinute = addZero(vDate.getMinutes());
    var vSecond = addZero(vDate.getSeconds());
    var vDateString = vFormat.replace(/dd/g,vDay).replace(/MM/g,vMonNum).replace(/y{1,4}/g,vYear)
    vDateString = vDateString.replace(/hh/g,vHour).replace(/mm/g,vMinute).replace(/ss/g,vSecond).replace(/Mon3/g,vMon).replace(/MonFull/g,vMonth)
    vDateString = vDateString.replace(/DD/g, vDayName)

    return vDateString
    }

/*********************************************************************************/
/******   Function to calculate and build the header on Class Notes pages   ******/

function customInstr(cCI, iCI) {
    headCI = "INSTRUCTOR: "
    headCI += MasterInstr[cCI][iCI].name
    headCI += "<br /></span><span style=\"font-size: 60%;\"><a href='mailto:"
               + MasterInstr[cCI][iCI].email + "'>"
               + MasterInstr[cCI][iCI].email
               + "</a>" //</h4></div>"
    return headCI
    }

/*********************************************************************************/
/**************   Function to calculate semester weekly dates and   **************/
/****************   build the header used on the syllabus pages   ****************/

function customDateString(chapters, cCDS, iCDS) {
    var classWeek = document.title.substring(document.title.indexOf('ss') + 3,
                                     document.title.length);
    firstDay.setTime(weeksTime(classWeek));

    /****************   Add in the list of Prerequisite courses   ****************
            if (header.indexOf("Prerequisites") < 0 ) {
                    header += dayNames[firstDay.getDay()] + ", "
                    header += monthNames[parseInt(firstDay.getMonth())] + " "
                    header += firstDay.getDate() + ", " + rightYear(firstDay.getYear())
                    }
    ******************************************************************************/

    /**************************   Add in the chapters   **************************/
    if (chapters.length > 0) {
        header += chapters
        }

    /***********************   Finish building the header   **********************/
    header += customInstr(cCDS, iCDS)
    return header
    }

/*********************************************************************************/
/****   Part of building the window to select which class on the first page   ****/
function getInstr(courseNum) {
    for (x = 1; x < MasterInstr[courseNum].length; x++) {
        InstrButton[x] = MasterInstr[courseNum][x].clDay + " - "
                             + MasterInstr[courseNum][x].name;
        }

    InstrButton[0] = MasterInstr[courseNum][0].name;
    }

/*********************************************************************************/
/*************   Function to calculate weekly dates on the Syllabus   ************/

var cwAdj = 0;

function syllabusDates(classWeek, classNum, ref) {
    quizToday = false
    var sDay = new Date()
    cW = classWeek;
    cW = cW + cwAdj;


    if (MasterInstr[cNum][iNum].blended && classWeek == noClass[nc]) {
        cW++;
        cwAdj = cwAdj + (classNum % 2);
        nc++;

       
        /**********  Adjust if there are two 'No Class' days in a row  ***********/
        if (noClass[nc]-1 == noClass[nc-1]) {
        	cW++;
        	cwAdj = cwAdj + (classNum % 2);
        	nc++;
        	}
        }
		

/*   Move the class date up one week due to oddity in schedule.   */
        if (MasterInstr[cNum][iNum].blended && classWeek == -noClass[nc]) {
        	cW--;
        	cwAdj = cwAdj - (classNum % 2);
        	nc++;
        	}
/*              Above is to move the class date up one week       */
		

    if (MasterInstr[cNum][iNum].blended && (classNum % 2 == 0)) {
        cW--;
        //cW = cW - cwAdj;
        }

    sDay.setTime(weeksTime(cW))
    
    ssDay = new Date((sDay.getMonth() + 1) + "/"
                        + sDay.getDate() + "/"
                        + rightYear(sDay.getFullYear()))
    satDay = new Date(ssDay - ((ssDay.getDay() + 1) * 24 * 60 * 60 * 1000))

function setPrePost(){
	var prePostArray = new Array();
	for (i=0; i < setPrePost.arguments.length; i++){
		prePostArray[i] = setPrePost.arguments[i];
	}

    if (MasterInstr[cNum][iNum].blended) {
        prePost = prePostArray[0];
        prePostHw = linkActive(prePostArray[1]);    //  When the Homework links become active in a blended class        
        //prePost = linkActive(0.5);                //	Turn off all links during week before class starts     
        //prePostHw = linkActive(0.5);		          //	Turn off all links during week before class starts
        }
      
      }
    //setPrePost(prePostBlended, 12.5);    
    showIt = (ssDay - prePost < nowDay) ? true : false;
    showItHw = (ssDay - prePostHw < nowDay) ? true : false;

    /*************   Turn on the last homework link one week early   *************/
    if (hw + 1 == MasterInstr[cNum][iNum].hwClass.length && ssDay - prePostHw - (60000 * 60 * 24 * 14) < nowDay) {
        showItHw = true;
        }

    /********   Between semesters, turn on a couple of weeks as examples   *******
            if (classWeek == 1 || classWeek == 24) {
                    showIt = true
                    }
    ******************************************************************************/

    /*****************************************************************************/
    /*************   Turn on all links to notes for the instructors   ************
            showIt = true;
    ******************************************************************************/

    /*************   Turn on all links to notes for one instructor   *************
            if (cNum == 1 && iNum == 2) {
                    showIt = true;
	    							showItHw = true;
                    }
    *****************************************************************************/

    /*****************************************************************************/
    /*************   Turn on all links to notes for just one class   *************/
            switch(cNum){
                    case 4: showIt = true;
                    }
    /******************************************************************************/

    classNum = (classNum <= 9 && cW != noClass[nc]) ? "0" + classNum : classNum
    clDesc = (shortSem || MasterInstr[cNum][iNum].blended) ? "Class " : "Week ";

    if (MasterInstr[cNum][iNum].online) { 
        clDesc = "Unit ";
        showIt = true;
	    	showItHw = true;
        prePostHw = linkActive(180);    //  When the Homework links become active
        //showIt = false;								//	Turn off all links during week before class starts
        //showItHw = false;							//	Turn off all links during week before class starts
        }

    if (ref != 0 && showIt && cW != noClass[nc]) {
        ref1 = csRef + "Notes" + classNum
        //ref1 += (cNum != 4) ? ".html' target='_blank'>" : ".pdf' target='_blank'>"

        switch (cNum) {
            case 1: exten = ".html"; break;
            case 2: exten = ".html"; break;
            case 3: exten = ".html"; break;
            case 4: exten = ".html"; break;
            case 5: exten = ".html"; break;
            case 6: exten = ".mht"; break;
            case 7: exten = ".pdf"; break;
            case 8: exten = ".mht"; break;
            }
        ref1 += exten + "' target=\"_blank\">";
        } else {
        ref1 = ""
        }
        
    ref2 = (ref == 0 || !showIt) ? "" : "</a>"

    classWeekStr = "<h5 class=\"eighty\">" + ref1 + clDesc + ordinals[(classWeek - 1)] + ref2 + "</h5>";

    if (MasterInstr[cNum][iNum].clNum > 0) {
        classWeekStr += "<span class='justCentr, eighty'>" + (sDay.getMonth() + 1)
        classWeekStr += "/" + sDay.getDate();

        if (twoTimes) {
            var ttDay = new Date((60100 * 60 * 24 * dNum) + sDay.getTime());
            classWeekStr += ", " + ttDay.getDate();
            }

        classWeekStr += "/" + rightYear(sDay.getFullYear());
        classWeekStr += (cW != noClass[nc]) ? newAsOf(ref) : "";
        classWeekStr += "</span>";
        }
		
		var breakLine = "";
		var chapText = chapters + chaps[parseFloat(classNum)];
    		
    if (MasterInstr[cNum][iNum].clNum > 0 && !MasterInstr[cNum][iNum].blended && cW == noClass[nc]) {
    	chapText = "";
    	}
    	
        	if (chapText != "") {
    		breakLine = "<br />";
    		}
    		
    if (chaps.length > classNum && chaps[parseFloat(classNum)].length > 0) {

        classWeekStr += "<span class=\"eighty emphBlue\">" + breakLine + chapText + "</span>";
        }

/**   Use parseFloat because parseInt can sometimes return an incorrect value.   */
/******************   Example: classNum = "08"   *********************************/
/*********************   parseInt(classNum) returned "0"     *********************/
/*********************   parseFloat(classNum) returned "8"   *********************/


    if (cW == noClass[nc] - 20) {
        nextAssn++;
        nc++;
        }

/***   Use the noClass array to post the notice and move on to the next week   ***/

    if (MasterInstr[cNum][iNum].clNum > 0 && !MasterInstr[cNum][iNum].blended && cW == noClass[nc]) {
        classWeekStr = classWeekStr + "</div><div class=\"boxRight2\"><h5>No Class</h5></div>"
        classWeekStr += "<div class=\"space-line\">&nbsp;</div></div><div class=\"box\">"
        classWeekStr += "<div class=\"boxLeft\">"
        
        if (noClass[nc]+1 == noClass[nc+1]) {
        	classWeekStr += syllabusDates(yy++, classNum, ref) + "</div><div class=\"boxRight2\"><h5>No Class</h5></div>"
        	classWeekStr += "<div class=\"space-line\">&nbsp;</div></div><div class=\"box\">"
        	classWeekStr += "<div class=\"boxLeft\">"
        	}
        classWeekStr += syllabusDates(yy++, classNum, ref);
        nc++;
        }

    return classWeekStr
    }

/*********************************************************************************/
/*****************   Function to calculate semester values and   *****************/
/****************   build the header used on the syllabus pages   ****************/
/*************************   The result looks like this   ************************/
/****   CCIS 2591 Tutorial Notes                          JavaScript & DHTML   ***/
/****   Monday - Spring, 2005                        INSTRUCTOR: Alan Kelsey   ***/
/****                               instructor@JavaScriptTutorialOnline.info   ***/
/****																		   ***/

function customSemester(cN3, iN3) {
    var classSem = dayNames[firstDay.getDay()]

    //		List two days, if necessary
    if (twoTimes) {
        classSem += " &amp; " + dayNames[firstDay.getDay() + dNum]
        }

    //		Choose the season
    if (firstDay.getMonth() <= 3) {
        classSem += " - Spring"
        } else {
        if (firstDay.getMonth() <= 6) {
            classSem += " - Summer"
            } else {
            classSem += " - Fall"
            }
        }

    //		Start building the header
    header = "<div class=\"headLeft\">"

    //		Add in the CCIS number
    header += "<h3>" + CCIS[cNum].CCIS + " Tutorial Notes<br />";

    //		Add in the day, season, and year
    classSem += ", " + rightYear(firstDay.getYear())
    header += "<span style=\"font-size: 75%;\">" + classSem
                  + "</span></h3></div>";
    header += "<div class=\"headRight\"><h3>";

    //		Add in the CCIS description (top row, right)
    header += CCIS[cNum].cDesc + "<br />";

    //		Add the instructor's name and email
    header += "<span style=\"font-size: 75%;\">"
    header += customInstr(cN3, iN3) + "</span></h3></div>"
    return header
    }

/*********************************************************************************/
/**
 * Build the actual Homework/Lab link or just text
 * @param hwRef1
 * @param hwRef2
 * @param hwRef3
 * @return If the number was less than 10, it is returned with a leading "0"
 */

function adjDay() {
    //	Add in one day for Monday or subtract for Friday if online
    //var dayAdj = (MasterInstr[cNum][iNum].clNum == 0) ? -2 : 1;
    var dayAdj = 0;
    dayAdj = 24 * 60 * 60 * 1000 * dayAdj
    if (cNum == 3) {
        //dayAdj -= 604800000;
        }
    return dayAdj;
    }

function hwAssgn(hwRef1, hwRef2, hwRef3) {
    hwRef2a = CCIS[cNum].cPre + "lab0";
    hwRef2b = "Lab 0";
    hwRef2c = "";
    hwRef3a = ""
    hwRef3a = "";

    if (hwRef2 == 1 || hwRef2 == 2) {
        //		It's a homework, not a lab
        hwRef2a = CCIS[cNum].cPre + "hw0";
        hwRef2b = "HW #";
        //if (cNum == 4) {hwRef2b = "Program #";}
        }

    //		If there's been a change, display the 'New' graphic
    if (hwRef2 == 2 || hwRef2 == 3) {
        //hwRef2c = "<img src='../images/updated.gif' height=10 width=30>";
        }

    //		Add a new line if there's also a quiz
    if (hwRef3 == 1) {
        hwRef3a = "<br />"
        }

    hwStrAssgn = hwRef3a;

    var hwRefShortSem = "";
    if (shortSem && cNum != 4 && showItHw) {
        with (MasterInstr[cNum][iNum]) {
            while (labWeek[labNum] < zz && labNum < labWeek.length - 1) {
                addLabs = "<a href=\"" + CCIS[cNum].cPre + "lab0" + (labNum+1);
                addLabs +=  ".html\" target=\"_blank\">" + "Lab" + (labNum+1) + "</a>";
                hwRefShortSem += addLabs+"<br />";
                labNum++;
                }
            }
        }
    hwStrAssgn += hwRefShortSem;
    closeA = ""

    //		Make it a link at the right time
    
    if (showItHw) {
        hwStrAssgn += "<a href='" + hwRef2a + hwRef1 + ".html' target='_blank'>";
        closeA = "</a>"
        }

    //		Finish the assembly
    hwStrAssgn += hwRef2b + hwRef1 + closeA + hwRef2c;
    hwStrAssgn = (quizToday) ? "<br />" + hwStrAssgn : "<h5 class=\"eighty\">" + hwStrAssgn;
    dueDate.setTime(weeksTime(nextAssn++) + adjDay());
    hwStrAssgn += (MasterInstr[cNum][iNum].clNum == 0)
                    ? "<br /><span class=\"sixty\">" + formatDate(dueDate, "MonFull dd, yyyy") + "</span>"
                    : ""
          
    hwStrAssgn += "</h5>";
    return hwStrAssgn;
    }

/* ********************************************************************************/
/* ************************   Function to determine if a   ************************/
/* *******************   homework link, lab link, or no link   ********************/
/* ********************   should be displayed on a given day   ********************/
/* ********************************************************************************/
/**
 * Determines if a homework link, lab link, or no link should be displayed on a given day
 * @param assignByClass boolean to differentiate between assignments set by class number (true) or by week number (false)
 * @return String - html code, either a link or just text
 */
function work(assignByClass) {
    workToday = -1;
    assgnToday = -1;
    assignByClass = (work.arguments.length < 1) ? false : assignByClass;

    with (MasterInstr[cNum][iNum]) {
        if (assignByClass) {
            if (hwClass[hw - 1] == (zz - 1)) {
                assgnToday = hw++;
                workToday = 1;
                }

            if (labClass[lb - 1] == (zz - 1) && !shortSem) {
                assgnToday = lb++;
                workToday = 0;
                }
            } else {
            if (hwWeek[hw - 1] == (yy - 1)) {
                assgnToday = hw++;
                workToday = 1;
                }

            if (labWeek[lb - 1] == (yy - 1) && !shortSem) {
                assgnToday = lb++;
                workToday = 0;
                }
            }
        }

    tasks = (workToday > -1) ? hwAssgn(assgnToday, workToday, 0) : "</h5>"
    return tasks
    }


/******************   Function to calculate homework due date   ******************/
function hwDue(hDue) {
    hintsPosted = "Hints:";
    labHintsPosted = "";
    firstDay.setTime(weeksTime(hDue));

    var dueDay = "";
    var hwNum2 = document.title.charAt(document.title.length-1);
    /*
    if (hwNum2 == MasterInstr[cNum][iNum].hwWeek.length - 1) {
        firstDay.setDate(expires.getDate()-7);
        }
    */
    
    timeToHints = 1;	//	Set the lab solution to appear 1 day later
    
    /**********************   firstDay is always a Sunday   **********************/
    /*****   Take 7 (one week), subtract the day of the week of the class,    ****/
    /********   then subtract how many days to wait for the lab solution   *******/
    labDay.setTime(firstDay.getTime() - 60000 * 60 * 24 * (7 + MasterInstr[cNum][iNum].hwDay - MasterInstr[cNum][iNum].clNum - timeToHints));
    
    timeToHints = 7;	//	Set the Homework hints to appear 7 days later

    secondDay.setTime(firstDay.getTime() + 60000 * 60 * 24 * timeToHints);
    hintsDay.setTime(firstDay.getTime() + 60000 * 60 * 24 * 1.5);	
    /******************   Is it time to post the lab solution?   *****************/
    //nowDay.setTime(labDay.getTime() + 60000 * 60 * 16);
            
    if (labDay < nowDay || MasterInstr[cNum][iNum].clNum == 0) {
        labHintsPosted = "<a href=\"" + keyHTML;
        labHintsPosted
            += "\">Here's one way to do this assignment.</a>"
        }

    /*****************   Is it time to post the homework hints?   ****************/
    if (hintsDay < nowDay && MasterInstr[cNum][iNum].clNum != 0) {
        hintsPosted = "<a href=\"" + keyHTML + "\">Hints:</a>"
        }
        
    if (MasterInstr[cNum][iNum].clNum == 0) {
        firstDay = new Date(startYr, startMo, startDy);

        var dayNum = hDue + 2;
        if (cNum == 3) {
            dayNum = hDue + 1;
        }



        //dueDate.setTime(weeksTime(nextAssn++) + adjDay());
        dueDate.setTime(weeksTime(dayNum)  + adjDay());
        dueDay
            = "<p>Two extra credit points will be added to your score "
        dueDay
            += "if you submit this assignment <strong>before</strong></p><h4>"
        dueDay += formatDate(dueDate, "MonFull dd");
        dueDay += "</h4>";
        } else {
        dueDay = "<h4>Due: ";
        dueDay += formatDate(firstDay, "MonFull dd");
        if (hwNum2 != MasterInstr[cNum][iNum].hwWeek.length - 1) {
            dueDay
            += "</h4><p>The last day this assignment will be accepted is ";
            dueDay += formatDate(secondDay, "MonFull dd");
            dueDay += "</p>";
        } else {
            dueDay += "</h4>";
        }
        }

    return dueDay;
    }
/*********************************************************************************/


/*********************************************************************************/
/*********************   Function to deliver an online Quiz   ********************/

function quizLink() {        	
    if ((zz - 1) != makeQuizWeek[mq] || !showQuiz) {
        return "";
        }

    with (makeQuiz[mq]) {

        if (quizDate > 0) {
            quizToday = true;
            quizNum++;
            } else {
            return "";
            }

        if (quizDate == 6) {
            quizDate = satDay;
            //quizDate = nowDay;		//		This turns on all of the Quiz links
            }

        if (quizDate == 12) {
            sat2Day = new Date(satDay - (2 * 24 * 60 * 60 * 1000));
            quizDate = sat2Day;
            //quizDate = nowDay;		//		This turns on all of the Quiz links
            }

        /***********   Turn on all the quiz links if this is an online course   **********/
        quizDate = (MasterInstr[cNum][iNum].clNum == 0) ? nowDay : quizDate;
        quizDate = (quizNum == 0) ? nowDay : quizDate;   // take out after week 2
        
        /*********************************************************************************/        

        /***********   Turn off all the quiz links if this is an online course   *********/
		/*
        sat2Day = new Date(nowDay + (20 * 24 * 60 * 60 * 1000));
        quizDate = (MasterInstr[cNum][iNum].clNum == 0) ? sat2Day : quizDate;
		*/
        /*********************************************************************************/

        var hour12 = 12 * 60 * 60 * 1000; //  12 hours
        var quizText = "Quiz #" + quizNum

        /*********************************************************************************/

        var quizHTML = quizText

        if (quizOnline) {        	
            //quizDate = new Date(quizDate.setTime((hour12) + quizDate.getTime()));	//	this adds 12 hours
            quizOffDay = new Date(((quizOn * hour12 * 2) - .1)
                                      + quizDate.getTime());
            quizOffWarn = quizOffDay + "";

            if (quizOffWarn.indexOf("GMT") > 1) {
                quizOffWarn = quizOffWarn.substring(0, quizOffWarn.indexOf("GMT") - 1);
                }

            if (quizOffWarn.indexOf("ST") > 1) {
                quizOffWarn = quizOffWarn.substring(0, quizOffWarn.indexOf("ST") - 2);
                }

            timeAvail = (zz == 2) ? "thirty minutes" : "two hours";

            confirmText = "confirm('Once you begin, ";
            confirmText += "you will have " + timeAvail + " to complete this quiz.\\n";
            confirmText += "Do NOT click OK unless you are ready to finish the ";
            confirmText += "quiz in the next " + timeAvail + "!\\nDo you want to proceed?\\n";
            confirmText += (MasterInstr[cNum][iNum].clNum == 0) ? "')" : "[This link will be active only until " + quizOffWarn + "]')";

            linkFirstPart = "<a href=\"javascript:void(0)\" onclick=\"if ("
            linkFirstPart += confirmText + "){ quizWin = window.open('"
            linkSecondPart = "', 'quizWinName')} else {return false;}\">"

            if (quizDate <= nowDay && nowDay <= quizOffDay){
                quizHTML = linkFirstPart
                quizHTML += quizLocation
                quizHTML += quizURL
                quizHTML += linkSecondPart
                quizHTML += quizText + "</a>";
                }
            }

        if (!quizOnline) {
            //quizDate = new Date(quizDate.setTime((hour12) + quizDate.getTime()));	//	this adds 12 hours
            quizOffDay = new Date(((quizOn * hour12 * 2) - .1) + quizDate.getTime());
            quizOffWarn = quizOffDay + "";

            /**************   Set a special day to turn off Java Quiz 4   ****************
            if (cNum == 6 && quizNum == 4) {
                quizOffDay = new Date(2006, 3, 27)
                }
            *****************************************************************************/    

            if (quizOffWarn.indexOf("GMT") > 1) {
                quizOffWarn = quizOffWarn.substring(0, quizOffWarn.indexOf("GMT") - 1);
                }

            if (quizOffWarn.indexOf("ST") > 1) {
                quizOffWarn = quizOffWarn.substring(0, quizOffWarn.indexOf("ST") - 2);
                }

            confirmText = "confirm('This is a take-home quiz. ";
            confirmText += "You need to print it out, complete it,\\n";
            confirmText += "and get it back to me by the date it is due.\\n";
            confirmText += "It is due at the beginning of class on that date.\\n";
            confirmText += "If you cannot make it to class that day, you will need ";
            confirmText += "to find another method to get it to me by that time.\\n";
            confirmText += "[This link will be active only until " + quizOffWarn + "]')"

/***************   for Fundamentals of Programming - Summer 2006   ***************/
/*
            confirmText = "confirm('This is one of your two Exams. ";
            confirmText += "You need to download it and open it in MS Word.\\n";
            confirmText += "Once you have it open, enter your answers and then email it back to me.')";
*/
/*********************************************************************************/
            linkFirstPart = "<a href=\"javascript:void(0)\" onclick=\"if ("
            linkFirstPart += confirmText + "){ quizWin = window.open('"
            linkSecondPart = "', 'quizWinName')} else {return false;}\">"

            if (quizDate <= nowDay && nowDay <= quizOffDay) {
                quizHTML = linkFirstPart
                quizHTML += quizPDFLocation
                quizHTML += quizURL
                quizHTML += linkSecondPart
                quizHTML += quizText + "</a>";
                }
            }
        }

    quizHTML = "<h5 class=\"eighty\">" + quizHTML
    mq++;
    return quizHTML
    }

/*********************************************************************************/
/**
 * Enables a special quiz link for make up quizzes
 * @param forWhom (string) the name of the student taking the quiz
 * @param quizNo (integer) which quiz they want to make up
 * @return String - html code for the link
 */
function specialQuiz(forWhom, quizNo) {
    var forClass1, forClass2;

    switch (cNum) {
        case (1):
            forClass1 = "HTML";
            forClass2 = "html";
            break;

        case (2):
            forClass1 = "XHTML";
            forClass2 = "xhtml";
            break;

        case (3):
            forClass1 = "WebPub";
            forClass2 = "wpc1";
            break;

        case (4):
            forClass1 = "FundProg";
            forClass2 = "fop1";
            break;

        case (5):
            forClass1 = "JavaScript";
            forClass2 = "javascript";
            break;

        case (6):
            forClass1 = "Java";
            forClass2 = "java";
            break;

        case (7):
            forClass1 = "XML";
            forClass2 = "xml";
            break;

        case (8):
            forClass1 = "XML2";
            forClass2 = "xmlii";
            break;
        }

    if (specialQuiz.arguments.length < 2) {
        quizNo = 1;
        }

    var quizSpecial = "quizTest" + forClass1 + ".cgi?" + forClass2
            + "quiz" + quizNo

    var quizSpecialLink = "<a href=\"" + quizLocation + quizSpecial
            + "\">Special quiz for ";
    quizSpecialLink += forWhom
    quizSpecialLink += "</a>"

    return quizSpecialLink;
    }

/*********************************************************************************/
/**************   Store the cookie that keeps track of the visits   **************/

function visits() {
    var lastStoredVisit = CookiesOBJ.getCookie(cookie1)
    var nextPrevStoredVisit = CookiesOBJ.getCookie(cookie2)
    adjustDate()

    if (lastStoredVisit == null || lastStoredVisit == "")
        { // never been here before
        saveCurrentVisit()
        repeatCustomer = false
        } else {              // been here before...
        if (nextPrevStoredVisit == null
            || nextPrevStoredVisit == "")
            {                 // but first time this session
            CookiesOBJ.setCookie(cookie2, lastStoredVisit,
                      nowDay) // only for current session
            lastVisit = parseFloat(lastStoredVisit)
            saveCurrentVisit()
            repeatCustomer = true
            } else
            { // back again during this session (perhaps reload or Back)
            lastVisit = parseFloat(nextPrevStoredVisit)
            repeatCustomer = true
            }
        }
    }

/*********************************************************************************/
/**************   Function to display 'NEW' graphic appropriately   **************/

function newAsOf(authorDate) {
    authorDate = new Date(authorDate)
    var authorZoneOffset = 210
    var base = new Date()
    var localZoneOffset = base.getTimezoneOffset()
    var netOffset = authorZoneOffset - localZoneOffset
    var itemUpdated = authorDate.getTime() - dateAdjustment
            + (netOffset * 60000)
    return ((itemUpdated > lastVisit) && repeatCustomer && showIt)
        ? "<img src=\"" + commonFolder + "images/updated.gif\" height=\"10\" width=\"30\">"
        : ""
    }

/*****************************   Set dateAdjustment   ****************************/
/******************   to accommodate Mac bug in Navigator 2.0x   *****************/

function adjustDate() {
    var base = new Date()
    var testDate = base
    testDate = testDate.toLocaleString()
    testDate = new Date(testDate)
    dateAdjustment = testDate.getTime() - base.getTime()
    }

/************   Write date of current visit (in GMT time) to cookie   ************/

function saveCurrentVisit() {
    var visitDate = new Date()
    var nowGMT = visitDate.getTime() - dateAdjustment
    //expires = new Date(expires)
    //expires = expires.toGMTString()
    CookiesOBJ.setCookie(cookie1, nowGMT, expires)
    }
/*********************************************************************************/

/*********************************************************************************/
/***********************   Bill Dortch's Cookie Functions   **********************/
//
// "Internal" function to return the decoded value of a cookie
//
function getCookieVal(offset) {
    var endstr = document.cookie.indexOf(";", offset);

    if (endstr == -1) endstr = document.cookie.length;

    return unescape(document.cookie.substring(offset, endstr));
    }

//
//  Function to correct for 2.x Mac date bug.  Call this function to
//  fix a date object prior to passing it to SetCookie.
//  IMPORTANT:  This function should only be called *once* for
//  any given date object!  See example at the end of this document.
//
function FixCookieDate(date) {
    var base = new Date(0);
    var skew = base.getTime(); // dawn of (Unix) time - should be 0

    if (skew > 0)              // Except on the Mac - ahead of its time
    date.setTime(date.getTime() - skew);
    }
//
//  Function to return the value of the cookie specified by "name".
//    name - String object containing the cookie name.
//    returns - String object containing the cookie value, or null if
//      the cookie does not exist.
//

function GetCookie(name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;

    while (i < clen) {
        var j = i + alen;

        if (document.cookie.substring(i, j) == arg)
            return getCookieVal(j);

        i = document.cookie.indexOf(" ", i) + 1;

        if (i == 0) break;
        }

    return null;
    }

//
//      SetCookie (myCookieVar, cookieValueVar, null, "/myPath", null, true);
//
function SetCookie(name, value, expr, path, domain, secure) {
    document.cookie = name + "=" + escape(value) +
        ((expr) ? "; expires=" + expr.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
    }

//  Function to delete a cookie. (Sets expiration date to start of epoch)
//    name -   String object containing the cookie name
//    path -   String object containing the path of the cookie to delete.  This MUST
//             be the same as the path used to create the cookie, or null/omitted if
//             no path was specified when creating the cookie.
//    domain - String object containing the domain of the cookie to delete.  This MUST
//             be the same as the domain used to create the cookie, or null/omitted if
//             no domain was specified when creating the cookie.
//
function DeleteCookie(name, path, domain) {
    if (GetCookie(name)) {
        document.cookie = name + "=" + ((path)
                                           ? "; path=" + path
                                           : "") + ((domain)
                                                       ? "; domain=" + domain
                                                       : "")
                              + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
        }
    }
/*******************   End of Bill Dortch's Cookie Functions   *******************/


/*************   The following lines and those several lines lower   *************/
/**************   are used to keep my email address from spambots   **************/

var emailByJS1 = "<a hr";
var emailByJS2_1 = "nCM";
var emailByJS3 = "lto:ala";
var emailByJS2_2 = "ne.i";
var emailByJS9 = "me.com</a><br />";
var emailByJS2_3 = "ials";
var emailByJS4 = "n@rar";
var emailByJS2_4 = "ala";
var emailByJS6 = "om\">Alan Kelse";
var emailByJS2_5 = "nfo";
var emailByJS2 = "ef=\"mai";
var emailByJS2_6 = "onli";
var emailByJS7 = "y</a> at ";
var emailByJS2_7 = "utor";
var emailByJS8 = "ef=\"..\" rel=\"external\">RareHo";
var emailByJS2_8 = "K13t";
var emailByJS5 = "ehome.c";

/*********************************************************************************/
/**
 * Adds a style rule to the embedded styles in the html file
 * @param selector the new selector to be added
 * @param rule the new rule for the selector
 * @param val the value for the rule
 * @return None
 */
function addRule(selector, rule, val) {
    if (document.styleSheets) {
        var SS = document.styleSheets.item(0)['cssRules'];

        var new_rule = document.styleSheets[0]
        var selectorRule;

        if (new_rule.insertRule) {
            var numRules = SS.length;
            selectorRule = '{' + rule + ": " + val + ';}';
            new_rule.insertRule(selector + selectorRule, numRules);
            } else {
            if (new_rule.addRule) {
                selectorRule = rule + ": " + val + ";";
                new_rule.addRule(selector, selectorRule);
                }
            }
        }
    }

/*****   This function adds a style rule based on the location of an object   ****/
function newPosition(refObj) {

    /************************   Adjust the styles in IE   ************************/
    if (document.all) {
        var positionTop = Math.floor(refObj + 12) + "px";
        }

    /**********************   Adjust the styles in FireFox   *********************/
    if (is_fx) { // taken from the browser sniffer I use
        var positionTop = Math.floor(refObj + 15) + "px";
        }

    addRule('.logo', "top", positionTop);
    }

/************   Adjust various attributes and values in certain tags   ***********/
function adjustTags() {
    if (!document.getElementsByTagName) {
        return null;
        }
    /**************   Set "external" links to load in a new window   *************/
    var anchors = document.getElementsByTagName("a");

    for (var i = 0; i < anchors.length; i++) {
        var anchor = anchors[i];

        if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
            anchor.setAttribute("target", "_blank");
            }

        if (anchor.getAttribute("href") && anchor.href.indexOf("Common") > -1) {
            var commonPlace = anchor.href.indexOf("Common") + 7;
            var tmp = anchor.href.substring(commonPlace, anchor.href.length);
            anchor.href = commonFolder + tmp;
            }
        }

    /****************   Set the Common directory for each course   ***************/
    var linkTags = document.getElementsByTagName('LINK');
    for (i = 0; i < linkTags.length; i++) {
       if (linkTags[i].getAttribute('rel') == "home") {
            homeDir = linkTags[i].getAttribute('href');
           
            if (homeDir != "./") {
                commonFolder = homeDir + "Common/";
                
                /*****   Double check that the Common directory is referenced properly   *****/
                var replCommons = document.getElementsByTagName("img");
            
                for (var i = 0; i < replCommons.length; i++) {
                    var replCommon = replCommons[i];
            
                    if (replCommon.getAttribute("src") && replCommon.src.indexOf("Common") > -1) {
                        var commonPlace = replCommon.src.indexOf("Common") + 7;
                        var tmp = replCommon.src.substring(commonPlace, replCommon.src.length);
                        replCommon.src = commonFolder + tmp;
                    }
                }
            }
        }
    }

    /***********   Add the name attribute to any map tags in FireFox   ***********/
    var mapNames = document.getElementsByTagName("map");

    for (var i = 0; i < mapNames.length; i++) {
        var mapName = mapNames[i];

        if (is_fx && mapName.getAttribute("id")
            && !mapName.getAttribute("name")) {
            var idVal = mapName.getAttribute("id");
            mapName.setAttribute("name", idVal);
            }
        }
    }


/********   Standard function to adjust styles in external style sheets   ********/

function adjustExternalStyles(selectr, property, valu) {
	    if (!document.styleSheets || adjustExternalStyles.arguments.length < 3) {
	        return;
	    }        
            
        var firstSheet=(document.styleSheets[0].imports) ? document.styleSheets[0].imports[0] : document.styleSheets[0];  
        var theRules=(firstSheet.cssRules) ? firstSheet.cssRules: firstSheet.rules;

        /************************   Adjust the styles in FireFox   ***********************/
        if (document.styleSheets[0].insertRule) {
            selectrTxt = selectr + " {" + property + ": " + valu + ";}";    
            firstSheet.insertRule(selectrTxt, theRules.length); //add new rule to end of stylesheet        
            document.styleSheets[0].insertRule(selectrTxt, theRules.length); //add new rule to end of stylesheet
        }        
        
        /**************************   Adjust the styles in IE   **************************/
        if (document.styleSheets[0].imports) {
            
            for (i = 0; i < theRules.length; i++) {
                if (theRules[i].selectorText.toLowerCase() == selectr.toLowerCase()) { 
                    theRules[i].style[property] = valu; //good for IE
                }
            }
        }
    }


/*********************************************************************************/    
        

/***********************   Assemble email address pieces   ***********************/
var emailByJS = emailByJS1 + emailByJS2 + emailByJS3 + emailByJS4;
emailByJS += emailByJS5 + emailByJS6 + emailByJS7 + emailByJS1;
emailByJS += emailByJS8 + emailByJS9;


var emailByJS2 = emailByJS2_4 + emailByJS2_1 + emailByJS2_8 + emailByJS2_7;
emailByJS2 += emailByJS2_3 + emailByJS2_6 + emailByJS2_2 + emailByJS2_5;

/*********************************************************************************/

/*****************   Standard functions to create popup windows   ****************/
/**************************   Assemble the parameters   **************************/

function windowParms() {
    winStats = "";

    for (i = 0; i < windowStats.length; i++) {
        winStats += windowStats[i];
        }
    }

/*********************************************************************************/
/*********************   Declare the individual parameters   *********************/

windowStats[0] = "directories=no,"; //  directories=[yes|no]
/****   Specifies whether to create the standard browser directory buttons.   ****/
/***   In some browsers the directory buttons can be customized by the user.    **/

windowStats[1] = "height=800px,width=500px,";
/**********   Specifies the height and width of the window in pixels.   **********/
/*********************   The minimum value should be 100.    *********************/

windowStats[2] = "location=no,"; //	location=[yes|no]
/**************   Specifies whether to display the Location field,   *************/
/********   the input field for entering URLs directly into the browser.   *******/

windowStats[3] = "menubar=no,"; //	menubar=[yes|no]
/*******   Specifies whether to create the menu at the top of the window.   ******/
/***********   In Internet Explorer, this feature is yes by default.   ***********/
/*******   A menu normally consists of a "File" option, an "Edit" option,   ******/
/********************   and other browser-specific options.   ********************/

windowStats[4] = "resizable,"; //	resizable=[yes|no]
/*   Specifies whether to display resize handles at the corners of the window,   */
/*****   which enable the user to resize the window. If this feature is not   ****/
/********   turned on explicitly, the user cannot resize the new window.   *******/

windowStats[5] = "scrollbars,"; //	scrollbars=[yes|no]
/*****   Specifies whether to display horizontal and vertical scroll bars,   *****/
/***********   when the content exceeds the dimensions of the window.   **********/
/**********************   This feature is yes by default.   **********************/

windowStats[6] = "status=yes,"; //	status=[yes|no]
/***   Specifies whether to create a status bar at the bottom of the window.   ***/
/***********   In Internet Explorer, this feature is yes by default.   ***********/

windowStats[7] += "toolbar=no"; //	toolbar=[yes|no]
/*************   Specifies whether to display the browser toolbar,   *************/
/*******************   with buttons such as Back and Forward.   ******************/
var winStats = "";

for (i=0; i<windowStats.length; i++) {
    winStats += windowStats[i];
    }
/*********************************************************************************/
/**********************   WinStats for a full sized window   *********************/
var winStatsFull = "toolbar=no,";
winStatsFull += "location=false,";
winStatsFull += "directories=no,";
winStatsFull += "menubar=no,";
winStatsFull += "scrollbars,";
winStatsFull += "resizable,";

winStatsFull += "height=" + (parseInt(screen.availHeight) - 60) + "px,";
winStatsFull += "width=" + (parseInt(screen.availWidth) - 60) + "px";

if (navigator.appName.indexOf("Microsoft") >= 0) {
    winStats += ",left=10,top=25";
    } else {
    winStats += ",screenX=10,screenY=25";
    }

var newWindCodTitle = "<html><head><title>Definitions</title>";
var newWindCodHead;
var newWindCodEnd = "</body></html>"; // last code for new window

var newWindow;

function makeNewWindow(wStats, newWinTitle) {
    if (makeNewWindow.arguments.length < 2) {
        newWinTitle = newWindCodTitle;
        };

    newWindCodHead = newWinTitle + "<style type='text/css'>@import \""
              + commonFolder + "css_js/tutorial.css\";";
    newWindCodHead += "body {background-image: none; margin:30px;}</style></head>";

    wStats = (wStats == null || wStats == "") ? winStats : wStats;

    newWindow = window.open("", "", wStats);

    if (!newWindow || newWindow == "undefined") {
        alert("You must disable your popup window blocker to see all of the information on this site.");
        }
    }

/********************   Make a new window and load in a file   *******************/

function popUp(newURL, newName, wStats, orgName) {
    wStats = (wStats == null || wStats == "") ? winStats : wStats;
    var remote = open(newURL, newName, wStats);

    if (remote.opener == null) remote.opener = window;

    if (window.focus) {
        remote.focus();
        }

    remote.opener.name = orgName;
    return remote;
    }

function staticWin(winUrl, wStats, mainTitle) {
    //Make a new window if it isn't already open

    if (!newWindow || newWindow == "undefined") {
        makeNewWindow(wStats, mainTitle);
        }

    if (newWindow.closed) {
        makeNewWindow();
        }

    newWindow.location = winUrl;
    }

/*******************   Make a new window with dynamic content   ******************/
function dynamicWin(winContent) {
    //Make a new window if it isn't already open
    if (newWindow) {
        newWindow.close();
        }

    if (!newWindow) {
        makeNewWindow();
        }

    if (newWindow.closed) {
        makeNewWindow();
        }

    // write html to new window document
    winContent = newWindCodHead + winContent + newWindCodEnd;
    newWindow.document.write(winContent);
    newWindow.document.close(); // close layout stream

    }

/**********************************************************************************
* 			Sliding Menu Bar Script- ? Dynamic Drive (www.dynamicdrive.com)
* 			Visit http://www.dynamicdrive.com/ for full source code
* 			This notice must stay intact for use
**********************************************************************************/

var slidemenu_width = '260px'; 	//		specify width of menu (in pixels)
var slidemenu_reveal = '115px';	//		specify amount that menu should protrude initially
var slidemenu_top = '200px';   	//		specify vertical offset of menu on page
var set_style;                	//		Variable to set browser based styles

function slidePosition(ref) {
    var slideLeft = ((parseInt(slidemenu_width) - parseInt(slidemenu_reveal)) * -1) + "px;";

    /************************   Adjust the styles in IE   ************************/
    if (document.all) {
        slidemenu_top = ref + 12 + "px";
        }

    /**********************   Adjust the styles in FireFox   *********************/
    if (is_fx) { // taken from the browser sniffer I use
        slidemenu_top = ref + 15 + "px";
        }

    addRule('#slidemenubar2', "left", slideLeft);
    addRule('#slidemenubar2', "top", slidemenu_top);
    addRule('#slidemenubar2', "width", slidemenu_width);

    if (is_ie4up || is_id_not_all) {
        set_style = "<div id=\"slidemenubar2\"";
        set_style += " onmouseover=\"pull()\" onmouseout=\"draw()\">";
        document.write(set_style);
        } else if (is_nav4) {
        set_style = "<style>\n#slidemenubar{\nwidth:" + slidemenu_width;
        set_style += ";}\n<\/style>\n";
        document.write(set_style);
        set_style = "<layer id=\"slidemenubar\" left=0 top=" + slidemenu_top;
        set_style += " width=" + slidemenu_width;
        set_style += " onMouseover=\"pull()\" onMouseout=\"draw()\" visibility=\"hide\">";
        document.write(set_style);
        }

    var hiddenMenu = new Array();
    var hiddenMenuHTML = "";

    /*******************************   Edit below   ******************************/

    //siteitems[x]=["Item Text", "Optional URL associated with text"]
    x = 0;
    hiddenMenu[x++] = ["More Places", ""];
    hiddenMenu[x++] = ["Tutorials Main", "http://TutorialsOnline.info/index.html"];
    hiddenMenu[x++] = ["Discussion Forums", "http://TutorialsOnline.info/cgi-bin/yabb2/YaBB.pl\" target=\"_blank"];

    if (MasterInstr[cNum].length > 3) {
        hiddenMenu[x++] = ["Change Instructors", "javascript:changeInstr(" + cNum + ")"];
        
        /*
        hiddenMenu[x++] = ["Change Instructors",
                          "javascript:declareWin = window.open(declInstrHtml, 'declare', winStats)"]
                          */
        }

    if (MasterInstr[cNum].length == 3) {
        iNumExMenu = (iNum == 1) ? 2 : 1;
        hiddenMenu[x++] = ["Change Instructors", "javascript:wrapUp("
                          + cNum + ", " + iNumExMenu + ")"];
        }

    hiddenMenu[x++] = ["",""];

    //sitems[x++] = ["Pat, the lab assistant", commonFolder+ "images/LA01real.html\" target=\"_blank"]

    if (nowDay > evalDate) {
        hiddenMenu[x++] = ["","javascript:void(0)"];
        //sitems[x++] = ["Course evaluation","http://TutorialsOnline.info/courseEval.html"]
        }

    //If you want the links to load in another frame/window, specify name of target (ie: target="_new")
    var targetPlace = "";

    /*******************************   Edit above   ******************************/

    if (is_ie4up || is_nav4 || is_id_not_all) {
        hiddenMenuHTML += "<div class=\"emphMaroonBold one50\">\n";
        hiddenMenuHTML += hiddenMenu[0][0];
        hiddenMenuHTML += "</div>\n<div class=\"padTopBot\">\n";

        for (i = 1; i < hiddenMenu.length; i++) {
            if (hiddenMenu[i][1]) {
                hiddenMenuHTML += "<a href=\"" + hiddenMenu[i][1] + "\"";
                if (targetPlace.length > 0) { 
                    hiddenMenuHTML += " target=\"" + targetPlace + "\"";
                    }                
                hiddenMenuHTML += ">";
                }

            hiddenMenuHTML += hiddenMenu[i][0];

            if (hiddenMenu[i][1]) {
                hiddenMenuHTML += "</a>";
                }

            hiddenMenuHTML += "<br />\n";
            }

        document.write(hiddenMenuHTML);
        document.write('</div>');
        }

    rightboundary = 0;
    leftboundary = (parseInt(slidemenu_width) - parseInt(slidemenu_reveal)) * -1;

    if (is_ie4up || is_id_not_all) {
        document.write('</div>');
        themenu = (is_id_not_all)
            ? document.getElementById("slidemenubar2").style
            : document.all.slidemenubar2.style
        } else if (is_nav4) {
        document.write('</layer>');
        themenu = document.layers.slidemenubar;
        }
    }

function pull() {
    if (window.drawit) {
        clearInterval(drawit);
        }

    pullit = setInterval("pullengine()", 10);
    }

function draw() {
    clearInterval(pullit);
    drawit = setInterval("drawengine()", 10);
    }

function pullengine() {
    if ((is_ie4up || is_id_not_all) && parseInt(themenu.left) < rightboundary) {
        themenu.left = parseInt(themenu.left) + 10 + "px";
        } else if (is_nav4 && themenu.left < rightboundary) {
        themenu.left += 10;
        } else if (window.pullit) {
        themenu.left = 0;
        clearInterval(pullit);
        }
    }

function drawengine() {
    if ((is_ie4up || is_id_not_all) && parseInt(themenu.left) > leftboundary) {
        themenu.left = parseInt(themenu.left) - 10 + "px";
        } else {
        if (is_nav4 && themenu.left > leftboundary) {
            themenu.left -= 10;
            } else {
            if (window.drawit) {
                themenu.left = leftboundary;
                clearInterval(drawit);
                }
            }
        }
    }
/***********************   End of Sliding Menu Bar Script   **********************/
/*  If you are a JavaScript student and reading this, 
    copy the next line and paste it into an email for 5 extra credit points
    
I was reading the TutorialsOnline JavaScript Library

I know 5 points isn't much, but it's five more than you had an hour ago.
Please don't tell anyone else about this.  I'd like to see just how many actually read over this stuff.

*/

/*****************************   Instructor Setup   ******************************/
/*********************************************************************************/
/****************   The variable sc sets the specific course   *******************/
/*********************************************************************************

1 -     XHTML
2 -     Advanced XHTML
3 -     Network Essentials
4 -     Fundamentals of Programming
5 -     JavaScript
6 -     Java
7 -     XML I
8 -     XML II or AJAX
9 -     PowerPoint

**********************************************************************************/
/*********************************************************************************/
/********************   The variable xx sets the instructor   ********************/
/**   Homework & labs can follow either the weeks (yy) or the class notes (zz)   */
/*********************************************************************************/
/*************   The information for each instructor is as follows   *************

MasterInstr[sc][xx] = new makeInstr(
                                "Instructor Name",
                                dayOfClass,
                                dayNames[dayOfClass] + " Morn",
                                "instructor@HTMLTutorialOnline.info",
                                "index.html",
                                dayHwDue
                                [, iTwoTimes (default = false)]
                                [, iShortSem (default = false)]
                                [, blended (default = false)]
                                [, hwemail (different email for HW)];

**********************************************************************************/

/*****************   Make sure the array has at least one value   ****************/
for (x = 0; x < MasterInstr.length; x++) {
    MasterInstr[x][0] = "I don&#39;t know";
    }

/*********************************************************************************/
/***********************************   HTML   ************************************/
/*********************************************************************************/

sc = 1;
dayOfWeek = 0;
CCIS[sc] = new makeInstrBasic("CCIS 1301", "HTML", "HT1301")
courses[sc] = "HTML"
xx = 0;
MasterInstr[sc][xx] = new makeInstr("I don&#39;t know", dayOfWeek, dayNames[dayOfWeek] + " Morn",
    "instructor@HTMLTutorialOnline.info", "index.shtml", 5);

/*********   Make arrays to hold weeks of lab and homework assignments   *********/
MasterInstr[sc][xx].labClass = new Array(1, 2, 4, 5, 7, 9, 11, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 2, 4, 5, 7, 10, 12, 0);

MasterInstr[sc][xx].hwClass = new Array(3, 6, 8, 10, 12, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(4, 6, 9, 11, 13, 14, 0);

/*********************************************************************************/

/* Online class - 16 week session */
/*****************************   Next Instructor   ******************************/
/*
dayOfWeek = 0				//		Day of the week that the class meets
MasterInstr[sc][xx]
    = new makeInstr("Alan Kelsey", dayOfWeek, dayNames[dayOfWeek]
                        + " ",
                        "instructor@HTMLTutorialOnline.info",
                        "index.shtml", 5, false, false);
*/
/*********   Make arrays to hold weeks of lab and homework assignments   *********/
/*********************   Sixteen Week Semester Assignments   *********************/
/*
MasterInstr[sc][xx].labClass = new Array(1, 2, 4, 5, 7, 9, 11, 13, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 2, 4, 5, 7, 9, 11, 13, 0);

MasterInstr[sc][xx].hwClass = new Array(3, 6, 8, 10, 12, 14, 0);
MasterInstr[sc][xx++].hwWeek = new Array(3, 6, 8, 10, 13, 15, 0);
*/
/*********************************************************************************/


/* Online class - 8 week session */
/*****************************   Next Instructor   ******************************/
dayOfWeek = 0 //		Day of the week that the class meets
MasterInstr[sc][xx] = new makeInstr("Alan Kelsey", dayOfWeek, dayNames[dayOfWeek] + " Eve.",
    "instructor@HTMLTutorialOnline.info", "index.shtml", 5, false, true, false);

/*********   Make arrays to hold weeks of lab and homework assignments   *********/
/**********************   Eight Week Semester Assignments   **********************/

MasterInstr[sc][xx].labClass = new Array(1, 2, 4, 5, 7, 9, 11, 12, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 2, 4, 5, 7, 9, 11, 12, 0);

MasterInstr[sc][xx].hwClass = new Array(3, 6, 7, 9, 11, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(3, 6, 7, 9, 11, 13, 0);

/*********************************************************************************/


/* Online class - 8 week session */
/*****************************   Next Instructor   ******************************
dayOfWeek = 0				//		Day of the week that the class meets
MasterInstr[sc][xx]
    = new makeInstr("Dave Wood", dayOfWeek, dayNames[dayOfWeek]
                        + " Eve.",
                        "instructor@styxsoftware.com",
                        "index.shtml", 5, false, true, false);
*/
/*********   Make arrays to hold weeks of lab and homework assignments   *********/
/**********************   Eight Week Semester Assignments   **********************

MasterInstr[sc][xx].labClass = new Array(1, 2, 4, 5, 7, 9, 11, 12, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 2, 4, 5, 7, 9, 11, 12, 0);

MasterInstr[sc][xx].hwClass = new Array(3, 6, 7, 9, 11, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(3, 6, 7, 9, 11, 13, 0);
*/
/*********************************************************************************/

/* Regular Semester */
/******************************   Next Instructor   ******************************
//	dayOfWeek = 0			//		Day of the week that the class meets
MasterInstr[sc][xx]
    = new makeInstr("Alan Kelsey", dayOfWeek, dayNames[dayOfWeek]
                        + " Aft.",
                        "instructor@HTMLTutorialOnline.info",
                        "index.shtml", 1);

*********   Make arrays to hold weeks of lab and homework assignments   *********
MasterInstr[sc][xx].labClass = new Array(1, 2, 4, 5, 7, 9, 11, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 2, 4, 5, 7, 10, 12, 0);

MasterInstr[sc][xx].hwClass = new Array(3, 6, 8, 10, 12, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(3, 6, 9, 11, 13, 14, 0);
*/

/* Blended  */
/******************************   Next Instructor   ******************************/
/*
dayOfWeek = 3; //		Day of the week that the class meets

MasterInstr[sc][xx]
    = new makeInstr("Brandon Carlson", dayOfWeek, dayNames[dayOfWeek] + " Eve.",
                        "brandon@aphion.com",
                        "index.shtml", 2, false, false, true);
*/
/*********   Make arrays to hold weeks of lab and homework assignments   *********/
/*
MasterInstr[sc][xx].labClass = new Array(1, 2, 4, 5, 7, 9, 11, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 2, 4, 6, 8, 10, 11, 0);

MasterInstr[sc][xx].hwClass = new Array(3, 6, 8, 10, 12, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(3, 6, 8, 11, 13, 16, 0);
*/
/*********************************************************************************/

/* Blended  */
/******************************   Next Instructor   ******************************
dayOfWeek = 3; //		Day of the week that the class meets

MasterInstr[sc][xx]
    = new makeInstr("Li Liu", dayOfWeek, dayNames[dayOfWeek] + " Aft. and Eve.",
                        "LLiu@hennepintech.edu",
                        "index.shtml", 5, false, false, true);

*********   Make arrays to hold weeks of lab and homework assignments   *********
MasterInstr[sc][xx].labClass = new Array(1, 2, 4, 5, 7, 9, 11, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 2, 4, 6, 8, 10, 11, 0);

MasterInstr[sc][xx].hwClass = new Array(3, 6, 8, 10, 12, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(3, 6, 8, 11, 13, 16, 0);

*********************************************************************************/

/* Blended  */
/******************************   Next Instructor   ******************************/
/*
dayOfWeek = 2; //		Day of the week that the class meets


MasterInstr[sc][xx]
    = new makeInstr("Alan Kelsey", dayOfWeek, dayNames[dayOfWeek]
                        + " Aft.",
                        "instructor@HTMLTutorialOnline.info",
                        "index.shtml", 5, false, false, true);
*/
/*********   Make arrays to hold weeks of lab and homework assignments   *********/
/*
MasterInstr[sc][xx].labClass = new Array(1, 2, 4, 5, 7, 9, 11, 13, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 2, 4, 5, 7, 10, 12, 14, 0);

MasterInstr[sc][xx].hwClass = new Array(3, 6, 8, 10, 12, 14, 0);
MasterInstr[sc][xx++].hwWeek = new Array(3, 6, 8, 11, 13, 15, 0);
*/
/*********************************************************************************/

/*********************************************************************************/
/*******************************   Advanced HTML   *******************************/
/*********************************************************************************/

sc += 1;
dayOfWeek = 2; //		Day of the week that the class meets
CCIS[sc] = new makeInstrBasic("CCIS 1351", "Advanced XHTML", "HT1351")
courses[sc] = "Advanced XHTML"
xx = 0;
MasterInstr[sc][xx] = new makeInstr("I don&#39;t know", dayOfWeek, dayNames[dayOfWeek] + " Morn",
    "instructor@CSSTutorialOnline.info", "index.shtml", 5, false, false, true);

/*********   Make arrays to hold weeks of lab and homework assignments   *********/
MasterInstr[sc][xx].labClass = new Array(1, 3, 5, 9, 11, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 3, 6, 11, 13, 0);

MasterInstr[sc][xx].hwClass = new Array(2, 4, 6, 7, 10, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(2, 3, 4, 5, 6, 7, 0);

/******************************   Next Instructor   ******************************/
/*
MasterInstr[sc][xx] = new makeInstr("Alan Kelsey", dayOfWeek, dayNames[dayOfWeek] + " Eve.",
    "instructor@CSSTutorialOnline.info", "index.shtml", 5, false, false, true);
*/
/*********   Make arrays to hold weeks of lab and homework assignments   *********/
/************************   Blended Semester Assignments   ***********************/
/*
MasterInstr[sc][xx].labClass = new Array(1, 3, 5, 9, 12, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 3, 6, 10, 15, 0);

MasterInstr[sc][xx].hwClass = new Array(2, 4, 6, 8, 10, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(1, 3, 7, 9, 12, 16, 0);
*/
/*********************************************************************************/

/* Online class */
/******************************   Next Instructor   ******************************/
dayOfWeek = 0				//		Day of the week that the class meets

MasterInstr[sc][xx]
    = new makeInstr("Dave Wood", dayOfWeek, dayNames[dayOfWeek]
                        + " Eve.",
                        "instructor@styxsoftware.com",
                        "index.shtml", 5, false, true, false);

/*********   Make arrays to hold weeks of lab and homework assignments   *********/
MasterInstr[sc][xx].labClass = new Array(1, 3, 5, 9, 11, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 3, 6, 10, 12, 0);

MasterInstr[sc][xx].hwClass = new Array(2, 4, 6, 8, 10, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(1, 3, 7, 9, 12, 16, 0);

/*********************************************************************************/

/*********************************************************************************/
/*********************************   JavaScript   ********************************/
/*********************************************************************************/

sc += 1;
dayOfWeek = 2; //		Day of the week that the class meets
CCIS[sc] = new makeInstrBasic("CCIS 2591", "JavaScript&#8482;", "JS2591")
xx = 0;
MasterInstr[sc][xx] = new makeInstr("I don&#39;t know", dayOfWeek, dayNames[dayOfWeek] + " Eve",
    "instructor@JavaScriptTutorialOnline.info", "index.shtml", 5);

/*********   Make arrays to hold weeks of lab and homework assignments   *********/

MasterInstr[sc][xx].labClass = new Array(2, 3, 5, 8, 10, 12, 0);
MasterInstr[sc][xx].labWeek = new Array(3, 4, 8, 10, 12, 16, 0);

MasterInstr[sc][xx].hwClass = new Array(1, 4, 6, 7, 9, 11, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(1, 4, 6, 7, 9, 11, 13, 0);

/* Blended  */
/******************************   Next Instructor   ******************************/
/*
MasterInstr[sc][xx] = new makeInstr("Alan Kelsey", dayOfWeek, dayNames[dayOfWeek] + " Eve",
    "instructor@JavaScriptTutorialOnline.info", "index.shtml", 5, false, false, true);
*/
/*********   Make arrays to hold weeks of lab and homework assignments   *********/
/************************   Blended Semester Assignments   ***********************/
/*
MasterInstr[sc][xx].labClass = new Array(2, 3, 5, 7, 9, 0);
MasterInstr[sc][xx].labWeek = new Array(3, 4, 8, 10, 12, 0);

MasterInstr[sc][xx].hwClass = new Array(1, 4, 6, 8, 10, 11, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(2, 5, 8, 11, 13, 14, 15, 0);
*/
/*********************************************************************************/

/* Online class */
/*****************************   Next Instructor   ******************************/

dayOfWeek = 0				//		Day of the week that the class meets

MasterInstr[sc][xx]
    = new makeInstr("Ernie Feil", dayOfWeek, dayNames[dayOfWeek]
                        + " Eve.",
                        "Ernie@JavaScriptTutorialOnline.info",
                        "index.shtml", 5, false, true, false);

/*********   Make arrays to hold weeks of lab and homework assignments   *********/
/************************   Blended Semester Assignments   ***********************/

MasterInstr[sc][xx].labClass = new Array(2, 3, 5, 7, 9, 11, 13, 0);
MasterInstr[sc][xx].labWeek = new Array(3, 4, 8, 10, 12, 14, 0);

MasterInstr[sc][xx].hwClass = new Array(1, 4, 6, 8, 10, 12, 14, 0);
MasterInstr[sc][xx++].hwWeek = new Array(2, 4, 6, 8, 10, 12, 14, 0);

/*********************************************************************************/

/*********************************************************************************/
/************************************   Java   ***********************************/
/*********************************************************************************/

sc += 1;
dayOfWeek = 3; //		Day of the week that the class meets
CCIS[sc] = new makeInstrBasic("CCIS 2595", "Java I", "Jv2595")
xx = 0
MasterInstr[sc][xx] = new makeInstr("I don&#39;t know", dayOfWeek, dayNames[dayOfWeek] + " Morn",
    "instructor@JavaTutorialOnline.info", "index.shtml", 0);

/*********   Make arrays to hold weeks of lab and homework assignments   *********/
MasterInstr[sc][xx].labWeek = new Array(1, 3, 6, 10, 11, 14, 16, 0);
MasterInstr[sc][xx++].hwWeek = new Array(2, 4, 5, 7, 11, 12, 14, 0);

/******************************   Next Instructor   ******************************/
MasterInstr[sc][xx] = new makeInstr("Alan Kelsey", dayOfWeek, dayNames[dayOfWeek] + " Eve",
    "instructor@JavaTutorialOnline.info", "index.shtml", 0, false, false);

/*********   Make arrays to hold weeks of lab and homework assignments   *********/

MasterInstr[sc][xx].labClass = new Array(1, 3, 6, 8, 9, 12, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 3, 6, 8, 9, 13, 0);

MasterInstr[sc][xx].hwClass = new Array(2, 4, 5, 7, 10, 11, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(2, 4, 5, 7, 11, 13, 16, 0);
/* */
/*
MasterInstr[sc][xx].labClass = new Array(1, 3, 6, 8, 9, 12, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 3, 6, 8, 10, 13, 16, 0);

MasterInstr[sc][xx].hwClass = new Array(2, 4, 5, 7, 10, 11, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(2, 4, 5, 7, 10, 13, 15, 0);
*/
/*********************************************************************************/

/*********************************************************************************/
/************************************   XML   ************************************/
/*********************************************************************************/

sc += 1;
dayOfWeek = 2; //		Day of the week that the class meets
CCIS[sc] = new makeInstrBasic("CCIS 2610", "XML&trade; I", "XM2610")
xx = 0
MasterInstr[sc][xx] = new makeInstr("I don&#39;t know", dayOfWeek, dayNames[dayOfWeek] + " Morn",
    "instructor@TutorialsOnline.info", "index.shtml", 0);

/*********   Make arrays to hold weeks of lab and homework assignments   *********/
MasterInstr[sc][xx].labClass = new Array(1, 3, 5, 8, 12, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 3, 5, 8, 12, 0);

MasterInstr[sc][xx].hwClass = new Array(2, 4, 6, 7, 14, 16, 0);
MasterInstr[sc][xx++].hwWeek = new Array(2, 4, 6, 7, 14, 15, 0);

/******************************   Next Instructor   ******************************/
MasterInstr[sc][xx] = new makeInstr("Alan Kelsey", dayOfWeek, dayNames[dayOfWeek] + " Eve.",
    "instructor@TutorialsOnline.info", "index.shtml", 0, false, false);


/*********   Make arrays to hold weeks of lab and homework assignments   *********/
MasterInstr[sc][xx].labClass = new Array(1, 3, 5, 8, 10, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 3, 5, 8, 10, 14, 0);

MasterInstr[sc][xx].hwClass = new Array(2, 4, 6, 7, 11, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(2, 4, 6, 7, 11, 13, 0);

/*********************************************************************************/

/*********************************************************************************/
/************************************   AJAX   ***********************************/
/*********************************************************************************/

sc += 1;
dayOfWeek = 1; //		Day of the week that the class meets
CCIS[sc] = new makeInstrBasic("CCIS 2625", "AJAX", "AJ2625")
xx = 0
MasterInstr[sc][xx] = new makeInstr("I don&#39;t know", dayOfWeek, dayNames[dayOfWeek] + " Aft",
    "instructor@TutorialsOnline.info", "index.shtml", 0);

/*********   Make arrays to hold weeks of lab and homework assignments   *********/

MasterInstr[sc][xx].labClass = new Array(1, 3, 5, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 4, 5, 0);

MasterInstr[sc][xx].hwClass = new Array(2, 4, 6, 8, 12, 13, 0);
MasterInstr[sc][xx++].hwWeek = new Array(3, 5, 8, 10, 13, 14, 0);

/******************************   Next Instructor   ******************************/

MasterInstr[sc][xx] = new makeInstr("Alan Kelsey", dayOfWeek, dayNames[dayOfWeek] + " Eve.",
    "instructor@TutorialsOnline.info", "index.shtml", 0, false, false);

/*********   Make arrays to hold weeks of lab and homework assignments   *********/

MasterInstr[sc][xx].labClass = new Array(1, 3, 4, 6, 8, 11, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 4, 5, 8, 11, 14, 0);

MasterInstr[sc][xx].hwClass = new Array(2, 5, 7, 9, 10, 12, 0);
MasterInstr[sc][xx++].hwWeek = new Array(3, 7, 9, 12, 13, 15, 0);

/*********************************************************************************/

/*********************************************************************************/
/*******************************   Administrative   ******************************/
/*********************************************************************************/

sc = 9;
dayOfWeek = 0;
CCIS[sc] = new makeInstrBasic("TOad1000", "Administrative", "AD1000");
//courses[sc] = "XHTML"
xx = 0;
MasterInstr[sc][xx] = new makeInstr("8fc5f1ccc4223c56f76195bc66477a1a", dayOfWeek, dayNames[dayOfWeek] + " Morn",
    "instructor@TutorialsOnline.info", "index.shtml", 5);

/*********   Make arrays to hold weeks of lab and homework assignments   *********/
MasterInstr[sc][xx].labClass = new Array(1, 3, 5, 9, 0);
MasterInstr[sc][xx].labWeek = new Array(1, 3, 5, 9, 0);

MasterInstr[sc][xx].hwClass = new Array(2, 4, 6, 8, 10, 0);
MasterInstr[sc][xx++].hwWeek = new Array(2, 4, 6, 8, 10, 0);


/******************************   Next Instructor   ******************************/
dayOfWeek = 0 //		Day of the week that the class meets
MasterInstr[sc][xx] = new makeInstr("Alan Kelsey", dayOfWeek, dayNames[dayOfWeek] + " Aft.",
    "instructor@TutorialsOnline.info", "index.shtml", 5, true, true);

/*********   Make arrays to hold weeks of lab and homework assignments   *********/
MasterInstr[sc][xx].labClass = new Array(0, 0, 0, 0, 0, 0, 0);
MasterInstr[sc][xx].labWeek = new Array(0, 0, 0, 0, 0, 0, 0);

MasterInstr[sc][xx].hwClass = new Array(0, 0, 0, 0, 0, 0, 0);
MasterInstr[sc][xx++].hwWeek = new Array(0, 0, 0, 0, 0, 0, 0);

/*********************************************************************************/

/***************   Get Date Last Modified and Course Number (cNum)   *************/

var metas = document.getElementsByTagName('META');
var cNum = 0;

for (i = 0; i < metas.length; i++) {
    if (metas[i].getAttribute('name') == "DC.Date.X-MetadataLastModified")
        {
        dlm = metas[i].getAttribute('content');
        dlmYr = dlm.substring(0, 4);
        dlmMo = dlm.substring(5, 7);
        dlmDa = dlm.substring(8, 10);
        dlmMoDaYr = dlmMo + "/" + dlmDa + "/" + dlmYr;
        dlmDate = new Date(dlmMoDaYr);

        /************   Try to get the date from the file itself   ***************/
        fileDLMTmp = document.lastModified;
        fileDLM = new Date(fileDLMTmp);

        if (fileDLM > dlmDate && fileDLM < nowDay)
            {
            dlmDate = fileDLM;
            }
        dlm = formatDate(dlmDate, "MonFull dd, yyyy");
        }

    if (metas[i].getAttribute('name') == "Course.Number")
        {
        cNum = parseInt(metas[i].getAttribute('content'));
        }

    /****************   Comment this out before the semester begins   ****************/
    /*
        if (metas[i].getAttribute('name') == "DC.Title") {
            var DCTitle = metas[i].getAttribute('content');
            var docTitle = document.title;
            if (DCTitle != docTitle && titleFlag) {
                alert("Titles don't match.");
                titleFlag = false;
                }
          }
    */
    /************************   Comment out the lines above   ************************/

    }

/*********************************************************************************/
/****************   Special weekly blocks for the Syllabus page   ****************/

var firstSession = "<div class=\"boxLeft\"><h5 class=\"eighty\">First Meeting</h5></div>";
firstSession += "<div class=\"boxMiddle\">Introductions&nbsp; XHTML Overview</div>";
firstSession += "<div class=\"boxRight\"><h5 class=\"eighty\">Go to lab after introductions</h5></div>";
firstSession += "<div class=\"space-line\">&nbsp;</div>";

var midSemBreak = "<div class=\"boxLeft\">";

function reviewBreak(sylDates) {
    midSemBreak += syllabusDates(yy++, zz, "");
    midSemBreak += "</div>";
    midSemBreak += "<div class=\"boxRight2\"><h5>Review of everything so far</h5></div>";
    midSemBreak += "<div class=\"space-line\">&nbsp;</div>";
    }

var finalDate = "<p>&nbsp;</p>";
var finalTopic = "<p>&nbsp;</p>";

function lastClass() {
    finalDate = "<p>&nbsp;</p>";
    onlineDueDate = new Date(expires.getFullYear(), expires.getMonth(), expires.getDate() - 7);
    onlineDueDate = formatDate(onlineDueDate, "MonFull dd");
    finalTopic = "<h5 class=\"eighty emphRedBold\">All work, including your project, is due by noon on " + onlineDueDate
        + ".<br />Remember, it takes time to correct assignments. If you hand in your last assignment less than one full week before the final due date, you may not get it back before your project is due.</h5>";

    if (MasterInstr[cNum][iNum].clNum > 0)
        {
        finalDate = syllabusDates(yy++, zz++, 0);
        finalTopic
            = "<h5 class=\"eighty\">Projects due one hour before the end of class<br />All work is due.<br />Remember, it takes time to correct assignments. If you hand in your last assignment less than one full week before the final due date, you may not get it back before your project is due.</h5>";
        }
    }

window.onload = adjustTags;

visits();
/******************************   tutorial.js stop   *****************************/
