$(document).ready(function(){$('nav a').hoverIntent(function(){$(this).animate({'top':'-18px'},200);},function(){$(this).animate({'top':'-36px'},200,function(){$(this).css('top',0);});});

if($('#weenidSlide').length>0){if($(window).width()>1024){$('#weenidSlide').after('<a href="" id="prev" title="Previous Feature">Previous</a><a href="" id="next" title="Next Feature">Next</a>');} $('#weenidSlide').after('<div id="weenidSlide-nav"></div>').cycle({fx:'scrollHorz',speed:2000,timeout:8000,easing:'easeInOutQuint',prev:'#prev',next:'#next',pager:'#weenidSlide-nav',manualTrump:false});}

$('.home .column img').after('<span class="image" style="display: none;"></span>');$('.home .column a, #ideas-insights .column a, #posts .column a').not('.more').hoverIntent(function(){$(this).parents('.column').find('.image').fadeIn();},function(){$(this).parents('.column').find('.image').fadeOut();});

	/* Transparence Effect */
	var myTable = [".weenidEffect"];
	var nbBloc = myTable.length;
				
	for (i = 0; i < nbBloc; i++) {
		$(myTable[i]).hover(function(){
			$(this).stop().animate({
				'opacity': 0.7
			}, 200)
		}, function(){
			$(this).stop().animate({
				'opacity': 1
			}, 200)
		})
	}
	/* Protect email */
	$('.nospam').each(function(){
		 var email = $(this).html();
		 email = email.replace("[arobase]","@");
		 email = email.replace("[point]",".");
		 $(this).html("<a href=\"mailto:"+email+"\">"+email+"</a>");
	});	
	/* backtotop */
	$('a.top').click(function(){
		 $('html, body').animate({scrollTop: '0px'}, 1); /* Mettre 300 à la place de 1 pour voir l'animation */
		 return false;
	});
	
	/* ** IMAGES PRELOADER ** */
	$(function () {
		$('.preview img').hide();
	});
	
});

$(window).bind("load", function() {
	var int = setInterval("doThis(i)",200);
});	
var i = 0;
var int=0;
function doThis() {
	var images = $('.preview img').length;
	if (i >= images) {
		clearInterval(int);
	}
	$('.preview img:hidden').eq(0).fadeIn(300);
	i++;
}
