function genpic_png(name,w,h,over){
  var addstyle = '';
  var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
  var v7 = (rslt != null && Number(rslt[1]) >= 7);
  
  if(navigator.appName.indexOf('Netscape') && !v7) addstyle = ' style="_filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+name+'\', sizingMethod=\'scale\');"'
  if (addstyle.length>0) name = 'images/0.gif';
  
  if (over) addpicsctr = ' onmouseover="this.src=\''+over+'\'" onmouseout="this.src=\''+name+'\'"';
  else addpicsctr = '';
  
  document.write('<img src="'+name+'" width="'+w+'" height="'+h+'" alt="" border=""'+addstyle+addpicsctr+'>');
}

function zoompic (picname, picwidth, picheight, lang){
  if (lang == "de") {
    print_str = "drucken";
    close_str = "schliessen";
  } else if (lang == "en") {
    print_str = "print";
    close_str = "close";
  } else if (lang == "fr") {
    print_str = "imprimer";
    close_str = "fermer";
  }
  picheight = picheight + 20;
  picwidth = picwidth + 10;
  zoom = window.open('','zoom','width=' + picwidth + ' height=' + picheight + ', resizable, scrollbars=yes');
  zoom.document.write('<html><head><title>' + document.title + '</title><link rel="stylesheet" href="_tplinc/site.css" type="text/css"></head><body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" onload="if(' + picheight + ' > ' + screen.height + ') window.resizeTo(' + (picwidth + 40) + ', ' + (screen.height - 50) + '); else window.resizeTo(' + (picwidth + 40) + ', ' + (picheight + 80) + '); self.focus();">');
  zoom.document.write('<table width="100%" cellpadding="5" cellspacing="0" border="0"><tr><td align="center">');
  zoom.document.write('<table cellpadding="0" cellspacing="0" border="0"><tr><td align="center" nowrap class="backmain">');
  zoom.document.write('<img src="' + picname + '"><br><br>');
  zoom.document.write('<a href="javascript: opener.nextzoompic (\'0\', \'' + picname + '\');" class="printinc"> << </a>&nbsp&nbsp<a href="javascript:window.close();" class="printinc">' + close_str + '</a>&nbsp;&nbsp;&nbsp;<a href="javascript:window.print();" class="printinc">' + print_str + '</span></a>&nbsp&nbsp<a href="javascript: opener.nextzoompic (\'1\', \'' + picname + '\');" class="printinc"> >> </a>');
  zoom.document.write('</td></tr></table></td></tr></table>');
  zoom.document.write('</body></html>');
  zoom.document.close();
}

function nextzoompic (ppic, apic) {
  for (i = 1; i < 1000; i++) {
    if (document.getElementById('bild' + i)) {
      if (apic == document.getElementById('bild' + i).value) {
	picw = "";
	if (document.getElementById('bildw' + (i + 1)) && ppic == 1) {
	  picw = document.getElementById('bildw' + (i + 1)).value;
	  pich = document.getElementById('bildh' + (i + 1)).value;
	  picn = document.getElementById('bild' + (i + 1)).value;
	} else if (document.getElementById('bildw' + (i - 1)) && ppic == 0) {
	  picw = document.getElementById('bildw' + (i - 1)).value;
	  pich = document.getElementById('bildh' + (i - 1)).value;
	  picn = document.getElementById('bild' + (i - 1)).value;
	}
	window.zoom.document.links[3].href = "javascript: opener.nextzoompic (\'1\', \'" + picn + "\');";
	window.zoom.document.links[0].href = "javascript: opener.nextzoompic (\'0\', \'" + picn + "\');";
	window.zoom.document.images[0].width = picw;
	window.zoom.document.images[0].height = pich;
	window.zoom.document.images[0].src = picn;
	
	if (picw == "") window.zoom.close();
      }
    } else {
      break;
    }
  }
}
