// JavaScript Document
 
$(document).ready(function() {	
 
	$('a[name=modal]').click(function(e) {
		e.preventDefault();
		
		var id = $(this).attr('href');
	
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		$('#mask').css({'width':maskWidth,'height':maskHeight});
 
		$('#mask').fadeIn(1000);	
		$('#mask').fadeTo("slow",0.8);	
	
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
              
		$(id).css('top',  winH/2-$(id).height()/3);
		$(id).css('left', winW/2-$(id).width()/2);
	
		$(id).fadeIn(2000); 
	
	});
	
	$('.window .close').click(function (e) {
		e.preventDefault();
		
		$('#mask').hide();
		$('.window').hide();
	});		
	
	$('#mask').click(function () {
		$(this).hide();
		$('.window').hide();
	});	
	

	
});


$(function() {
		$("#tabs").tabs();
	});
	

/** PAGINAÇÃO CORPO VIGENTE **/

	$(document).ready(function(){
		$(".corpo_vigente").hide();
		$(".primeiros").show()
		$(".h2Departamentos").hide();
		
		$("#nav-vigente li a").click(function(){
			var id = $(this).attr('href');
			$(".corpo_vigente").hide();
			
			var pegaId = id.replace('#', '.');
			$(pegaId).fadeIn("slow");
			
			if (pegaId == (".quartos")) {
				
				$(".departamentos22").show();
			}
			
			else {
				$(".departamentos22").hide();
			}
			
			if (pegaId == (".dozemos")){
				$(".departamentos23").show();
			}
			
			else {
				$(".departamentos23").hide();
			}
			
		});		
	});


//TABS MEMORIAS
$(function(){
	$(".aba:first").show();
	$("#nav-abas a").click(function(){
		$(".aba").hide();
		
		var div = $(this).attr('href');
		$(div).fadeIn("");
		$("#nav-abas a").removeClass('current');
		$(this).addClass('current');
		return false;
	});
});

	


