	function InitAuthorizedAccessDlg ()
	{
		let ss = sessionStorage.getItem ( 'AuthorizedAccessDlgInitialized' );

		if ( ss == 'true' )
			return;
		
		sessionStorage.setItem ( 'AuthorizedAccessDlgInitialized', true );

		$(document).ready(function () 
		{
			GetAuthorizedAccess ();

			// switchLanguage ( CurrentLanguage );
		});
	}

	function GetAuthorizedAccessOK ( data )
	{
		let idcOl = document.getElementById ( 'IdcAuthorizedAccessOl' );

		let tmp = "";
		let lastInst = "";
		for ( let i=0; i<data.length; i++ )
		{
			if ( lastInst != data [i].institution )
			{
				lastInst = data [i].institution;

				if ( i > 0 )
				{
					tmp += 				'</ul>';
                	tmp +=			'</div>';
                	tmp +=		'</div>';
                	tmp +=	'</li>';	
				}

				tmp += '<li class="list-group-item d-flex justify-content-between align-items-start">';
                tmp += 		'<div class="ms-2 me-auto">';
                tmp +=			'<div><b>' + data [i].institution;
                tmp +=				'</b><ul style="list-style-type: square;">';
			}

			if ( data [i].access ==  1)
				tmp +=						'<li>'+data [i].department+'<span class="m-0 p-0 ps-3 d-inline">✓</span></li>';
			else
				tmp +=						'<li>'+data [i].department+'</li>';


			if ( i == data.length -1  )
			{
				tmp += 				'</ul>';
                tmp +=			'</div>';
                tmp +=		'</div>';
                tmp +=	'</li>';
			}

			
		}	

		idcOl.innerHTML = tmp;
	}

	function GetAuthorizedAccessError ( data )
	{
	}

	function GetAuthorizedAccess ()
	{
		let data = {};
		// data['id'] 			= $('#IdcProcedureInformationsDiv' ).data ('procedure_id');
		
		var request = $.ajax ({
        		url: 		G_ServerFolder+"/eoQUAL/SubFW/database/GetAuthorizedAccess.php",
        		type: 		"post",
        		dataType: 	"json",
        		data: 		data
    			}
    	)
		.done ( GetAuthorizedAccessOK )
    	.fail ( GetAuthorizedAccessError );
	}