function showpic(datei,w,h){
  bar='hotkeys=no,location=0,menubar=0,status=0,toolbar=0,';
  tobig=1;                        // 1 wenn Bild zu groß
  head=20;                        // Größe der Titelzeile
  bw=7;                           // Randbreite
  sb=16;                          // Scrollbarbreite
  if ((w <= (screen.width - 2*bw)) && (h <= (screen.height - head - bw))){
    x=Math.floor((screen.width - w - 2*bw) / 2);
    y=Math.floor((screen.height - h - head - bw) / 2);
    tobig=0;
  }
  else if ((w > (screen.width - 2*bw)) && (h <= (screen.height - head - bw - sb))){
    x=0;
    w=screen.width - 2*bw;
    h+=sb;
    y=Math.floor((screen.height - h - head - bw) / 2);
  }
  else if ((h > (screen.height - head - bw)) && (w <= (screen.width - 2*bw))){
    y=0;
    h=screen.height - 1.5*bw - head;
    w+=sb;
    x=Math.floor((screen.width - w - 2*bw) / 2)
  }
  else{
    x=0;
    y=0;
    w=screen.width - 2*bw;
    h=screen.height - head - bw;
  }
  if (tobig == 1) bar+='scrollbars=1,resizable=1,';
  else bar+='scrollbars=0,';
  // Testen ob Picfenster noch offen ist
  if ((typeof(nw) != 'undefined') && (nw.closed == false)) nw.close();
  // Neues Fenster öffnen aber noch nichts reinschreiben
  if (document.all)          // IE
    nw=window.open('','Pic',bar+'top='+y+',left='+x+',width='+w+',height='+h);
  else                       // Alle anderen Browser
    nw=window.open('','Pic',bar+'screenX='+x+',screenY='+y+',width='+w+',height='+h);
  // Den Scripttext erzeugen und ins neue Fenster schreiben
  
  //strRightClick="<script language='Javascript1.2'>am = '(C)opyright by Klang und Kleid';bV  = parseInt(navigator.appVersion);bNS = navigator.appName=='Netscape';bIE = navigator.appName=='Microsoft Internet Explorer';function nrc(e) {if (bNS && e.which > 1){alert(am);return false;} else if (bIE && (event.button >1)) {alert(am);return false;}}document.onmousedown = nrc;if (document.layers) window.captureEvents(Event.MOUSEDOWN);if (bNS && bV<5) window.onmousedown = nrc;</script>"
  strRightClick="";
    
  txt="<html><head>"+strRightClick+"<style><!-- #x {position:absolute;top:0px;left:0px;} --></style>"+"<title>Klang und Kleid</title></head>";
  nw.document.write(txt);
  //txt=strRightClick;
  //alert(txt);
  //nw.document.write(txt);
  // Das Bild ausgeben
  txt="<body><div id='x'><a href='javascript: self.close()'><img src='"+datei+"' alt='Klick schliesst das Pop-Up wieder' border='0'></a></div></body></html>";
  nw.document.write(txt);
  // Datei schließen und Focus geben
  nw.document.close();
  nw.focus();
}



function showpicsite(htmldatei){
  bar='hotkeys=no,location=0,menubar=0,status=0,toolbar=0,';
  w=1240;
  h=768;
  tobig=1;                        // 1 wenn Bild zu groß
  head=20;                        // Größe der Titelzeile
  bw=7;                           // Randbreite
  sb=16;                          // Scrollbarbreite
  if ((w <= (screen.width - 2*bw)) && (h <= (screen.height - head - bw))){
    x=Math.floor((screen.width - w - 2*bw) / 2);
    y=Math.floor((screen.height - h - head - bw) / 2);
    tobig=0;
  }
  else if ((w > (screen.width - 2*bw)) && (h <= (screen.height - head - bw - sb))){
    x=0;
    w=screen.width - 2*bw;
    h+=sb;
    y=Math.floor((screen.height - h - head - bw) / 2);
  }
  else if ((h > (screen.height - head - bw)) && (w <= (screen.width - 2*bw))){
    y=0;
    h=screen.height - 1.5*bw - head;
    w+=sb;
    x=Math.floor((screen.width - w - 2*bw) / 2)
  }
  else{
    x=0;
    y=0;
    w=screen.width - 2*bw;
    h=screen.height - head - bw;
  }
  //if (tobig == 1) bar+='scrollbars=1,resizable=1,';
  //else bar+='scrollbars=0,';
  bar+='scrollbars=0,resizable=1,';
  // Testen ob Picfenster noch offen ist
  if ((typeof(nw) != 'undefined') && (nw.closed == false)) nw.close();
  // Neues Fenster öffnen aber noch nichts reinschreiben
  if (document.all)          // IE
    nw=window.open('','Pic',bar+'top='+y+',left='+x+',width='+w+',height='+h);
  else                       // Alle anderen Browser
    nw=window.open('','Pic',bar+'screenX='+x+',screenY='+y+',width='+w+',height='+h);
    
  //txt=htmldatei;
  //nw.document.write(txt);
  nw.location.href = htmldatei;
  
  // Datei schließen und Focus geben
  nw.document.close();
  nw.focus();
}



function showpollingsite(htmldatei){
  bar='hotkeys=no,location=0,menubar=0,status=0,toolbar=0,';
  w=650;
  h=380;
  tobig=1;                        // 1 wenn Bild zu groß
  head=20;                        // Größe der Titelzeile
  bw=7;                           // Randbreite
  sb=16;                          // Scrollbarbreite
  if ((w <= (screen.width - 2*bw)) && (h <= (screen.height - head - bw))){
    x=Math.floor((screen.width - w - 2*bw) / 2);
    y=Math.floor((screen.height - h - head - bw) / 2);
    tobig=0;
  }
  else if ((w > (screen.width - 2*bw)) && (h <= (screen.height - head - bw - sb))){
    x=0;
    w=screen.width - 2*bw;
    h+=sb;
    y=Math.floor((screen.height - h - head - bw) / 2);
  }
  else if ((h > (screen.height - head - bw)) && (w <= (screen.width - 2*bw))){
    y=0;
    h=screen.height - 1.5*bw - head;
    w+=sb;
    x=Math.floor((screen.width - w - 2*bw) / 2)
  }
  else{
    x=0;
    y=0;
    w=screen.width - 2*bw;
    h=screen.height - head - bw;
  }
  //if (tobig == 1) bar+='scrollbars=1,resizable=1,';
  //else bar+='scrollbars=0,';
  bar+='scrollbars=0,resizable=1,';
  // Testen ob Picfenster noch offen ist
  if ((typeof(nw) != 'undefined') && (nw.closed == false)) nw.close();
  // Neues Fenster öffnen aber noch nichts reinschreiben
  if (document.all)          // IE
    nw=window.open('','Pic',bar+'top='+y+',left='+x+',width='+w+',height='+h);
  else                       // Alle anderen Browser
    nw=window.open('','Pic',bar+'screenX='+x+',screenY='+y+',width='+w+',height='+h);
    
  //txt=htmldatei;
  //nw.document.write(txt);
  nw.location.href = htmldatei;
  
  // Datei schließen und Focus geben
  nw.document.close();
  nw.focus();
}
