var sizeFont = "=10px";

// Extract size from cookie or sizeFont
function setFont()
{
var setSize = document.cookie;
if(setSize == "") setSize = sizeFont;
else sizeFont = setSize.substring( setSize.indexOf("="), setSize.indexOf("x") + 1  )
document.getElementById("myBody").style.fontSize = setSize.substring( setSize.indexOf("=") + 1, setSize.indexOf("x") + 1  );
}

function changeFontSize(inc)
{
var digFont = parseInt(sizeFont.substring(1, sizeFont.indexOf("px")));
var newSize = digFont += inc;
if(newSize < 10) newSize = 10;
if(newSize > 30) newSize = 30;
sizeFont = "=" + newSize.toString() + "px";

// Extract size from sizeFont
document.getElementById("myBody").style.fontSize = sizeFont.substring( sizeFont.indexOf("=") + 1, sizeFont.indexOf("x") + 1  );

// Store in cookie
var cookieDate = new Date();
cookieDate.setTime(cookieDate.getTime() + 30 * 24 * 60 * 60 * 1000);
document.cookie = "fontSize=" + newSize + "px;expires=" + cookieDate.toGMTString() + "path=/;";
}

function deleteCookie()
{
  var cookieDate = new Date();
  cookieDate.setTime(cookieDate.getTime() - 30 * 24 * 60 * 60 * 1000);
  document.cookie = "fontSize=10px;expires=" + cookieDate.toGMTString();
}