function load(){
	var obj = WF_getElement('radioFilter');
	if (obj[0].status == true){
		changeSize(obj[0], false);
	}else if (obj[1].status == true){
		changeSize(obj[1], false);
	}else if (obj[2].status == true){
		changeSize(obj[2], false);
	}else if (obj[3].status == true){
		changeSize(obj[3], false);
	}
	WF_setFocus(WF_getElement('filtro0'));
}

function changeSize(obj, clear){
	var size, max;
	switch(obj.value){
		case "I":
			size = 4;
			max = 4;
			break;
		case "N":
			size = 20;
			max = 30;
			break;
		case "C":
			size = 20;
			max = 20;
			break;
		case "U":
			size = 2;
			max = 2;
	}
	for (i = 0; i < 10; i++){
		if (clear) WF_getElement('filtro' + i).value = "";	
		WF_getElement('filtro' + i).size = size;
		WF_getElement('filtro' + i).maxLength = max;
	}
}

function submit(){
	var nenhumCampoPreenchido = true;
	
	for(i = 0; i < 10; i++){
		if (trim(WF_getElement('filtro' + i).value) != ""){
			nenhumCampoPreenchido = false;
			break;
		}
	}
	
	if (nenhumCampoPreenchido){
		alert('Por favor, preencha um campo pelo menos para efetuar a consulta.');
		return;
	}
	
	document.suplementosAIPForm.submit();
}

function submitToResult(indicador){
    WF_getElement('localidadeId').value = indicador;
	document.suplementosAIPForm.submit();
}

