  var g_sFontString = null;

function SetCookie(sName, sValue) {
  var sCookie = sName + "=" + escape(sValue) +
    "; expires=Mon, 31 Dec 2001 23:59:59 UTC;";
  document.cookie = sCookie;
  //alert(sCookie + " vs " + document.cookie);
}
function GetCookie (sName, sDefault) {
  var sReturn = sDefault;
  var arg = sName + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      {
      var endstr = document.cookie.indexOf (";", j);
      if (endstr == -1)
        endstr = document.cookie.length;
      // alert(document.cookie.substring(j,endstr));
      sReturn = unescape(document.cookie.substring(j, endstr));
      }
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return sReturn;
}
function ClearCookie(sName)
{
  var sCookie = sName + "=; expires=Thu, 01-Jan-70 00:00:01 GMT;";
  document.cookie = sCookie;
}

function PrintFont() {
  var size = GetCookie("fontsml", "s");
  document.write("<LINK REL=stylesheet HREF=\"style_");
  document.write(size);
  document.write(".css\">");
}

// functions that only run on this page
function CheckBox() {
  if ("blank" == GetCookie("target", null))
  {
    document.customize.linkbox.checked = true;
  }
  var font = GetCookie("fontsml", "s");
  if (font == 'm')
	document.customize.size[1].checked = true;
  else if (font == 'l')
	document.customize.size[2].checked = true;
  else
	document.customize.size[0].checked = true;

}

function ChangeFont(font) {
  SetCookie('fontsml', font);  
  history.go(0);
}

// insert this into the stream while loading
PrintFont();

