// pop-up function
var newWin = null;
function closeWin(){
	if (newWin != null){
		if(!newWin.closed)
			newWin.close();
	}
}


function NewWindow(mypage,myname,w,h,scroll) {
    closeWin();
    //alert('mypage = '+ mypage+', myname = '+ myname +', w = '+ w +', h = '+ h);
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
    newWin = window.open(mypage,'newWin',settings);
    newWin.focus();
}

function NewWindow2(form,myname,w,h,scroll) {
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
    form.target = myname;
    open ('', myname, settings);
}
//functie om de opener van de link eventueel te herladen of eventueel te openen
function redirarchief(newurl)  {

//alert (window.opener.location);
if (window.opener != null) {
	if (window.opener.name = 'archief') {
		window.opener.location = newurl;
		window.opener.focus();
		}
	else {
	open(newurl);
		}
	}
else {
	open(newurl);
}	

window.close();


}
