function OpenFoto(img, titel, width, height){
foto= new Image();
foto.src=(img);
ControlFoto(img, titel, width, height);
}

function ControlFoto(img, titel, width, height){
if((width!=0)&&(height!=0)){
ViewFoto(img, titel, width, height);
}
else{
interval_a="ControlFoto('"+img+"')";
interval_b=setTimeout(interval_a,20);
}
}
function ViewFoto(img, titel, width, height){
width20=width+20;
height24=height+24;

try {
if (output.closed == false) throw "offen";
}
catch (e) {
if (e=="offen") {
output.close();
}
}
output=window.open("","output","left=40,top=40,width="+width20+",height="+height24+",location=no,toolbar=no,menubar=no,status=no,scrol lbars=no,resizable=no");
output.document.writeln("<html><head><title>"+titel+"<\/title><\/head>");
output.document.writeln("<body bgcolor=\"white\" text=\"white\" link=\"white\" vlink=\"white\" alink=\"white\" leftmargin=\"0\" marginwidth=\"0\" topmargin=\"0\" marginheight=\"0\">");
output.document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"100%\">");
output.document.writeln("<tr><td width=\"100%\" height=\"100%\" align=\"left\" valign=\"top\"><p><a href=\"javascript:self.close()\"><img src=\""+img+"\" width=\""+width+"\" height=\""+height+"\" border=\"10\" alt=\"click here to close the window\"></a><\/p><\/td><\/tr>");
output.document.writeln("<\/table><\/body><\/html>");
output.focus();
}