function thumbWindow( mypage, myname, w, h, fit_to_screen, imgtoolbar )
{
    w += 20;
    h += 20;
	var orig_w = w;
	var winl = (screen.availWidth - w) / 2;
	var wint = (screen.availHeight - h) / 2;
	if (winl < 0) { winl = 0; w = screen.availWidth - 6; }
	if (wint < 0) { wint = 0; h = screen.availHeight - 32; }

	var winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',fullscreen=no,directories=no,history=no,location=no,menubars=no,menubar=no,resizable=yes,scrollbars=yes,statusbars=no,status=no,titlebar=no,toolbar=no'
	win = window.open('', 'myThumb', winprops)
	win.document.open();
	win.document.write('<html><head>');
	if (imgtoolbar==0) { win.document.write('<meta http-equiv="imagetoolbar" content="false" />'); }
	win.document.write('<scr' + 'ipt type="text/javascr' + 'ipt">');
  	win.document.write("function click() { window.close(); } ");  // bei click  schliessen
  	win.document.write('</scr' + 'ipt>');
	win.document.write('<title>'+myname+'</title></head>');
	win.document.write('<body style=\"margin: 0; padding: 0;\" onLoad=\"window.focus()\">');

if (fit_to_screen) {
	var ns6 = (!document.all && document.getElementById);
	var ie4 = (document.all);
	var ns4 = (document.layers);
	
	if(ns6||ns4) { sbreite = innerWidth - 23; }
	else if(ie4) { sbreite = document.body.clientWidth - 6; }
	
	if (orig_w>sbreite) { rw = 'width='+sbreite; } 
	else { rw = ''; }
	win.document.write('<div align="center"><a href="javascript:close()"><img src="'+mypage+'" alt="'+myname+'" border="0" '+rw+'\></a></div>');
}
else
{
	win.document.write('<div align="center"><a href="javascript:close()"><img src="'+mypage+'" alt="'+myname+'" border="0" /></a></div>');
}

	win.document.writeln('</body></html>');
	win.document.close();
	//if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}