﻿function ChangeFontSize(a)
{
    try
    {
        if(document.all) 
        {
            for(var h=0; h<document.styleSheets.length; h++)
            {   
        
               for(var i=0; i< document.styleSheets[h].rules.length; i++)
               {      
                    if(document.styleSheets[h].rules[i].style.fontSize !="")
                    {
                       var valor=document.styleSheets[h].rules[i].style.fontSize;
                   
                       var medida=valor.substring(valor.length-2);
                       valor=valor.substring(0,valor.length-2);
                       if(medida=="em")
                       {
                        x=a/10;
                       }
                       else  x=a;
                       if(valor>0)
                            document.styleSheets[h].rules[i].style.fontSize = parseFloat(valor) +x+medida; 
                        
                    }
               }
            }
        }
        else{
        
            for(var h=0; h<document.styleSheets.length; h++)
            { 
                for(var i=0; i< document.styleSheets[h].cssRules.length; i++)
                    {
                        if(document.styleSheets[h].cssRules[i].style.fontSize !="")
                        {
                            var valor=document.styleSheets[h].cssRules[i].style.fontSize;
                           
                            var medida=valor.substring(valor.length-2);
                            valor=valor.substring(0,valor.length-2);
                            if(medida=="em")
                            {
                             x=a/10;
                            }
                            else  x=a;
                            if(valor>0)
                                document.styleSheets[h].cssRules[i].style.fontSize = parseFloat(valor) +x+medida; 
                         
                         }
                           
                    }
             }
        }
    }
    catch(err)
    {

    //Handle errors here
    }   
}
  
