var active_tab = null;
var curr_tab = null;

/* jQuery(function() {
	$("#contact_form").validate({
		errorPlacement: function(error, element) { return false; },
		submitHandler: function() {
			$('#contact_form :submit').attr('disabled', 'disabled');
			$('#contact_form .buttons').append('<span>Aguarde, enviando...</span>');
			$.post('/contact/deliver', $("#contact_form").serialize(), function(response) {
                                $('#contact_form').append("<p class=\"message\" style=\"display: none;\">Agradecemos o interesse.<br />Em breve responderemos a sua mensagem.</p>")
				$('#contact_form div.fields').slideUp();
				$('#contact_form p.message').slideDown();
			})
		}
	});

	$('#contrast .menu a').click(function() {
		if (!$(this).hasClass('active')) {
			curr_tab = this;
			$('#contrast .menu a').removeClass('active')
			$(curr_tab).addClass('active');
			if (active_tab) {
				$('.widget-holder').animate({opacity: 0.001}, 400);
				$('.content-'+active_tab).animate({opacity: 0.001}, 400);
				$('#widget-'+active_tab).animate({opacity: 0.001}, 400, 'linear', fadeTabIn);
				$('#widget-'+active_tab).css({zIndex: 0});
				
				$('.title').css({zIndex: 999, top: $('.title').css('top') });
			} else {
				fadeTabIn(true);
			}
		}
		return false;
	});
	// $('#contrast .context-widget, #contrast .context-content').animate({opacity: 0.001}, 5);
	// $('#contrast .menu a:first').click();
});

function fadeTabIn() {
	if (!arguments[0]) {
		$('.title').css({top: '+4px'});
	}
	active_tab = $(curr_tab).attr('id');
	$('.widget-holder').animate({opacity: 1}, 400);
	$('.content-'+active_tab).animate({opacity: 1}, 400);
	$('#widget-'+active_tab).animate({opacity: 1}, 400);
	$('#widget-'+active_tab).css({zIndex: 100});
}
*/
