function openNewWindow(theurl,winWidth,winHeight) {
// OK - okno nie powinno byc wieksze niz rozmiar ekranu
	if(winWidth > window.screen.width) winWidth = window.screen.width;
	if(winHeight > window.screen.height) winHeight = window.screen.height;
//
	var size = "width="+winWidth+",height="+winHeight;	
	var rie = (is_ie) ? ",resizable=0" : ",resizable=1"
	var windowX = (window.screen.width  - winWidth)/2; 
	var windowY = (window.screen.height - winHeight)/2;
//-------- Otworz okno i wysrodkuj na ekranie	
	splashWin = window.open("#", "NIKI", 'fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,'+size+rie);
	splashWin.blur();
	splashWin.resizeTo(Math.ceil(winWidth),Math.ceil(winHeight));
	splashWin.moveTo(Math.ceil(windowX),Math.ceil(windowY));
//-------- Zaladuj strone "theurl" 
	splashWin.document.open();
	splashWin.document.write("<style type='text/css'>\n");
	splashWin.document.write("body { overflow: hidden; border-style: none; border-width: 0px; margin: 10;}\n");
	splashWin.document.write("#lineLDiv 		{ position: absolute; left:       0px;   top:         0px; width:     1px; height: "+winHeight+"px; z-index: 2; background-color: #000000; layer-background-color:#000000; clip:rect(0,1,"+winHeight+",0);}");
	splashWin.document.write("#lineRDiv		{ position: absolute; left: "+(winWidth-1)+"px; top:         0px; width:     1px; height: "+winHeight+"px; z-index: 2; background-color: #000000; layer-background-color:#000000; clip:rect(0,1,"+winHeight+",0);}");
	splashWin.document.write("#lineBDiv 		{ position: absolute; left:       0px;   top: "+(winHeight-1)+"px; width: "+winWidth+"px; height:     1px; z-index: 2; background-color: #000000; layer-background-color:#000000; clip:rect(0,"+winWidth+",1,0);}");
	splashWin.document.write("#lineTDiv 		{ position: absolute; left:       0px;   top:         0px; width: "+winWidth+"px; height:     1px; z-index: 2; background-color: #000000; layer-background-color:#000000; clip:rect(0,"+winWidth+",1,0);}");
	splashWin.document.write("#stillloadingDiv 	{ position: absolute; left:   0px; top: "+Math.ceil(winHeight/2)+"px; width: "+winWidth+"px; height: "+winHeight+"px; z-index: 1; background-color: #C0C0C0; layer-background-color:#C0C0C0; clip:rect(0,"+winWidth+",19,0);}");
	splashWin.document.write("</style>\n");
	splashWin.document.write("<body onload=\"self.document.location.href='"+theurl+"'\">");
	splashWin.document.write("<div id='lineLDiv'></div>");
	splashWin.document.write("<div id='lineRDiv'></div>");
	splashWin.document.write("<div id='lineBDiv'></div>");
	splashWin.document.write("<div id='lineTDiv'></div>");
	splashWin.document.write("<body>");
	splashWin.document.close();
//------------------------------------------------
	splashWin.focus();
}

var newwin;

function launchwin(winurl,winname,winfeatures)
{
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	newwin = window.open(winurl,winname,winfeatures);
	if(javascript_version > 1.0)
	{
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
 		setTimeout('newwin.focus();',250);
	}
}



