var galleryWindow;

function displayGalleryPicture(ID, fileName, width, height) {
	height=Math.round(height)+76;
	width=Math.round(width)+50;

	if(galleryWindow)
		galleryWindow.close( );

	var screenWidth = screen.width;
	var screenHeight = screen.height;
	if(!screenWidth) screenWidth = 0;
	if(!screenHeight) screenHeight = 0;

	var xPos = 0; var yPos = 0;

	if(screenWidth>0) xPos = Math.round((screenWidth/2) - (width / 2));
	if(screenHeight>0) yPos = Math.round((screenHeight/2) - (height / 2));	

	galleryWindow = window.open(fileName, 'galleryWindow', 
		'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,'+
		'width='+width+',height='+height+',left='+xPos+',top='+(yPos-16)
	);

	return false;

	/*galleryWindow = window.open($fileName, 'Title',

			
			'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=500,left = 440,top = 262'*/
}