<%@page import="java.util.*,javax.sql.*,java.sql.*,javax.naming.*,m05bClasses.*,m05bBD.m05bAsignacion,m05bClasses.m05bPaginacion.*, m05bClasses.m05bPaginacion.m05bValueObject.*" %>
<%@include file="/mantenimientosJSP/includes/m05b.inc"%>

<HTML>

<%	// _______________________________XLNETs______________________________________
	// Evaluar variable de session que indica si esta conectado a XLNets
	if (session.getAttribute("objetoSeguridad") == null)  { 
		// Verificar que no ha transcurrido el tiempo de sesion (web.xml) %>
			<%@ include file="/m05bControlAcceso.inc"%> 
<%	} 
	String persona = (String) session.getAttribute("persona");
	
	String url="history.back()";
		session.setAttribute("rutaRetorno",url);
%>
	<%@ include file="/m05bIdioma.inc"%>

<head>
		<title><%= resTit.getString("titVehiRelacion")%></title>
		<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
		<link rel="stylesheet" href="<%=m05bConstantesPaginas.PATH_ESTILOS%>/m05bestilos.css" type="text/css">
		<script language="javascript1.2" src="<%=m05bConstantesPaginas.PATH_SCRIPTS%>/m05Funciones.js"></script>

</head>
<BODY style="cursor: wait" onload="document.body.style.cursor='default';InitMenu();" onkeydown="cancelaEnter();" onunload="document.body.style.cursor='wait';">
 <SCRIPT language=JavaScript>
	var urlIdioma;		//URL recarga en funcion del idioma	var urlIdioma;
	var detPadre;		//Ventana padre de la actual
	var detActual;		//Ventana actual
	var rutaCabecera;	//Camino de migas
	urlIdioma = "<%=m05bConstantesPaginas.VEH_GESTION_RELACION%>";
	detPadre = '<%=resCM.getString("cmVehiBusqueda")%>';
	rutaCabecera = "<%=m05bConstantesPaginas.DATOS_CABECERA%><%=m05bConstantesPaginas.VEH_GESTION_BUSQUEDA_PARAM%>" + "'>\\"+detPadre+"</a>";
	detActual = '<%=resCM.getString("cmVehiRelacion")%>';
	//rutaCabecera += "<%=m05bConstantesPaginas.DATOS_CABECERA%>" + urlIdioma + "'>\\"+detActual+"</a>";
 </SCRIPT>
 <%@include file="/mantenimientosJSP/includes/m05Cabecera_c.jsp"%>
<table  width="100%" height="100%"  cellspacing="0" cellpadding="0" align="center">

	<tr><td colspan=3></td></tr>
	<tr valign="top">
		<td width="2%">
			<DIV ID="thessm" style="visibility:hidden;Position : Absolute ;Left : 0 ;Top : 80 ;Z-Index : 20;">
	      		<DIV ID="thessm2" style="Position : Absolute ;Left : (-150) ;Top : 0 ;Z-Index : 20;">
	                <%@ include file="/m05bMenuInicial.inc"%>
	       		</DIV>
			</DIV>
		</td>
		<td>&nbsp</td>
		<td width="98%">

		<FORM NAME="FormRelVehiculos" METHOD="POST" TARGET="_top">
				 <TABLE  class="general">
				   <tr colspan="10">
					   <!--td align="right" colspan="7"><INPUT TYPE="IMAGE" style="cursor:hand" VALUE="Retornar" ONCLICK="JavaScript:volver();return false;" onMouseOver="top.status='Retornar'; return true" onMouseOut="top.status=''; return true" src="<%=m05bConstantesPaginas.PATH_IMAGENES%>/retornar.gif"></td-->
                       <td align="right" ><input type="button" class="boton" name="<%= res.getString("etBOT_RETORNAR")%>" value="<%= res.getString("etBOT_RETORNAR")%>" ONCLICK="JavaScript:volver();return false;" onMouseOver="top.status='<%= res.getString("etBOT_STATUSRETORNAR")%>'; return false" onMouseOut="top.status=''; return false" /></td>				      					  					   
				    </tr>
				 </TABLE>
		      <div id="capaHtml" style="clipt:rect();  width: 100%; border: thin #336699 solid;">
				 <TABLE border="1" class="general">
				    <tr>
				       <td class="searchTitle" width="10%"><%= res.getString("etMatricula")%></td>
				       <td class="searchTitle" width="10%"><%= res.getString("etBastidor")%></td>
				       <td class="searchTitle" width="10%"><%= res.getString("etExpediente")%></td>
				       <td class="searchTitle" width="5%"><%= res.getString("etAutorizaApar")%></td>
				       <td class="searchTitle" width="5%"><%= res.getString("etInfAdicional1")%></td>
				       <td class="searchTitle" width="5%"><%= res.getString("etInfAdicional2")%></td>
				       <td class="searchTitle" width="5%"><%= res.getString("etNotas")%></td>
				       <td class="searchTitle" width="5%"><%= res.getString("etTarjeta")%><%= res.getString("etGastos")%></td>
				       <td class="searchTitle" width="5%"><%= res.getString("etTarjeta")%><%= res.getString("etViaT")%></td>
				       <td class="searchTitle" width="10%"><%= res.getString("etMatriculaAnterior")%></td>
				    </tr>
				<%
				    m05bComun comun = new m05bComun();
				    m05bFileLog miLog = new m05bFileLog();

					miLog.addTraza(persona, "Rel. Vehiculos JSP", "Inicio", m05bConstantes.LOG_NIVEL_BAJO);
					int contador=0;
					String sql = "", sql2 = "";
					//String nSerieAsterisco="";
					//String expdteAsterisco="";
					//String tarjetaVAsterisco="";
					//String tarjetaGAsterisco ="";
					//String autorizaAsterisco ="";
					//String inf1Asterisco ="";
					//String inf2Asterisco ="";
					//String notasAsterisco ="";
					//String matriculaAntAsterisco ="";
					//String matriculaAsterisco ="";
					String nSerie=request.getParameter("NSerie")==null?"":request.getParameter("NSerie").toUpperCase();
					//nSerieAsterisco=nSerie;
					String expdte=request.getParameter("Expdte")==null?"":request.getParameter("Expdte").toUpperCase();
					//expdteAsterisco=expdte; 
					String tarjetaV=request.getParameter("TarjetaV")==null?"":request.getParameter("TarjetaV").toUpperCase();
					//tarjetaVAsterisco=tarjetaV;
					String tarjetaG =request.getParameter("TarjetaG")==null?"":request.getParameter("TarjetaG").toUpperCase();
					//tarjetaGAsterisco=tarjetaG;
					String autoriza =request.getParameter("Autoriza")==null?"":request.getParameter("Autoriza").toUpperCase();
					//autorizaAsterisco=autoriza;
					String inf1 =request.getParameter("Inf1")==null?"":request.getParameter("Inf1").toUpperCase();
					//inf1Asterisco=inf1;
					String inf2 =request.getParameter("Inf2")==null?"":request.getParameter("Inf2").toUpperCase();
					//inf2Asterisco=inf2;
					String notas =request.getParameter("Notas")==null?"":request.getParameter("Notas").toUpperCase();
					//notasAsterisco=notas;
					String matriculaAnt =request.getParameter("MatriculaAnt")==null?"":request.getParameter("MatriculaAnt").toUpperCase();
					//matriculaAntAsterisco=matriculaAnt;
					String matricula="";
                    nSerie=comun.fncReplaceAcentos(nSerie);
                    nSerie=comun.fncReplaceAsterisco(nSerie);
                    expdte=comun.fncReplaceAcentos(expdte);
                    expdte=comun.fncReplaceAsterisco(expdte);
                    inf1=comun.fncReplaceAcentos(inf1);
                    inf1=comun.fncReplaceAsterisco(inf1);
                    inf2=comun.fncReplaceAcentos(inf2);
                    inf2=comun.fncReplaceAsterisco(inf2);
                    notas=comun.fncReplaceAcentos(notas);
                    notas=comun.fncReplaceAsterisco(notas);
                    tarjetaV=comun.fncReplaceAsterisco(tarjetaV);
                    tarjetaG=comun.fncReplaceAsterisco(tarjetaG);
                    autoriza=comun.fncReplaceAsterisco(autoriza);
                    matriculaAnt=comun.fncReplaceAsterisco(matriculaAnt);
                    matricula=comun.fncReplaceAsterisco(matricula);
                    


				try{
					session.removeAttribute("Vehiculo");

				    sql = 	"select " + m05bConstantes.COL_34_MATRICULA + "," + m05bConstantes.COL_34_NSERIE +
				    		"," + m05bConstantes.COL_34_EXPDTE + "," + m05bConstantes.COL_34_AUTORI_APAR + 
				    		"," + m05bConstantes.COL_34_INF1 + "," + m05bConstantes.COL_34_INF2 +
							"," + m05bConstantes.COL_34_NOTA + "," + m05bConstantes.COL_34_MATRIC_ANT +
							"," + "(select " + m05bConstantes.COL_31_TARJETA +" from  "+ m05bConstantes.TAB_TARJETAS+
							" where " + m05bConstantes.COL_31_MATRICULA+"="+m05bConstantes.COL_34_MATRICULA +" and "+ m05bConstantes.COL_31_TIPO+" ='"+m05bConstantes.TAR_GASTO+"' )"+
							","+" (select " + m05bConstantes.COL_31_TARJETA +" from  "+m05bConstantes.TAB_TARJETAS+
							" where "+m05bConstantes.COL_31_MATRICULA+"="+m05bConstantes.COL_34_MATRICULA +" and "+ m05bConstantes.COL_31_TIPO+"='"+m05bConstantes.TAR_VIAT+"' )"+
				    		" FROM " + m05bConstantes.TAB_VEHICULOS ;
				    		
				    if ((nSerie==null)||(nSerie.equals(""))){
				  		  sql2= sql2;
				   	}else {
				   	       if (sql2.equals(""))
				   	       {   sql2= sql2+" WHERE "+" replace(replace(replace(replace(replace("+m05bConstantes.COL_34_NSERIE+",'Ú','U'),'Ó','O'),'Í','I'),'É','E'),'Á','A')" + "   like '" + nSerie + "' ";
				   	       }else {                    
				           sql2=sql2+" AND "+" replace(replace(replace(replace(replace("+m05bConstantes.COL_34_NSERIE+",'Ú','U'),'Ó','O'),'Í','I'),'É','E'),'Á','A')" + "   like '" + nSerie + "' ";
				           }
				    }
				    
			       	if ((expdte==null)||(expdte.equals(""))){
				           sql2=sql2;
				    }else {
			           if (sql2.equals("")){
			           sql2=sql2+" WHERE "+" replace(replace(replace(replace(replace("+m05bConstantes.COL_34_EXPDTE+",'Ú','U'),'Ó','O'),'Í','I'),'É','E'),'Á','A')" + "   like '" + expdte + "' ";
			           }else{
				        sql2=sql2+" AND "+" replace(replace(replace(replace(replace("+m05bConstantes.COL_34_EXPDTE+",'Ú','U'),'Ó','O'),'Í','I'),'É','E'),'Á','A')" + "   like '" + expdte + "' ";
				       }
				    }
				    if ((tarjetaV==null)||(tarjetaV.equals("")))
				            sql2=sql2;
				        else {
			                //sql2=sql2+" AND "+m05bConstantes.COL_31_TARJETA +  "   like '" + tarjetaV + "' AND " + m05bConstantes.COL_31_TIPO +" = '"+m05bConstantes.TAR_VIAT+"'";
			             if (sql2.equals("")){			                
                            sql2=sql2+" WHERE  (select " + m05bConstantes.COL_31_TARJETA +" from  "+ m05bConstantes.TAB_TARJETAS+
							" where " + m05bConstantes.COL_31_MATRICULA+"="+m05bConstantes.COL_34_MATRICULA +" and "+ m05bConstantes.COL_31_TIPO+" ='"+m05bConstantes.TAR_VIAT+"' )" +  "   like '" + tarjetaV+"'" ;			                
						}else{
                            sql2=sql2+" and  (select " + m05bConstantes.COL_31_TARJETA +" from  "+ m05bConstantes.TAB_TARJETAS+
							" where " + m05bConstantes.COL_31_MATRICULA+"="+m05bConstantes.COL_34_MATRICULA +" and "+ m05bConstantes.COL_31_TIPO+" ='"+m05bConstantes.TAR_VIAT+"' )" +  "   like '" + tarjetaV +"'";			                						
						}
				    }
				    if ((tarjetaG==null)||(tarjetaG.equals("")))
				            sql2=sql2;
				        else {
			                //sql2=sql2+" AND "+m05bConstantes.COL_31_TARJETA +  "   like '" + tarjetaG + "' AND " + m05bConstantes.COL_31_TIPO +" = '"+m05bConstantes.TAR_GASTO+"'";
			             if (sql2.equals("")){					                
                            sql2=sql2+" where (select " + m05bConstantes.COL_31_TARJETA +" from  "+ m05bConstantes.TAB_TARJETAS+
                            " where " + m05bConstantes.COL_31_MATRICULA+"="+m05bConstantes.COL_34_MATRICULA +" and "+ m05bConstantes.COL_31_TIPO+" ='"+m05bConstantes.TAR_GASTO+"' )" +  "   like '" + tarjetaG +"'";			                			                                            
                         }else{
							sql2=sql2+" and (select " + m05bConstantes.COL_31_TARJETA +" from  "+ m05bConstantes.TAB_TARJETAS+
                            " where " + m05bConstantes.COL_31_MATRICULA+"="+m05bConstantes.COL_34_MATRICULA +" and "+ m05bConstantes.COL_31_TIPO+" ='"+m05bConstantes.TAR_GASTO+"' )" +  "   like '" + tarjetaG+"'" ;			                			                                                                     
                         }
							
				    }				    
				    if ((autoriza==null)||(autoriza.equals("")))
				            sql2=sql2;
				        else {
				          if (sql2.equals("")){			
			                sql2=sql2+" WHERE "+m05bConstantes.COL_34_AUTORI_APAR +  "   like '" + autoriza + "'  ";
			              }else{
			              sql2=sql2+" AND "+m05bConstantes.COL_34_AUTORI_APAR +  "   like '" + autoriza + "'  ";
			              }
				    }		
			       	if ((inf1==null)||(inf1.equals(""))){
				           sql2=sql2;
				    }else {
				       if (sql2.equals("")){			
				        sql2=sql2+" WHERE "+" replace(replace(replace(replace(replace("+m05bConstantes.COL_34_INF1+",'Ú','U'),'Ó','O'),'Í','I'),'É','E'),'Á','A')" + "   like '" + inf1 + "' ";
				       }else{
				       sql2=sql2+" AND "+" replace(replace(replace(replace(replace("+m05bConstantes.COL_34_INF1+",'Ú','U'),'Ó','O'),'Í','I'),'É','E'),'Á','A')" + "   like '" + inf1 + "' ";
				       }
				    }				    
			       	if ((inf2==null)||(inf2.equals(""))){
				           sql2=sql2;
				    }else {
				       if (sql2.equals("")){				    
				        sql2=sql2+" WHERE "+" replace(replace(replace(replace(replace("+m05bConstantes.COL_34_INF2+",'Ú','U'),'Ó','O'),'Í','I'),'É','E'),'Á','A')" + "   like '" + inf2 + "' ";
				       }else{
				       sql2=sql2+" AND "+" replace(replace(replace(replace(replace("+m05bConstantes.COL_34_INF2+",'Ú','U'),'Ó','O'),'Í','I'),'É','E'),'Á','A')" + "   like '" + inf2 + "' ";
				       }
				    }				 				 
			       	if ((notas==null)||(notas.equals(""))){
				           sql2=sql2;
				    }else {
				      if (sql2.equals("")){				  
				        sql2=sql2+" WHERE "+" replace(replace(replace(replace(replace("+m05bConstantes.COL_34_NOTA+",'Ú','U'),'Ó','O'),'Í','I'),'É','E'),'Á','A')" + "   like '" + notas + "' ";
				       }else{
                         sql2=sql2+" AND "+" replace(replace(replace(replace(replace("+m05bConstantes.COL_34_NOTA+",'Ú','U'),'Ó','O'),'Í','I'),'É','E'),'Á','A')" + "   like '" + notas + "' ";				       
                       }
				    }				 				 				       	
					if ( (matriculaAnt == null) || (matriculaAnt.equals("")) )
						sql2 = sql2;
					else{
				      if (sql2.equals("")){								
					 		sql2 = sql2 + " where "+m05bConstantes.COL_34_MATRIC_ANT+" like '"+matriculaAnt+"'";
                      }else{
                         sql2 = sql2 + " and "+m05bConstantes.COL_34_MATRIC_ANT+" like '"+matriculaAnt+"'";					 		
                      }
					}
					



					sql = sql + sql2 + " order by "+m05bConstantes.COL_34_MATRICULA+" desc";
					miLog.addTraza(m05bConstantes.LOG_NO_USER, m05bConstantes.LOG_NO_SRC, "SQL: " + sql, m05bConstantes.LOG_NIVEL_BAJO);
				    
				    //Ini Pag
					m05bPaginator m = new m05bPaginator();
					m05bPage pagina = m.getRelVehiculos((request.getParameter("paginaActual")==null?1:new Integer(request.getParameter("paginaActual")).intValue()), m05bConstantes.PAGINACION_NUMREG_PAGINA, sql);	
					
					String ultimaPagina = pagina.getLastPage()+"";
					String numeroElementos = pagina.getTotalElements() + "";
					String numeroPagina = pagina.getPage()+"";
					boolean hayPaginas = (pagina.getResults().size()==0)?false:true;
					//Fin Pag
					ArrayList listaVehiculos = (ArrayList)pagina.getResults();
					for (contador=0;contador<listaVehiculos.size();contador++){
						m05bRelVehiculos relVehiculos = (m05bRelVehiculos)listaVehiculos.get(contador);
						
						nSerie = relVehiculos.getNSerie();
						matricula= relVehiculos.getMatricula();
						expdte= relVehiculos.getExpdte();
				        autoriza= relVehiculos.getAutoriza();
				        inf1= relVehiculos.getInf1();
						inf2= relVehiculos.getInf2();
				        notas= relVehiculos.getNotas();
				        matriculaAnt= relVehiculos.getMatriculaAnt();
				        tarjetaG= relVehiculos.getTarjetaG();
				        tarjetaV= relVehiculos.getTarjetaV();
						%>
						<tr>
						   <td class=inputFieldTitle width="10%"><FONT size="1"><A href="JavaScript:fncSeleccionar('<%=matricula%>')"><%=matricula%></A></FONT></td>
						   <td class=inputFieldTitle width="10%"><FONT size="1"><%=((nSerie==null)?"":nSerie)%></FONT>
				           <td class=inputFieldTitle width="10%"><FONT size="1"><%=((expdte==null)?"":expdte)%></FONT></td>
				   		   <td class=inputFieldTitle width="5%"><FONT size="1"><%=((autoriza==null)?"":autoriza)%></FONT></td>
				   		   <td class=inputFieldTitle width="5%"><FONT size="1"><%=((inf1==null)?"":inf1)%></FONT></td>
				   		   <td class=inputFieldTitle width="5%"><FONT size="1"><%=((inf2==null)?"":inf2)%></FONT></td>
				   		   <td class=inputFieldTitle width="5%"><FONT size="1"><%=((notas==null)?"":notas)%></FONT></td>
				   		   <td class=inputFieldTitle width="5%"><FONT size="1"><%=((tarjetaG==null)?"":tarjetaG)%></FONT></td>
				   		   <td class=inputFieldTitle width="5%"><FONT size="1"><%=((tarjetaV==null)?"":tarjetaV)%></FONT></td>
				   		   <td class=inputFieldTitle width="10%"><FONT size="1"><%=((matriculaAnt==null)?"":matriculaAnt)%></FONT></td>
						</tr>
				<%} %>
						<tr> 
							<!--Ini Pag -->
							<input type="hidden" name="paginaActual" value="<%=numeroPagina%>" />
							<input type="hidden" name="ultimaPagina" value="<%=ultimaPagina%>" />
							
							<!-- Campos del filtro -->
							<input type="hidden" name="Matricula" value="<%=((request.getParameter("Matricula")==null)?"":request.getParameter("Matricula").toUpperCase())%>" />
							<input type="hidden" name="NSerie" value="<%=((request.getParameter("NSerie")==null)?"":request.getParameter("NSerie").toUpperCase())%>" />
							<input type="hidden" name="Expdte" value="<%=((request.getParameter("Expdte")==null)?"":request.getParameter("Expdte").toUpperCase())%>" />
							<input type="hidden" name="Autoriza" value="<%=((request.getParameter("Autoriza")==null)?"":request.getParameter("Autoriza").toUpperCase())%>" />
							<input type="hidden" name="Inf1" value="<%=((request.getParameter("Inf1")==null)?"":request.getParameter("Inf1").toUpperCase())%>" />
							<input type="hidden" name="Inf2" value="<%=((request.getParameter("Inf2")==null)?"":request.getParameter("Inf2").toUpperCase())%>" />
							<input type="hidden" name="Notas" value="<%=((request.getParameter("Notas")==null)?"":request.getParameter("Notas").toUpperCase())%>" />
							<input type="hidden" name="MatriculaAnt" value="<%=((request.getParameter("MatriculaAnt")==null)?"":request.getParameter("MatriculaAnt").toUpperCase())%>" />
							<input type="hidden" name="TarjetaV" value="<%=((request.getParameter("TarjetaV")==null)?"":request.getParameter("TarjetaV").toUpperCase())%>" />
							<input type="hidden" name="TarjetaG" value="<%=((request.getParameter("TarjetaG")==null)?"":request.getParameter("TarjetaG").toUpperCase())%>" />
						<!-- Fin Campos filtro -->
							<!--Fin Pag -->
						</tr>
						<!--Ini Pag -->
			    <tr>
			    	<td colspan="10" width="100%">
			    		<% if (hayPaginas){ %>
			    			<% if (new Integer(numeroPagina).intValue()==1){%>
			    				<label class="paginacionSinSub" >
			    					<%= res.getString("etPRIMERO")%>
			    				</label>			    			
			    			<% }else{%>
			    				<label>
			    					<a href="javascript: fncPrimeraPagina('m05bRelVehiculosJsp.jsp'); " class="paginacionConSub" ><%= res.getString("etPRIMERO")%></a>
			    				</label>
			    			<% }%>
				    		&nbsp&nbsp
				    		<% if (new Integer(numeroPagina).intValue()==1){%>
			    				<label class="paginacionSinSub" >
			    					<%= res.getString("etANTERIOR")%>
			    				</label>
			    			<% }else{%>
			    				<label>
					    			<a href="javascript: fncAnteriorPagina('m05bRelVehiculosJsp.jsp'); " class="paginacionConSub" ><%= res.getString("etANTERIOR")%></a>
					    		</label>
			    			<% }%>
				    		&nbsp&nbsp
				    		<% if (new Integer(ultimaPagina).intValue()==new Integer(numeroPagina).intValue()){%>
			    				<label class="paginacionSinSub" >
			    					<%= res.getString("etSIGUIENTE")%>
			    				</label>
			    			<% }else{%>
			    				<label>
					    			<a href="javascript: fncSiguientePagina('m05bRelVehiculosJsp.jsp'); " class="paginacionConSub" ><%= res.getString("etSIGUIENTE")%></a>
					    		</label>
			    			<% }%>
				    		&nbsp&nbsp
			    			<% if (new Integer(ultimaPagina).intValue()==new Integer(numeroPagina).intValue()){%>
			    				<label class="paginacionSinSub" >
			    					<%= res.getString("etULTIMO")%>
			    				</label>
			    			<% }else{%>
			    				<label>
			    					<a href="javascript: fncUltimaPagina('m05bRelVehiculosJsp.jsp'); " class="paginacionConSub" ><%= res.getString("etULTIMO")%></a>
			    				</label>
			    			<% }%>
			    		<% }%>
			    		</label>
			    	</td>
		    	</tr>
		    	<tr align="center">
					    <td colspan="10" width="100%"> 
					    	<table width="100%">
					    		<tr align="left">
					    			    <td class="searchTitle" width="10%"> &nbsp</td>
									    <td class="searchTitle" width="60%"> 
									    <% if(!hayPaginas){%>
							    			<%= res.getString("etNINGUNREG")%>
							    		<% }else{%>
							    			<%= res.getString("etREGPAGACT")%>: <%=contador%>
							    		<% }%>
									    </td>
							    		<td class="searchTitle" width="30%"> 
							    		<% if(!hayPaginas){%>
							    			<%= res.getString("etNINGUNPAG")%>
							    		<% }else{%>
							    			<%= res.getString("etPAGINA")%>: <INPUT class="paginacionInputPag" TYPE="TEXT" NAME="irNumPag" VALUE="<%=((new Integer(ultimaPagina).intValue()==0)?0+"":numeroPagina)%>" SIZE="3" onblur="javascript:fncCambiaPag(document.FormRelVehiculos.irNumPag.value);return true;"/>/<%=ultimaPagina%>
							    		<% }%>
							    		</td>
							    </tr>
					    	</table>
					    </td>
			    </tr>
					</TABLE>				    
				 </TABLE>
				 <p>
          </p>
          </div>
		</FORM>
		</td>
	</tr>
	<tr>
			<td colspan="3"><%@ include file="/mantenimientosJSP/includes/m05Pie_c.jsp"%></td>
	</tr>
</table>
<SCRIPT language='javascript'>
	function fncSeleccionar (codigo){
	     document.forms[0].action="m05bVehiculosJsp.jsp?Matricula=" + codigo+ "&Habilitar=true2"; ;
	     document.forms[0].submit();
	}
	
	//Ini Pag
        function  fncSiguientePagina (jsp){
			//m05bCochesLibresHoyJsp.jsp
	        var docu = document.FormRelVehiculos;
	        var pagAct=parseInt(docu.paginaActual.value);
	     	pagAct=pagAct+1;
	        
	        docu.action=jsp + "?paginaActual="+pagAct ;
	        docu.submit();
        } 
        
        function  fncAnteriorPagina (jsp){
			//m05bCochesLibresHoyJsp.jsp
	       	var docu = document.FormRelVehiculos;
	        var pagAct=parseInt(docu.paginaActual.value);
	     	pagAct=pagAct-1;
	        
	        docu.action=jsp + "?paginaActual="+pagAct;
	        docu.submit();
        }
        
        function  fncPrimeraPagina (jsp){
			//m05bCochesLibresHoyJsp.jsp
	        var docu = document.FormRelVehiculos;
	        docu.paginaActual.value=1;
	     
	        docu.action=jsp + "?paginaActual="+docu.paginaActual.value ;
	        docu.submit();
        }
        
        function  fncUltimaPagina (jsp){
			//m05bCochesLibresHoyJsp.jsp
	        var docu = document.FormRelVehiculos;	
	        docu.paginaActual.value=docu.ultimaPagina.value;
	        docu.action=jsp + "?paginaActual="+docu.paginaActual.value ;
	        docu.submit();
        }
        
        function  fncCambiaPag (pag){
        
	        var docu = document.FormRelVehiculos;
	        //Valido que sea numero entero
	        if(docu.irNumPag.value=='' || !esEntero(docu.irNumPag.value)){
	        	alert(dameAlerta(idioma, 85));
	        	docu.irNumPag.focus();
	        	return;
	        }
	        //Valido que sea entre 1 - Última página 
	        if(parseInt(docu.irNumPag.value)<1 || (parseInt(docu.irNumPag.value)>parseInt(docu.ultimaPagina.value))){
	        	alert(dameAlerta(idioma, 84));
	        	docu.irNumPag.focus();
	        	return;
	        }       
	        
	        docu.paginaActual.value=pag;
	        docu.action="m05bRelVehiculosJsp.jsp?paginaActual="+docu.paginaActual.value ;
	        docu.submit();
        }
        //Fin Pag
        
        function  volver (){
	       	var docu = document.FormRelVehiculos;
	        docu.action="m05bBuscarVehiculoParamJsp.jsp";
	        docu.submit();
        }

    setTimeout('initSlide();', 1);
</SCRIPT>
<%
} catch (Exception SQLException) {
	miLog.addTraza(SQLException);
} finally {
	//m05bEndSelect();
}%>
</BODY>
