function win_open(dest,x,y,name)
{

	var maxx = screen.width-10;
	var maxy = screen.height-20;

         if (x > maxx)  x = maxx;
         if (y > maxy)  y = maxy;
	
	var  top = (maxy -y) /2 ;
	var  left = (maxx -x) /2;

	 if (top<0) top=0;
	 if (left<0) left=0;


    var options = 'scrollbars=no, location=no, toolbar=no,  directories=no, status=no, resizable=yes, fullscreen=no, width='+x+', height='+y+', top='+top+', left='+left;
	var w      = window.open(dest, name, options);

	w.moveTo(left,  top);
	w.resizeTo(x, y);
	w.focus();

}

function show_game(name)
{
	win_open('gameview.php?pic='+name,240,400,'viewgame')	
}
function show_game_nb(name)
{
	win_open('gameview_nb.php?pic='+name,240,400,'viewgame')	
}