
if (!window['$hnj'] || !$hnj.registry.included('/scripts/contentOverlayHandler.js')) { 
$hnj.contentOverlayHandler = function () {
	var cookieName = "hni_contentOverlayDisclaimer";

	var invoke = function (callbackUrl, fallbackUrl, fixHeightToContent) {
		$hnj.blockUI();
		$hnj.getJSONP(
				callbackUrl,
				null,
				function (data) {
					$hnj.unblockUI();
					$hnj.html(data).overlayWindow({ fixHeightToContent: fixHeightToContent });
				},
				function () {
					$hnj.unblockUI();
					alert('We are sorry for the inconvenience, but the content you requested could not be loaded.');
				});
	};

	var warnThenInvoke = function (callbackUrl, fallbackUrl, fixHeightToContent) {
		var hasCookie = $hnj.cookie(cookieName) == "1";
		if (hasCookie) {
			invoke(callbackUrl, fallbackUrl, fixHeightToContent);
			return;
		}
		var message = 'The following information is scientific, independent research provided by Healthnotes ' +
			'and is for informational purposes only. It is not intended to be a substitute for the advice ' +
			'from your physician or healthcare provider, including information on supplement drug interactions. ' +
			'Healthnotes does not recommend or endorse any specific products.';
		$hnj.html(message).disclaimer({
			onAccept: function (e) {
				if (e.dontShowAgainChecked) {
					$hnj.cookie(cookieName, '1');
				}
				invoke(callbackUrl, fallbackUrl, fixHeightToContent);
			}
		});
	};

	return {
		show: function (callbackUrl, fallbackUrl, warn, fixHeightToContent) {
			if (warn) {
				warnThenInvoke(callbackUrl, fallbackUrl, fixHeightToContent);
			}
			else {
				invoke(callbackUrl, fallbackUrl, fixHeightToContent);
			}
			return true;
		}
	};
} ();
$hnj.contentOverlay.addHandler($hnj.contentOverlayHandler.show);

}
if (window['$hnj']) { $hnj.registry.register('/scripts/contentOverlayHandler.js', false); };


