<%@ include file="/project/include.jsp" %>

<script type="text/javascript">
	var tipiIntInsStruttura = '';
	/**  */
	function onChangeEnteErogatore(combo) {
		var idEnte = getComboValueById('selEnteErogatore');
		var params = 'idEnteErogatore=' + idEnte;

		var idTipoIntervento = getComboValueById('selectTipoIntervento');
		
		loadStandardSelectOptionsAndFill('selectTipoIntervento', 
				'it.cedaf.icare.interventi.control.binding.requestbean.valuesetproviders.TipoInterventoCaricamentoAccessiBuoniValueSetProvider(idEnteErogatore)', 
				params, ' ',idTipoIntervento);
	}
	function onChangeTipoIntervento() {
		var idTipoIntervento = getComboValueById('selectTipoIntervento');
		var idEnte = getComboValueById('selEnteErogatore');
		var params = 'idEnteErogatore=' + idEnte + '&idTipoIntervento=' + idTipoIntervento;
		showHideStruttura();
		loadStandardSelectOptionsAndFill('selectStruttura', 'it.cedaf.icare.interventi.control.binding.requestbean.valuesetproviders.StrutturaCaricamentoAccessiBuoniValueSetProvider(idEnteErogatore,idTipoIntervento)', params, '');
	}

	function showHideStruttura() {
		var idTipoIntervento = getComboValueById('selectTipoIntervento');
		if (tipiIntInsStruttura == '') {
			document.getElementById('trStruttura').style.display='';
		} else {
			var tipiIntIS = tipiIntInsStruttura.split(',');
			for (var i = 0; i < tipiIntIS.length; i++) {
				if (tipiIntIS[i] == idTipoIntervento) {
					document.getElementById('trStruttura').style.display='';
					return;
				}
			}
			document.getElementById('trStruttura').style.display='none';
		}
		
	}

	if(window.attachEvent) {
	    window.attachEvent('onload', showHideStruttura);
	} else {
	    if(window.onload) {
	        var curronload = window.onload;
	        var newonload = function() {
	            curronload();
	            showHideStruttura();
	        };
	        window.onload = newonload;
	    } else {
	        window.onload = showHideStruttura;
	    }
	}
</script>

<shell:fieldset title="${j:bundle('LBL_estrazioni_parmsel_SET')}">
<table border="0" cellspacing="3" cellpadding="0">
	<icare:estrazioniExistsParam name="periodoRiferimentoDa">
	<tr>
		<td class="form-label">
			<shell:label prop="periodoRiferimentoDa" />
		</td>
		<td class="form-values">
			${j:bundle('LBL_ricercaDa')}
			<j:bind prop="periodoRiferimentoDa">
				<j:text class="form-date" id="periodoRiferimentoDa_cld" />
				<shell:calendar inputId="periodoRiferimentoDa_cld" />
				<shell:error />
			</j:bind>	
		</td>
		<td class="form-values">
			a:
			<j:bind prop="periodoRiferimentoA">
				<j:text class="form-date" id="periodoRiferimentoA_cld" />
				<shell:calendar inputId="periodoRiferimentoA_cld" />
				<shell:error />
			</j:bind>	
		</td>
	</tr>
	</icare:estrazioniExistsParam>
	<icare:estrazioniExistsParam name="dataEmissioneBuonoDa">
	<tr>
		<td class="form-label">
			<shell:label prop="dataEmissioneBuonoDa" />
		</td>
		<td class="form-values">
			${j:bundle('LBL_ricercaDa')}
			<j:bind prop="dataEmissioneBuonoDa">
				<j:text class="form-date" id="dataEmissioneBuonoDa_cld" />
				<shell:calendar inputId="dataEmissioneBuonoDa_cld" />
				<shell:error />
			</j:bind>	
		</td>
		<td class="form-values">
			a:
			<j:bind prop="dataEmissioneBuonoA">
				<j:text class="form-date" id="dataEmissioneBuonoA_cld" />
				<shell:calendar inputId="dataEmissioneBuonoA_cld" />
				<shell:error />
			</j:bind>	
		</td>
	</tr>
	</icare:estrazioniExistsParam>		
	<icare:estrazioniExistsParam name="dataAttivazioneBuonoDa">
	<tr>
		<td class="form-label">
			<shell:label prop="dataAttivazioneBuonoDa" />
		</td>
		<td class="form-values">
			${j:bundle('LBL_ricercaDa')}
			<j:bind prop="dataAttivazioneBuonoDa">
				<j:text class="form-date" id="dataAttivazioneBuonoDa_cld" />
				<shell:calendar inputId="dataAttivazioneBuonoDa_cld" />
				<shell:error />
			</j:bind>	
		</td>
		<td class="form-values">
			a:
			<j:bind prop="dataAttivazioneBuonoA">
				<j:text class="form-date" id="dataAttivazioneA_cld" />
				<shell:calendar inputId="dataAttivazioneA_cld" />
				<shell:error />
			</j:bind>	
		</td>
	</tr>
	</icare:estrazioniExistsParam>	
	<icare:estrazioniExistsParam name="enteErogatoreBuono">
	<tr>
		<td class="form-label">
			<shell:label prop="enteErogatoreBuono" />
		</td>
		<td class="form-values" colspan="2">
			<j:bind prop="enteErogatoreBuono">
				<j:select class="form-input" id="selEnteErogatore" emptyOptionDescr=" - Tutti - " onchange="onChangeEnteErogatore();" selectIfUnique="true"/>
				<shell:error />
			</j:bind>	
		</td>		
	</tr>
	</icare:estrazioniExistsParam>		
	<icare:estrazioniExistsParam name="tipoIntervento">
 		<tr>
			<td class="form-label">
				<shell:label prop="tipoIntervento" />
			</td>
			<td class="form-values" colspan="2">
				<j:bind prop="tipoIntervento">
					<j:select id="selectTipoIntervento" class="form-input" emptyOptionDescr="" onchange="onChangeTipoIntervento();"/>
					<shell:error />
				</j:bind>	
			</td>
 		</tr> 
 	</icare:estrazioniExistsParam>
 	<icare:estrazioniExistsParam name="struttura">		 		
 		<tr id="trStruttura" style="display:none">
			<td class="form-label">
				<shell:label prop="struttura" />
			</td>
			<td class="form-values" colspan="2">
				<j:bind prop="struttura">
					<j:select id="selectStruttura" class="form-input" emptyOptionDescr="" />
					<shell:error />
				</j:bind>	
			</td>
 		</tr>
 	</icare:estrazioniExistsParam>
	<icare:estrazioniExistsParam name="uoAbilitato">
	<tr>
		<td class="form-label">
			<shell:label prop="uoAbilitato" />
		</td>
		<td class="form-values" colspan="2">
			<j:bind prop="uoAbilitato">
				<j:select class="form-input" emptyOptionDescr=""  />
				<shell:error />
			</j:bind>	
		</td>
	</tr>
	</icare:estrazioniExistsParam>
		
	<icare:estrazioniExistsParam name="operatoreAbilitato">
	<tr>
		<td class="form-label">
			<shell:label prop="operatoreAbilitato" />
		</td>
		<td class="form-values" colspan="2">
			<j:bind prop="operatoreAbilitato">
				<j:select class="form-input" emptyOptionDescr=""  />
				<shell:error />
			</j:bind>	
		</td>
	</tr>	
	</icare:estrazioniExistsParam>
		
	<icare:estrazioniExistsParam name="uoRiferimento">
	<tr>
		<td class="form-label">
			<shell:label prop="uoRiferimento" />
		</td>
		<td class="form-values" colspan="2">
			<j:bind prop="uoRiferimento">
				<j:select class="form-input" emptyOptionDescr=""  />
				<shell:error />
			</j:bind>	
		</td>
	</tr>
	</icare:estrazioniExistsParam>
		
	<icare:estrazioniExistsParam name="operatoreRiferimento">
	<tr>
		<td class="form-label">
			<shell:label prop="operatoreRiferimento" />
		</td>
		<td class="form-values" colspan="2">
			<j:bind prop="operatoreRiferimento">
				<j:select class="form-input" emptyOptionDescr=""  />
				<shell:error />
			</j:bind>	
		</td>
	</tr>
	</icare:estrazioniExistsParam>	
	
	<icare:estrazioniExistsParam name="statoIntervento">
	<tr>
		<td class="form-label">
			<shell:label prop="statoIntervento" />
		</td>
		<td class="form-values">
			<j:bind prop="statoIntervento">
				<j:select class="form-input" emptyOptionDescr=""  />
				<shell:error />
			</j:bind>	
		</td>
	</tr>				
	</icare:estrazioniExistsParam>
</table>
</shell:fieldset>