var healthspot = {
	props: {
		cta: {
			paddingTop: 0, 
			paddingBottom: 0, 
			textWidth: 0, 
			gutterWidth: 0, 
			imagePadding: 20
		}
	}, 
	fn: {
		resizeCTAHeight:
			function() {
				if (healthspot.props.cta.paddingTop == 0)			healthspot.props.cta.paddingTop		= parseInt(jQuery("#container>#main>article").css("paddingTop").replace("px", ""));
				if (healthspot.props.cta.paddingTop == 0)			healthspot.props.cta.paddingBottom	= parseInt(jQuery("#container>#main>article").css("paddingBottom").replace("px", ""));
				
				var intHeight			= parseInt(jQuery("#container>#main>aside>div.content>div>p").height());
				var intPadding			= (healthspot.props.cta.paddingTop * 3) + healthspot.props.cta.paddingBottom + 7;
				var boolHasNav			= ((jQuery("#container>#main>article>aside>menu").length > 0) ? true : false);
				
				jQuery("#container>#main>aside>div.content")
					.css("height", jQuery("#container>#main>aside>div.content>div>p").height() + "px");
					/*
					.stop()
					.animate({"height": jQuery("#container>#main>aside>div.content>div>p").height() + "px"}, 75);
					*/
				jQuery("#container>#main>article")
					.css("paddingTop", (intHeight + intPadding) + "px");
					/*
					.stop()
					.animate({"paddingTop": (intHeight + intPadding) + "px"}, 75);
					*/
				if (boolHasNav) {
					jQuery("#container>#main>article>aside>menu")
						.stop()
						.css({"visibility": "visible", "marginTop": -(intHeight + intPadding) + "px"});
						/*
						.css({"visibility": "visible", "opacity": 0})
						.animate({"marginTop": -(intHeight + intPadding) + "px"}, 75, function() { if ($(this).css("opacity") == 0) $(this).animate({"opacity": 1}, 400); });
						*/
				}
			}, 
			
		resizeCTAText:
			function() {
				var objTextElement		= jQuery("#container>#main>aside>div.content>div>p");
				
				if (jQuery("#container>#main>aside>div").length > 1) {
					var objImageElement		= jQuery("#container>#main>aside>div:first-child>img");
					var objTextPosition		= jQuery(objTextElement).offset();
					var objImagePosition	= jQuery(objImageElement).offset();
					var boolLeftJustified	= ((objImagePosition.left == 0) ? true : false);
					var intMaxX;

					if (healthspot.props.cta.textWidth == 0)		healthspot.props.cta.textWidth		= jQuery(objTextElement).width();
					if (healthspot.props.cta.gutterWidth == 0)		healthspot.props.cta.gutterWidth	= parseInt(jQuery(objTextElement).css("marginLeft").replace("px", ""));
					
					intMaxX					= objTextPosition.left + healthspot.props.cta.textWidth;
					
					if (!boolLeftJustified) {
						if (objImagePosition.left <= intMaxX) {
							jQuery(objTextElement)
								.css("width", (healthspot.props.cta.textWidth - ((intMaxX - objImagePosition.left) + healthspot.props.cta.imagePadding)) + "px");
								/*
								.stop()
								.animate({"width": (healthspot.props.cta.textWidth - ((intMaxX - objImagePosition.left) + healthspot.props.cta.imagePadding))}, 75);
								*/
							
							setTimeout(healthspot.fn.resizeCTAHeight, 15);
						}
					} else {
						// we don't really need to worry about left-justified images since most of them they'll clear the text with the 280 pixel indent -- if we need to add this later, we will do it here
					}
				}
				
				if (jQuery(objTextElement).css("visibility") === "hidden") {
					jQuery(objTextElement)
						.css("visibility", "visible");
						/*
						.css({"opacity": 0, "visibility": "visible"})
						.animate({"opacity": 1}, 500);
						*/
				}
			}
	}
};
