	expireDate = new Date;
	expireDate.setMonth(expireDate.getMonth()+6);
	existingInstructor = "";
	
// Set up the arrays of instructors
  
/* Spring 2001
var qinst = new Array ('com','ein','pel','per','sil','str','sum','val','wal');
var instructors = new Array('Comeau','Einhorn','Pelliccio','Perch','Silver','Stroup','Summa','Valentin','Walkup');
var emails = new Array('Comeau_Mark@Sirus.commnet.edu','amy.einhorn@eastlymeschoolsl.org','Pelliccio_El@Sirus.commnet.edu','Perch_John@Sirus.commnet.edu','Silver_Wayne@Sirus.commnet.edu','Stroup_Marga@Sirus.commnet.edu','Summa_Louise@Sirus.commnet.edu','Valentin_M@Sirus.commnet.edu','Lnwalkup@aol.com'); */

/* Fall 2001
var qinst = new Array ('che','com','ken','lan','lis','sum','wal');
var instructors = new Array('Cheslak','Comeau','Kent','Languth','Liscum','Summa','Walkup');
var emails = new Array('Tweensy@aol.com','mcomeau@trcc.commnet.edu','LKENT@norwichpublicschools.org','clanguth@trcc.commnet.edu','mliscum@trcc.commnet.edu', 'lsumma @trcc.commnet.edu','Lnwalkup@aol.com');
*/

var qinst = new Array ('che','com','ken','lis','pel','sum','wal');
var instructors = new Array('Cheslak','Comeau','Kent','Liscum','Pelliccio','Summa','Walkup');
var emails = new Array('tweensy@aol.com','mcomeau@trcc.commnet.edu','LKENT@norwichpublicschools.org','mliscum@trcc.commnet.edu','epelliccio@trcc.commnet.edu','lsumma @trcc.commnet.edu','lnwalkup@aol.com');

var hrefString = "";
var queryString = "";
var	instrString = "";
var confAddress = "setinstructor.htm?reset"; // Default to instructor selection page if no conference can be found
var emailAddress = "abenoit@trcc.commnet.edu?subject=No%20email%20in%20FYE%20pages";
var instructor = "";
var slcIdx=0;

	function readInstructor()			// Read the instructor code from cookie or query string
		{
		if (document.cookie != "")		// Read cookie if set
			{
			instrString = getCrumbValue("inst");
			}
		if (readQuery() != "")
			{
			instrString = readQuery();
			}
		return instrString;
		}
		
	function instrLoop(qS) 	// Set conference address, email address and instructor name based on code
		{
		for(j=0;j<qinst.length;j++)
			{
			if(qS==qinst[j])
				{
				confAddress = "http://www.trctc.commnet.edu/fye/cgi-bin/webbbs_config-" + qinst[j] + ".pl";
				emailAddress = emails[j];
				instructor = instructors[j];
				slcIdx = j;
				return true;
				}
			}
		return false; // Instructor code does not match a valid instructor
		}
		
	function readQuery() // Read query string from HREF
		{
		var rQ = "";
		// NS needs to use document.location.href and IE needs document.location
		if(document.location.href) { hrefString = document.location.href; }
		else { hrefString = document.location; }

		// Find the question mark in the URL and strip off everything before it.

		var questionMark = hrefString.indexOf('?');
		if (questionMark >= 0) 
    	    {rQ = hrefString.substring(questionMark+1, hrefString.length);}
		return rQ;
		}


	function getCrumbValue(crumbName)
		{
		thisCookie = document.cookie.split("; ");
		for (i=0; i<thisCookie.length; i++)
			{
			if(crumbName == thisCookie[i].split("=")[0])
				{
				return thisCookie[i].split("=")[1]
				}
			}
		return;
		}
		
	function skipSet()
	{
	if (queryString != "reset" && document.cookie != "")
		{
		iS = readInstructor();
		if(instrLoop(iS))
			{
				newHREF = "fye-dl.htm?" + readInstructor();
				if(document.location.href) { document.location.href = newHREF; }
				else {document.location = newHREF; }	
			}
		}
	}

	function loadUp()
	{

// Check to see that the instructor is set by cookie or query.  If not send to setinstructor page
		iS = readInstructor();
		if(instrLoop(iS))
			{
			var src0 = "fye-nav.htm?" + queryString;
			var src1 = "welcome.htm?" + queryString;

 			window.frames[0].document.location.href = src0;
			window.frames[1].document.location.href = src1; 
			return;
			}


	// If you get here, the query did not match any of the instructor names
	
		if(document.location.href) { document.location.href = "setinstructor.htm"; } 
			else {document.location = "setinstructor.htm"; }	
	}

	function setNav()
	{

// Check to see that the instructor is set by cookie or query.  If not send to setinstructor page
	iS = readInstructor();
	if (instrLoop(iS))
		{
		return;
		}
		
	// If you get here, the query did not match any of the instructor names
	
		if(top.location.href) { top.location.href = "setinstructor.htm"; } 
			else {top.location = "setinstructor.htm"; }	
	}

function setInstructor()
	{
		if (document.enterInstructor.slcInstructor.options[document.enterInstructor.slcInstructor.selectedIndex].value != "none") 
			{
			instructor = document.enterInstructor.slcInstructor.options[document.enterInstructor.slcInstructor.selectedIndex].value;
			setCookie(instructor)
			// NS needs to use document.location.href and IE needs document.location
			newHREF = "fye-dl.htm?" + instructor;
			if(document.location.href) { document.location.href = newHREF; }
			else {document.location = newHREF; }			
			}
	}


function setCookie(inst)
	{
	document.cookie = "inst=" + inst + "; expires=" + expireDate.toGMTString();
	}
