function popup(theURL, winName, winWidth, winHeight, features) 
{
	if (winWidth > (screen.width-100))
	{
		winWidth = screen.width-100;
	}
	
	if (winHeight > (screen.height-100))
	{
		winHeight = screen.height-100;
	}
	
	var w = (screen.width - winWidth)/2;
	var h = (screen.height - winHeight)/2 - 100;
	var features = features+',width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
	
	_popup = window.open(theURL, winName, features);
	_popup.focus();
	return false;
}

function catPopup(theURL) 
{
	var winWidth = 800;
	var winHeight = 600;
	var winName = '';
	var features = 'location=0,scrollbars=0,resizable';
	
	return popup(theURL, winName, winWidth, winHeight, features);
}