<!--

// 12/15/2004 - A.Z.

// Handle pop-up window display

/************************* For full usage of this script in the client areas use the following code sample: **************************
*                                                                                                                                    *
*                  <A href="...some location..." onclick="handlePopups(this.href);return false;">...some link...</A>                 *
*                                                                                                                                    *
*                  For objects other than <a href...> just use: <......... onclick="handlePopups("some location");return false;">    *
*                  in the object definition code.                                                                                    *
*                                                                                                                                    *
**************************************************************************************************************************************/


var win = null;			// Pop-up Window object
var winName = '';		// Name of window to be passed
var winWidth = 680;		// Window width
var winHeight = 550;	// Window height
var scrollYN = 'yes';	// Scrollbars property (yes/no)


// Auto center window for most browsers

function NewWindow(location, wname, w, h, scrollb)
{
	var LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrollb+',resizable,status';
	
	win = window.open(location, wname, settings);
}


function handlePopups(location)
{
	if (win && !win.closed)
	{
		if (win.location != location)
		{
			win.location = location;		// put new content into the same window to prevent untidy users from opening up multiple windows
		}
		win.focus();					// bring the window to the front	
	}
	else
	{
		NewWindow(location, winName, winWidth, winHeight, scrollYN);
	}
}

// Close the popup upon user navigating away from the page. Best used with <body onunload=...>
// Example: <body onunload="javascript:cleanUp();">
function cleanUp()
{
	if (win && !win.closed)
	{
		win.close();
	}
}


/*
function handlePopups(location)
{
	if (win && !win.closed)
	{
		win.close();		// close the window to prevent untidy users from opening up multiple windows
		win = null;			// remove the reference to the current window object
		NewWindow(location, winName, winWidth, winHeight, scrollYN);	// reopen document in a new window	
	}
	else
	{
		NewWindow(location, winName, winWidth, winHeight, scrollYN);
	}
}

*/

/*
if (self.location == "/news.htm")
{
	var winWidth = 660;		// Window width
	var winHeight = 600;	// Window height
}
else
{
	var winWidth = 300;		// Window width
	var winHeight = 300;	// Window height
}
*/

//-->