function refinar(id){
	if(document.getElementById(id + '_r').style.visibility=='visible'){
		document.getElementById(id + '_r').style.visibility='hidden';
		SetAllCheckBoxes('cercador', id + '_c', 'false' );
		tancar(id);
		}else{
	document.getElementById(id + '_r').style.visibility='visible';	
	}	
}

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++)
		//com ue no cambiava li he posat directament el valor false en comptesde CheckValue
			objCheckBoxes[i].checked = false;
}

