/*
Theme Name: Mundo por Terra
Theme URI: http://site.mundoporterra.com.br
Nome do arquivo: script.js
Caminho do arquivo: /wp-content/themes/mundo_por_terra/js/

Descrição:
Este é o JS que contém os scripts do site inseridos manualmente (sem plugin).
Foi escrito com jQuery.

*/

jQuery(document).ready(function(){
	
	/* Aplicar fonte HelveticaNeue em Cabeçalhos h2 e títulos com classe .entry-title ----------------- */
	Cufon.replace('h2, h3, .entry-title', {'font-family' : 'HelveticaNeue'});
	
	
	
	/* Slideshow - Sempre mostrar botões anterior e próximo ----------------- */
	jQuery('#meteor-slideshow').find('.meteor-nav').show();

	
	
	/* Tirar borda de baixo da última notícia da home ----------------- */
	jQuery('.noticia:last-child').css('border-bottom', '0');
	
	
	
	/* Hover imagem da home ----------------- */
	jQuery('.noticia-imagem').find('a').hover(function(){
		jQuery(this).stop().animate({'opacity' : '0.6'}, 200);
	}, function(){
		jQuery(this).stop().animate({'opacity' : '1'}, 200);
	});
	
	
	
	/* Zebrar comentarios ----------------- */
	jQuery('.comment-list').find('li:nth-child(2n+1)').css('background', '#f4f4f4');

	
	
	/* Twitter da sidebar ----------------- */
	
	// Mostra tweets usando o plugin twitter-1.13.1.min.js
	getTwitters(
		'wrapper-twitter',
		{
		id: 'mundoporterra',
		count: 3,
		enableLinks: true,
		ignoreReplies: true,
		clearContents: true,
		newwindow: true,
		lang: 'pt-br',
		template: '%text%'
		}
	);	
	
	/* Hover dos botões de redes sociais da sidebar usando plugin jquery.bgpos.js ----------------- */
	// Atribui os botões à variáveis
	rs_youtube = jQuery('.wrapper-redes_sociais').find('.rs_youtube a');
	rs_flickr = jQuery('.wrapper-redes_sociais').find('.rs_flickr a');
	rs_twitter = jQuery('.wrapper-redes_sociais').find('.rs_twitter a');
	rs_orkut = jQuery('.wrapper-redes_sociais').find('.rs_orkut a');
	
	// Começa a brincadeira ;) - Posição Inicial das Imagens
	rs_youtube.css('background-position', '0 -52px');
	rs_flickr.css('background-position', '-55px -52px');
	rs_twitter.css('background-position', '-110px -52px');
	rs_orkut.css('background-position', '-166px -52px');
	
	// Efeito hover
	rs_youtube.hover(function(){
		jQuery(this).stop().animate({'background-position' : '(0 -1px)'}, 200);
	}, function(){
		jQuery(this).stop().animate({'background-position' : '(0 -52px)'}, 200);
	});
	
	rs_flickr.hover(function(){
		jQuery(this).stop().animate({'background-position' : '(-55px -1px)'}, 200);
	}, function(){
		jQuery(this).stop().animate({'background-position' : '(-55px -52px)'}, 200);
	});
	
	rs_twitter.hover(function(){
		jQuery(this).stop().animate({'background-position' : '(-110px -1px)'}, 200);
	}, function(){
		jQuery(this).stop().animate({'background-position' : '(-110px -52px)'}, 200);
	});
	
	rs_orkut.hover(function(){
		jQuery(this).stop().animate({'background-position' : '(-166px -1px)'}, 200);
	}, function(){
		jQuery(this).stop().animate({'background-position' : '(-166px -52px)'}, 200);
	});
	
	
});
