function externaliseLinks()
{
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i < anchors.length; i++)
	{ 
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
		{
			anchor.target = "_blank";
		}
	}
}

window.onload = externaliseLinks;

function clearTextfield(c)
{
	c.value = '';
}

function resetTextfield(c, defText)
{
	if (c.value == '')
	{
		c.value = defText;
	}
}

function popWindow(url, w, h)
{
	var win = window.open(url, 'win', 'width=' + w + ',height=' + h + ',scrollbars,resizable');
	win.moveTo(screen.width / 2 - w / 2, screen.height / 2 - h / 2);
	win.focus();
}