 // initialize the jquery code
$(document).ready(function(){
   // get the desired font-size from cookie
   var size = $.cookie('DGZ_fontsize');

   // set the current font to the desired size.
   $('.resizable').css('font-size', size);
   // display the correct resize-image
   if (size == "20px") {
       $('#fontSizeIcon').attr('src','/images/ico_aMinus.png');
   }
   if (size == "11px") {
       $('#fontSizeIcon').attr('src','/images/ico_aPlus.png');
   }

   $("#sizer").click(function(){
       // get current size
       var currentFontSize = $('.resizable').css('font-size');

       // initialize var
       var newFontSize = "20px";
       var newLineHeight = "25px;";

       if (currentFontSize == "11px") {
           newFontSize = "20px";
           var newLineHeight = "25px";
           $('#fontSizeIcon').attr('src','/images/ico_aMinus.png');
       }
       if (currentFontSize == "20px") {
           newFontSize = "11px";
           var newLineHeight = "16px";
           $('#fontSizeIcon').attr('src','/images/ico_aPlus.png');
       }
       
       // modify page
       $('.resizable').css('font-size', newFontSize);
       $('.resizable').css('line-height', newLineHeight);


       // save size to cookie
       $.cookie('DGZ_fontsize', newFontSize, {
    	   path: '/'
       });
       return false;
   });

});
