var sStatus;

function popup(link, name, w, h)
{
	window.open(link, name, 'resizable=yes,width=' + w + ',height=' + h + ',left=' + (window.screen.width - w)/2 + ',top=' + (window.screen.height - h)/2 + ',scrollbars=yes');
	return false;
}

function setStatus(element)
{
	window.status = element.getElementsByTagName('a')[0].href;
}

function restoreStatus()
{
	window.status = sStatus;
}

function trim(s)
{
	return (s.replace(/\s+$/, "")).replace(/^\s+/, "");
}

function invertDisplay(id, element)
{
	var obj = document.getElementById(id);

	obj.style.display = (obj.style.display == 'block')? '' : 'block';
}

function switchBlock(id)
{
	if (document.getElementById(id).style.display == 'none')
		document.getElementById(id).style.display = 'block';
	else
		document.getElementById(id).style.display = 'none';
}