/**
* Öffnen eines Popup-Fensters
*
* @param	mixed	URL oder Link-Tag mit href-Attribut
* @param	integer	Popup-Breite
* @param	integer	Popup-Höhe
* @param	string	Fenstername (optional)
*/
function popup(url, width, height, name)
{
	if (typeof url.getAttribute != 'undefined')
	{
		url = url.getAttribute('href');
	}

	if (typeof name == 'undefined')
	{
		name = '_blank';
	}

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

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

	win =  window.open(url, name, 'width=' + width + ', height=' + height + ', left=' + pos_x + ', top=' + pos_y + ', resizable=1, scrollbars=1, status=1');
	this.target=name;
	win.focus()
	
}
