var popupWebmanagerHandle;

function popupWebmanager(WebManagerpicUrlString, windowWebmanagerWidth, windowWebmanagerHeight, picWebManagerUrlDescription, winWebManagerhoehe, winWebManagerbreite)
{

  // Always close the old one, so only one at a time is open
  if(popupWebmanagerHandle || popupWebmanagerHandle!=null)
  {
    if (!popupWebmanagerHandle.closed) popupWebmanagerHandle.close();
  }
  popupWebmanagerHandle=null;

  // create a feature string for the popupWebmanager
  var x=(screen.width-windowWebmanagerWidth)/2
  var y=(screen.height-windowWebmanagerHeight)/2
  var rahmen=500
  var featureWebManagerString = "toolbar=no,scrollbars=no,resizable=yes"
  featureWebManagerString += ',left='+x + ',top='+y
  featureWebManagerString += ',width='+winWebManagerhoehe+',height='+winWebManagerbreite

  // html content of the popupWebmanager
  var htmlWebManagerString = "<html><head><title>Bildvergrösserung</title><link rel=\"stylesheet\" href=\"../inc/mainstyle.css\" type=\"text/css\"></head>"
  htmlWebManagerString += "<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 bgcolor=\"#FFFFFF\" text=\"white\" onclick=\"self.close()\">"
  htmlWebManagerString += "<table border=\"0\" width=\"100%\" height=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"100%\" valign=\"middle\" align=\"center\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"5\" bordercolor=\"#000000\" bordercolorlight=\"#000000\" bordercolordark=\"#3E77E9\"><tr><td width=\"100%\"><table border=\"1\" bordercolor=\"#000000\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#000000\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\"><tr><td bgcolor=\"#FFFFFF\" bordercolor=\"#000000\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\">"
  htmlWebManagerString += "<A HREF=\"javascript:window.close();\" title=\"Klicken um das Fenster zu schliessen\" ><IMG SRC=\"" + WebManagerpicUrlString + "\" BORDER=\"0\" WIDTH=" + windowWebmanagerWidth + " HEIGHT=" + windowWebmanagerHeight + "></A>"
  htmlWebManagerString += "</td></tr></table></td></tr></table></td></tr></table>"
  htmlWebManagerString += "</body></html>"

  popupWebmanagerHandle = window.open("" ,"popupWebmanager",featureWebManagerString)
  popupWebmanagerHandle.document.clear();
  popupWebmanagerHandle.document.writeln(htmlWebManagerString);
  popupWebmanagerHandle.focus();
  popupWebmanagerHandle.document.close(); // should trigger the picture loading.
  return popupWebmanagerHandle;

}

function winclose()
{
  if (window.popupWebmanagerHandle!=null && !window.popupWebmanagerHandle.closed)
  {
    window.popupWebmanagerHandle.close();
  }
}

function doWebManagerNothing(){} // does nothing but required by JavaScript in this case
