//#Version 0.999
//# Presentation Time Script

function CalculatePos(pos, screenPos, mode)
{
	switch(mode)
	{
		case "default":
		default:
			return pos;
		case "absolutToScreen":
			return pos;
		case "relativToWindow":
			return screenPos + parseInt(pos);
	}
}

function PTOpenInOpener(url) 
{
	window.opener.location.href=url;
	window.opener.focus();
}


//+
// ! popupname ist nur ein Dummy, wird für das Editieren eines existierenden Popups benötigt
function PTOpenPopup(url, left, top, position, width, height, opener, popupName)
{
	var s="";
	if( position != "default" )
	{
		s += "top=" + CalculatePos(top, window.screenTop, position) + ", ";
		s += "left=" + CalculatePos(left, window.screenLeft, position) + ", ";
	}

	s += "width=" + width + ", ";
	s += "height=" + height; // Achtung: kein Komma, das wird gesetzt, wenn der Opener-String nicht leer ist

	if( opener != "" )
	{
		s += ", " + opener;
	}

	window.open(url, null, s);
}
