
$(document).ready(function() {
	var aberto9 = "#content-form1";
	function mostra9(este9) {
		if (aberto9 != este9){
			$(aberto9).slideUp('slow',function(){$(este9).slideDown("slow");});
			aberto9 = este9;
		}
	}
				   
	$(".a1").click(function (){
		mostra9("#content-form1");						 
	});
	
	$(".a2").click(function (){
		mostra9("#content-form2");						 
	});
	
	$(".a3").click(function (){
		mostra9("#content-form3");						 
	});
			   
	


				   
						   
	anchor.init()
	var aberto = ".noticias";
	function mostra(este) {
		$(aberto).slideDown("slow");
		$(este).slideUp("slow");
		aberto = este;
	}
		
	$(".empresa a").click(function () { 
    	mostra(".empresa");
	});
	$(".portfolio a").click(function () { 
    	mostra(".portfolio");
    });
	$(".noticias a").click(function () { 
    	mostra(".noticias");
    });
	$(".contactos a").click(function () { 
    	mostra(".contactos");
    });

$(".noticias").slideUp('slow');

	
	$(".obra-feita-bt1").click(function () { 
    	$(".portfolio-grey-box").fadeOut(function(){
			$(".portfolio-white-box").fadeIn();
		});
    });
	
	$("#portfolio-buttons-container a").click(function () { 
    	$(".portfolio-white-box").fadeOut(function(){
			$(".portfolio-grey-box").fadeIn();
		});
    });
	
	var abertoEmpresa = "#boxEmpresa1";
	function mostra2(esteempresa) {
		  $(abertoEmpresa).fadeOut('slow',function(){
				$(esteempresa).fadeIn("slow");
		  });
		abertoEmpresa = esteempresa;
	}
		
	$(".btEmpresa1").click(function () { 
    	mostra2("#boxEmpresa1");
	});
	$(".btEmpresa2").click(function () { 
    	mostra2("#boxEmpresa2");
    });
	$(".btEmpresa2_2").click(function () { 
    	mostra2("#boxEmpresa2_2");
    });
	$(".btEmpresa3").click(function () { 
    	mostra2("#boxEmpresa3");
    });
	$(".btEmpresa4").click(function () { 
    	mostra2("#boxEmpresa4");
    });
	
	// Noticias
	var noticia = "#newBox_1";
	$(".noticiaBT").click(function () { 
		estaNoticia = this.id.replace(/new_/g, "");
		esta = "#newBox_" + estaNoticia;
		if (noticia != esta )
		{
			$(noticia).fadeOut('slow',function(){$(esta).fadeIn("slow");});
			noticia = esta;
		}
	});
	
	$(".noticiaBT").hover(
	  function () {
		  	$(this).css({ color: "#006699"});
			$(this).animate({left: 7, opacity: 1}, { duration: 200, queue: false }); 
	  },
	  function () {
		  	$(this).css({ color: "#000"});
			$(this).animate({left: 0, opacity: 1}, { duration: 200, queue: false });
	  }
	);







	var ffffrupo = "#Agrupo_1";
	$(".todos > a").hover( function () {
			
		  	esteGrupo = this.id.replace(/g_/g, "");
			esta3 = "#Agrupo_" + esteGrupo;
			
		if (ffffrupo != esta3 )
		{
			$(ffffrupo).fadeOut(50,function(){$(esta3).fadeIn(200);});
			ffffrupo = esta3;
		}
	  });


		
});

anchor = {
	init : function()  {
		$("a.anchorLink").click(function () {	
			elementClick = $(this).attr("href")
			destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1200, "easeInOutCirc" );
		  	return false;
		})
	}
}

