//-----------------------------------------------
// popup window
//-----------------------------------------------
var popWin = null
var winCount = 0
var winName = "popWin"


function openPopWin(winURL, winWidth, winHeight, winFeatures){
  winName = "popWin" + winCount++
    closePopWin()
    if (openPopWin.arguments.length == 4)
      winFeatures = "," + winFeatures
    else
      winFeatures = ""
        popWin = window.open(winURL, winName, "width=" + winWidth
            + ",height=" + winHeight + winFeatures)
}


function closePopWin(){
  if (navigator.appName != "Microsoft Internet Explorer"
      || parseInt(navigator.appVersion) >=4)
    if(popWin != null) if(!popWin.closed) popWin.close()
}




////////////////////////////////////////////////////////
function showImage(a)
{
  var bildle=new Image();
  bildle.src=a;

  bildle.onload = function ()
  {
    getHeightWidth( this )
  };

  getHeightWidth( bildle );
}


function getHeightWidth( newImage )
{
  if (newImage.alreadyLoaded || newImage.width == 0)
    return true;
  breite = newImage.width+20;
  hoehe = newImage.height+40;
  newImage.alreadyLoaded = true;
  //alert(breite + ":" + hoehe);

  //alert(newImage.src);

  var oBeschreibung;
  oBeschreibung = "Zum Schließen bitte ins Bild klicken.";


  var fenster2=window.open('','fenschterle', 'width='+breite+'height='+hoehe+',scrollbars=no,status=0,menu=0,resizable=0,top=0,left=0');
  fenster2.resizeTo(breite,hoehe);

  fenster2.document.open();
  fenster2.document.write("<html><head><title>Image</title></head><body leftmargin=10 topmargin=10 margindwidth=10 marginheight=10>");
  fenster2.document.write('<img OnClick="JavaScript:self.close();" src="' + newImage.src + '" title = "' + oBeschreibung + '" alt="' + oBeschreibung + '" border=0 marginwidth="0" topmargin="0">\n');
  fenster2.document.write("</body></html>");
  fenster2.document.close();
  fenster2.focus();

}






