function expand_box(box)  {
	$("#"+box).slideToggle("slow");
}

function details(box) {
	$('#'+box).slideToggle('slow');
}

function show_dt(id)
{
  var stato = document.getElementById(id).style.display;

  if(stato=='none')
    {
      document.getElementById(id).style.display = 'block';
    }
    else
      {
        document.getElementById(id).style.display = 'none';
      }
}


function selCombo(id_combo1,id_combo2,tipo) {

  id = $("select[id='" + id_combo1 + "']").val();

  $.get("/decode64.php?id="+id+"&tipo="+tipo,
  function(dataProvince){
    $("select[id='"+ id_combo2 + "']").empty();
    var options = '<option value="">-- Seleziona --</option>';

   var arr = eval('(' + dataProvince + ')');

      $.each(arr, function (i, elem) {
          options += '<option value="' + i + '">' + elem.toUpperCase() + '</option>';
    });

    $("select[id='"+ id_combo2 + "']").html(options);
  });

}


function confirm_redir(destination,type) {

  switch(type)  {

    case 'delete':
      if (confirm("Confermi cancellazione?"))
        document.location.href = destination;
      break;

    case 'activation':
      if (confirm("Modificare lo stato di questo nominativo?"))
        document.location.href = destination;
      break;
  }

}





function select_jump(link)  {
    if(link!='')  {
      document.location.href = link;
    }
}





function ck_logout()  {
    if(confirm("Vuoi uscire dall'area riservata?"))
      document.location.href="/login/logout";
}

