function openwin(file, picx, picy, bars, imagetext, backcolor, fontcolor)
{	
	if(picx > 600)
	{
		var x = 600;
		bars = 'yes';
	}
	else
	{
		var x = picx;
	}

	if(picy > 450)
	{
		var y = 450;
		bars = 'yes';
	}
	else
	{
		var y = picy + 50;
	}

	if(bars == 'yes')
	{
		y = y + 15
		x = x + 15
	}


	if(!backcolor)
	{
		backcolor = '#e0e0e0';
	}

	if(!fontcolor)
	{
		fontcolor = '#000000';
	}

	var xpos = screen.availWidth / 2 - x/2;
	var ypos = screen.availHeight / 2 - y/2;

	var css_style = 'body { padding:0px; border-width:0px; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; background-color: ' + backcolor + ' } .imagetext { color: ' + fontcolor + '; font-style: normal; font-size: 7pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; text-decoration: none; padding: 3px }';

	ImagePreview = window.open('','','toolbar=no,location=no,directories=no,status=no,resizable=yes,menubar=no,scrollbars=' + bars + ',width=' + x + ',height=' + y + ',top=' + ypos + ',left=' + xpos);
	ImagePreview.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'><html><head><meta http-equiv='content-type' content='text/html;charset=iso-8859-1'><title>Galerie</title><style type='text/css'>" + css_style + "</style></head>");
	ImagePreview.document.write("<body><table border='0' cellpadding='0' cellspacing='0' width='100%' height='100%'><tr><td align='center' valign='top' height='" + picy + "'><a href='Javascript:self.close();'><img src='" + file + "' border='0' width='" + picx + "' height='" + picy + "' alt='Fenster schlie&szlig;en'></a></td></tr><tr><td align='center' valign='top' class='imagetext'>" + imagetext + "</td></tr></table></body></html>");
	ImagePreview.focus();
}

