Event.observe(window, 'load', function()
{
    var font_button = $('font'),
        print_button = $('print');
        
    if(font_button)
    {
        setOpacity(font_button, 80);
        font_button.style.cursor = 'pointer';
        Event.observe(font_button, 'click', function(){ increaseFontSize(); });
        Event.observe(font_button, 'mouseover', function(){ setOpacity(font_button, 100); });
        Event.observe(font_button, 'mouseout', function(){ setOpacity(font_button, 80); });
    }
    
    if(print_button)
    {
        setOpacity(print_button, 80);
        print_button.style.cursor = 'pointer';
        Event.observe(print_button, 'click', function(){ window.print(); });
        Event.observe(print_button, 'mouseover', function(){ setOpacity(print_button, 100); });
        Event.observe(print_button, 'mouseout', function(){ setOpacity(print_button, 80); });
    }
});

setOpacity = function(el, op)
{
    el.style.opacity = op / 100;
    el.style.filter = 'alpha(opacity=' + op + ')';
}

var min=8;
var max=18;
var elements = $A(['h1','h2','h3','h4','h5','p','td','dt','dd']);

function increaseFontSize() {
    elements.each(function(element){
      var p = document.getElementsByTagName(element);
      for(i=0;i<p.length;i++) {
         if(p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px",""));
         } else {
            var s = 12;
         }
         if(s!=max) {
            s += 1;
         }
         p[i].style.fontSize = s+"px"
      }
   });
}
function decreaseFontSize() {
    elements.each(function(element){
      var p = document.getElementsByTagName(element);
      for(i=0;i<p.length;i++) {
         if(p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px",""));
         } else {
            var s = 12;
         }
         if(s!=min) {
            s -= 1;
         }
         p[i].style.fontSize = s+"px"
      }   
   });
}
