function getLeft(width) {
	return (Math.round(screen.availWidth - width)/2);
}

function getTop(height) {
	return (Math.round(screen.availWidth - height - 350)/2);
}

function viewImage(width, height, file) {
	var imageWindow = window.open('index.php?Screen.image='+file, 'preview_window', "width="+width+", height="+height+", scrollbars=0, status=0, toolbar=0, location=0"+", left="+getLeft(width)+", top="+getTop(height));
	imageWindow.resizeTo(width, height);
	imageWindow.focus();
}

function closeWin() {
	window.close();
}