function fontSize(container, target, defSize, midSize, maxSize) {
	
	//Read cookie & sets the fontsize
	if ($.cookie != undefined) {
		var cookie = target.replace(/[#. ]/g,'');
		var value = $.cookie(cookie);
		if (value !=null) {
			$(target).css('font-size', parseInt(value));
		}
	}
	
	//on clicking default font size button, font size is reset
	$(container + " .defaultFont").click(function(){
		$(target).css('font-size', defSize);
		updatefontCookie(target, defSize);
	});
	
	//on clicking mid font size button, font size is increased
	$(container + " .midFont").click(function(){
		$(target).css('font-size', midSize);
		updatefontCookie(target, midSize);
	});
	
	//on clicking max font size button, font size is increased
	$(container + " .largeFont").click(function(){
		$(target).css('font-size', maxSize);
		updatefontCookie(target, maxSize);
	});

	function updatefontCookie(target, size) {
		if ($.cookie != undefined) { //If cookie plugin available, set a cookie
			var cookie = target.replace(/[#. ]/g,'');
			$.cookie(cookie, size);
		} 
	}
}

$('document').ready(function(){
	fontSize("#txtSize", "body", 12, 14, 16);
});
