var imagewin;
var imagewinexists = false;
   
function openImageWin(file) {
	if (!imagewinexists || imagewin.closed)  {
		imagewin = window.open(file, "imagewindow", "height=480,width=640");
		imagewinexists = true;
	} else {
		imagewin.close();
		imagewin = window.open(file, "imagewindow", "height=480,width=640");
        imagewin.focus();
	}
} 

function hideEmail(pre, post, text){
	if (text == "") {
		document.write("<a href=\"mailto:" + pre + "@" + post + "\">" + pre + "@" + post + "</a>");
	} else {
		document.write("<a href=\"mailto:" + pre + "@" + post + "\">" + text + "</a>");
	}
} 

  var WinExists = false;
  var ImageWin;
  
  var FotoDirectory;
  var FotoNameStringBeforeNr;
  var FotoNameStringAfterNr;
  var FotoHeight;
  var FotoWidth;
  
  function LoadImage(FotoNr) {
  	   var FotoName = FotoDirectory + "/" + FotoNameStringBeforeNr;
	   if (FotoNr<10) FotoName += "0";
	   FotoName +=  FotoNr + FotoNameStringAfterNr + ".html";
	   if (!WinExists || ImageWin.closed) 
          {  ImageWin=window.open(FotoName,"FotoWindow","height="+FotoHeight+",width="+FotoWidth);
             WinExists=true;
	      }
       else { ImageWin.document.location.href = FotoName;
              ImageWin.focus();
            }  
	}

  function OpenImageWin(path, width, height) {
	   width+=20;
	   height+=30;
	   if (!WinExists || ImageWin.closed)	    
          {  ImageWin=window.open(path,"FotoWindow","height="+height+",width="+width);
             WinExists=true;
	      }
       else { ImageWin.document.location.href = path;
              ImageWin.focus();
            }  
	
  }
