t1="Kean University"
t2="Dr. Stanley H. Lipson"
t3="Professor of Computer Science"
office="H-204"
mailbox="H-215"
phone="(908) 737-3794"
messages="(908) 737-3800"
fax="(908) 737-3799"
email="stanl@kean.edu"
web="http://www.kean.edu/~stanl"
phd="./"
    
function buildCalendar()
   {
    document.write('<center><table border=1 hspace=30 background="../../../_themes/watermar/watbkgnd.gif"><caption align=top><center><h3>CALENDAR<br>')
    document.write("<font=+1>Section "+section+"</font></h3></center></caption>")
    for(i=0;i< entry.length;i++)
     { 
      color = "#000000" 
      if(entry[i][0]=="red") color = "#ff0000"
       else if(entry[i][0]=="blue") color = "#0000ff"
      document.write("<tr><td><h4>")
      if(!(entry[i][1]==null))document.write('<font color="'+color+'">'+entry[i][1]+'</font>')
        else document.write("&nbsp;")
      document.write("</h4></td><td><h4>&nbsp;&nbsp;&nbsp;&nbsp;")
      document.write('<font color="'+color+'">'+entry[i][2]+"</font></h4></td><td><h4>")
      if(!(entry[i][3]==null))document.write('<font color="'+color+'">'+entry[i][3]+"</font>")
        else document.write("&nbsp;")
      document.write("</h4></td><td><h4>")
      if(!(entry[i][4]==null))document.write(entry[i][4])
        else document.write("&nbsp;")
      document.write("</h4></td><td><h4>")
      if(entry[i][5]==null)document.write("&nbsp;")
        else if(entry[i][5]==0)         {
          document.write('<a href="http://eve.kean.edu/~stanl/syllabi/assn0.html">')
          document.write("Assn. 0</a>")
         }
        else 
         {
          document.write('<a href="#" onClick="window.open(\'assn'+entry[i][5]+'.html\'')
          document.write(',\'Assignment_'+entry[i][5]+'\',')
          document.write('\'toolbar=0,menubar=1,status=0,scrollbars=1,resizable=1\')">')
          document.write('Assn.&nbsp;'+entry[i][5]+'</a>')
         }
      document.write("</h4></td>")
     }
    document.write("</table></center>")
   }
function returnButton()
 {
  document.write('<center><form>')
  document.write('<INPUT TYPE="button" VALUE="Return to Syllabus" onClick="history.go(-1)">')
  document.write('</form></center>')
 }
function lastUpdated()
 {
  document.write('<font face="arial, Arial, Helvetica">');
  document.write("<hr><em>Last updated: ");
  nDate=new Date(document.lastModified);
  month = nDate.getMonth() + 1;
  day = nDate.getDate();
  year = 2000 + nDate.getYear()%100;
  document.write(month+"/"+day+"/"+year);
  document.writeln(" by S.H. Lipson</em></font>");
 }
function buildSchedule()
 {
  document.write('<center><font face="arial" size=+1>Class Schedule:</font>')
  document.write("<h4>"+term+"</h4>")
  document.write("<em>click on section number for course materials.</em>")
  document.write("<table cellspacing=10 border=0>")
  for(i = 0; i < courses.length; i++)
   {
    document.write('<tr><td valign="top"><a href="syllabi/'+courses[i][1]+'/syllabus.html">'+courses[i][0]+'</a></td>')
    document.write('<td valign="top">'+title[courses[i][2]]+'</td><td>')
    for(k = 0; k < days[i].length; k++)
     document.write(days[i][k]+'<br>')
    document.write('</td><td>')
    for(k = 0; k < room[i].length; k++)
     document.write(room[i][k]+'<br>')
    document.write('</td></tr>')
   }
  document.write("</table></center>")
  document.write('<center><a href="NewBldg.html">Location of classes in Hennings Hall</a></center>')
 }
function buildOfficeHours()
 {
  document.write("<center><table>")
  document.write("<tr><td><strong>Office:</strong></td>")
  document.write("<td>"+office+"</td>")
  document.write("<td><strong>Mailbox at:</strong></td>")
  document.write("<td>"+mailbox+"</td></tr>")
  document.write("<tr><td><strong>Phone:</strong></td>")
  document.write("<td>"+phone)
  for(k=0;k<8;k++)
   document.write("&nbsp;")
  document.write("</td>")
  document.write("<td><strong>Messages:</strong></td>")
  document.write("<td>"+messages+"</td></tr>")
  document.write("<tr><td><strong>Fax:</strong></td>")
  document.write("<td>"+fax+"</td>")
  document.write("<td><strong>E-mail:</strong></td>")
  document.write('<td><address><a href="mailto:'+email+'">')
  document.write(email+"</a></address></td>")
  document.write("</tr>")
  document.write("</table><p>")
  document.write("<strong>Web Page:&nbsp;&nbsp;&nbsp;<em>")
  document.write("http://www.kean.edu/~stanl</em></strong><p>")
  document.write("<strong>Office hours:</strong>&nbsp;")
  document.write(term+"<br>")
  document.write("<table cellpadding=3>")
  for(i=0; i < officeHours.length; i++)
   {
    document.write("<tr><td>"+officeHours[i][0]+"</td>")
    document.write("<td>"+officeHours[i][1]+"</td></tr>")
   }
  document.write("</table>")
  document.write("<em>On days that classes are in session, only!</em>")
  document.write("</center>")
 }

function buildTitle(t1,t2,t3)
 {
  document.write('<table border=0>')
  document.write('<tr><td width=15%><font face="arial, Arial, Helvetica">')
  document.write('<a href=# onClick="window.open(\'http://www.kean.edu\',\'Kean\',')
  document.write(' \'toolbar=1,menubar=1,status=1,location=1,scrollbars=1,resizable=1\')">')
  document.write('<img src="'+phd+'images/pic5.jpg" width=88 height=66 border=0 alt="Kean University\'s Home Page"></a>')
  document.write('</font></td>')
  document.write('<td width=70%><font face="arial, Arial, Helvetica">  <CENTER>')
  document.write('<font size=+1 face="arial" color="#aaccff">')
  document.write( t1+'<BR>'+t2+'<br>'+t3)
  document.write('</font>')
  document.write('</CENTER></font></td>')
  document.write('<td width=15%><font face="arial, Arial, Helvetica">')
  document.write('<a href=# onClick="window.open(\'http://www.kean.edu/~compsci\',\'CPS\',')
  document.write('   \'toolbar=1,menubar=1,status=1,location=1,scrollbars=1,resizable=1\')">')
  document.write('<img src="'+phd+'images/pic6.jpg" width=88 height=66 border=0 alt="Computer Science Home Page"></a>')
  document.write('</font></td>')
  document.write('</tr></table>')
 }
function buildInfo()
 {
  document.write('   <center>')
  document.write('    <IMG alt="{Riley, Elijah, Simon, Michael &#10; Josh}"') 
  document.write('    src="'+phd+'images/3.jpg" width=240 height=180 align=center hspace="15" vspace="10">') 
  document.write('   </center>')
  document.write('   <CENTER><A href="http://www.kean.edu/~stanl/wfld/westfield.html">Westfield</A>') 
  document.write('    <br><A href="http://www.kean.edu/~stanl/scouts/cards.html">Boy Scout Postcards</A>')
  document.write('    <br><a href="http://eve.kean.edu/~stanl/abelow/">The Abelow Cousin\'s Club</a>')
  document.write('    <br><a href="http://mildreds90th.com">Mildred Tipton\'s 90th Birthday</a>')
  document.write('    <br><a href="http://www.kean.edu/~stanl/cv.html">c. v.</a></CENTER>')
 }

   function init(n)
      {
        page = 1;
      }

    function readCookie()
      {
        cookie = document.cookie;
        page = getNumberValue(cookie,"page");
      }
    function getNumberValue(s,n)
      { 
        s = removeBlanks(s);
        var pairs = s.split(";");
        for(var i = 0; i < pairs.length; ++i)
          {
            var pairSplit = pairs[i].split("=");
            if(pairSplit[0] == n)
              {
                if(pairSplit.length > 1)
                  {
                    return parseInt(pairSplit[1])
                  }
                else return 0;
              }
          }
        return 0;
      } 
    function removeBlanks(s)
      {
        var t = "";
        for(var i = 0; i < s.length; i++)
          {
            var ch = s.charAt(i);
            t = (ch == " ")?t:t + ch;
          }
        return t; 
      } 

    function updateCookie()
      { 
        document.cookie="page=" + page;
      } 
function displayPage(n)
  {
    for(i=0;i<page[n].length;i++)
    document.write(page[n][i])
  }



  function displayPage2()
      {
     if(this.landscape==1)        //  horizontal format
       {
         this.displayTitle();
         this.displayImage();
         this.displayCaption();
         document.write('<center><form><table border=0 width=90%><tr><td align=left width=30%>');
         this.displayPreviousButton();
         document.write('</td><td width=30%>');
         if(this.link==null){document.write('&nbsp;');} 
           else {this.displayDetailButton()}
         document.write('</td><td align=right width=30%>');
         this.displayNextButton();              
         document.write('</td></tr></table></form></center>');
       }
     else                         // vertical format
       {
         document.write('<table><tr><td>');
         this.displayImage();
         document.write('</td>');
         document.write('<td valign="top"><table><tr><td height=50></td></tr><tr>'); 
         document.write('<td width=380>');
         this.displayTitle();
         document.write('&nbsp;<p>');
         this.displayCaption();
         document.write('</td><tr><td height=150 valign="bottom"><p><center><form>');
         document.write('<table width=90%><tr><td align=left width=30%>');
         this.displayPreviousButton();
         document.write('</td><td width=30%>');
         if(this.link==null){document.write('&nbsp;');} 
            else {this.displayDetailButton()}
         document.write('</td><td align=right width=30%>');
         this.displayNextButton();              
         document.write('</td></tr></table></tr>    </table></td>');
         document.write('</tr></table></center>');
       }

      this.acknowledge();   
      }
    function cardPage(n)
      {
       // instance variables
        this.count = count;
        this.topicNumber=topicNumber;
        this.title=currentTopic;
        this.landscape = ca[n][0];
        this.imageNo = ca[n][1];
        this.caption = ca[n][2];
        this.owner = ca[n][3];
        this.link = ca[n][4];
        this.address = ca[n][5];
        this.windowName = ca[n][6];
        this.bookPage = 9 + ca[n][7];
       // instance methods
        this.displayPage = displayPage;
        this.acknowledge = acknowledge;
        this.displayNextButton = displayNextButton;
        this.displayPreviousButton = displayPreviousButton;
        this.displayDetailButton = displayDetailButton;
        this.displayBackButton = displayBackButton;
        this.displayDetail = displayDetail;
        this.displayImage = displayImage;
        this.displayTitle = displayTitle;
        this.displayCaption = displayCaption;
      }
