
function open_image( image_href, image_text )
{
	var image_window;
	
	if ( image_window )	{
		if ( !image_window.closed ) { image_window.close(); }
	}
	
	image_handle = new Image();
	image_handle.src = image_href;
	image_width = image_handle.width;
	image_height = image_handle.height;
	
	image_org_width = image_width;
	image_org_height = image_height;
	
	if ( image_width > screen.width )
	{
		image_width = screen.width-150;
		faktor = image_width / image_org_width;
		image_height = image_height * faktor;
	}
	else
	{
		if ( image_height > screen.height )
		{
			image_height = screen.height-150;
			faktor = image_height / image_org_height;
			image_width = image_width * faktor;
		}
	}
	
	window_width = image_width+10;
	window_height = image_height+50;
	
	xpos = (screen.width/2)-(window_width/2);
	ypos = (screen.height/2)-(window_height/2);

	// toolbar=no, location=no, directories=no, status=no,locationbar=no ... nur ab Netscape 4.0, Mozilla 1.0, Safari 1.2
	image_window=window.open("Kuckuk&rsquo;s Scheune - "+image_text, "Picture", "height="+window_height+",width="+window_width+",toolbar=no, location=no, directories=no, status=no,locationbar=no,toolbar=no,scrollbars=no,resizable=no,top="+ypos+",left="+xpos+"");

	image_window.document.write ("<html><head><title>Kuckuk&rsquo;s Scheune - "+image_text+"</title>");
	image_window.document.write ("<link href='styles/form.css' rel='stylesheet' type='text/css'>");
	image_window.document.write ("</head><body bgcolor='#FFFFFF' style='margin:0px; padding:0px;'>");
	
	image_window.document.write ("<div align='center'><a href='#' onClick='self.close()'>");
	image_window.document.write ("<img src='"+image_href+"' width='"+image_width+"' height='"+image_height+"' alt='' border='0'>");
	image_window.document.write ("</a></div>");


	image_window.document.write ("<div style='position:absolute; right:10px; bottom:10px; z-index:1;'>");
	
	var actual_date = new Date();
	var actual_year = actual_date.getYear();
	if ( actual_year < 999 ) actual_year += 1900;
	var copyright_year = "";
	if ( actual_year > 2008 ) copyright_year = "&nbsp;-&nbsp;"+actual_year;

	image_window.document.write ("<strong>&copy;&nbsp;2008"+copyright_year+"&nbsp;Kuckuk&rsquo;s&nbsp;Scheune,&nbsp;Meike H&ouml;hne</strong>");
	image_window.document.write ("</div>");
	
	image_window.document.write ("</body></html>");
	
	image_window.document.close();

	image_window.focus();
	
	image_window.resizeTo(window_width,window_height); 
}

