function openImageWindow(url, width, height, title, css_file) {
	width += 20;
	height += 30;
	if (width > screen.availWidth) {
		width = screen.availWidth;
	}
	
	if (height > screen.availHeight) {
		height = screen.availHeight;
	}
	
	new_window = window.open(url, '', 'resizable=yes,left=0,top=0,width=' + width + ',height=' + height);
	new_window.document.open();
	new_window.document.write(
		'<html><head><title>' + title + '</title>' + 
		'<link rel="stylesheet" href="' + css_file + '">' +
		'</head><body><img class="gallery" style="cursor: pointer;" onclick="window.close()" src="' + 
		url + 
		'"/></body></html>'
	);
	new_window.document.close();
}
