var tags = new Array( 'div','td','tr','p','emphasis','a','h1','h2','h3','pre','sub','sup','i','th','cp','ul','ol','li','dt','dd', 'span', 'font');
//var tags = new Array( 'div','a','font', 'p', 'span', 'td');
var letra = 2;
	
function fontSizer(inc,unit) {
	if (!document.getElementById) 
		return;
	
	var actSize = 0;
	var actSizeN = 0;
	var newSize = 0;
	var actUnit = '';
	
	if (inc > 0 && letra < 6) {
		if (letra == 0) { letra += 1; }
		letra += 1;
	} else if (inc < 0 && letra > 0) {
		if (letra == 6) { letra -= 1; }
		letra -= 1;
	}
	
	if (letra > 0 && letra < 6) {
		

		
		getBody = document.getElementById('txt_main_tag');
		for (i = 0 ; i < tags.length ; i++ ) {
			getallTags = getBody.getElementsByTagName(tags[i]);
			
			for (k = 0 ; k < getallTags.length ; k++) {
			
				actSize = getStyle(getallTags[k], 'font-size');
				if (actSize == 'smaller' || actSize == 'larger') { continue; }
				
				actUnit = actSize.substr((actSize.length-2));
				if (actUnit == 'px' || actUnit == 'em') {
					actSize = actSize.substr(0, (actSize.length-2));
				} else {
					actSizeN = getallTags[k].getAttribute('size');
					if (actSizeN != null) {
						switch (actSizeN) {
							case '1': actSize = '10'; break;
							case '2': actSize = '13'; break;
							case '3': actSize = '16'; break;
							case '4': actSize = '18'; break;
							case '5': actSize = '24'; break;
							case '6': actSize = '31'; break;
							case '7': actSize = '38'; break;
							case '8': actSize = '47'; break;
						}
					}
				}
				
				newSize = parseInt(actSize) + inc;
				getallTags[k].style.fontSize = (unit=='px') ? newSize+unit: newSize+unit;
			}
		}
	}
}


/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Robert Nyman :: http://www.robertnyman.com/ */

/*
  Example call of the function:
  
  getStyle(document.getElementById('container'), 'font-size');
*/



// The version if you expect any IE 5.0 users whatsoever
function getStyle(oElm, strCssRule){
  var strValue = '';
  if(document.defaultView && document.defaultView.getComputedStyle){
    strValue = document.defaultView.getComputedStyle(oElm, '').getPropertyValue(strCssRule);
  }
  else if(oElm.currentStyle){
    try {
      strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
        return p1.toUpperCase();
      });
      strValue = oElm.currentStyle[strCssRule];
    }
    catch(e){
      // Used to prevent an error in IE 5.0
    }
  }
  return strValue;
}

	
function fontSet(newSize, newFamily) {
	if (!document.getElementById) 
		return;
	
	var actSize = 0;
	
		getBody = document.getElementById('txt_main_tag');
		for (i = 0 ; i < tags.length ; i++ ) {
			getallTags = getBody.getElementsByTagName(tags[i]);
			
			for (k = 0 ; k < getallTags.length ; k++) {
			
				actSize = getStyle(getallTags[k], 'font-size');
				if (actSize == 'smaller' || actSize == 'larger') { continue; }
				
				if (getallTags[k].className == 'txt_titulo') { continue; }
				
				getallTags[k].style.fontSize = newSize+'px';
				if (getallTags[k].style.fontFamily != 'Wingdings') {
					getallTags[k].style.fontFamily = newFamily;
				}
			}
		}
	
}