//Specify affected tags. Add or remove from list: var tgs = new Array('div', 'td', 'tr', 'font', 'p', 'span'); var fontsizePx = 14; // same as font-size in body /* *** Adjust Font Size *** */ function adjustFontsize(tag, sizechange) { if (!document.getElementById) return; var d = document, cEl = null, i, j, cTags; if (sizechange == 'smaller' && fontsizePx > 12) fontsizePx = fontsizePx - 1; else if (sizechange == 'larger') fontsizePx = 22; else if (sizechange == 'small') fontsizePx = 12; // same as font-size in body else if (sizechange == 'middle') fontsizePx = 14; if (!(cEl = d.getElementById(tag))) cEl = d.getElementsByTagName(tag)[0]; //debug(cEl); cEl.style.fontSize = fontsizePx + "px"; for (i = 0; i < tgs.length; i++) { cTags = cEl.getElementsByTagName(tgs[i]); t = cEl.all.tags(tgs[i]); //alert(tgs[i] +":" + cTags.length); for (j = 0; j < cTags.length; j++) cTags[j].style.fontSize = fontsizePx + "px"; } } /* *** end of Adjust Font Size *** */