<div class="directory">
  
  <div class="external-links">
    <div class="sub-title">Secciones de interes</div>
    <?php
      $block = module_invoke('menu', 'block_view', 'menu-directorio---links');
      print render($block['content']);    
    ?>
  </div>
    
  <form id="directory-form-filters" class="directory-form-filters" method="get">
  
  <div class="filters">
    
    <div class="general-filters">
      <fieldset>
      <a id="filters-start"></a>
      <div class="sub-title">Buscar por:</div>
    
      <div class="filter place <?php print( ($checked=='place')?'':'disabled') ?>">
        <input id="radio-filter_by_place" type="radio" name="filter_by" value="place"
          <?php print( ($checked=='place')?'CHECKED=CHECKED':'') ?> />
        <label for="radio-filter_by_place">Departamentos y ciudades</label>
        <div class="select-wrapper">
          <select name="place" title="Departamentos y ciudades" <?php print( ($checked=='place')?'':'disabled=disabled'); ?> >
            <?php foreach($metropolitanas as $metropolitana) { ?>
              <?php
                $selected = ''; 
                if($metropolitana->nid == $unity_id) $selected = 'SELECTED=SELECTED';
              ?>
              <option <?php print $selected; ?> value="<?php print $metropolitana->nid ?>"><?php print $metropolitana->title ?></option>
            <?php } ?>
          </select>
          <div class="unblocker"></div>
        </div>
      </div>

      <div class="filter unity-type <?php print( ($checked=='unity_type')?'':'disabled') ?>">
        <input id="radio-filter_by_unity-type" type="radio" name="filter_by" value="unity_type"
          <?php print( ($checked=='unity_type')?'CHECKED=CHECKED':'') ?> />
        <label for="radio-filter_by_unity-type">Otros tipos de unidad</label>
        <div class="select-wrapper">
          <select name="unity_type" title="Tipo de unidad" <?php print( ($checked=='unity_type')?'':'disabled=disabled') ?> >
            <?php foreach($tiposunidad['elemento tipo unidad'] as $tipo) { ?>
              <?php
                $selected = '';
                if($tipo['tid'] == $category_id) $selected = 'SELECTED=SELECTED';
              ?>
              <option <?php print $selected; ?>  value="elemento-tipounidad_<?php print $tipo['tid'] ?>"><?php print $tipo['title'] ?></option>
            <?php } ?>
            <?php foreach($otrasUnidades as $unidad) { ?>
              <?php
                $selected = '';
                if($unidad->nid == $unity_id) $selected = 'SELECTED=SELECTED';
              ?>
              <option <?php print $selected; ?>  value="elemento-otraunidad_<?php print $unidad->nid ?>"><?php print $unidad->title ?></option>
            <?php } ?>
            <?php foreach($tiposunidad['elemento directorio'] as $tipo) { ?>
              <?php
                $selected = ''; 
                if($tipo->code == arg(1)) $selected = 'SELECTED=SELECTED';
              ?>
              <option <?php print $selected; ?> value="elemento-directorio_<?php print $tipo->nid ?>"><?php print $tipo->title ?></option>
            <?php } ?>
          </select>
          <div class="unblocker"></div>
        </div>
      </div>

      <div class="filter custom-search <?php print( ($checked=='custom_search')?'':'disabled') ?>">
        <input id="radio-filter_by_search" type="radio" name="filter_by" value="custom_search"
          <?php print( ($checked=='custom_search')?'disabled=disabled':'') ?> />
        <label for="radio-filter_by_search">Busqueda personalizada</label>
        <input type="text" title ="custom-search-text" name="custom_search" <?php print( ($checked=='custom_search')?'':'disabled=disabled') ?> />
        <div class="unblocker"></div>
      </div>
      </fieldset>
    </div>
    
    
  

    <div class="inplace-filters">
      <fieldset>
      <div class="inplace-filter radio active">
        <input id="radio-inplacefilter_all" type="radio" name="inplace-filter" value="todos" checked />
        <label for="radio-inplacefilter_all">Todos</label>
      </div>
      <div class="inplace-filter radio">
        <input id="radio-inplacefilter_estaciones" type="radio" name="inplace-filter" value="estacion" />
        <label for="radio-inplacefilter_estaciones" >Estaciones</label>
      </div>
      <div class="inplace-filter radio">
        <input id="radio-inplacefilter_cais" type="radio" name="inplace-filter" value="cai" />
        <label for="radio-inplacefilter_cais">CAIs</label>
      </div>
      <div class="inplace-filter radio">
        <input id="radio-inplacefilter_cuadrantes" type="radio" name="inplace-filter" value="cuadrante" />
        <label for="radio-inplacefilter_cuadrantes">Cuadrantes</label>
      </div>
      <div class="inplace-filter radio">
        <input id="radio-inplacefilter_dependencias" type="radio" name="inplace-filter" value="dependencia" />
        <label for="radio-inplacefilter_dependencias">Dependencias</label>
      </div>
      <div class="inplace-filter select direcciones">
        <label for="inplace-filter-direcciones">Dirección:</label>
        <select id="inplace-filter-direcciones" name="inplace-filter-direcciones">
          <?php foreach($direcciones as $direccion) { ?>
            <?php
              $selected = ''; 
              if($direccion->nid == $unity_id) $selected = 'SELECTED=SELECTED';
            ?>
            <option <?php print $selected; ?> value="<?php print $direccion->nid ?>"><?php print $direccion->title ?></option>
          <?php } ?>
        </select>
      </div>
      <div class="inplace-filter select oficinasasesoras">
        <label for="inplace-filter-oficinaasesora">Oficina asesora:</label>
        <select id="inplace-filter-oficinaasesora" name="inplace-filter-oficinaasesora">
          <?php foreach($oficinasasesoras as $oficina) { ?>
            <?php
              $selected = ''; 
              if($oficina->nid == $unity_id) $selected = 'SELECTED=SELECTED';
            ?>
            <option <?php print $selected; ?> value="<?php print $oficina->nid ?>"><?php print $oficina->title ?></option>
          <?php } ?>
        </select>
      </div>
      <div class="inplace-filter select escuelas">
        <label for="inplace-filter-escuela">Escuela de policía:</label>
        <select id="inplace-filter-escuela" name="inplace-filter-escuela">
          <?php foreach($escuelas as $escuela) { ?>
            <?php
              $selected = ''; 
              if($escuela->nid == $unity_id) $selected = 'SELECTED=SELECTED';
            ?>
            <option <?php print $selected; ?> value="<?php print $escuela->nid ?>"><?php print $escuela->title ?></option>
          <?php } ?>
        </select>
      </div>
      </fieldset>
    </div>
  
    <div class="actions">
      <button>Buscar</button>
    </div>
    <input type="submit" value="Send" class="element-invisible" />
</div>
  </form>
    
    
  

  <a id="results-start"></a>

  <div class="results">
    
    <div class="search_term">
      <div class="label">Resultados de la búsqueda realizada por:</div>
      <div class="value"></div>
    </div>
    
    <div class="content">
      
    </div>
    
    <div class="item-list">
      <ul class="pager clearfix">
      
      </ul> 
    </div>
    
      
  </div>

  <div class="message_box start">

    <div class="text">Búsqueda no iniciada</div>

  </div>

  <div class="message_box notfound" style="display:none;">

    <div class="text">Resultados no encontrados</div>

  </div>

  <div class="message_box loading" style="display:none;">

    <div class="text">Cargando</div>

  </div>
  



</div>
