//-------------------------------------------------------------------------------------------------------
//	Popup Window
//-------------------------------------------------------------------------------------------------------
function openarchivepopup( id )
{
	//	Set the parameters
	url     = '/newsletter/archive.php?id=' + id;
	target  = 'popupwindow' + id;
	sizeX   = 0;
	sizeY   = 0;
	leftpos	= 2000;
	toppos	= 2000;

	//	Open, focus the window
	winobject = open(url,target,"menubar=0,statusbar=0,scrollbars=1,toolbar=0,location=0,resizable=0" );
	winobject.focus();
}

//*********************************************************************************************************
//	Function:		resizeAndCenterWindow()
//	What It Does:	Resize and center the current window using the available height and width of the screen
//					which takes into account the "start bar" height and width
//*********************************************************************************************************
function resizeAndCenterWindow( sizeX, sizeY )
{
	//	Resize the window
	window.resizeTo( sizeX, sizeY );

	//	Center the window
	leftpos	= (window.screen.availWidth)	? (window.screen.availWidth-sizeX)/2 : 100;
	toppos	= (window.screen.availHeight)	? (window.screen.availHeight-sizeY)/2 : 100;

	window.moveTo( leftpos, toppos );
}

//*********************************************************************************************************
//	Function:		loadinparent(url, closeSelf)
//	What It Does:	Loads the provided url in the parent window (Because Target="_parent" doesn't work)
//					Option to close the popup.
//*********************************************************************************************************
function loadinparent(url, closeSelf)
	{
		self.opener.location = url;
		if(closeSelf) self.close();
	}
