AddInicioPagina(function() {
	$("#listafotosemp li a").click(function () { //Ao clicar numa foto da lista...
	    var label = $("#fotoatual span");
	    with ($("#fotoatual img")) {
	        load(function() {
		        $(this).fadeIn();//Fadein ao carregar a imagem
	        });
		    hide();//Ocultar a imagem (antes de carregar)
		    label.hide();//Ocultar o label (antes de carregar)
	        attr({src: $(this).find("img")[0].src.replace("tamanho=64", "tamanho=350"), alt: this.title});//Carregar a imagem (em tamanho maior)
	        label.text(this.title);//Muda o texto do label
	        label.fadeIn();//Fade in do label
	    }
	    return false;
	});
	$("#listafotosemp li a img, div.logoemp img, #fotoatual img").each(function () {//Carregando as fotos e o logo do empreendimento
	    with($(this)) {
	        error(function() {//Caso a imagem não carregue
	            $(this).hide();//Oculta a imagem
	            if (this.parentNode.tagName.toLowerCase() === "a") {//Se a imagem for da lista de miniaturas
	                this.parentNode.parentNode.style.display = "none";//Oculta o item 'li' pai
	            }
	            if ($("#listafotosemp img:visible, #fotoatual img:visible").length == 0)//Se não houver mais fotos
	                $("#LinkFotosEmp, #ctl00_CPHConteudo_QuadroFotos").slideUp();//Oculta o quadro e link das fotos
	        });
	        attr("src", this.src);//Atualizar
	    }
	});
	if (($("#ctl00_CPHConteudo_LabelDescricao").text().trim().length == 0) && ($("#ctl00_CPHConteudo_LinkEstatutoSocial").length + $("#ctl00_CPHConteudo_LinkRegulamentoInterno").length == 0))//Se não houver 'Informações' 'EstatutoSocial' ou 'Regulamento'
	    $("#ctl00_CPHConteudo_QuadroInformacoes").slideUp();//Oculta o quadro de 'Informações'
	$("#LinkFotosEmp").click(function(){$("#ctl00_CPHConteudo_QuadroFotos").fadeOut(function(){$("#ctl00_CPHConteudo_QuadroFotos").fadeIn()[0].scrollIntoView();});});
	$("#LinkPrint").click(function(){
	    pageTracker._trackEvent("Empreendimentos", "Imprimir", $("#ctl00_CPHConteudo_LabelNome").text());
	    print();
	}).show(); //Exibe o link de impressão
	$("#ctl00_CPHConteudo_LinkEtapas").click(function(){$("#ctl00_CPHConteudo_QuadroEtapas").fadeOut(function(){$("#ctl00_CPHConteudo_QuadroEtapas").fadeIn()[0].scrollIntoView();});});

    //Efeitos barras etapas:
    setTimeout(function(){
        $("#ctl00_CPHConteudo_QuadroEtapas").click(function(){
            $("#dlEtapas dd").each(function(){
                if (typeof($(this).data("w")) === "undefined")
                    $(this).data("w", $(this).css("width"));
                $(this).stop().animate({width: "0px", opacity: 0}, 500);
                $(this).animate({width: $(this).data("w"), opacity: 1}, parseInt($(this).data("w")) / 300 * 1000);
            });
        }).click();
    });
});