// JavaScript Document

// Filter out all rows that don't have a path that begins
// with the letter 'n'.
/*
function myFilterFuncModelNacional(dataSet, row, rowNumber)
{
	if (row["@internacional"].search(/^n/) != -1)
		return row; // Return the row to keep it in the data set.
	return null; // Return null to remove the row from the data set.
}
function myFilterFuncModelInternacional(dataSet, row, rowNumber)
{
	if (row["@internacional"].search(/^y/) != -1)
		return row; // Return the row to keep it in the data set.
	return null; // Return null to remove the row from the data set.
}
//Activa os filtros de escolha entre modelos nacionais e internacionais
function ModelNacional()
{ 
dsGallery.filter(null);
dsGallery.filter(myFilterFuncModelNacional); // Filter the rows in the data set.
}
function ModelInternacional()
{
dsGallery.filter(null);
dsGallery.filter(myFilterFuncModelInternacional); // Filter the rows in the data set.
}
*/

function fnacional(ds, row, index){ var c = row.@internacional.charAt(0); return c >= 'n' && c <= 'n' ? null : row;};
function finternacional(ds, row, index){ var c = row.@internacional.charAt(0); return c >= 'y' && c <= 'y' ? null : row;};
function fmulher(ds, row, index){ var c = row.@sexo.charAt(0); return c >= 'f' && c <= 'f' ? null : row;};
function fhomem(ds, row, index){ var c = row.@sexo.charAt(0); return c >= 'm' && c <= 'm' ? null : row;};

function ToggleFilter(enable, f)
{
	if (enable)
		dsGallery.addFilter(f, true);
	else
		dsGallery.removeFilter(f, true);
}

function RemoveAllFilters()
{	
	document.forms[0]["nacional"].checked = false;
	document.forms[0]["internacional"].checked = false;
	document.forms[0]["homens"].checked = false;
	document.forms[0]["mulheres"].checked = false;

	dsGallery.removeAllFilters(true);

}
