function replaceReturnLink()
{
	if (!window.opener) return;
	var a = document.getElementById('return_link');
	if (!a) return;
	a.href='javascript:window.close();';
	a.replaceChild(document.createTextNode('close'),a.firstChild);
}

function addBackLink()
{
	if (window.history && window.history.back)
	{
		var a = document.getElementById('return_link');
		if (!a) return;
		var a2 = document.createElement("A");
		a2.href='javascript:window.history.back();';
		a2.appendChild(document.createTextNode('Go back one page'));
		a.parentNode.insertBefore(a2, a);
	}
}

function do_onload()
{
	replaceReturnLink();
	addBackLink();
}

function openFitxa(href)
{
	window.open(href, 'fitxa_cs', 'height=300,width=550,toolbar=no,status=no,scrollbars=yes,resizable=yes');
	return false;
}
