<%@page import="java.util.*,javax.sql.*,java.sql.*,javax.naming.*,m05bClasses.*" %>
<%@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"%>
	<% } %>
	<%@ include file="/m05bIdioma.inc"%>
	
<head>
		<title><%= resTit.getString("titRevBusqueda")%></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>
		<script language="javascript1.2" src="<%=m05bConstantesPaginas.PATH_SCRIPTS%>/formateador.js"></script>
			
</head>
<BODY style="cursor: wait" onkeydown="cancelaEnter();" onload="document.body.style.cursor='default';InitMenu();" onunload="document.body.style.cursor='wait';">
<div id='p01popUpWindowCalendar' style='position:relative; top:15px left:150px'></div>
		<SCRIPT language=JavaScript>
			var urlIdioma;		//URL recarga en funcion del idioma
			var rutaCabecera;	//Camino de migas
			var detActual;		//Ventana actual
			urlIdioma = "<%=m05bConstantesPaginas.VEH_REV_BUSQUEDA%>";
			detActual = '<%=resCM.getString("cmRevBusqueda")%>';
			rutaCabecera="";
			//rutaCabecera = "<%=m05bConstantesPaginas.DATOS_CABECERA%>" + urlIdioma + "'>\\"+detActual+"</a>";
		</SCRIPT>
		<%@ include file="/mantenimientosJSP/includes/m05Cabecera_c.jsp"%>
<p> 	 
<table  width="100%" height="100%" border="0" 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="formBuscarRevisiones" METHOD="POST">
				<!-- Calendarios -->
				<%	m05bComun comun = new m05bComun(); 
					String m05bCalendarEstilo = comun.leerPropiedad("m05bEstilos.Calendario");  %>
				<%= m05bCalendarEstilo%>
				<%	String m05bCalendarScripts = comun.leerPropiedad("m05bScripts.Calendario");  %>
				<%= m05bCalendarScripts%>
				<%  m05bCombo miCombo = new m05bCombo();
				%>
				<TABLE class="general">
					 <tr><td align="right" colspan="8">
							<input type="button" class="boton" name="<%= res.getString("etBOT_BUSCAR")%>" value="<%= res.getString("etBOT_BUSCAR")%>" ONCLICK="JavaScript:fncBuscar();return false;" onMouseOver="top.status='<%= res.getString("etBOT_STATUSBUSCAR")%>'; return false" onMouseOut="top.status=''; return false" />
					 </td></tr>
				</TABLE> 	 
				 <TABLE class="general">
				    <tr>
					      <td align="left" class="inputFieldTitle" width="25%"><%= res.getString("etMatricula")%></td>
					      <td align="left" colspan="2" width="25%" class="inputFieldTitle"><%= res.getString("etFechaRevision")%></td>
					      <td align="left" width="25%" class="inputFieldTitle"><%= res.getString("etKmRevision")%></td>
					</tr>
					<tr>
						   <!--td align="left">
						          <select class="inputField"  NAME="Matricula" >
						                <option value="">  </option>
						                <%//=miCombo.ComMatricula(m05bConstantes.VEH_TODOS,"")%>
						          </select>
						  </td-->
					   	  <td align="left"><INPUT class="inputField" TYPE="TEXT" NAME="Matricula" value="<%=(request.getParameter("Matricula")==null?"":request.getParameter("Matricula"))%>" size="20" maxlength="20"/></td>
					   	  <td align="left"><INPUT class="inputField" TYPE="TEXT" NAME="FRevision" value="<%=(request.getParameter("FRevision")==null?"":request.getParameter("FRevision"))%>" size="10" maxlength="10" onblur="javascript:formatearFecha(this);return false;"/></td>
					   	  <td align="left" width="18%"><a href='#' name='anchorFRevision'  onClick='JavaScript:showCalendar("anchorFRevision",idioma,document.all("FRevision"),true,200,200,2002);return false;' onMouseOver="top.status='Ver Calendario'; return true" onMouseOut="top.status=''; return true" ><img border="0" src='<%=m05bConstantesPaginas.PATH_IMAGENES%>/p01calendario.gif' /></a></td>
					   	  <td align="left"><INPUT class="inputField" TYPE="TEXT" NAME="KmRevision" value="<%=(request.getParameter("KmRevision")==null?"":request.getParameter("KmRevision"))%>" size="10" maxlength="10" onblur="javascript:validaNum(this);return false;"/></td>
			        </tr>
				    <tr>
					      <td align="left" class="inputFieldTitle" width="25%"><%= res.getString("etRealizada")%></td>
					      <td align="left" colspan="2" width="20%" class="inputFieldTitle"><%= res.getString("etFechaProxRevision")%></td>
					      <td align="left" colspan="2" width="20%" class="inputFieldTitle"><%= res.getString("etKmProxRevision")%></td>
					</tr>
					<tr>
			      	      <td align="left">
			      	      	  <select name="Realizada" class="inputField" onKeypress="buscar_op(this,this)" onblur="borrar_buffer()" onclick="borrar_buffer()">
			                          <option <% if(request.getParameter("Realizada")==null){ %> SELECTED <%}%> value=""></option>
			                          <option <% if(request.getParameter("Realizada")!=null && request.getParameter("Realizada").equals("S")){ %> SELECTED <%}%> value="S"><%=res.getString("etSi") %></option>
			                          <option <% if(request.getParameter("Realizada")!=null && request.getParameter("Realizada").equals("N")){ %> SELECTED <%}%> value="N"><%=res.getString("etNo") %></option> 
			              </td>
					   	  <td align="left"><INPUT class="inputField" TYPE="TEXT" NAME="FProxRev" value="<%=(request.getParameter("FProxRev")==null?"":request.getParameter("FProxRev"))%>" size="10" maxlength="10" onblur="javascript:formatearFecha(this);return false;"/></td>
					   	  <td align="left" width="18%"><a href='#' name='anchorFProxRev'  onClick='JavaScript:showCalendar("anchorFProxRev",idioma,document.all("FProxRev"),true,200,200,2002);return false;' onMouseOver="top.status='Ver Calendario'; return true" onMouseOut="top.status=''; return true" ><img border="0" src='<%=m05bConstantesPaginas.PATH_IMAGENES%>/p01calendario.gif' /></a></td>
					   	  <td align="left"><INPUT class="inputField" TYPE="TEXT" NAME="KmProxRev" value="<%=(request.getParameter("KmProxRev")==null?"":request.getParameter("KmProxRev"))%>"size="10" maxlength="10" onblur="javascript:validaNum(this);return false;"/></td>
			        </tr>
				    <!--tr>
				       <td class="searchTitle">Matr&iacute;cula</td>
				       <td class="searchTitle" colspan="7">Conductor</td>
				    </tr>
					<tr>
				      <td align="left"><INPUT class="inputField" TYPE="TEXT" NAME="Matricula" size="22" maxlength="10"/> </td>
				      <td align="left" colspan="7"><INPUT class="inputField" TYPE="TEXT" NAME="Conductor" size="90" maxlength="50"/> </td>
		  			</tr-->
				</TABLE>
		</FORM>
		</td>
	</tr>
	<tr>
			<td colspan="3"><%@ include file="/mantenimientosJSP/includes/m05Pie_c.jsp"%></td>
	</tr>
</table>
<SCRIPT language='javascript'>
	function fncBuscar (){
		var realizada = "N";
		var matricula="";
	    docu=document.formBuscarRevisiones;
	    if(existeCaracter(docu.Matricula.value,"\'")||existeCaracter(docu.Matricula.value,'\"')){
 			alert(dameAlerta(idioma, 1));
 			docu.Matricula.focus();
 			return;
 		}
	    
	    if (docu.Realizada.checked==true) {
			realizada = "S";
	    } 				
	    //docu.action="m05bRelRevisionesJsp.jsp?Realizada=" + realizada;
	    formatearFecha(docu.FProxRev);
	    formatearFecha(docu.FRevision);
	    docu.action="m05bRelRevisionesJsp.jsp";
	    //docu.Matricula.value=docu.Matricula.value.trim();
        matricula=docu.Matricula.value;
		matricula=matricula.toUpperCase();
		docu.Matricula.value=matricula;	 
	    docu.submit();
	}  // Fin funcion fncBuscar
	
	function validaNum(elem){
		if(!esEnteroSig(elem.value)){
			alert(dameAlerta(idioma, 14));
			elem.focus();
		}
	}
    setTimeout('initSlide();', 1);
</SCRIPT>
</BODY>
</HTML>