$(document).ready(function(){

	//Controle do clique do menu cartoes
	var clicado = 0;
	
	
	$("a[href*='http://']").click(function(){
		//$(this).attr("target", "_blank");
	});
	
	var heightContent = $(window).height() - $("#top").height() - $("#footer").height() - 10;
	if($(window).height() > $("#main").height()){
		$("#content").css({
			'min-height': heightContent + 'px'
		});
	}
	
	$("#nav-3 > li:last-child a").click(function(e){
		e.isDefaultPrevented ();
		$(this).parent().parent().addClass("Active");
		$(this).parent().next().fadeIn('slow');
		clicado = 1;
    });
	
	$("#nav-3 a.Close").click(function(e){
		e.isDefaultPrevented ();
		$("#nav-3 > li:last-child").removeClass("Active");
		$(this).parent().toggle();
		clicado = 0;
    });
	
	$("#nav-3 > li:last-child h3 a").mouseover(function(){
		if(!$(this).parent().parent().hasClass('Active')) {
			$(this).parent().parent().addClass("Active");
			$(this).parent().next().fadeIn('slow');
		}
		
		
	});
	
	$("#nav-3 > li:last-child h3 a").mouseout(function(){
		if(($(this).parent().parent().hasClass('Active'))&&(clicado != 1)) {
			$(this).parent().parent().removeClass("Active");
			$(this).parent().next().fadeOut('slow');
		}
		
	});
	
	$("#nav-2 > li: a").mouseover(function(e){
		if($("#nav-2 > li: a").hasClass("Active"))
		   $("#nav-2 > li: a").removeClass("Active");
		   $(this).addClass("Active");
	});
	
	$("#nav-3 .Box img").mouseover(function(){
		$(this).attr('width', 70);
		$(this).attr('height', 44);
	});
	
	$("#nav-3 .Box img").mouseout(function(){
		$(this).attr('width', 64);
		$(this).attr('height', 40);
	});

});
