var firstCall = true;

function changeFontsize(fSize, increment) {
  if (firstCall) {
    firstCall = false;
    if (increment != "")
      changeFontsize('13', '');
  }
  if (document.getElementsByTagName) {
    //tags = new Array ( "p", "li", "h1", "h2", "h3", "h4", "h5", "h6", "body" );
    tags = new Array ( "body" );
    for (j=0; j<tags.length; j++) {
      var getElement = document.getElementsByTagName(tags[j]);
      var eachElement, currentFontSize, fontIncrease, newFontSize;
      for (i=0; i<getElement.length; i++) {
        eachElement = getElement[i];
        if (increment != "") {
          currentFontSize = parseInt(eachElement.style.fontSize);
          fontIncrease = parseInt(increment);
          newFontSize = currentFontSize + fontIncrease;
          }
        else if (fSize != "")
          newFontSize = parseInt(fSize);
        if (tags[j] == "li")
          eachElement.style.lineHeight = Math.round(newFontSize*1.2) + "px";
        else
          eachElement.style.lineHeight = Math.round(newFontSize*1.5) + "px";
        if (fSize != "") {
          switch(tags[j]) {
          case "h1": newFontSize += 4; break;
          case "h2": newFontSize += 3; break;
          case "h3": newFontSize += 2; break;
          case "h4": newFontSize += 1; break;
          case "h5": newFontSize += 1; break;
          case "h6": newFontSize += 1;
          }
        }
        eachElement.style.fontSize = newFontSize + "px";
        //setCookie('fontSize', newFontSize);
      }
    }
  }
}
