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 storyPopup(theURL, winName) 
{
	var winWidth = screen.width / 2;
	var winHeight = screen.height - 300;
	var features = 'location,scrollbars,resizable';
	
	return popup(theURL, winName, winWidth, winHeight, features);
}
