var time = 0;
$(document).ready(function(){

	//typo
	Cufon.replace('.article-full h3', {fontFamily: 'helvetica' });
	Cufon.replace('.helvetica', {fontFamily: 'helvetica' });
	Cufon.replace('.main-menu a', {fontFamily: 'helvetica' });

	$(".main-menu li a").click(function(){
		if($(this).parent().has('ul').length > 0)
			return false;
	});
		
																  

	$(".main-menu li").hover(function(){
		$("a", $(this)).addClass('hover');
		$(this).find("ul:first").stop(true, true).slideDown("fast");
		//if(!$(this).has('ul'))
			$("span.background-hover:first", $(this)).stop().fadeTo('fast', 1);
		},
	function(){
		$("a", $(this)).removeClass('hover');
		$(this).find("ul:first").stop(true, true).slideUp("fast");
		//if(!$(this).has('ul'))
			$("span.background-hover:first", $(this)).stop().fadeTo('fast', 0);
	});
	
	// Rollover sur les articles de la homepage
	$(".articles").hover(function(){
		$(this).find('p').stop().fadeTo(400, 0);
		$(this).find('img').stop().fadeTo(400, 1);
		$(this).find('.link').stop().fadeTo(400, 1);
		},
	function(){
		$(this).find('p').stop().fadeTo(400, 1);
		$(this).find('img').not('.link img').stop().fadeTo(400, 0);
		$(this).find('.link').stop().fadeTo(400, 0.5);
	});

	$('.articles').click(function() {
		var destination = $(this).find('.link').attr('href');
  		window.location = destination;
	});
	
	// Rollover sur les vignettes des réseaux sociaux (Facebook, RSS, Vimeo)
	$("#link a span").hover(function(){
		// $(this).stop().fadeTo(100, 0.7);
		$(this).stop().animate({backgroundPositionX:0,backgroundPositionY:0});
		},
	function(){
		$(this).stop().animate({backgroundPositionX:0,backgroundPositionY:-26});
	});
	
	
	$(function() {
	// Use this example, or...
	$('.ngg-gallery-thumbnail a').lightBox({
	imageLoading: 'http://www.agence-dragonne.com/prod/wp-content/themes/Dragonne/images/lightbox-btn-loading.gif',
	imageBtnClose: 'http://www.agence-dragonne.com/prod/wp-content/themes/Dragonne/images/lightbox-btn-close.gif',
	imageBtnPrev: 'http://www.agence-dragonne.com/prod/wp-content/themes/Dragonne/images/lightbox-btn-prev.gif',
	imageBtnNext: 'http://www.agence-dragonne.com/prod/wp-content/themes/Dragonne/images/lightbox-btn-next.gif'									   
	}); // Select all links that contains lightbox in the attribute rel
});
	
});
function hideMenu(parent) {
	$('.children', parent).slideUp("fast");
}
