function traduzir2(idioma){
     
    if(idioma == 'pt'){
        jQuery('body').show();
    }
    else{
        jQuery('body').translate(idioma,{
            start:     function(){  jQuery('body').hide() },
            complete:  function(){   jQuery('body').show(); initPaginationImagem(); },
            error:     function(){    jQuery('body').show()   }
        });
    }
}

function changeIdioma(idioma){
    
    var parametros = 'idioma='+idioma;

    jQuery.ajax({
        type : 'POST',
        url: '../administrador/modulo.outraslinguas/idioma.php',
        data: parametros,
        success: function(){
            window.location.reload();
        },
        error: function(){
            alert('Erro ao tentar processar a informação.');
        },
        complete: function(){
            //window.location.reload();
        }
    });
}
function traduzir(idioma){
    if(idioma == 'pt'){
        jQuery('body').show();
    }
    else{
        var arr = new Array(1);
        arr[0] = "Pousadas";
        var arr2 = jQuery.map(arr,function(val,i){
            return(val + i);
        });

        var teste = jQuery('body').html();
        for(k=0 ; k < arr.length ; k++){
            teste2 = str_replace(arr[k],arr2[k],teste);
            teste = teste2;
        }
		
        jQuery('body').html(teste);/**/
        //alert(jQuery('body').html());
        jQuery('body').translate(idioma,{
            start:     function(){  jQuery('body').hide() },
            complete:  function(){
                var teste = jQuery('body').html();
                for(k=0 ; k < arr.length ; k++){
                    //alert (arr2[k]);

                    // conversao da palavra Pousadas
                    if (idioma == "en"){
						alert(0)
                        teste2 = str_replace(arr2[k],'Inn',teste);
                    }else if (idioma == "fr"){
						alert(1)
                        teste2 = str_replace(arr2[k],'inn',teste);
                    }else if (idioma == "de"){
						alert(2)
                        teste2 = str_replace(arr2[k],'Gasthaus',teste);
                    }

                    teste = teste2;
                }
                jQuery('body').html(teste);
                jQuery('body').show();
                initPaginationImagem();                
            },
            error: function(){
				jQuery('body').show()
			}
        });
    }
}



