function popWin(file, w, h){
	
	l = (screen.width - w) / 2;
	t = (screen.height - h) / 2;
	
  newWin = window.open("","ResizeBillede","width=300,height=200,status=no,left=" + l + ",top=" + t);
  txt='<html><head><title>Resize til billede<\/title>';
  txt+='<script language="javascript" type="text/javascript">';
  txt+='function resPic(){h=document.images[0].scrollHeight;';
  txt+='w=document.images[0].scrollWidth;window.resizeTo(w+6,h+54);}';
  txt+='<\/script><\/head><body style="overflow:hidden;border:0px;margin:0px">';
  txt+='<img src="' + file + '" style="top:0px;left:0px;border:0px;cursor:pointer;" onload="resPic();" onclick="window.close();">';
  txt+='<\/body><\/html>';
  newWin.document.write(txt);
  newWin.document.close();
}
