/*
 *	@titre: home.
 *	@description: javascript homepage - dream on.
 *	@auteur: neov - http://www.neov.net.
 *	@creation: 20091126.
 *	@modification: -
 *	@required: jQuery 1.3.2
 *
 */

$(
	function()
	{
		if(!ie6) {
			$('.dreamers .thumb a').hover(
				function()
				{
					$(this).find('img')
						.animate({opacity: 0.7}, {queue: true, duration: gtime, easing: 'sineEaseOut'});
				},
				function()
				{
					$(this).find('img').stop().animate({opacity: 1}, {queue: true, duration: gtime, easing: 'sineEaseOut'});
				}
			);
			
			$('.news .thumb').hover(
				function()
				{
					$(this).find('img').animate({opacity: 0.6}, {queue: false, duration: 200, easing: 'sineEaseOut'});
				},
				function()
				{
					$(this).find('img').stop().animate({opacity: 1}, {queue: true, duration: 200, easing: 'sineEaseOut'});
				}
			);
			
			// t-a-vu
			doOnLoadVoirca() ;
		}
		
		$('.archive-news > p > a').click(
			function()
			{
				$('.archive-news .archive-inner-wrapper').slideToggle({queue: true, duration: 150, easing: 'sineEaseOut'});
				return false;
			}
		);

		$('.archive-news .archive-inner').jScrollPane(
			{
				showArrows:			false, 
				scrollbarWidth: 	19, 
				arrowSize: 			11, 
				scrollbarMargin:	5,
				dragWidth:			9
			}
		);
		
		$('.archive-news .archive-inner-wrapper').hide();
	}
);


function doOnLoadVoirca() {
	if(!ie6) {
		$('.t-a-vu .thumb a').hover(
			function()
			{
				$(this).find('img').animate({opacity: 0.7}, {queue: false, duration: gtime, easing: 'sineEaseOut'});
			},
			function()
			{
				$(this).find('img').stop().animate({opacity: 1}, {queue: true, duration: gtime, easing: 'sineEaseOut'});
			}
		);
		
		$('.t-a-vu .plus a')
			.hover(
				function()
				{
					$(this).addClass('active');
				},
				function()
				{
					$(this).removeClass('active');
				}
			)
			.click(
				function()
				{
					var src = j_basepath + 'ajax.php';
					$('.t-a-vu').load (src, {module:'commun', action:'communFo:getZone', zone:'voirca~voircaFo'}, function() {
						doOnLoadVoirca () ;
					}) ;
				}
			);
	}
}
