function OpenPasswordReminderInMainFrame()
{
	parent.document.getElementById('m_MainFrame').src = "/Wcmsnl/WebUser/LoginPage.aspx?Cmd=0&ActivePasswordReminderMode=true";
}

function UpdateLoginFrame()
{
	parent.document.getElementById('anmeldung_iframe').src = "/Wcms35/WebUser/LoginPage.aspx";
}

function LoadInFrame(strUrl)
{
	// set correct seperator if we have already parameters or not
	if(strUrl.indexOf('?') == -1)
	{
		strSeparator='?';
	}
	else
	{
		strSeparator='&';
	}

	//CAUTION: strUrl Page may not be cached by IE / NS! Because if we
	// do something in another page when we reload this page, 
	// the dont change their content (it's cached)
	// See: <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
	if(document.getElementById('m_MainFrame') == null)
	{
		parent.document.getElementById('m_MainFrame').src = strUrl + strSeparator + GetFirmCustId();
	}
	else
	{
		document.getElementById('m_MainFrame').src = strUrl + strSeparator + GetFirmCustId();
	}
}

function GetFirmCustId()
{
	// add firmCustId parameter
	if(document.getElementById('m_FirmCustId') == null)
	{
		//return 'FirmCustId=' + parent.document.getElementById('m_FirmCustId').value;
		return 'FirmCustId=WA';
	}
	else
	{
		//return 'FirmCustId=' + document.getElementById('m_FirmCustId').value;
		return 'FirmCustId=WA';
	}
}

function AdaptIFrameHeight(FrameId)
{	// adapt height of the frame, that no scrollbars are shown scroll to the end
	oMainFrame = window.parent.document.getElementById(FrameId);
	
	if(oMainFrame == null)
	{
		alert("Frame "+FrameId+" not found");
	}
	else
	{
		nFullSizeHeight = 		
			window.parent.document.body.clientHeight - oMainFrame.offsetTop - oMainFrame.offsetParent.offsetTop;

		oMainFrame.height = nFullSizeHeight;
		
		window.scrollTo(0, 10000000);
		// must be a number, no units allowed, we filter it
//		nHeight = oMainFrame.height.replace("%").replace("px").replace("\"");
		nNewHeight = Math.round(nFullSizeHeight) + Math.round(document.body.scrollTop);
			
		window.scrollTo(0,0);
		
		if(nNewHeight < nFullSizeHeight)
		{
			nNewHeight = nFullSizeHeight;			
		}
		
		// set Frame - height
		oMainFrame.height = nNewHeight;
	}
}
