<!--

function NRTLegal_setCookie (name,value,expires,path,domain,secure) 
{
	document.cookie = name + "=" + escape (value) +
		((expires) ? "; expires=" + expires.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
}

function NRTLegal_getCookieVal (offset) 
{
	var endstr = document.cookie.indexOf (";", offset);

	if ( endstr == -1 )
		endstr = document.cookie.length;

	return(unescape(document.cookie.substring(offset, endstr)));
}

function NRTLegal_getCookie (name) 
{
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;

	while ( i < clen ) 
	{
		var j = i + alen;
		if ( document.cookie.substring(i, j) == arg ) return(NRTLegal_getCookieVal (j));
		i = document.cookie.indexOf(" ", i) + 1;
		if ( i == 0 ) break;
	}

	return(null);
}

function NRTLegal_deleteCookie (name,path,domain) 
{
	if ( getCookie(name) ) 
	{
		document.cookie = name + "=" +
			((path) ? "; path=" + path : "") +
			((domain) ? "; domain=" + domain : "") +
			"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

function NRTLegal_submitSearch(ctlName)
	{
		var strLegalAgreeYesNo = NRTLegal_getCookie("LegalAgreeYesNo");
		if (document.getElementById(ctlName) != null)
		{
			if (strLegalAgreeYesNo == null )
			{
				var sText;
				
				sText = "I understand that the information on this website is proprietary information.\n" +
						"I will not use, or distribute, such information for any commercial purpose.\n";
			
				if (confirm(sText))
				{
					var Expiration = new Date();
					var OneYear = 365*24*60*60*1000; 
					Expiration.setTime(Expiration.getTime()+OneYear);
					NRTLegal_setCookie("LegalAgreeYesNo", "agreeYes", Expiration, "/");
					return true;
				}
				else
				return false;
			}
			return true;
		}
	}

function NRTLegal_linkSearch(ctlName)
	{
		var strLegalAgreeYesNo = NRTLegal_getCookie("LegalAgreeYesNo");
		if (strLegalAgreeYesNo == null )
		{
			var sText;
				
			sText = "I understand that the information on this website is proprietary information.\n" +
						"I will not use, or distribute, such information for any commercial purpose.\n";
			
			if (confirm(sText))
			{
				var Expiration = new Date();
				var OneYear = 365*24*60*60*1000; 
				Expiration.setTime(Expiration.getTime()+OneYear);
				NRTLegal_setCookie("LegalAgreeYesNo", "agreeYes", Expiration, "/");
				return true;
			}
			else
			{
				if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
					location.reload(false);
				}
				else {
					var oCtrl = document.getElementById(ctlName);
					if ( oCtrl != null)
					{
						oCtrl.href = "";
						window.location.replace(oCtrl.href);
					}
				}
			}
		}
		else
		{
			/*	06/13/2006 - DMF - HEAT -100136.
				Javascript error is raised because linkCtl is not defined.
				
				// OLD VERSION.
				location.href = linkCtl.href
			*/
			
			// Instead, just return true, which allows the user to continue to the URL specified in the
			// hyperlink they clicked. They already have accepted our cookie so we do not need to change the destination URL.
			return true;
		}
	}
		
function NRTLegal_CheckCookie()
	{
		var strLegalAgreeYesNo = NRTLegal_getCookie("LegalAgreeYesNo");
		if (strLegalAgreeYesNo == null )
			{
				var sText;
				
				sText = "I understand that the information on this website is proprietary information.\n" +
						"I will not use, or distribute, such information for any commercial purpose.\n";
			
				if (confirm(sText))
				{
					var Expiration = new Date();
					var OneYear = 365*24*60*60*1000; 
					Expiration.setTime(Expiration.getTime()+OneYear);
					NRTLegal_setCookie("LegalAgreeYesNo", "agreeYes", Expiration, "/");
					return true;
				}
				else
				return false;
			}
			return true;
	}
//-->
