// JavaScript Document

// Início do código de Aumentar/ Diminuir a letra
 
// Para usar coloque o comando: "javascript:tuningFontSize('tag_ou_id_alvo', -1);" para diminuir
// e o comando "javascript:tuningFontSize('tag_ou_id_alvo', +1);" para aumentar
 
var tags_content_text = new Array('p'); //pega todas as tags
 
// Especificando os possíveis tuning de fontes, poderia ser: x-small, small...
var tuning = new Array( '70%','80%','90%','100%','110%','120%','130%' );
var font_size_default = 3;
 
function tuningFontSize(id_body, action){
  if (!document.getElementById) return
  
  var select_content = null, font_size = font_size_default, i, j, tags_select;
  font_size += action;
  if ( font_size < 0 ) font_size = 0;
  if ( font_size > 6 ) font_size = 6;
  font_size_default = font_size;
  if ( !( select_content = document.getElementById( id_body ) ) ) select_content = document.getElementsByTagName( id_body )[ 0 ];
  
  select_content.style.fontSize = tuning[ font_size ];
  
  for ( i = 0; i < tags_content_text.length; i++ ){
    tags_select = select_content.getElementsByTagName( tags_content_text[ i ] );
    for ( j = 0; j < tags_select.length; j++ ) tags_select[ j ].style.fontSize = tuning[ font_size ];
  }
}
// Fim do código de Aumentar/ Diminuir a letra
