
function openSubWindow( url, width, height, windowName, extraFeatures )
{
var wdw           = null;
var wdwName       = null;
var addlFeatures  = '';
var widthFeature  = '';
var heightFeature = '';

	if (extraFeatures)
	{
		addlFeatures = ',' + extraFeatures;
	}

	if (width)
	{
		widthFeature = ',width=' + (width+22);
	}

	if (height)
	{
		heightFeature = ',height=' + (height+26);
	}

	if (windowName)
	{
		wdwName = 'subWdw_' + windowName;
	}
	else
	{
		wdwName = 'subWdw_' + url;
	}

	wdw = window.top[ wdwName ];

	if (wdw && !wdw.closed)
	{
		wdw.close();
	}

	window.top[wdwName] = window.open(
			url,
			wdwName,
			'status=yes,resizable=yes,scrollbars=yes'
			+ widthFeature
			+ heightFeature
			+ addlFeatures
		);

	window.top[wdwName].focus();
}

function enlargeImage( url, width, height, windowName, extraFeatures )
{
var wdw = null;
var wdwName = null;

	if (windowName)
	{
		wdwName = 'imageWdw_' + windowName;
	}
	else
	{
		wdwName = 'imageWdw_' + url;
	}

//	wdw = window.top[ wdwName ];
//
//	if (wdw && !wdw.closed)
//	{
//		wdw.close();
//	}
//
//	window.top[wdwName] = window.open(
//			url,
//			wdwName,
//			'width=' + (width+24) + ',height=' + (height+28)
//		);
	openSubWindow( url, width, height, wdwName, extraFeatures );
}
