                 $(document).ready(function() {	
                     				
var iduser=JSON.parse(localStorage.getItem("userid"));
var fracc=localStorage.getItem("fraccionamiento");
var cluster=JSON.parse(localStorage.getItem("cluster"));
var urlapp=JSON.parse(localStorage.getItem("urlapp"));


$.ajax({
    type: "GET",
    url: urlapp+"getServEmpleado.php",
    data:{fracc:fracc, iduser:iduser, cluster:cluster},       
    success: function(response)
    {
        $('.selector-servempleado select').html(response).fadeIn();
    }
});



$.ajax({
    type: "GET",
    url: urlapp+"getGiroemp.php",
    data:{fracc:fracc, iduser:iduser, cluster:cluster},
    success: function(response)
    {

$('.selector-giroempresa select').html(response).fadeIn();
    }
});


 $('.inmueble2').select2({
        placeholder: 'DESPLIEGUE PARA SELECCIONAR EL CIRCUITO',
        ajax: {
          url: urlapp+'getCluster.php',
          dataType: 'json',
          minimumInputLength: 4,
          language: 'es',
          theme: 'classic',
          width: 'resolve',
          type: 'GET',
          delay: 250,
          data: function (params) {
        return {
        fracc:fracc, iduser:iduser, cluster:cluster
        };
            },
          processResults: function (response) {
            return {
              results: response
            };
          },

          cache: true
        }
      });

            $(".inmueble2").change(function(){
    var cluster2=$("#inmueble2").val();
 $('.inmueble').select2({
        placeholder: 'INGRESA CALLE Y NÚMERO',
        ajax: {
          url: urlapp+'getCalles.php',
          dataType: 'json',
          minimumInputLength: 4,
          language: 'es',
          theme: 'classic',
          width: 'resolve',
          type: 'GET',
          delay: 250,
          data: function (params) {
        return {
        searchTerm2: params.term, // search term
        fracc:fracc, iduser:iduser, cluster:cluster, cluster2:cluster2
        };
            },
          processResults: function (response) {
            return {
              results: response
            };
          },

          cache: true
        }
      });
});

        });

						
              