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);
	}
	WF_setFocus(WF_getElement('filtro0'));
}

function changeSize(obj, clear){

	var size, max;
	switch(obj.value){
		case "A":
			size = 8;
			max = 8;
			break;
		case "D":
			size = 20;
			max = 30;
	}
	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(){
	if (!(WF_getElement('radioFilter')[0].checked) && !(WF_getElement('radioFilter')[1].checked)){
		alert('Por favor, selecione uma opção de pesquisa.');
		return;
	}

	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.abreviaturasForm.submit();
}

