/*
 *	@titre: projet detail.
 *	@description: javascript affichage detail projet - dream on.
 *	@auteur: neov - http://www.neov.net.
 *	@creation: 20091109.
 *	@modification: -
 *	@required: jQuery 1.3.2
 *
 */
$(
	function ()
	{
		// initialisation.
		$('.projet-description').hide();
		
		// action sur les blocs projets.
		$('.projet').each(
			function()
			{
				$(this).css({height: 185, overflow: 'hidden'});
				var zthis = this;
				
				// rollover sur les images.
				$('.thumb > a', this).hover(
					function()
					{
						if(!ie6) {
							$(this).find('strong').css({opacity: 0});
							$(this).find('strong').stop(false, true).animate({opacity: 1}, {queue:false, duration:gtime, easing:"sineEaseOut"});
						}
						
						$(this).find('> img').stop(false, true).animate({opacity: 0.3}, {queue:false, duration:gtime, easing:"sineEaseOut"});
					},
					function()
					{
						$(this).find('> img').stop(false, true).animate({opacity: 1}, {queue:false, duration:gtime, easing:"sineEaseOut"});
					}
				);
				
				// voir informations.
				$('.titre > a.info', this).bind(
					'mouseover',
					function()
					{
						var $link = $(this);
						if(!$link.hasClass('running')) {
							
							$link.addClass('running');
							
							if($(this).hasClass('fermer')) {
								$('.link-titre2', zthis).hide();
								$('.link-titre', zthis).show();
								$('.st2', zthis).hide();
								$('.st', zthis).show();
								$('.ec', zthis).show();
								
								$('.thumb', zthis).stop().slideDown({queue:true, duration:500, easing:"sineEaseOut"});
								
								$('.thumb', zthis).queue(
									function()
									{
										$link.removeClass('fermer');
										$link.removeClass('running');
										$(this).dequeue();
									}
								);
							} else {
								$('.link-titre', zthis).hide();
								$('.link-titre2', zthis).show();
								$('.st', zthis).hide();
								$('.st2', zthis).show();
								$('.ec', zthis).hide();
								
								$('.thumb', zthis).stop().slideUp({queue:true, duration:500, easing:"sineEaseOut"});
								$('.projet-description', zthis).show();
								$('.projet-description', zthis).css({opacity: 0});
								$('.projet-description', zthis).animate({opacity: 1},{queue:true, duration:500, easing:"sineEaseOut"});
								
								$('.thumb', zthis).queue(
									function()
									{
										$link.addClass('fermer');
										$link.removeClass('running');
										$(this).dequeue();
									}
								);
							}
						}
					}
				);
			}
		);
	}
);
