// GLOBAL FUNCTIONS

var m_loadTimer = null;


function setWindowStatus(szStatus)
{
	window.status = szStatus;
	return (true);
}

function getContentLoadLayer()
{
	var content = '';
	content = '<img border="0" src="images/load.gif" width="200" height="50">';
	return (content);
}

function createLoadLayer()
{
	var nWidth = getWinWidth();
	var nHeight = getWinHeight();
	var nLeft = parseInt((nWidth - 200)/2);
	var nTop = parseInt((nHeight - 50)/2);
	var content = getContentLoadLayer();
	createLayer("LoadDoc", nLeft, nTop, 200, 50, false, content);
}

function checkLoadDoc()
{
	if (m_loadTimer != null)
		window.clearTimeout(m_loadTimer);
	if (document.all) {
		if (getVisibleLayer("LoadDoc"))
			hideLayer("LoadDoc");
	}
	else {
		if (!getVisibleLayer("LoadDoc"))
			showLayer("LoadDoc");
		m_loadTimer = setTimeout("checkLoadDoc()", 1);
	}
}

function writeEMailPerson(szPerson, szFirst, szSecond, szAddress, szEndStr, bEng)
{
	var szText = " Skriva mail till";
	if (bEng)
		szText = " Send e-mail to";
		
	var szEMail = szFirst;
	if (szSecond.length > 0)
		szEMail += "." + szSecond;
		
	document.writeln('<a href="mailto:' + szEMail + '@' + szAddress + '"');
	document.writeln(' onMouseOver="setWindowStatus(\''+ szText + ' ' + szPerson + '\'); return (true);"');
	document.writeln(' onMouseOut="setWindowStatus(\'\');">' + szPerson + '</a>' + szEndStr);
}