function checkBrowser(name){  
  var agent = navigator.userAgent.toLowerCase();  
  if (agent.indexOf(name.toLowerCase())>-1) { return true; }  
  return false;  
}
$(document).ready(function(){
  // Reset Font Size
  var originalFontSize = $('html').css('font-size');
    $(".resetFont").click(function(){
    if (checkBrowser('MSIE')) { originalFontSize = originalFontSize+'em'; }
    $('html').css('font-size', originalFontSize);
	createCookie('fs',originalFontSize,30);
  });
  // Increase Font Size
  $(".increaseFont").click(function(){
    var currentFontSize = $('html').css('font-size');
    var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*1.2;
    if (checkBrowser('MSIE')) { newFontSize = newFontSize+'em'; }
    $('html').css('font-size', newFontSize);
	createCookie('fs',newFontSize,30);
    return false;
  });
  // Decrease Font Size
  $(".decreaseFont").click(function(){
    var currentFontSize = $('html').css('font-size');
    var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*0.8;
    if (checkBrowser('MSIE')) { newFontSize = newFontSize+'em'; }
    $('html').css('font-size', newFontSize);
	createCookie('fs',newFontSize,30);
    return false;
  });
  var fontSize = readCookie('fs');
  if (fontSize != '') {
	if (checkBrowser('MSIE')) {
	  $('html').css('font-size', fontSize);
	} else {
      $('html').css('font-size', parseFloat(fontSize, 10));
	}
  }
});