var xmlns = 'http://www.w3.org/1999/xhtml';

/* Internet Explorer... */
if(!document.createElementNS)
{
	document.createElementNS = function(ns, el)
	{
		return document.createElement(el);
	};
}

if(!window.DOMInitialised)
{
	Event.onDOMReady(init);
}
else
{
	window.setTimeout(init, 1);
}

function init()
{
	document.getElementsByClassName('popup').each(function (obj) { Event.observe(obj, 'click', popup, false); });
	window.DOMInitialised = true;
};

/**
 * Pop up a link in a new window.
 * @param evt Event
 */
function popup(evt)
{
	var el = Event.element(evt);
	
	do
	{
		if(/a/i.test(el.tagName))
		{
			window.open(el.href, null);
			Event.stop(evt);
			break;
		}
	}
	while(el = el.up());
};