// JavaScript Document

// Return the coordinate string to center the window on screen using DHTML
function CenterParams(width, height)
{
 	LeftPosition = (screen.width) ? (screen.width - width) / 2 : 0;
	TopPosition = (screen.height) ? (screen.height - height) / 2 : 0;
	return 'height=' + height + ',width=' + width + ',top=' + TopPosition + ',left=' + LeftPosition;
}

// Window opening functions

function OpenThis(id,pr) 
{
	settings = CenterParams(640, 480) + ",resizable,scrollbars";
	if(!pr)
	{
		var openedWindow=window.open('openThis.php?poesia='+id,'OpenThis',settings);
	}
	else
	{
		var openedWindow=window.open('openThis.php?poesia='+id+'&pr='+pr,'OpenThis',settings);
	}
	if(openedWindow.window.focus)
		openedWindow.window.focus();
	if (!openedWindow.opener)
		openedWindow.opener = self;
}
