/****************************************
*	FANCYBOX - ADD SITES
*	Lightbox Plugin
*	http://fancybox.net/
****************************************/

/****************************************
*	EqualHeight
***************************************

function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}

$(document).ready(function() {
	equalHeight($(".menu-box"));
});
*/

/*
$(document).ready(function() {
    $("#twitter2").getTwitter({
        userName: "ids_brasil",
        numTweets: 3,
        loaderText: "Carregando tweets...",
        slideIn: true,
        showHeading: true,
        headingText: "",
        showProfileLink: true
    });
});
*/

/****************************************
*	Abrir página externa
****************************************/

$(document).ready(function() {
	$('a[rel="external"]').click(function() {
		window.open($(this).attr('href'));
		return false;
	});
});

/****************************************
*	Twitter
****************************************/

$(document).ready(function() {
	$('#twitter').twitterSearch({
		term: 'from%3AIDS_Brasil',
		title: '',
		titleLink: '',
		bird: false,					// true or false (show or hide twitter bird image)
		birdSrc: '', 		// twitter bird image
		birdLink: '',		// url that twitter bird image should like to
		avatar: false,				// true or false (show or hide twitter profile images)
		anchors: true,			// true or false (enable embedded links in tweets)
		animOutSpeed: 500,	// speed of animation for top tweet when removed
		animInSpeed: 500,	// speed of scroll animation for moving tweets up
		pause: true,				// true or false (pause on hover)
		time: false,					// true or false (show or hide the time that the tweet was sent)
		timeout: 4000,			// delay betweet tweet scroll
		css: { 
			a:     { textDecoration: 'none', color: '#ec0011', fontWeight: 'bold'},
			container: { background: 'none' },
			frame: { border: '0px solid transparent', borderRadius: '0px', '-moz-border-radius': '0px', '-webkit-border-radius': '0px' },
			img:   { width: '0px', height: '0px' },
			loading: { color: '#888888' },
			text:  {fontWeight: 'normal', fontSize: '14px', fontFamily: 'Helvetica', color:'#000000'},
			time:  { fontSize: '10px', color: '#cccccc' },
			title: { backgroundColor: 'transparent', padding: '0px 0 0px 0', textAlign: 'center', fontWeight: 'bold', fontSize: '14px'},
			titleLink: { textDecoration: 'none', color: 'transparent' },
			user:  { fontSize: '14px', fontFamily: 'Helvetica', marginRight: '5px'},
			fail:  { background: '#6cc5c3 url(/images/failwhale.png) no-repeat 50% 50%'}
		}
	});
});


/* =FACEBOOK */
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

/* =VALIDATE */
$(document).ready(function() {
	var container = $('div.container');
	// validate the form when it is submitted
	var validator = $("#contact-form").validate({
		errorContainer: container,
		errorLabelContainer: $("ol", container),
		wrapper: 'li',
		meta: "validate"
	});
	
	$(".cancel").click(function() {
		validator.resetForm();
	});
});

$(document).ready(function() {
	$(".telefone").mask("99-9999-9999");
	$(".celular").mask("99-9999-9999");
});



