<script type="text/jscript">
function Valtext(e) {
    key = e.keyCode || e.which;
    tecla = String.fromCharCode(key).toLowerCase();
    letras = " áéíóúabcdefghijklmnñopqrstuvwxyz";
    especiales = [8, 37, 39, 46];

    tecla_especial = false
    for(var i in especiales) {
        if(key == especiales[i]) {
            tecla_especial = true;
            break;
        }
    }

    if(letras.indexOf(tecla) == -1 && !tecla_especial)
        return false;
}

function ValNumero(e) {
    key = e.keyCode || e.which;
    tecla = String.fromCharCode(key).toLowerCase();
    letras = "0123456789";
    especiales = [8, 37, 39, 46];

    tecla_especial = false
    for(var i in especiales) {
        if(key == especiales[i]) {
            tecla_especial = true;
            break;
        }
    }

    if(letras.indexOf(tecla) == -1 && !tecla_especial)
        return false;
}
</script>

	<?php
		if (isset($con))
		{
	?>

	<!-- Modal -->
<div class="modal fade" id="nuevoCliente" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
	 		<div class="modal-header">
	 			<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	 		    <h4 class="modal-title" id="myModalLabel"><i class='glyphicon glyphicon-edit'></i> Agregar nuevo cliente</h4>
	 	    </div>
	 	    <div class="modal-body">
	 			<form class="form-horizontal" method="post" id="guardar_cliente" name="guardar_cliente">
	 		    	<div id="resultados_ajax"></div>
	 		    	<div class="form-group">
	 			    	<label for="nombre" class="col-sm-3 control-label">Tipo de Cliente</label>
	 			    	<div class="col-sm-8">
					  		
	                      		<select class="form-control" id="organismo" name="organismo" required>
					          		<option value="">---Seleccione una opcion---</option>
									<option value="juridica">Persona Juridica</option>
	    		    	            <option value="natural">Persona natural</option>
								</select>
							
        	      		</div>
	 		      </div>
                  <div class="form-group">
                  		<label for="nombre" class="col-sm-3 control-label">Cedula o Rif</label>
	 			    	<div class="col-sm-8">
	 			        	<input type="text" class="form-control" id="rif" name="rif" maxlength="9" required onKeyPress="return ValNumero(event)">
				      </div>
				 </div>
                 <div class="form-group">
	 			    <label for="nombre" class="col-sm-3 control-label">Nombre Completo</label>
	 			 		<div class="col-sm-8">
	 			        	<input type="text" class="form-control" id="nombre" name="nombre" maxlength="100" onKeyPress="return Valtext(event)" required>
	 			   		</div>
	 		     </div>
	 		     <div class="form-group">
	 			    <label for="direccion" class="col-sm-3 control-label">Dirección</label>
	 			      <div class="col-sm-8">
	 				     <textarea class="form-control" id="direccion" name="direccion"   maxlength="250"></textarea>
	 			      </div>
	 		      </div>
				  <div class="form-group">
	 			    <label for="telefono" class="col-sm-3 control-label">Teléfono</label>
				      <div class="col-sm-8">
				        <input type="text" class="form-control" id="telefono" name="telefono" maxlength="11" onKeyPress="return ValNumero(event)">
				      </div>
			      </div>
			      <div class="form-group">
				    <label for="email" class="col-sm-3 control-label">Email</label>
				       <div class="col-sm-8">
					     <input type="email" class="form-control" id="email" name="email" maxlength="50" >
				       </div>
			      </div>
                  
			      <div class="modal-footer">
			        <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
			        <button type="submit" class="btn btn-primary" id="guardar_datos">Guardar datos</button>
		          </div>
		          </form>
               </div>
		  </div>
	</div>
</div>
	<?php
		}
	?>