// encoding: utf-8
// $.fn.fontsizer 1.0  -- (c) 2009 Hugsmiðjan ehf. 
(function(b){var c=null,a,f=function(){c.className=c.className.replace(/zoom\d+/,'')+' zoom'+a.currentSize;return false},e=function(d){a.currentSize=Math.min(a.maxSize,Math.max(d,a.minSize));if(b.cookie){b.cookie('fontSize',a.currentSize,{path:'/',expires:365})}return f()};b.fn.fontsizer=function(h){if(this.length){c=c||document.body;a=b.extend({doClientSide:!1,fontDownSel:'.dwn a',fontUpSel:'.up a',fontJumpSel:'[class*=fsz] > a',minSize:1,maxSize:3,defaultSize:1,currentSize:1},h);a.currentSize=a.defaultSize;if(/\bzoom(\d+)\b/.test(c.className)){a.currentSize=parseInt(RegExp.$1,10)}if(a.doClientSide){var g=(b.cookie)?parseInt(b.cookie('fontSize'),10):0;if(g){a.currentSize=Math.min(a.maxSize,Math.max(g,a.minSize))}f()}this.find(a.fontUpSel).bind('click',function(d){return e(a.currentSize+1)}).end().find(a.fontDownSel).bind('click',function(d){return e(a.currentSize-1)}).end().find(a.fontJumpSel).each(function(){if(/(^|\s)fsz(\d+)(\s|$)/.test(this.parentNode.className)){b(this).data('fontsize',parseInt(RegExp.$2,10)).bind('click',function(d){return e(b(this).data('fontsize'))})}})}return this}})(jQuery);
