<!DOCTYPE html>
<html lang="en">

<?php $this->load->view("template/header"); ?>
<?php $this->load->view("template/nav"); ?>

<style>
    /* Establecer una altura fija para los label */
    .fixed-height-label {
        height: 20px; /* Ajusta esta altura según tu diseño */
        display: flex;
        align-items: center; /* Alinea verticalmente el texto */
        white-space: nowrap; /* Evita que el texto pase a la siguiente línea */
        overflow: hidden; /* Oculta cualquier desbordamiento de texto */
        text-overflow: ellipsis; /* Muestra los puntos suspensivos si el texto es demasiado largo */
    }
</style>

<div class="content-wrapper">
	<div class="content-header">
		<div class="container-fluid">
			<div class="row mb-2">
				<div class="col-sm-6">
					<h1 class="m-0">Ver Reserva</h1>
				</div>
			
				<div class="col-sm-6">
					<ol class="breadcrumb float-sm-right">
						<li class="breadcrumb-item"><a href="#">Inicio</a></li>
					</ol>
				</div>
			</div>
		</div>
	</div>

	<section class="content">
		<div class="container-fluid">
			<div class="card card-secondary">
				<div class="card-header">
					<h3 class="card-title">Datos Reserva</h3>
				</div>

				<form id="quickForm"  autocomplete="off">
					<div class="card-body">
						<div class="row">
							<div class="col-sm-2">
								<div class="form-group"> 
									<label>Establecimiento</label>
									<input type="text" name="txt_numero_reserva" class="form-control" id="txt_numero_reserva" maxlength="125" disabled></input>
								</div>
							</div>

							<div class="col-sm-2">
								<div class="form-group">
									<label>Fecha Ingreso</label>
									<input type="date" name="txt_fechaini_reserva" class="form-control" id="txt_fechaini_reserva" disabled></input>
								</div>
							</div> 

							<div class="col-sm-2">
								<div class="form-group">
									<label>Hora Ingreso</label>
									<input type="time" name="txt_horaini_reserva" class="form-control" id="txt_horaini_reserva" disabled></input>
								</div>
							</div> 
							
							<div class="col-sm-2">
								<div class="form-group">
									<label>Fecha Salida</label>
									<input type="date" name="txt_fechafin_reserva" class="form-control" id="txt_fechafin_reserva" disabled></input>
								</div>
							</div> 

							<div class="col-sm-2">
								<div class="form-group">
									<label>Hora Salida</label>
									<input type="time" name="txt_horafin_reserva" class="form-control" id="txt_horafin_reserva" disabled></input>
								</div>
							</div> 

							<div class="col-sm-2">
								<div class="form-group">  
									<label>Estado</label> 
									<input type="text" name="txt_estado_reserva" class="form-control" id="txt_estado_reserva" disabled></input>
								</div>
							</div>
						</div> 
						
						<div class="row"> 
							<div class="col-sm-2">
								<div class="form-group">
									<label>No.Habitación</label>
									<input type="text" name="txt_numerohab_reserva" class="form-control" id="txt_numerohab_reserva" disabled></input>
								</div>
							</div>

							<div class="col-sm-2">
								<div class="form-group">
									<label>Habitación</label>
									<input type="text" name="txt_habitacion_reserva" class="form-control" id="txt_habitacion_reserva" disabled></input>
								</div>
							</div>

							<div class="col-sm-2">
								<div class="form-group">
									<label>Motivo Viaje</label>
									<input type="text" name="txt_motivo_reserva" class="form-control" id="txt_motivo_reserva" disabled></input>
								</div>
							</div>

							<div class="col-sm-2">
								<div class="form-group">
									<label>Acompañantes</label>
									<input type="text" name="txt_acompanantes_reserva" class="form-control" id="txt_acompanantes_reserva" disabled></input>
								</div>
							</div>

							<div class="col-sm-2">
								<div class="form-group">
									<label>Medio Pago</label>
									<input type="text" name="txt_mdpago_reserva" class="form-control" id="txt_mdpago_reserva" disabled></input>
								</div>
							</div>

							<div class="col-sm-2">
								<div class="form-group">  
									<label>Tipo Documento</label>	
									<input type="text" name="txt_tipfac_reserva" class="form-control" id="txt_tipfac_reserva" disabled></input>                      
								</div>
							</div>
						</div>
						<br>
						<fieldset class="border p-2">
							<legend class="w-auto">Huésped Principal</legend>
							<div class="row">  
								<!-- <div class="col-sm-1"> -->
                                <div class="col-6 col-sm-1">
									<div class="form-group">
										<label class="fixed-height-label">Id</label>
										<input type="text" name="txt_huesped_reserva" class="form-control" id="txt_huesped_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-1"> -->
                                <div class="col-6 col-sm-1">
									<div class="form-group">
										<label class="fixed-height-label">Documento</label>
										<input type="text" name="txt_documento_reserva" class="form-control" id="txt_documento_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-12 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Tipo Documento</label>
										<input type="text" name="txt_tipodoc_reserva" class="form-control" id="txt_tipodoc_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-12 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Nombres</label>
										<input type="text" name="txt_nombres_reserva" class="form-control" id="txt_nombres_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-12 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Apellidos</label>
										<input type="text" name="txt_apellidos_reserva" class="form-control" id="txt_apellidos_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-12 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Fecha Nacimiento</label>
										<input type="date" name="txt_fechanac_reserva" class="form-control" id="txt_fechanac_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-12 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Lugar Nacimiento</label>
										<input type="text" name="txt_lugarnac_reserva" class="form-control" id="txt_lugarnac_reserva" disabled></input>
									</div>
								</div>
							</div>

							<div class="row"> 
								<!-- <div class="col-sm-2"> -->
                                <div class="col-6 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Género</label>
										<select class="custom-select" id="txt_genero_reserva" disabled>
											<option value="0">--Seleccionar-- </option>
											<option value="1">MASCULINO</option>
											<option value="2">FEMENINO</option>                                                         
										</select>  
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-6 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Teléfono</label>
										<input type="text" name="txt_telefono_reserva" class="form-control" id="txt_telefono_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-6 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Móvil</label>
										<input type="text" name="txt_movil_reserva" class="form-control" id="txt_movil_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-6 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Nacionalidad</label>
										<input type="text" name="txt_nacionalidad_reserva" class="form-control" id="txt_nacionalidad_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-6 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Ocupación</label>
										<input type="text" name="txt_ocupacion_reserva" class="form-control" id="txt_ocupacion_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-6 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Correo Electronico</label>
										<input type="text" name="txt_correoelect_reserva" class="form-control" id="txt_correoelect_reserva" disabled></input>
									</div>
								</div>
							</div>

							<div class="row"> 
								<!-- <div class="col-sm-2"> -->
                                <div class="col-6 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">País Residencia</label>
										<input type="text" name="txt_psresidencia_reserva" class="form-control" id="txt_psresidencia_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-6 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Departamento Residencia</label>
										<input type="text" name="txt_dtresidencia_reserva" class="form-control" id="txt_dtresidencia_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-6 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Ciudad Residencia</label>
										<input type="text" name="txt_cdresidencia_reserva" class="form-control" id="txt_cdresidencia_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-6 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">País Procedencia</label>
										<input type="text" name="txt_psprocedencia_reserva" class="form-control" id="txt_psprocedencia_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-6 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Departamento Procedencia</label>
										<input type="text" name="txt_dtprocedencia_reserva" class="form-control" id="txt_dtprocedencia_reserva" disabled></input>
									</div>
								</div>

								<!-- <div class="col-sm-2"> -->
                                <div class="col-6 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Ciudad Procedencia</label>
										<input type="text" name="txt_cdprocedencia_reserva" class="form-control" id="txt_cdprocedencia_reserva" disabled></input>
									</div>
								</div>
							</div>

							<div class="row"> 
								<!-- <div class="col-sm-2"> -->
                                <div class="col-6 col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Placa Vehículo</label>
										<input type="text" name="txt_placa_reserva" class="form-control" id="txt_placa_reserva" disabled></input>
									
									</div>
								</div>
							</div>
						</fieldset >
						<br>

						<fieldset class="border p-2">
							<legend class="w-auto">Huésped Acompañante</legend>
							<div class="row"> 
								<div class="col-sm-2">
									<!-- <div class="form-group">
										<button style="float: left" type="button" class="btn btn-primary col-md-1 " id="btn_agregar_acompanante">Ingresar Acompañante</button>
									</div> -->
								</div>
							</div>

							<div class="row">
                            	<div class="col-sm-12">
                                    <table id="example1" class="table table-bordered table-striped dataTable dtr-inline" role="grid" aria-describedby="example1_info">
                                        <thead>
                                        <tr role="row">
                                          
                                            <th class="sorting" tabindex="0" aria-controls="example1" style="">ID</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1" style="">Nombres</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1" style="">Apellidos</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1" style="">Tipo Documento</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1" style="">Identificación</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1" style="">Fecha Nacimiento</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1" style="">Ocupación</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1" style="">Nacionalidad</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1" style="">Email</th>
                                        </thead>
										<tbody>
												
										</tbody>
										<tfoot>
											<tr>
												<th style="">ID</th>
												<th style="">Nombres</th>
												<th style="">Apellidos</th>
												<th style="">Tipo Documento</th>
												<th style="">Identificación</th>
												<th style="">Fecha Nacimiento</th>
												<th style="">Ocupación</th>
												<th style="">Nacionalidad</th>
												<th style="">Email</th>
											</tr>
										</tfoot>
                                    </table>
                            	</div>
                            </div>
						</fieldset >
						<br>
						
						<fieldset class="border p-2">
							<legend class="w-auto">Información Reserva</legend>
							<div class="row">  
						    	<div class="col-sm-1">
									<div class="form-group">
										<label class="fixed-height-label">Tipo de ocupación</label>
										<input type="text" name="txt_tipoocupacion" class="form-control" id="txt_tipoocupacion" disabled></input>
									</div>
								</div>

								<div class="col-sm-1">
									<div class="form-group">
                                        <label class="fixed-height-label">Persona Adicional</label>
										<input type="text" name="txt_adicional" class="form-control" id="txt_adicional" disabled></input>
									</div>
								</div>

								<div class="col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Precio Habitación</label>
										<input type="text" name="txt_precio" class="form-control" id="txt_precio" disabled></input>
									</div>
								</div>

                                <div class="col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Precio Persona Adicional</label>
										<input type="text" name="txt_precioadicional" class="form-control" id="txt_precioadicional" disabled></input>
									</div>
								</div>

                                <div class="col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Cargo Adicional</label>
										<input type="text" name="txt_cargoadicional" class="form-control" id="txt_cargoadicional" disabled></input>
									</div>
								</div>

                                <div class="col-sm-1">
									<div class="form-group">
										<label class="fixed-height-label">Descuento</label>
										<input type="text" name="txt_descuento" class="form-control" id="txt_descuento" disabled></input>
									</div>
								</div>

								<div class="col-sm-1">
									<div class="form-group">
										<label class="fixed-height-label">IVA</label>
										<input type="text" name="txt_iva" class="form-control" id="txt_iva" disabled></input>
									</div>
								</div>

                                <div class="col-sm-2">
									<div class="form-group">
										<label class="fixed-height-label">Precio Total</label>
										<input type="text" name="txt_preciototal" class="form-control" id="txt_preciototal" disabled></input>
									</div>
								</div>
							</div>
						</fieldset >
					</div>

					<div class="card-footer d-flex justify-content-start">
						<button type="button" class="btn btn-secondary col-6 col-md-auto" id="btn_cancelar_reserva">Cancelar</button>
					</div>
				</form>
			
				<div class="row">
					<section class="col-lg-7 connectedSortable">
					</section>
				
					<section class="col-lg-5 connectedSortable">
					</section>
				</div>
			</div>
		</section>
	</div>

<?php $this->load->view("template/footer"); ?>

<aside class="control-sidebar control-sidebar-dark"></aside>

<!-- ======================================================================================================================================================================================================= -->

     <!-- jQuery -->
    <script src="<?php echo base_url() ?>assets/plugins/jquery/jquery.js"></script>
    <script src="<?php echo base_url() ?>assets/plugins/jquery/jquery.min.js"></script>
    <!-- jQuery UI 1.11.4 -->
    <script src="<?php echo base_url() ?>assets/plugins/jquery-ui/jquery-ui.min.js"></script>
    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
    <script>
        $.widget.bridge('uibutton', $.ui.button)
    </script>
    <!-- Bootstrap 4 -->
    <script src="<?php echo base_url() ?>assets/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
    <!-- ChartJS -->
    <script src="<?php echo base_url() ?>assets/plugins/chart.js/Chart.min.js"></script>
    <!-- Sparkline -->
    <!-- <script src="<?php echo base_url() ?>assets/plugins/sparklines/sparkline.js"></script> -->
     <!-- JQVMap -->
    <script src="<?php echo base_url() ?>assets/plugins/jqvmap/jquery.vmap.min.js"></script>
    <script src="<?php echo base_url() ?>assets/plugins/jqvmap/maps/jquery.vmap.usa.js"></script>
    <!-- jQuery Knob Chart -->
    <script src="<?php echo base_url() ?>assets/plugins/jquery-knob/jquery.knob.min.js"></script>
    <!-- daterangepicker -->
    <script src="<?php echo base_url() ?>assets/plugins/moment/moment.min.js"></script>
    <script src="<?php echo base_url() ?>assets/plugins/daterangepicker/daterangepicker.js"></script>
    <!-- Tempusdominus Bootstrap 4 -->
    <script src="<?php echo base_url() ?>assets/plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
    <!-- Summernote -->
    <script src="<?php echo base_url() ?>assets/plugins/summernote/summernote-bs4.min.js"></script>
    <!-- overlayScrollbars -->
    <script src="<?php echo base_url() ?>assets/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
    <!-- AdminLTE App -->
    <script src="<?php echo base_url() ?>assets/dist/js/adminlte.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="<?php echo base_url() ?>assets/dist/js/demo.js"></script>
    <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
     <!-- <script src="<?php echo base_url() ?>assets/dist/js/pages/dashboard.js"></script> -->
	<!-- SweetAlert -->
	<script src="<?php echo base_url() ?>assets/plugins/sweetalert2/sweetalert2.all.min.js"></script>
	<!-- AdminLTE Datatable components -->
	<script src="<?php echo base_url() ?>assets/plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="<?php echo base_url() ?>assets/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
    <script src="<?php echo base_url() ?>assets/plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
    <script src="<?php echo base_url() ?>assets/plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
    <script src="<?php echo base_url() ?>assets/plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
    <script src="<?php echo base_url() ?>assets/plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>
    <script src="<?php echo base_url() ?>assets/plugins/jszip/jszip.min.js"></script>
    <script src="<?php echo base_url() ?>assets/plugins/pdfmake/pdfmake.min.js"></script>
    <script src="<?php echo base_url() ?>assets/plugins/pdfmake/vfs_fonts.js"></script>
    <script src="<?php echo base_url() ?>assets/plugins/datatables-buttons/js/buttons.html5.min.js"></script>
    <script src="<?php echo base_url() ?>assets/plugins/datatables-buttons/js/buttons.print.min.js"></script>
    <script src="<?php echo base_url() ?>assets/plugins/datatables-buttons/js/buttons.colVis.min.js"></script>


<!-- ======================================================================================================================================================================================================= -->
    <script>

		var reserva     = <?php echo json_encode($reserva) ?>;
		var acompanante = <?php echo json_encode($acompanante) ?>;
		
		console.log(reserva);
		//inicio de Carga
		$(document).ready (function() 
		{
			//bloquear Botones
			$('#btn_cerrar_reserva').hide();
            $('#btn_generar_reporte').hide();

            $("#btn_cancelar_reserva").click(function (){ 
				window.location.href="<?php echo base_url() ?>Reservas/listReservas";
		    }); 
			
			//capturar los valores Reserva
			$('#txt_numero_reserva').val(reserva[0].NomHotel);
			$('#txt_fechaini_reserva').val(reserva[0].FechaIni);
			$('#txt_horaini_reserva').val(reserva[0].HoraIni);
			$('#txt_fechafin_reserva').val(reserva[0].FechaFin);
			$('#txt_horafin_reserva').val(reserva[0].HoraFin);
			$('#txt_estado_reserva').val(reserva[0].EstadoReserva);
			$('#txt_numerohab_reserva').val(reserva[0].NumeroHabitacion);
			$('#txt_habitacion_reserva').val(reserva[0].TipoHabitacion);
			$('#txt_motivo_reserva').val(reserva[0].MotivoViaje);
			$('#txt_acompanantes_reserva').val(reserva[0].CantAcompanantes);
			$('#txt_mdpago_reserva').val(reserva[0].MedioPago);
			$('#txt_valor_reserva').val(reserva[0].ValorHabitacion);
			$('#txt_tipfac_reserva').val(reserva[0].NomTipFac);
			$('#txt_huesped_reserva').val(reserva[0].IdHuesped);
			$('#txt_documento_reserva').val(reserva[0].Identificacion);
			$('#txt_tipodoc_reserva').val(reserva[0].TipoDocumento);
			$('#txt_nombres_reserva').val(reserva[0].NomHPrincipal);
			$('#txt_apellidos_reserva').val(reserva[0].Apellidos);
			$('#txt_fechanac_reserva').val(reserva[0].FechaNac);
			$('#txt_lugarnac_reserva').val(reserva[0].LugarNacimiento);
			$('#txt_genero_reserva').val(reserva[0].Genero);
			$('#txt_telefono_reserva').val(reserva[0].Telefono);
			$('#txt_movil_reserva').val(reserva[0].Movil);
			$('#txt_nacionalidad_reserva').val(reserva[0].Nacionalidad);
			$('#txt_ocupacion_reserva').val(reserva[0].Ocupacion);
			$('#txt_correoelect_reserva').val(reserva[0].Email);
			$('#txt_cdresidencia_reserva').val(reserva[0].CResidencia);
			$('#txt_dtresidencia_reserva').val(reserva[0].DepResidencia);
			$('#txt_psresidencia_reserva').val(reserva[0].PaisResidencia);
			$('#txt_cdprocedencia_reserva').val(reserva[0].CProcedencia);
			$('#txt_dtprocedencia_reserva').val(reserva[0].DepProcedencia);
			$('#txt_psprocedencia_reserva').val(reserva[0].PaisProcedencia);
			$('#txt_placa_reserva').val(reserva[0].Placa);
			$('#txt_precio').val(reserva[0].PrecioHabitacion);
			$('#txt_precioadicional').val(reserva[0].PrecioAdicional);
			$('#txt_cargoadicional').val(reserva[0].CargoAdicional);
			$('#txt_descuento').val(reserva[0].Descuento);
			$('#txt_preciototal').val(reserva[0].PrecioTotal);
			$('#txt_iva').val(reserva[0].Iva);
			$('#txt_tipoocupacion').val(reserva[0].TipoOcupacion);
			
			if (reserva[0].PrecioAdicional>0){
				var adicional = 'SI'
			} else{
				var adicional = 'NO'
			}
		
			$('#txt_adicional').val(adicional);
			
			//Capturar los Valores Acompañante
			$("#example1").DataTable({
				data: acompanante,
				destroy: true,
				searching: false,
				columns:
				[
					{data : 'IdAcompanante'},
					{data : 'Nombres'},
					{data : 'Apellidos'},
					{data : 'TipoDocumento'},
					{data : 'Identificacion'},
					{data : 'FechaNac'},
					{data : 'Ocupacion'},
					{data : 'Nacionalidad'},
					{data : 'Email'}
				],
					responsive: true, "lengthChange": false, "autoWidth": false
			}).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
		});

		//funcion pasar a mayusculas
		function mayus(e) 
		{
			e.value = e.value.toUpperCase();
		}

		//funcion para reemplazar y limpiar caracteres
		function limpiarCaracteres(Texto1)
		{
			Texto1 = Texto1 .replaceAll('á', '&aacute')
						    .replaceAll('é', '&eacute')
						    .replaceAll('í', '&iacute')
						    .replaceAll('ó', '&oacute')
						    .replaceAll('ú', '&uacute')
						    .replaceAll('ñ', '&ntilde')
						    .replaceAll('Á', '&Aacute')
						    .replaceAll('É', '&Eacute')
						    .replaceAll('Í', '&Iacute')
						    .replaceAll('Ó', '&Oacute')
						    .replaceAll('Ú', '&Uacute')
						    .replaceAll('Ñ', '&Ntilde')
						    .replaceAll('%', ' ')
						    .replaceAll('"', ' ')
						    .replaceAll('/', ' ')
						    .replaceAll(':', ' ')
						    .replaceAll(';', ' ')
						    .replaceAll('(', ' ')
						    .replaceAll(')', ' ')
						    .replaceAll('#', ' ');
			
			return Texto1;
		}

		//funcion para reemplazar y limpiar caracteres
		function asignarCaracteres(Texto2)
		{
			Texto2 = Texto2 .replaceAll('&aacute', 'á')
							.replaceAll('&eacute', 'é')
							.replaceAll('&iacute', 'í')
							.replaceAll('&oacute', 'ó')
							.replaceAll('&uacute', 'ú')
							.replaceAll('&ntilde', 'ñ')
							.replaceAll('&Aacute', 'Á')
							.replaceAll('&Eacute', 'É')
							.replaceAll('&Iacute', 'Í')
							.replaceAll('&Oacute', 'Ó')
							.replaceAll('&Uacute', 'Ú')
							.replaceAll('&Ntilde', 'Ñ');

			return Texto2;
		}

	</script> 

</body>

</html>
