function SetLoginFocus()
{
	var username = document.getElementById("username");
	username.focus(); 
}

function showlayer(layer)
{
	var myLayer = document.getElementById(layer);
	if(myLayer.style.display=="none" || myLayer.style.display=="") {
		myLayer.style.display="block";
		SetLoginFocus();
	} else { 
		myLayer.style.display="none";
	}
}

function clearText(thefield)
{
	if (thefield.defaultValue==thefield.value)
		thefield.value = ""
}

function DHTMLSound(surl)
{
	document.getElementById("dummyspan").innerHTML="<embed src='"+surl+"' hidden=true autostart=true loop=false>";
}


function SetEmailSubjectFocus()
{
    document.forms[0].subject.focus()
}

function SetEmailMessageFocus()
{
    document.forms[0].message.focus()
}

function PopupWarningMessage()
{
	alert('WARNING! You are accessing an R&D system at Thorcom Systems Limited.\n\nBy accessing this system you agree that this system is experimental and that features and facilities may be incomplete and under development. You also agree that this system is confidential and may not be shared with any third party.\n\nWARNING: Access to this system is provided to authorised users only. The Computer Misuse Act (1990) UK applies to this system. All access attempts are monitored and recorded. If you are not an authorised user you should disconnect immediately.');
}

