//<SCRIPT>
window.isCordysApplication = true;
if (!document.defaultView) document.defaultView = document.parentWindow;
findCordysRoot(window);
if ( window.location.pathname.indexOf(".caf") == -1 )
{
	var defaultStyle = document.getElementsByTagName("head")[0].appendChild(document.createElement("link"));
	defaultStyle.setAttribute("rel", "stylesheet");
	defaultStyle.setAttribute("type","text/css");
	defaultStyle.setAttribute("href", document.compatMode == "BackCompat" ? "/cordys/wcp/style/default.css" : "/cordys/wcp/theme/default/style/default.css" );
}
function findCordysRoot(ancestorWindow)
{
	// Check cross domain window access. This is implemented in system.isWindowAccessible as well.
	try { var p1 = ancestorWindow.document._undefined; }
	catch (e)
	{
		if (ancestorWindow.parent!=ancestorWindow) findCordysRoot(ancestorWindow.parent);
		else if (ancestorWindow.opener) findCordysRoot(ancestorWindow.opener);
		return;
	}
	if (ancestorWindow.isCordysApplication) CordysRoot = ancestorWindow;
	if (ancestorWindow.opener) findCordysRoot(ancestorWindow.opener);
	if (ancestorWindow.dialogArguments && ancestorWindow.dialogArguments.system) CordysRoot = ancestorWindow.dialogArguments.system.document.defaultView;
	if (ancestorWindow.parent==ancestorWindow) return;
	findCordysRoot(ancestorWindow.parent);
}

if( document.compatMode == "BackCompat" && !window.navigator.appVersion.match(/MSIE ([0-9]+.)[A-Za-z0-9.]+;/))
{
	window.location.replace("/cordys/wcp/unsupportedwebcontent.htm");
}
else if (CordysRoot==window)
{
	var iframeObject = document.createElement("iframe");
	iframeObject.style.display = "none";
	iframeObject.src = "/cordys/wcp/library/system/framework.htm";
	document.getElementsByTagName("head")[0].appendChild(iframeObject);
}
else
{
	CordysRoot.system.framework.attachApplicationLibrary(window.document.documentElement);
}

