﻿var ctr = 0;





function accessSize(baseFontPercent) {
   document.body.style.fontSize = baseFontPercent + "%";
   $.cookie('fontsize', baseFontPercent, { expires: 365, path: '/' });

   $(".jqColumn").vjustify();
}

function addSizeChangeUI() {
   document.write("<span><a href='javascript:void(0);' class='mediumA' onclick='accessSize(100);' title='Standard text size'>A</a> <a href='javascript:void(0);' class='largerA' onclick='accessSize(110);' title='Larger text size'>A</a> <a href='javascript:void(0);' class='largestA' onclick='accessSize(120);' title='Largest text size'>A</a></span> <span>|</span> ");
}


jQuery.fn.vjustify = function () {

   // reset heights from previous fixed amounts
   this.each(function () {
      $(this).height("auto");
   });


   var maxHeight = 0;
   this.each(function () {
      if (this.offsetHeight > maxHeight) { maxHeight = this.offsetHeight; }
   });
   this.each(function () {
      $(this).height(maxHeight + "px");
      if (this.offsetHeight > maxHeight) {
         $(this).height((maxHeight - (this.offsetHeight - maxHeight)) + "px");
      }
   });
};


$(function () {
   // check for cookie with font-sizing
   if ($.cookie('fontsize') != null) {
      accessSize($.cookie('fontsize'));
   } else {
      $(".jqColumn").vjustify();
   }
});
