function recuperaElemento(elemento) {
    return document.getElementById(elemento);
}

function idioma(idioma) {
    if (idioma == 'pt') { /*portugues*/
        recuperaElemento('hfmFormulario:sbwRodape:hihIdioma').value = 'pt';
    } else if (idioma == 'en') { /*ingles*/
        recuperaElemento('hfmFormulario:sbwRodape:hihIdioma').value = 'en';
    } else if (idioma == 'es') { /*espanhol*/
        recuperaElemento('hfmFormulario:sbwRodape:hihIdioma').value = 'es';
    }
    recuperaElemento('hfmFormulario:sbwRodape:hcbIdioma').click();
}
