/**
* Opens a popup window
*
* @param	mixed	URL oder Link-Tag mit href-Attribut
* @param	integer	popup-width
* @param	integer	popup-height
*/
function popup(element, width, height) {
	url = element.getAttribute ? element.getAttribute('href') : element;

	width = Math.min(screen.availWidth, width);
	height = Math.min(screen.availHeight, height);

	pos_x = Math.round((screen.availWidth - width) / 2);
	pos_y = Math.round((screen.availHeight - height) / 4);

	return window.open(url, '_blank', 'width=' + width + ', height=' + height + ', left=' + pos_x + ', top=' + pos_y + ', resizable=1, scrollbars=1');
}