function handleLoseFocus()
{
	var main = document.getElementById("Main");
	
	if (main && main.showPausedMessage)
	{
		document.getElementById("Main").showPausedMessage();
	}
}

function handleGainFocus()
{
	var main = document.getElementById("Main");
	
	if (main && main.hidePausedMessage)
	{
		document.getElementById("Main").hidePausedMessage();
	}
}

function handle_body_onload()
{
	window.document.Main.onblur = handle_Main_onblur;
	
	setFocus();
	
	if (navigator.appName.indexOf("Microsoft") == -1)
	{
		document.onfocusout = handleLoseFocus;
		document.onfocusin = handleGainFocus;
	}
	else
	{
		window.onblur = function() {handleLoseFocus();};
		window.onfocus = function() {handleGainFocus();};
	}
}

function handle_Main_onblur()
{
	setFocus();	
}

function setFocus()
{	
	var m = document.getElementById("Main");
	
	if (m != null)
	{
		m.focus();
	}
}

function getFlexApp(appName)
{
	if (navigator.appName.indexOf("Microsoft") == -1)
	{
		return document[appName];
	}
	else
	{	
		return window[appName];
	}
}

function setPageTitle(title)
{
	document.title = title;
}