// afb previewen in nieuw venster
var afbPreviewSrc = "";
var afbPreviewName = "";

function openAfbeeldingPopup (theImageSrc, theImageName) {
	afbPreviewName = theImageName;
	afbPreviewSrc = theImageSrc;
	openWindow('popup_afb.php?img='+afbPreviewSrc, theImageName);
}

// opens a new window 
function openWindow(theUrl, windowName) {
	//alert(theUrl + ' : ' + windowName);
	var url = theUrl;
	var name = 'popup';
	var xcoord = 0;
	var ycoord = 0;
	var width = 1024;
	var height = 768;
	var attributes = 'resizable=yes,width='+width+',height='+height+'fullscreen=no,directories=0,location=0,menubar=0,scrollbars=1,status=0,toolbar=0,titlebar=0,screenX='+xcoord+',screenY='+ycoord+',top='+ycoord+',left='+xcoord;		
	var mijnPopup = window.open(url, name, attributes);
	mijnPopup.focus();
}

// pop-up resizen naar afb size
function maakWindowOpMaat() {
	var theImage = document.getElementById('theImage');
	var fitWidth = theImage.width + 46;
	var fitHeight = theImage.height + 66;
	if (fitWidth > screen.width) {
		fitWidth = screen.width;
		if ( fitHeight + 25 < screen.height - 50 ) { 
			fitHeight += 26;
		}
	}
	if (fitHeight > screen.height) {
		fitHeight = screen.height - 50;
		if ( fitWidth + 25 < screen.width ) { 
			fitWidth += 26;
		}
	}
	window.resizeTo(fitWidth,fitHeight);
}

// tekst op de statusbar weergeven
function setStatusBar (msg) {	
	status = msg;
}

