/*--------------------------------------------------------------
# Copyright (C) joomla-monster.com
# License: http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
# Website: http://www.joomla-monster.com
# Support: info@joomla-monster.com
---------------------------------------------------------------*/

jQuery(document).ready(function() { 
	
	if(jQuery.cookie('jm-font-size')) {
		count = parseInt(jQuery.cookie('jm-font-size'));
		jQuery('body').addClass('fsize' + count); 
	} else {
		count = 100; //default step
	}

	jQuery('.jm-font-larger').click(function(event){    
		event.preventDefault();
		if(count<130) {
			jQuery('body').removeClass('fsize' + count);
			count = count + 10;
			jQuery('body').addClass('fsize' + count);
			checkheight();
			jQuery.cookie('jm-font-size', count, { expires: 7, path: window.cookiePath });
		}	

	});
	
	jQuery('.jm-font-smaller').click(function(event){
		event.preventDefault();
		if(count>70) {
			jQuery('body').removeClass('fsize' + count);
			count = count - 10;
			jQuery('body').addClass('fsize' + count);
			checkheight();
			jQuery.cookie('jm-font-size', count, { expires: 7, path: window.cookiePath });
		}
		
	});

	jQuery('.jm-font-readable').click(function(event){
		event.preventDefault();
		jQuery('body').addClass('font-readable');
		jQuery.cookie('jm-font-readable', 'font-readable', { expires: 7, path: window.cookiePath });
	});
	
	jQuery('.jm-font-normal').click(function(event){
		event.preventDefault();
		jQuery('body').removeClass('fsize70 fsize80 fsize90 fsize100 fsize110 fsize120 fsize130 font-readable');
		count = 100;
		checkheight();
		jQuery.removeCookie('jm-font-size', { path: window.cookiePath });
		jQuery.removeCookie('jm-font-readable', { path: window.cookiePath });
	}); 
	
});