//grwise code
function popoutx(url, targetWin, h, w, bTouchUrl, bUseSame )
{
	if( bUseSame && ViewWin != null && !ViewWin.closed && ViewWin.name == targetWin )
	{
		ViewWin.focus();
	}
	else
	{
		if (bTouchUrl)
		{
			if (bTouchUrl == 1)
			{
				url += "&z=" + uniqueUrl;
				uniqueUrl++;
			}
		}

		if (h && h > 0)
			height=h;
		else
			height=290;

		if (w && w > 0)
			width=w;
		else
			width=380;

		if (screen.width > 0)
		{
			var w = 290, h = 380;
			if (document.layers)
			{
				w = window.innerWidth;
				h = window.innerHeight;
			}
			else
			{
				w = document.body.clientWidth;
				h = document.body.clientHeight;
			}

			winLeft = (screen.width-width)/2;
			winTop = (screen.height-height)/2;


			//var winLeft = Math.abs((w-width)/2)+window.screenX, winTop = (Math.abs((h-height)/2)+window.screenY)/1.5;
			//document.write(winLeft+' :: '+winTop);
			//document.write(w+' :: '+h);
		}

		if( bUseSame  )
			ViewWin=window.open(url, targetWin, 'width='+width+',height='+height+',resizable=yes,menubar=no,scrollbars=yes,status=yes,left='+winLeft+',top='+winTop );
		else
			ViewWin = window.open(url, targetWin, 'width='+width+',height='+height+',resizable=yes,menubar=no,scrollbars=yes,status=yes,left='+winLeft+',top='+winTop );


		if (window.focus)
		{
			ViewWin.focus();
		}
	}

	//KPALAGIRI: I don't think we need these two statements anymore...
	//ViewWin.moveTo( ( screen.width - width ) / 2, ( screen.height - height ) / 2 );
	//ViewWin.focus();
} // popoutx
