function PopGallery(name, url)
{
	var width = screen.width;
	var height = screen.height;

	if (height <= 480)
		size = 1;
	else if (height <= 864) 
		size = 2;
	else if (height <= 1024)
		size = 3;
	else
		size = 4;

	width -= 100;
	height -= 160;

	// Maybe force the mode here for testing
	//size = 3;

	var full_url = url + "?Gallery=" + name + "&Size=" + size + "&Mode=Comp" + "&Piece=0";
	var fixed_options = "toolbar=no,location=no,directories=no,menubar=no,status=no,titlebar=no,scrollbars=yes,resizable=yes,left=10,top=10"
	var options = fixed_options + ",width=" + width + ",height=" + height;

  window.open(full_url, name, options);
	window.x = 0;
	window.y = 0;
}

