$(function(){
	$('.multiselect').multiselect({
		nonSelectedText: 'Tutti',
		numberDisplayed: 0,
		nSelectedText: 'selezionati',
		buttonWidth:'100%',
		maxHeight: window.innerHeight * 0.5,
	});
	
});
function populateGrp(val){
	$.get('./?populate='+val,function(data){

		var obj = $.parseJSON(data);
		var $sel = $('#sel-grp');
	
		if(obj != null){
			$sel.multiselect('dataprovider', obj);
			$sel.multiselect('enable');
		}else{
			$sel.find('option, optgroup').remove();
			$sel.multiselect('rebuild');
			$sel.multiselect('disable');
		}
	});

}