image_1 = new Image();
picTitle = "";
function DetectImageSize(){
	if ( image_1.complete ) {
		window.status = "Foto geladen ( " + image_1.width + "x" + image_1.height + " )";
		picURL=image_1.src;
		x = image_1.width;
		y = image_1.height;
		if ( image_1.width > image_1.height) {
			x= 800 / image_1.width;		// Ratio
			y= x * image_1.height;
			x= x * image_1.width;
		} else { 
			if ( image_1.height > image_1.width ) {
				y= 533 / image_1.height;		// Ratio
				x= y * image_1.width;
				y= y * image_1.height;
			} else {
				x = image_1.width;
				y = image_1.height;
			}
		} 
		image_1.width=x;	
		image_1.height=y;	
		winl = (screen.width - x) / 2;
		wint = (screen.height - y) / 2;
		wint -= 40;
		newWindow=window.open(picURL,'newWin','resizable=0,toolbar=no,width='+x+',height='+(y+40)+',left='+winl+',top='+wint);
		newWindow.document.write('<html><head><title>'+picTitle+'<\/title><\/head><body><img src='+image_1.src+' width='+x+' height='+y+'><br><center><a href="javascript:window.close();">Venster sluiten</a><\/center><\/body><\/html>');
		newWindow.focus();
		image_1.bLoaded = false
//		image_1 = null;
	} else {
		setTimeout("DetectImageSize()", 100);
	}
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}





function popUp(URL) {
	image_1.src = "";
	image_1.src = URL;
	picTitle = 'Woning Detail Foto';
	DetectImageSize ( );
}
