﻿/*
 * Require jQuery JavaScript Library v1.3.2+
 * http://jquery.com/
 *
 * Copyright © 2011 MBA Multimédia (www.mba-multimedia.com)
 * 
 *
 */

$(function(){
	if ($("#actualites").length) {
		$("#actualites .ctn").jHeadline ({intervalTime:5000});
	}
	
	$('#marques .ctn').css({height:0});
	$('#marques .ttr a').click(openCloseMarques);
	
	$('#visuels ul').animatedinnerfade({
								speed: 1000,
								timeout: 5000,
								containerheight: '320px',
								containerwidth: '640px',
								animationSpeed: 5000,
								animationtype: 'fade',
								bgFrame: 'none',
								controlBox: 'none',
								displayTitle: 'none'
							});
	$('#marques .bloc a').css({opacity:.3}).hover(btnHover,btnOut);

}); 

function openCloseMarques () {
	
	if ($('#marques .ctn').height() == 0) {
		$('#marques .ctn').stop().animate({height:600}, 300, scrollToMarques);
	} else {
		$('#marques .ctn').stop().animate({height:0}, 500);
	}
}

function scrollToMarques () {
	$('html').stop().scrollTo ($('#marques'), 500);
}

function btnHover () {
	$(this).stop().animate({opacity:1}, 200);
}

function btnOut () {
	$(this).stop().animate({opacity:.3}, 500);
}





