﻿var firstCall = true;

var TTITREONCE = 0, STYLEPRODONCE = 0;



function changeFontsize(fSize, increment) {

    //alert("tri");

    if (firstCall) {

        firstCall = false;

        if (increment != "")

            changeFontsize('20', '');

    }



    if (document.getElementsByTagName) {

        tags = new Array("div", "td", "span", "p", "font", "a");

        for (j = 0; j < tags.length; j++) {

            var getElement = document.getElementById('Main_Bloc').getElementsByTagName(tags[j]);

            var eachElement, currentFontSize, fontIncrease, newFontSize;



            if (document.getElementById('Main_Bloc').getElementsByTagName(tags[j]).name != 'noResize') {

                for (i = 0; i < getElement.length; i++) {

                    eachElement = getElement[i];



                    if (eachElement.id == 'SpanPetitA') {

                        //alert(eachElement.style.fontSize);

                        eachElement.style.fontSize = "12px";

                    }

                    else {



                        if (increment != "") {

                            currentFontSize = parseInt(eachElement.style.fontSize);

                            fontIncrease = parseInt(increment);

                            newFontSize = currentFontSize + fontIncrease;

                        }

                        else if (fSize != "")

                            newFontSize = parseInt(fSize);



                        eachElement.style.fontSize = newFontSize + "px";

                    }



                    //                    if (eachElement.className == "ttitre") {

                    //                        if (TTITREONCE == 0) {

                    //                            TTITREONCE = 1;

                    //                            newFontSize = newFontSize + 9;

                    //                        }

                    //                    }

                    //                    if (eachElement.className == "styleprod") {

                    //                        if (STYLEPRODONCE == 0) {

                    //                            STYLEPRODONCE = 1;

                    //                            newFontSize = newFontSize - 2;

                    //                        }

                    //                    }



                }

            }

        }

    }

}

 

