/* Copyright (c) 2009 WhiteInteractive
 *
 * Version: 4.0
 *
 * Requires: jQuery 1.3.1+, jQuery Cookie plugin
 */

(function($){

	$.firstParagraph = function(i) {
		// ********************************************************************** 
		// Re-styles the first paragraph on the page
		// **********************************************************************
		
		$('#contentInner p:nth-child(' + i + ')').css("font-size","1.4em").css("margin-top","16px");
	}
	
	$.fontSize = function() {
		// ********************************************************************** 
		// If the fontsize cookie is set then the site fontsize is increased
		// **********************************************************************
		if ($.cookie('fontsize') == "1") {
			$('body').css("font-size","75%");
			$('#welcomeLeft').css("background","none");
		}	
	}
	
	function saveFontSize(i) {
		// ********************************************************************** 
		// Saves the font size as a cookie or deletes as appropriate
		// **********************************************************************
		
		if (i == '1') {
			$.cookie('fontsize','1');
			$('body').css("font-size","75%");
		} else { 
			$.cookie('fontsize', null);
			$('body').css("font-size","62.5%");
		}
	}
	
	$.createFontSizeLinks = function() {
		// ********************************************************************** 
		// Attaches events to the font sizing links
		// **********************************************************************
		
		$('#fontSize0').bind('click',function(event) {
			saveFontSize('0');
		});
		
		$('#fontSize1').bind('click',function(event) {
			saveFontSize('1');
		});
	}
	
	
	
})(jQuery);