﻿var min = 10;
var max = 20;
var steps = 2;

function increaseFontSize()
{
    var p = document.getElementsByTagName("p");
    
    for (i = 0; i < p.length; i++)
    {
        if (p[i].style.fontSize)
        {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));
        }
        else
        {
            var s = 12;
        }
        if (s != max)
        {
            s += steps;
        }
        p[i].style.fontSize = s + "px";
    }
}

function decreaseFontSize()
{
    var p = document.getElementsByTagName("p");
    
    for (i = 0; i < p.length; i++)
    {
        if (p[i].style.fontSize) 
        {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));
        }
        else
        {
            var s = 12;
        }
        if (s != min)
        {
            s -= steps;
        }
        p[i].style.fontSize = s + "px";
    }
}
