if(jQuery)(
	
	function(jQuery){
		
		jQuery.extend(jQuery.fn,{
			
			/**
			* Creates a slideshow
			*/
			fontResize:function(options) {
				
				// Some default options
				defaults = jQuery.extend({
					"smallText" 	: "14px", 	// Small text size
					"mediumText" 	: "20px", 	// Medium text size
					"largeText" 	: "26px" 	// Large text size
				}, options);
				
				// Create the base object to store common settings
				var base = {};
				base.options = $.extend(defaults, options);
				
				// Set some variables
				base.element = $(this); // Set the base slideshow element for use throughout
				
				
				/**
				* Initialise the slideshow
				*/
				base.init = function() {
					
					base.element.find("a").click(function(event) {
						
						event.preventDefault();
						base.resize( $(this).attr("rel") );
						
					});
					
					base.resize();
					
				}
				
				
				
				/**
				* Change font size
				*/
				base.resize = function (size) {
					
					if (size != undefined) $.cookie( "font_size", size );
					
					if ( $.cookie( "font_size" ) == "small" ) $("body").css("font-size", base.options.smallText);
					else if ( $.cookie( "font_size" ) == "medium" ) $("body").css("font-size", base.options.mediumText);
					if ( $.cookie( "font_size" ) == "large" ) $("body").css("font-size", base.options.largeText);
					
				}
				
				
				
				// Initialise
				base.init();
				
			}
		
		});
		
	}
	
)(jQuery);

