/**
 * 
 *
 * @version $Id: popup.js,v 1.1 2006/01/18 10:30:02 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);
}

function new_window(src,w,h) {
	window.open(src,"okno","toolbar=no,menubar=no,location=no,directories=no,top=100,left=100,status=no,scrollbars=no,resizable=yes,width="+w+",height="+h);
}
