function GetCookie(name) {
  var start = document.cookie.indexOf(name+"=");
  var len = start+name.length+1;
  if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
  if (start == -1) return null;
  var end = document.cookie.indexOf(";",len);
  if (end == -1) end = document.cookie.length;
  return unescape(document.cookie.substring(len,end));
}

function SetCookie(name,value,expires,path,domain,secure) {
  if (expires == null){
    var now = new Date();
    expDays = 1000;
    expires = new Date(now.getTime() + (24 * 60 * 60 * 1000 * expDays));
  }
var c;
  document.cookie = c = name + "=" +escape(value) +
    ( (expires) ? ";expires=" + expires.toGMTString() : "") +
    ( (path)    ? ";path=" + path : "") + 
    ( (domain)  ? ";domain=" + domain : "") +
    ( (secure)  ? ";secure" : "");
}

document.path = 'fonts';
var hasFavoriteFonts = GetCookie('hasFavoriteFonts');

if (hasFavoriteFonts != '1'){
  document.write(
    "<br><p><i>This page was designed with certain fonts" +
    " (StoneSans, Univers, and HelveticaCondensed, etc).<br>" +
    "If you like, click to download " +
    "<a href='http://www.media.mit.edu/~mike/fonts/pcfonts.html'>PC</a> or " +
    "<a href='http://www.media.mit.edu/~mike/fonts/macfonts.html'>Mac</a> " +
    "versions.<br>Then reload this page.<br>" +
    "Note: You should only see this message <b>once</b>!</i><br><p>");
    SetCookie('hasFavoriteFonts', '1');
}

