function showAndereDebiteurDialogLocatie(locatie) {
    showPopWin('/bedrijfsinformatie/selecteerdebiteurdialog/?from_module='+encodeURI(locatie), 600, 400, debiteurdialogClose, true );
}
function showAndereDebiteurDialog() {
	showPopWin('/bedrijfsinformatie/selecteerdebiteurdialog/', 600, 400, debiteurdialogClose, true );
}

function debiteurdialogClose() {
    if ( httpget( 'verplichteselectie' ) == 'true' ) {
        setTimeout( "showAndereDebiteurDialog();", 500 );
    }
}

function setAfleveradres( debnr, aflnr, from_module ) {
    parent.showLoading( 'Bezig met wisselen van mutatieadres' );

	var bc = new bedrijfsinformatieclient( parent.BedrijfsinformatieClientHandler );
	bc.changeactieveklant( debnr, aflnr, from_module );    
}

var BedrijfsinformatieClientHandler = {
	changeactieveklant: function(result) {
		if ( result[0] == 0 ) {
		    hidePopWin( false );
		    if( result[1] == "") document.location = '/authenticatie/checkglobals/';
		    else document.location = decodeURI(result[1]);
		} else {
		    alert( 'Wisselen van mutatieadres is mislukt.' );
		}
	}
}
