function view_image_in_window(url, dimensions, image_title)
{
	var features = ''
	var img_height = ''
	var img_width = ''
	if(dimensions != '')
	{
		dimensions = dimensions.split('x')
		img_height = dimensions[1]
		img_width = dimensions[0]
		if(img_height < 100)
			img_height = 100
		if(img_width < 100)
			img_width = 100

		var top  = Math.round((screen.height - img_height) / 2)
		var left = Math.round((screen.width - img_width) / 2)
		features += 'resizable, height=' + img_height + ', width=' + img_width + ', top=' + top + ', left=' + left
	}

	var w = window.open('', '', features)
	if(!w)
		return false

	var known_width = false
	with(w.document)
	{

		//writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">')
		//writeln('<html xmlns="http://www.w3.org/1999/xhtml">')
		writeln('<html>')
		writeln('<head><title>' + image_title + '</title></head>')
		writeln('<body onclick="window.close()" style="height:100%;margin:0;padding:0;cursor:pointer;cursor:hand">')
		writeln('<table style="margin:0;padding:0;height:100%;width:100%" cellpadding="0" cellspacing="0"><tr><td style="vertical-align:middle;text-align:center">')
		writeln('<img alt="' + image_title + '" title="' + image_title + '" src="' + url + '" />')
		writeln('</td></tr></table>')
		writeln('</body>')
		writeln('</html>')
		close()
	}
	return false
}


