
function person(name,email)
{
    this.name = name
    this.email = email
}
	
function faculty(title,name,email,office,phone,URL,officeHours)
{
	this.title = title
    this.base = person
	this.base(name,email)
	this.office = office
    this.phone = phone
    this.URL = URL
    this.officeHours = officeHours
}

faculty.prototype = new person

function dept(name,location,phone,fax,URL)
{
	this.name = name
    this.location = location
    this.phone = phone
    this.fax = fax
    this.URL = URL
}
	
function TA_Entry(ta) {
	document.writeln("<TR>")
	document.writeln("<TD HEIGHT=12>\n<P>\n</TD>")
	document.writeln("<TD>\n  <FONT FACE=\"Arial\">" + 
					 ta.name + "</FONT>\n</TD>")
	document.writeln("<TD>\n  <A HREF=\"mailto: " + ta.email  + 
					 " (" + ta.name + ")\">" + 
					 "<TT>" + ta.email + "</TT>" + 
					 "</A>")
	document.writeln("</TD>\n</TR>")
	return ""
}

function instructorTable(instr,deptInfo,pic)
{	
// ----------------------------------------------------------------------------------
//    This creates a table of instructor contact information, with a separate column
//    for each instructor.
// ----------------------------------------------------------------------------------
	
	document.writeln("<TABLE BORDER=0 CELLPADDING=5>")
	// ----------------------------------------------------------------------------------
	//    Header info
	// ----------------------------------------------------------------------------------
	var numCols = parseInt(instr.length) + 1 
	
	if( pic != "" )
	{
		document.writeln("<TR>\n<TD HEIGHT=20 COLSPAN=" + numCols + " BGCOLOR=#FFFFFF>")
//		document.writeln("<P><FONT SIZE=+2 FACE=Arial>Instructors:</FONT>")
		document.writeln("<DIV ALIGN=center><BR>\n<IMG SRC=" + pic + ">\n</DIV><BR>")
		document.writeln("</TD>\n</TR>")
	}
	
	// ----------------------------------------------------------------------------------
	//    Name
	// ----------------------------------------------------------------------------------
	
	document.writeln("<TR>\n<TD VALIGN=top> <P> </TD>")
	for(var i=0; i<instr.length; i++)
	{
		document.writeln("<TD BGCOLOR=#FFFFFF> <P><FONT FACE=Arial><B>")
		with(instr[i])
		{
			document.writeln(title + " " + name + "<BR></B></FONT>")
		}
		document.writeln("</TD>")
	}
	document.writeln("</TR>\n<TR>\n")
	
	// ----------------------------------------------------------------------------------
	//    Office Location
	// ----------------------------------------------------------------------------------
	
	document.writeln("<TD BGCOLOR=#FFFFFF> <P><FONT FACE=Arial><B>Office</B></TD>")
	for(var i=0; i<instr.length; i++)
	{
		document.write("<TD VALIGN=top BGCOLOR=#FFFFCC> <P><FONT FACE=Arial>")
		with(instr[i])
		{
			document.writeln(office + "</FONT>")
		}
		document.writeln("</TD>")
	}
	document.writeln("</TR>\n<TR>\n")
	
	// ----------------------------------------------------------------------------------
	//    Phone Number
	// ----------------------------------------------------------------------------------
	
	document.writeln("<TD BGCOLOR=#FFFFFF> <P><FONT FACE=Arial><B>Phone</B></TD>")
	for(var i=0; i<instr.length; i++)
	{
		document.writeln("<TD VALIGN=top BGCOLOR=#FFFFCC> <P><FONT FACE=Arial>")
		with(instr[i])
		{
			document.writeln(phone + "</FONT>")
		}
		document.writeln("</TD>")
	}
	document.writeln("</TR>\n<TR>\n")
	
	// ----------------------------------------------------------------------------------
	//    Email Address
	// ----------------------------------------------------------------------------------
	
	document.writeln("<TD BGCOLOR=#FFFFFF> <P><FONT FACE=Arial><B>Email</B></TD>")
	for(var i=0; i<instr.length; i++)
	{
		document.writeln("<TD VALIGN=top BGCOLOR=#FFFFCC> <P>")
		with(instr[i])
		{
			document.writeln("<A HREF=mailto:"+email+"%20("+name.replace(/\s+/g,"%20")+")><FONT FACE=Arial>"+email+"</FONT></A>")
		}
		document.writeln("</TD>")
	}
	document.writeln("</TR>\n<TR>\n")
	
	// ----------------------------------------------------------------------------------
	//    Home Page
	// ----------------------------------------------------------------------------------
	
	document.writeln("<TD BGCOLOR=#FFFFFF> <P><FONT FACE=Arial><B>Home Page</B></TD>")
	for(var i=0; i<instr.length; i++)
	{
		document.writeln("<TD VALIGN=top BGCOLOR=#FFFFCC> <P><FONT FACE=Arial>")
		with(instr[i])
		{
			document.writeln(URL.link(URL) + "</FONT>")
		}
		document.writeln("</TD>")
	}
	document.writeln("</TR>\n<TR>\n")
	
	// ----------------------------------------------------------------------------------
	//    Office Hours
	// ----------------------------------------------------------------------------------
	
	document.writeln("<TD BGCOLOR=#FFFFFF> <P><FONT FACE=Arial><B>Office Hours</B></TD>")
	for(var i=0; i<instr.length; i++)
	{
		document.write("<TD VALIGN=top BGCOLOR=#FFFFCC> <P><FONT FACE=Arial>")
		with(instr[i])
		{
			document.writeln(officeHours + "<BR>\n<I>and by appointment</I><BR></FONT>")
		}
		document.writeln("</TD>")
	}
	document.writeln("</TR>")
	document.writeln("<TR>\n<TD COLSPAN=" + numCols + " HEIGHT=40 VALIGN=bottom BGCOLOR=#FFFFFF><FONT FACE=Arial><B>"+deptInfo.name+"</B></FONT></TD>")
	document.writeln("<TR><TD VALIGN=top BGCOLOR=#FFFFFF><P><FONT FACE=Arial><B>Phone:<BR>\nFax:<BR>\nLocation:<BR>\nWeb Site:</B></FONT></P></TD>")
	document.writeln("<TD VALIGN=top BGCOLOR=#FFFFCC><P>" +
	                "<FONT FACE=Arial>" + deptInfo.phone + "</FONT>" +
	                "<FONT FACE=Arial><BR>" + deptInfo.fax + "</FONT>" +
					"<FONT FACE=Arial><BR>" + deptInfo.location + "</FONT>" +
					"<FONT FACE=Arial><BR>" + deptInfo.URL.link(deptInfo.URL) + "</FONT>")
	document.writeln("<BR></P></TD></TR>")
	document.writeln("</TABLE>")
}
