$td .= ' title="' . $value['titulo'] . '" style="cursor:help;"';
    }
    if ($value['width'] != NULL) {
        $td .= ' width="' . $value['width'] . '"';
    }
    $td .= $value['width'] != NULL ? '><p style="width:' . $value['width'] . 'px;">' . $value['nombre'] . '</p></td>' : '><p>' . $value['nombre'] . '</p></td>';
    echo "\t\t\t" . $td . "\n";
}
$numCols = count($camposLista) + 1;
?>
			<td class="cabecera" width="110"><p style="width: 110px;">acciones</p></td>
		</tr>
		<?php 
// hallamos registros
$orden = 'nombre';
$registros = Datos::getDocumentos($where, RCOUNT, $pagActual);
?>
		<?php 
if (!is_array($registros) || count($registros) == 0) {
    ?>
		<tr>
			<td>&nbsp;</td>
			<td class="row-impar" colspan="<?php 
    echo $numCols;
    ?>
"><p><?php 
    echo __("No hay documentos creados");
    ?>
</p></td>
		</tr>
		<?php 
/* --------------------------------------------------------------------
/* Autor					Fecha				Acción                                                                          
/*
/* Digital5 S.L.	12/03/2012	Creación               
/*
/****************************************************************************************************/
// obtenemos los datos de los tipos
$tipos = Datos::getTipoDocumentos();
$opTipos = array();
foreach ($tipos as $tipo => $dTipo) {
    $opTipos[$tipo] = $dTipo['nombre'];
}
$pFlags['oculto_alta'] = $_POST['oculto_alta'] && $_POST['oculto_alta'] != NULL ? $_POST['oculto_alta'] : 'oculto';
// Documentos en los que basarse:
$filtros = ' order by codigo ';
$r = Datos::getDocumentos($filtros, NULL, NULL);
$otrosDoc = array('' => 'Sin referencia');
if (is_array($r)) {
    foreach ($r as $registro) {
        $otrosDoc[$registro['id_documento']] = $registro['codigo'];
    }
}
$campos = array(0 => array('nombre' => 'datos del documento', 'campos' => array('codigo' => array('nombre' => 'Código de referencia interno*', 'tipo' => 'autoref', 'title' => 'El valor lo da la aplicación', 'max' => 20, 'size' => 20, 'notnull' => 'N', 'meta' => 'N', 'comillas' => 'S', 'formato' => '%s', 'readonly' => 'S'), 'version' => array('nombre' => 'Versión del documento', 'tipo' => 'vchar', 'title' => NULL, 'max' => 10, 'size' => 8, 'notnull' => 'N', 'meta' => 'N', 'comillas' => 'S', 'formato' => '%s', 'readonly' => 'N'), 'referencia' => array('nombre' => 'Código de referencia propio', 'tipo' => 'vchar', 'title' => 'El valor lo da el dueño', 'max' => 50, 'size' => 30, 'notnull' => 'N', 'meta' => 'N', 'comillas' => 'S', 'formato' => '%s', 'readonly' => 'N'), 'tipo' => array('nombre' => 'Tipo', 'tipo' => 'select', 'title' => 'Tipo de documento', 'opciones' => $opTipos, 'meta' => 'N', 'comillas' => 'S', 'formato' => '%s', 'especial' => 'chgMedidas'), 'nombre' => array('nombre' => 'Nombre del documento', 'tipo' => 'vchar', 'max' => 50, 'size' => 30, 'notnull' => 'S', 'meta' => 'N', 'comillas' => 'S', 'formato' => '%s'), 'descripcion' => array('nombre' => 'Descripción del documento', 'tipo' => 'text', 'meta' => 'N', 'comillas' => 'S', 'formato' => '%s'), 'numerada' => array('nombre' => 'Documento numerado', 'tipo' => 'select', 'opciones' => array('N' => 'No', 'S' => 'Si'), 'meta' => 'N', 'comillas' => 'S', 'formato' => '%s'))), 1 => array('nombre' => 'detalles del documento', 'campos' => array('alto' => array('nombre' => 'Alto', 'tipo' => 'float', 'max' => 20, 'size' => 8, 'notnull' => 'S', 'meta' => 'N', 'comillas' => 'N', 'formato' => '%f', 'valor' => $tipos['A4']['alto']), 'ancho' => array('nombre' => 'Ancho', 'tipo' => 'float', 'max' => 20, 'size' => 8, 'notnull' => 'S', 'meta' => 'N', 'comillas' => 'N', 'formato' => '%f', 'valor' => $tipos['A4']['ancho']))), 2 => array('nombre' => 'documento referencial', 'campos' => array('idReferencia' => array('nombre' => 'Documento...', 'tipo' => 'select', 'title' => 'Documento en el que basarse', 'opciones' => $otrosDoc, 'meta' => 'N', 'comillas' => 'S', 'formato' => '%s', 'especial' => 'docBase'))));
?>
<script language="javascript">
var medidaDocumentos = new Array;
<?php 
foreach ($tipos as $tipo => $dTipo) {
    ?>
medidaDocumentos['<?php 
    echo $tipo;