/**
 * 
 *
 * @version $Id: popup.js,v 1.1 2005/08/10 11:26:06 tomek Exp $
 * @copyright 2003 
 **/
function newPopup(page, w, h)
{
	if(window.screen)
	{
		aw = window.screen.availWidth;
		ah = window.screen.availHeight;
	}
	else
	{
		aw = 250;
		ah = 250;
	}
	//h = ah - 100;
	if( !w || w < 1)
		w = 250;
	else if(w > aw)
		w = aw / 2;
	
	if( !h || h < 1)
		h = 250;
	else if(h > ah)
		h = ah / 2;
		
	//alert(w +"\n"+ h);
	//alert(aw +"\n"+ ah);
	
	posLeft = (aw -w) / 2;
	posTop = (ah - h) / 2;
	
	//alert(posLeft +"\n"+ posTop);
	
	conf =
		"left="+ (posLeft) +","
		+"top="+ (posTop) +","
	//	+"screenX="+(aw-w)/2+","
	//	+"screenY="+(ah-h)/2+","
		+"width="+(w)+","
		+"height="+(h)+","
		+"toolbar=no,"
		+"location=no,"
		+"directories=no,"
		+"status=no,"
		+"menubar=no,"
		+"scrollbars=yes,"
		+"resizable=no"
		//noweokno.focus();

	return window.open(page, 'popup', conf);
}

