
// IdcPhotoAlbumSitesContainer

// const IdcPhotoAlbumSitesCBMenu;

function PhotoAlbumShow ()
{
	console.log ( "PhotoAlbumShow..." );

	$('#IdcPhotoAlbum').modal('show');

	$(document).ready(function () 
	{
		IdcPhotoAlbumSitesCBMenu = new C_CheckboxMenu ( "IdcPhotoAlbumSitesContainer", "IdcPhotoAlbumSitesCBMenu0", Translate("Click here to select institution/department") );
		IdcPhotoAlbumSitesCBMenu.CallbackFct = PhotoAlbumDepartmentsChanged;

		InitTagInstDepCBList ( IdcPhotoAlbumSitesCBMenu );

		PhotoAlbumRender ();


	});
}

function PhotoAlbumRender ()
{
	// let survey_id = $('#IdcDivSurvey' ).data ('sur_id');

	let tags = retrieve_selectedtagid ( IdcPhotoAlbumSitesCBMenu );

	console.log ( " tags.ids : " + tags.ids.toString() );
	console.log ( " tags.and : " + tags.and.toString() );	
	console.log ( " tags.or  : " + tags.or.toString() );	

	RenderPage ( "SubFW/html/PhotoAlbum.php?tags_id="+tags.ids, "IdcPhotoAlbumDiv" );
}

function PhotoAlbumDepartmentsChanged ()
{
	let valuesList = IdcPhotoAlbumSitesCBMenu.GetSelection();

	for ( let i=0; i<valuesList.length; i++ )
	{
		console.log ( " valuesList ["+i+"] : " + valuesList[i][0] + " / " + valuesList[i][1] );
	}

	PhotoAlbumRender ();
}