var min=8;
var max=18;
function increaseFontSize() {
 
   var p = document.getElementsByTagName('p');
   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() {
   var p = document.getElementsByTagName('p');
   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"
 
   }
}


function init_imagepreview() {
    $('body').delegate('a.imagepreview:not(.overview a.imagepreview)', 'mouseenter', function() {
        var my_img = $('img', $(this));
        var x_offset = ((my_img.attr('width') - $(this).width())/2)+5;
        var y_offset = ((my_img.attr('height') - $(this).height())/2)+5;
        $(this).qtip({
            overwrite: true,
            content: {
                text: function() {
                    returnvalue = $(this).clone();
                    returnvalue.removeAttr('rel');
                    returnvalue.removeClass('imagepreview');
                    returnvalue.removeClass('vertical-middle');
                    returnvalue.removeAttr('style')
                    returnvalue.data('origin', $(this));
                    return returnvalue;
                }
            },
            hide: {
                fixed: true
            },
            show: {
                ready: true
            },
            position: {
                my: 'top left',
                at: 'left top',
                adjust: {
                    x: -x_offset,
                    y: -y_offset
                }
            },
            style: {
                classes: 'ui-tooltip-imagepreview',
                tip: false
            }
        });
    });
}



