
$(document).ready(function(){
  
  // Reset Font Size
  var originalFontSize = $('html').css('font-size');
    $(".resetFont").click(function(){
    $('html').css('font-size', originalFontSize);
  });
  // Increase Font Size
  $(".increaseFont").click(function(){
    var currentFontSize = $('html').css('font-size');
	
    var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*1.2;
	
	if (newFontSize < 35) {
	$('html').css('font-size', newFontSize);
	}
	
    //alert(currentFontSizeNum + '---' + newFontSize);
	return false;
  });
  // Decrease Font Size
  $(".decreaseFont").click(function(){
    var currentFontSize = $('html').css('font-size');
    var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*0.8;

	var length_of_size = originalFontSize.length;
	var size_piece = originalFontSize.substr(0, (length_of_size-2));
	

	if (newFontSize > size_piece) {
    $('html').css('font-size', newFontSize);
	} else {
		 $('html').css('font-size', originalFontSize);
	}

    return false;
  });
});