﻿    
    function smallFonts() {
      resize("smaller", "100%");
    }
    
    function largeFonts() {
      resize("larger", "120%");
    }
  
  function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else var expires = "";
  document.cookie = name+"="+value+expires+"; path=/";

}

function resize(cookie, size)
{
    createCookie("textsizestyle", cookie, 365);
    
    var div_ids = new Array();
    div_ids[0] = "nav";
    div_ids[1] = "content";
    div_ids[2] = "misc_info";
    div_ids[3] = "content_home";

    for (i = 0; i < div_ids.length; i++) {
        var div_id = document.getElementById(div_ids[i]);
        if (div_id)
        {    
          div_id.style.fontSize = size;
        }
    }
   
}

 
function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

function fsize(size){
  
  if (size == "larger")
  {
    largeFonts();
  }
  else
  {
    smallFonts();
  }
  
}