﻿function GetScreenSize()
{
	x10dGetControl('ScreenHeight').value=screen.height;
	x10dGetControl('ScreenWidth').value=screen.width;
}
function OpenModalLogin(company, user, url)
{
	var arCompanyAndUser = new Array();
	arCompanyAndUser[0] = company;
	arCompanyAndUser[1] = user;
	var returnVal = new Array();
	returnVal = window.showModalDialog(url, arCompanyAndUser, "dialogWidth:475px;dialogHeight:328px;center:1");
	if (returnVal[0] == "login")
	{
		//Login og fortsæt med samme session
		x10dGetControl("tbCompany").value = returnVal[1];
		x10dGetControl("tbUser").value = returnVal[2];
		x10dGetControl("tbPassword").value = returnVal[3];
		x10dGetControl('bLogin').click();
	}
	else
	{
		//Gå til "top" login side
		top.window.location.href='Login.aspx?Logout=true';
	}
}
function CheckIfOpenedInTopFrame()
{
	if (window != top)
	{
		//Redirect to the top frame
		top.location.href = location.href;
	}
}
function OnSubmitToWindow()
{
	window.document.forms[0].action = window.document.forms[0].action.replace("FrameLogin=", "FromFrameLogin=");
	setTimeout("ResetPassword()", 1);	
}
function ResetPassword()
{
	window.document.getElementById('tbPassword').value = "";	
}

