﻿
// for a

var aMin = 11;
var aMax = 12;

// for a.linkheader

var alMin = 14;
var alMax = 15;

// for td

var tdMin = 11;
var tdMax = 12;

// for h1

var h1Min = 24;
var h1Max = 25;

// for h2

var h2Min = 14;
var h2Max = 15;

// for h3

var h3Min = 12;
var h3Max = 13;


function increaseFontSize() {
    
    // For anchors
    
    var p = document.getElementsByTagName('a');
    for (i = 0; i < p.length; i++) {
        if (p[i].style.fontSize)
         {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));
        } else
         {
            var s = 11;
        }
       
        if (s != aMax)
         {
            s += 1;
        }
        
        p[i].style.fontSize = s + "px"

       
    }

//    var p = document.getElementsByClassName("linkheader");
//    for (i = 0; i < p.length; i++) {
//        if (p[i].style.fontSize) {
//            var s = parseInt(p[i].style.fontSize.replace("px", ""));
//        } else {
//            var s = 14;
//        }
//        if (s != alMax) {
//            s += 1;
//        }
//        p[i].style.fontSize = s + "px"
//    }
    
    // For td

    var p = document.getElementsByTagName('td');
    for (i = 0; i < p.length; i++) {
        if (p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));
        } else {
            var s = 11;
        }
        if (s != tdMax) {
            s += 1;
        }
        p[i].style.fontSize = s + "px"
    }

    // For h1

    var p = document.getElementsByTagName('h1');
    for (i = 0; i < p.length; i++) {
        if (p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));
        } else {
            var s = 24;
        }
        if (s != h1Max) {
            s += 1;
        }
        p[i].style.fontSize = s + "px"
    }

    // For h2

    var p = document.getElementsByTagName('h2');
    for (i = 0; i < p.length; i++) {
        if (p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));
        } else {
            var s = 14;
        }
        if (s != h2Max) {
            s += 1;
        }
        p[i].style.fontSize = s + "px"
    }

    // For h3

    var p = document.getElementsByTagName('h3');
    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 != h3Max) {
            s += 1;
        }
        p[i].style.fontSize = s + "px"
    }
}

function decreaseFontSize()
 {
        
    // For anchors
    
    var p = document.getElementsByTagName('a');
    for (i = 0; i < p.length; i++)
     {
        if (p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));
        } else
         {
            var s = 11;
        }
        if (s != aMin)
         {
            s -= 1;
        }
        p[i].style.fontSize = s + "px"
    }

//    var p = document.getElementsByClassName("linkheader");
//    for (i = 0; i < p.length; i++) {
//        if (p[i].style.fontSize) {
//            var s = parseInt(p[i].style.fontSize.replace("px", ""));
//        } else {
//            var s = 14;
//        }
//        if (s != alMin) {
//            s -= 1;
//        }
//        p[i].style.fontSize = s + "px"
//    }
    

    // For td

    var p = document.getElementsByTagName('td');
    for (i = 0; i < p.length; i++) {
        if (p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));
        } else {
            var s = 11;
        }
        if (s != tdMin) {
            s -= 1;
        }
        p[i].style.fontSize = s + "px"
    }

    // For h1

    var p = document.getElementsByTagName('h1');
    for (i = 0; i < p.length; i++) {
        if (p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));
        } else {
            var s = 24;
        }
        if (s != h1Min) {
            s -= 1;
        }
        p[i].style.fontSize = s + "px"
    }

    // For h2

    var p = document.getElementsByTagName('h2');
    for (i = 0; i < p.length; i++) {
        if (p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));
        } else {
            var s =14;
        }
        if (s != h2Min) {
            s -= 1;
        }
        p[i].style.fontSize = s + "px"
    }


    // For h3

    var p = document.getElementsByTagName('h3');
    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 != h3Min) {
            s -= 1;
        }
        p[i].style.fontSize = s + "px"
    }
}

