function Quote(t) { return "'" + t + "'"; }

function _gel(thing) { return document.getElementById(thing); }

function dw(t) { document.write(t); }

function HTML(text){ dw(text); }


// safeemail script taken from The JavaScript Source!! http://javascript.internet.com 
// Original:  William Rozell Jr (elranzer@nospam.com )
// Web Site:  http://www.elranzer.com
// altText added by Darryl Nester -- 05/05/2003

function safeemail(domain, suffix, user, altText){
 var addr = user+'@'+domain+'.'+suffix;
 var link = addr;
 if (altText != "") link = altText;
 return '<a href="' + 'mailto:' + addr+'">'+link+'</a>';
}

function BCemail(user,altText){
  return safeemail("bluffton", "edu", user, altText);
}

// SmallCaps function -- Darryl Nester, 4/24/2003
// modified 9/9/2003: If the first character of a word is "@", it
//   is displayed without alteration.

function SmallCaps(phrase,bigsize){
  WordArray = phrase.split(' ');
  dw('<font size='+bigsize+'>');
  for (var i=0; i < WordArray.length; i++) {
      if (WordArray[i].charAt(0)=='@') {
        dw(WordArray[i].slice(1));
      }else{
        dw (WordArray[i].charAt(0));
        if (WordArray[i].length>1)
          dw ('<font size='+(bigsize-1)+'>'+WordArray[i].slice(1) + '</font>');
      }
        dw(' ');
  }
  dw('</font>');
}


function GetModDate(){
  var modified = document.lastModified;
//return modified;
  DateArray = modified.split(':');
  modified = DateArray[0].substring(0,DateArray[0].length-2) + DateArray[2].substring(2,100);
  modified = modified.replace(/GMT/,"");
  return modified;
}

var DKN='Darryl Nester';
var DEH='Donald Hooley';
var SHH='Steve Harnish';
var DB='Duane Bollenbacher';
var DN=DKN, DH=DEH, SH=SHH;


function TblEntry(date, title, name){
  dw('<tr valign=top>');
  dw('<td width="10%" align=right>'+date+'</td>');
  dw('<td width="65%">'+title+'</td>');
  dw('<td width="25%"><i>'+name+'</i></td></tr>');
}

function SemDocs(date, title, presenter, LinkList){
 // LinkList should be of the form (e.g.):
 //   "XL|probs.xls|Excel spreadsheet|for computing probabilities|
 //    PP|probs.ppt|Presentation|(slide show with links)|
 //    |sem030926/index.html|web page|with links and images"
 // That is, for each link, there are four fields:
 //    a|b|c|d
 // where "a" is the file type (XL,PP,WD,NB,QT,PDF) [optional]
 //       "b" is the location of the file (for href="b")
 //       "c" is the link text
 //       "d" is the text to follow the link text.
  var i,j,k;
  dw('<tr valign="top"><td>' +date+ '</td>');
  dw('<td>' +title+ '<br><em>' +presenter+ '</em></td>');
  dw('<td><ul>');
  LinkArray = LinkList.split('|');
  i=LinkArray.length;
  if (i%4) {
    dw('<li>BAD LINK LIST<br>i=' + i%3);
    dw('<br>' + LinkArray[0] + '<br>' + LinkArray[1]+'<br>' + LinkArray[2]);
  }else{
    for (j=0 ; j<i; j+=4) {
      k = LinkArray[j];
      dw('<li><a HREF="'+LinkArray[j+1]+'">');
      if (k.length>0)
        dw('<img src="../images/'+k+'-s.gif" alt="['+k+']"> ');
      dw(LinkArray[j+2] + '</a> '+LinkArray[j+3]);
    }
  }
  dw('</ul></td></tr>');
}




function PageTop(title){
  var modified = document.lastModified;
  DateArray = modified.split(':');
  modified = DateArray[0].substring(0,DateArray[0].length-2) + DateArray[2].substring(2,100);
  modified = modified.replace(/GMT/,"");
  dw('<table border=0 cellspacing=1 width=100% align=center>');
  dw('<tr align=left valign=top>');
  dw('<td width=60%><h1>Mathematics Seminar<br>' + title + '</h1><hr>');
  dw('<span class="note">Last modified '+modified);
  dw('<br>maintained by Darryl Nester &bull; ' + safeemail("bluffton", "edu", "nesterd","[send mail]"));
  dw(' &bull; <A HREF="http://www.bluffton.edu/~nesterd">[home page]</A></span>');
  dw('</td><td width=40%>');
  dw('<h4><ul class="square">');
  dw('<li><A HREF="http://www.bluffton.edu/" target="_top">Bluffton University home page</A></li>');
  dw('<li><A HREF="http://www.bluffton.edu/mcst/" target="_top">MCST Department home page</A></li>');
  dw('<li><A HREF="/mcst/seminar/">Current year seminar topics</A></li>');
  dw('<li><A HREF="/mcst/dept/seminar_docs/oldseminar.html">Past seminar topics</A></li>');
  dw('<li><A HREF="/mcst/dept/seminar_docs/">Seminar documents archive</A></li>');
  dw('</ul></h4></td></tr></table><hr>');
}


