<!-- // JavaScript Document - DataGrid
 
	// Gestione del Focus sulla riga del Grid
	function gridRowSelect(row) { row.style.background='yellow'; }

	// Gestione del onFocus sulla riga del Grid, considerando se la riga è dispari o pari
	function gridRowUnselect(row, vclass) { if (vclass=='rigaP') { row.style.background='#EEF5F7'; } else { row.style.background='#FFF'; } }	
	
	// Imposta e passa i valori per la ricerca e ordinamento della grid
	function filtra(oIndex, oOrd)
	{				
		oOrdine	= ''; cRicerca = ''; fRicerca = ''; tRicerca = ''; sPathFilter = '';
		
        if(oOrd=='') {
		oOrdine   	= document.getElementById('c_Ordina').value;
        } else { oOrdine = oOrd; }
        sDirezione  = document.getElementById('dz_Ordina');
		cRicerca 	= document.getElementById('c_Ricerca');
		fRicerca 	= document.getElementById('f_Ricerca');
		tRicerca 	= document.getElementById('t_Ricerca');
		
		if (oOrdine != '') { sPathFilter = "&order=" + oOrdine + "&dz=" + sDirezione.value; }
		if (cRicerca != null)
		{ 
			if ( tRicerca != null && tRicerca.value != '' ) { sPathFilter = sPathFilter + '&cfilter=' + cRicerca.value + '&tfilter=' + tRicerca.value + '&ffilter=' + fRicerca.value; }
		}
		
		window.open(oIndex + sPathFilter,'_parent')	
	}

	// Imposta e passa i valori per la ricerca atleti per ruolo
	function filtrar(oIndex)
	{		
		sPathFilter = "";
		if (document.getElementById("idruolo").value != '') { sPathFilter = "&rfilter=" + document.getElementById("idruolo").value; }
		window.open(oIndex + sPathFilter,'_parent')
	}

    // Imposta e passa i valori per la ricerca atleti per categoria
    function filtractg(oIndex)
    {        
        sPathFilter = "";
        if (document.getElementById("idcategoria").value != '') { sPathFilter = "&ctgfilter=" + document.getElementById("idcategoria").value; }
        window.open(oIndex + sPathFilter,'_parent')
    }
    	
	function resetfiltra(oIndex)
	{
		oOrdine   = document.getElementById('cOrdina');		oOrdine.value = '';
		c1Ricerca = document.getElementById('c1Ricerca');	c1Ricerca.value = '';
		f1Ricerca = document.getElementById('f1Ricerca');	f1Ricerca.value = '';
		t1Ricerca = document.getElementById('t1Ricerca');	t1Ricerca.value = '';
		window.open(oIndex,'_parent')
	}
	
	// De/Seleziona i check in grid
	function SetAllCheckBoxes(FormName, FieldName, CheckValue)
	{
		if(!document.forms[FormName])
			return;
		var objCheckBoxes = document.forms[FormName].elements[FieldName];
		if(!objCheckBoxes)
			return;
		var countCheckBoxes = objCheckBoxes.length;
		if(!countCheckBoxes)
			objCheckBoxes.checked = CheckValue;
		else
			// set the check value for all check boxes
			for(var i = 0; i < countCheckBoxes; i++)
				objCheckBoxes[i].checked = CheckValue;
	}

	// Cancella i record selezionati nella Grid
	function cdel(sez)
	{
		// Verifica se vi sono righe selezionate
		fName='selezione[]';
		bOK=0;
		var objCheckBoxes = document.cmsForm.elements[fName];
		var countCheckBoxes = objCheckBoxes.length;
		for(var i = 0; i < countCheckBoxes; i++)
			if(objCheckBoxes[i].checked==true) { bOK=1; }
		if (bOK==1)
		{
			myVar=confirm("ELIMINARE LE RIGHE SELEZIONATE ?\n\nFai clic su OK per confermare, altrimenti fai clic su Annulla");
			if(myVar=="0") { alert('Operazione annullata!'); } else 
			{ 
			myVar=confirm("CONFERMA DEFINITIVA PER ELIMINARE LE RIGHE SELEZIONATE ?\n\nFai clic su OK per confermare, altrimenti fai clic su Annulla");
			if(myVar!="0") { submitForm("index.php?sez="+sez+"&op=delg"); }
			}
		}
		else
		{
			alert("Non ci sono righe selezionate!");
		}
	}
	
	-->

