var celdas = new Array(2);
celdas[0] = '#f2f4f8';
celdas[1] = '#e0f0ff';

function docInicializar()
{
	/*
	txtFiltro.disabled=true;
	txtFiltro.value='Cargando Rubros...';
	filtrarTabla(tabContactos, "");
    txtFiltro.disabled=false;
    txtFiltro.value='';
	txtFiltro.focus();
	*/
	filtrarTabla(tabContactos, "");
}

function filtrarTabla(obj, filtro)
{
	if (filtro == '') {
    	filtro = '/0';
    }

	var ind, nrocol, count, fila, textoCelda, contador=0, desde, hasta;
	for(ind=0; ind < obj.rows.length; ind++) {
		fila = obj.rows(ind);
		textoCelda = fila.cells(0).innerHTML;
		desde=textoCelda.indexOf('id="');
		if (desde<0) {
			desde=textoCelda.indexOf(' id=');
			hasta=textoCelda.indexOf('>',desde+4);
		} else
			hasta=textoCelda.indexOf('"',desde+4);
		textoCelda=textoCelda.substr(desde+4,hasta-(desde+4));
		// muestra u oculta cada celda
		if (textoCelda.substr(0, filtro.length).toUpperCase() == filtro.toUpperCase()) {
			fila.style.display = '';
			contador++;
			// colores alternados para las filas
			for (nrocol=0; nrocol < fila.cells.length; nrocol++) {
				fila.cells(nrocol).style.backgroundColor = celdas[contador % 2];
			}
		} else {
			fila.style.display = 'none';
		}
	}
}

function getClick()
{
	var id = event.srcElement.parentElement.cells(0).innerText;
}
