function popup(fileName,fileText) { 
imageWin=window.open("", "imageWin", fileName, "width=100, height=100"); 
imageWin.document.open(); 

imageWin.document.write(
'<html>'+ 
'<head>'+ 
'<title>FDF Lind</title>'+ 
'<script language="JavaScript">'+
'self.focus();'+
'function myResize() {'+ 
'picW = document.images["pic"].width;'+ 
'picH = document.images["pic"].height;'+ 
'picW = picW+10;'+
'picH = picH+37+55;'+

'if(picW > screen.availWidth)'+
'{'+
'picW = screen.availWidth'+
'}'+
'if(picH > screen.availHeight)'+
'{'+
'picH = screen.availHeight'+
'}'+

'window.resizeTo(picW,picH);'+ 
'}'+ 
'<\/script>'+ 
'</head>'+ 
'<body class="BODY" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="myResize();">'+ 

'<div style="width: 100%; height: 100%; overflow: auto; font-size:12px; text-align:center">'+

fileText+
'<img src="' +  fileName + '"  name="pic"><br />'+ 

'</div>'+

'</body>'+ 
'</html>' ); 
imageWin.document.close(); 
} 
