// ADA Specific
if (!is.w3c && !is.ieDOM)
	window.onerror	= function(){return true;};

is.DOM2	= is.DOM1; //compatiblity fix, remove when all references to is.DOM2 are removed.
var isLoading	= false;
var isValidate	= false;
var isTestMode	= false;
if (window.location.host.indexOf("usalinks") != -1)
	isTestMode	= true;
sDefaultStatus	= "ADA Members Retirement Program";
if (doStatus)
	doStatus("");

// Link Warning
var bLinksEnabled			= true;
var sLinksEnabledErrMsg1	= "Warning: You have NOT confirmed this transaction!\n\n";
var sLinksEnabledErrMsg2	= "If you leave this page your transaction will NOT be processed.\n\n";
var sLinksEnabledErrMsg3	= "Are you sure you want to leave this page?";
var sLinksEnabledErrMsg4	= "You have chosen to leave this page, your transaction will NOT be processed.";
function isLinksEnabled()
{
	if (!bLinksEnabled)
		bLinksEnabled	= confirm(sLinksEnabledErrMsg1 + sLinksEnabledErrMsg2 + sLinksEnabledErrMsg3);
	return bLinksEnabled;
}
function doLinksUnload()
{
	if (!bLinksEnabled)
		alert(sLinksEnabledErrMsg1 + sLinksEnabledErrMsg4);
}

// Events
if (is.ns4)
{
	window.captureEvents(Event.ONLOAD | Event.ONUNLOAD);
//	document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
}

window.onload	= doOnLoadHub;
window.onunload	= doUnLoadHub;
function doOnLoadHub()
{
	isLoading	= true;
	if ("function" == typeof(doOnLoad)) doOnLoad();
	if ("function" == typeof(doOnLoad2)) doOnLoad2();
	isLoading	= false;
}
function doUnLoadHub()
{
	if ("function" == typeof(doUnLoad)) doUnLoad();
	if ("function" == typeof(doUnLoad2)) doUnLoad2();
}

document.onmouseover	= doOnMouseover;
document.onmouseout		= doOnMouseout;
function doOnMouseover(oEvent, oElement)
{
	oEvent	= (window.event) ? window.event : (oEvent) ? oEvent : null;
	if (oEvent)
	{
		oElement	= (oElement) ? oElement : (oEvent.srcElement) ? oEvent.srcElement : (oEvent.target) ? oEvent.target : null;
		if (oElement && "LABEL" == oElement.tagName && (oElement.htmlFor == "" || document.all(oElement.htmlFor) && !document.all(oElement.htmlFor).disabled))
		{
			oElement.style.color	= "#0000FF";
			oEvent.cancelBubble		= true;
		}
	}
}
function doOnMouseout(oEvent, oElement)
{
	oEvent	= (window.event) ? window.event : (oEvent) ? oEvent : null;
	if (oEvent)
	{
		oElement	= (oElement) ? oElement : (oEvent.srcElement) ? oEvent.srcElement : (oEvent.target) ? oEvent.target : null;
		if (oElement && "LABEL" == oElement.tagName && (oElement.htmlFor == "" || document.all(oElement.htmlFor) && !document.all(oElement.htmlFor).disabled))
		{
			oElement.style.color	= "";
			oEvent.cancelBubble		= true;
		}
	}
}
// doOnLabelClick() is a fix for Opera browsers;
// When a label is clicked Opera checks the assoc. radio btn instead of firing the click() method.
// It also fails to honor the disabled property for the assoc. radio and checkboxes.
function doOnLabelClick(oEvent)
{
	if (!is.op)
		return true;
	oEvent	= (window.event) ? window.event : (oEvent) ? oEvent : null;
	if (!oEvent)
		return true;
	var oElement	= (oElement) ? oElement : (oEvent.srcElement) ? oEvent.srcElement : (oEvent.target) ? oEvent.target : null;
	if (oElement && "LABEL" == oElement.tagName)
	{
		oElement	= document.all(oElement.htmlFor);
		if (oElement)
		{
			if (oElement.disabled)
				return false;
			if ("string" == typeof(oElement.type))
				switch (oElement.type)
				{
					case "radio":
						oElement.click();
						break;
					case "checkbox":
						oElement.click();
						oElement.checked	= !oElement.checked;
						break;
				}
		}
	}
	return true;
}

// Help PopUps
var sHelpMsgId	= "";
function showTopicHelp(sMsgId, sDimensions)
{
	sMsgId			= arguments.get(0, "string", "");
	sDimensions		= arguments.get(1, "string", "100,50,460,300");
	sHelpMsgId		= sMsgId;
	var sUrl		= "topichelp.html";
	var iFeatures	= TwScrollbars|TwAutoClose;
	openWindow(sUrl, "ADATopicHelp", iFeatures, sDimensions);
}

// Show Window PopUps
function showWindow(sUrl, sDimensions, iFeatures, sWindowName)
{
	sDimensions	= arguments.get(1, "string", "100,50,500,300");
	iFeatures	= arguments.get(2, "number", TwScrollbars|TwAutoClose);
	sWindowName	= arguments.get(3, "string", "ADAWindowPopUp");
	openWindow(sUrl, sWindowName, iFeatures, sDimensions);
}

// Misc.
doDomainCheck();
function doDomainCheck()
{
	if (getDomainName() == "equitable.com")
		top.location	= "http://www.axa-equitable.com/ada/";
}
setTimeout("frameBuster()", 3000);
function frameBuster()
{
	if (parent.frames.length != 0)
		top.location	= document.location;
}
function toggleDisplay(sTagName, sElementId, bDisplayOn, sDisplayValue)
{
	sDisplayValue	= arguments.get(3, "string", "block");
	var oElements	= (is.DOM1) ? document.body.getElementsByTagName(sTagName) : null;
	if (!oElements || oElements.length == 0)
		return;
	var oElement	= null;
	var sStyle		= "";
	for (var idx = 0; idx < oElements.length; idx++)
	{
		oElement	= oElements[idx];
		if (oElement && "string" == typeof(oElement.id) && oElement.id.indexOf(sElementId) != -1)
		{
			$Element.extend(oElement);
			sStyle	= oElement.getCurrentStyle("display");
			if (bDisplayOn == null)	// Toggle Mode
			{
				if (sStyle == "none")
					oElement.style.display	= sDisplayValue;
				else
					oElement.style.display	= "none";
			}
			else	// Force state
			{
				if (bDisplayOn && sStyle != sDisplayValue)
					oElement.style.display	= sDisplayValue;
				else
				if (!bDisplayOn && sStyle != "none")
					oElement.style.display	= "none";
			}
		}
	}
}
// End of file
