function setPadresNivel(dict)
{
  var indice = document.getElementById('id_nivel').selectedIndex;
  var nivel_id = document.getElementById('id_nivel').options[indice].value;

  var padre = document.getElementById('id_padre');

  var k = 1;
  while(padre.options[k]!=null){
    padre.options[k]=null;
  }

  var j=1;
  padres = dict[nivel_id];
  for(i in padres){
    if(padres[i]){
      opcion = new Option(padres[i][1],padres[i][0]);
      padre.options[j] = opcion;
      j++;
    }
  }

}

