
var newwindow;
var wheight = 0, wwidth = 0;

function popImage(url) {
	var pwidth, pheight;

	if ( !newwindow || newwindow.closed ) {
		iwidth=document.images[0].width;
		iheight=document.images[0].height;		
		
		pwidth=510;
		pheight=720;
		newwindow=window.open('','','width=' + pwidth +',height=' + pheight + ',resizable=1,top=50,left=10');
		wheight=iheight;
		wwidth=iwidth;
	}
	
	if (wheight!=iheight || wwidth!=iwidth ) {
		pwidth=iwidth+30;
		pheight=iheight+90;
		newwindow.resizeTo(pwidth, pheight);
		wheight=iheight;
		wwidth=iwidth;
	}
	
	newwindow.document.clear();
	newwindow.focus();
	newwindow.document.writeln('<html> <head> <title>Uitvergroting<\/title> <\/head> <body marginheight=\"0\" marginwidth=\"0\"> <center>');
	newwindow.document.writeln('<img src=' + url + ' alt=\"\" title=\"popup\" >');
	newwindow.document.writeln('<\/center> ' + iheight + ' ' + iwidth + '<\/body> <\/html>');
	newwindow.document.close();
	newwindow.focus();
}

