var sitefunctions = {
	textresize : function(){
		// show text resizing links
		jQuery(".FontSize").show();
		var jQuerycookie_name = "CTA-FontSize";
		var originalFontSize = jQuery("html").css("font-size");
		// if exists load saved value, otherwise store it
		if(jQuery.cookie(jQuerycookie_name)) {
			var jQuerygetSize = jQuery.cookie(jQuerycookie_name);

			jQuery("html").css({fontSize : jQuerygetSize + (jQuerygetSize.indexOf("px")!=-1 ? "" : "px")}); // IE fix for double "pxpx" error
		} else {
			jQuery.cookie(jQuerycookie_name, originalFontSize, { path: '/', expires: 60 });
		}
		// reset link
		jQuery(".FontSizeReset").bind("click", function() {
			jQuery("html").css("font-size", originalFontSize);
			jQuery.cookie(jQuerycookie_name, originalFontSize);
		});
		// text "+" link
		jQuery(".increaseFont").bind("click", function() {
			
			var currentFontSize = jQuery("html").css("font-size");
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum*1.1;
			if (newFontSize, 11) {
				jQuery("html").css("font-size", newFontSize);
				jQuery.cookie(jQuerycookie_name, newFontSize, { path: '/', expires: 60 });
			}
			return false;	
		});
		jQuery(".decreaseFont").bind("click", function() {
		  var currentFontSize = jQuery("html").css("font-size");
		  var currentFontSizeNum = parseFloat(currentFontSize, 10);
		  var newFontSize = currentFontSizeNum*0.9;
		  if (newFontSize, 11) {
		    jQuery("html").css("font-size", newFontSize);
		    jQuery.cookie(jQuerycookie_name, newFontSize, { path: '/', expires: 60 });
		  }
		  return false;
		});
	}
}

jQuery(document).ready(function() {
	
	jQuery('.primaryNav ul li:eq(0) a').addClass('gettingStarted');
	jQuery('.primaryNav ul li:eq(1) a').addClass('retirement');
	jQuery('.primaryNav ul li:eq(2) a').addClass('calsters');
	jQuery('.primaryNav ul li:eq(3) a').addClass('plans');
	jQuery('.primaryNav ul li:eq(4) a').addClass('investing');
	jQuery('.primaryNav ul li:eq(5) a').addClass('saving');
	jQuery('.primaryNav ul li:eq(6) a').addClass('insurance');
	
	sitefunctions.textresize();	
	
	jQuery('a[target="_blank"]').after("<img src='/App_Themes/CTA_V2/i/icon-newwindow.png' class='newWindow'/>");
	
	jQuery('.functionalNav li').mouseover(function() {
		jQuery(this).addClass('over');
	}).mouseout(function() {
		jQuery(this).removeClass('over');
	});
	
	jQuery.localScroll();
	
	
	
	jQuery('.checklist tr:odd td, .chart tr:odd td, .chart tr:odd th').css({'background': '#f5f5f5', 'border': '1px dotted #aeaeae', 'border-width':' 1px 0'});
	
	
});

Cufon.replace('h1, h2, h3, .btn, .billboardDesc .title, .glossary a', { fontFamily: 'Alexandria', hover: true });

Cufon.now();


 




// $('.footer ul li:last-child').css('border', '0');
// 
// $('a[target="_blank"]').after("<img src='/App_Themes/CTA/i/application_double.png' class='newWindow'/>");
// $("p:has(.fineprint)").css("marginTop", "30px"); // all paragraphs that contain children with fineprint class
// $("p:has(.fineprint)").prev("p:has(.fineprint)").css("marginBottom", "2px"); // all paragraphs that contain children with fineprint class that come before paragraphs that contain children with fineprint class
// $("p:has(.fineprint) + p:has(.fineprint)").css("marginTop", "2px"); // all paragraphs that contain children with fineprint class that come after paragraphs that contain children with fineprint class
// $(".callOut p:last-child, .callOut ul:last-child").css("paddingBottom", "25px");