//
//	  @(#) popupwin.js		Ibis - Popup venster
//	  @(#) Last edit:		Anneke, 20-04-2007
//

function popupWin(path) {
	var width		= 800;
	var height		= 421;
	var maxwidth	= screen.width;
	var maxheight	= screen.height;

	if (width >= (maxwidth - 10)) {
			width = (maxwidth - 10);
	}
	if (height >= (maxheight - 50)) {
			height = (maxheight - 50);
	}

	var left = (maxwidth - width)/2 - 5;	// assuming border width 5

	var top = 10;
	var p = window;
	while ((p.opener) && (top < 100)) {
			top += 10;
			p = p.opener;
	}

	if (top >= 100) {
			top = (maxheight - height)/2;
	}

	var newWindow = window.open("", "popup",
			"width="+width+",height="+height+","+
			"innerWidth="+width+",innerHeight="+height+","+
			"top="+top+",left="+left+","+
			"scrollbars=yes");

	var doc = newWindow.document;
	doc.open("text/html");
	doc.writeln("<html><head><title>Ibis</title></head><body bgcolor=\"#FFFFFF\"></body></html>");

	newWindow.focus();
	newWindow.location = path;

	return newWindow;
}
