//DECLARATION SLIDER
$(document).ready( 
function(){  
$('ul#slider-banniere').innerfade({ speed: 2500, timeout: 6000, type: 'sequence', containerheight: '240px' }); 
} 
);

//DECLARATION SLIDER PAGE
$(document).ready( 
function(){  
$('ul#slider-banniere-page').innerfade({ speed: 2500, timeout: 6000, type: 'sequence', containerheight: '350px' }); 
} 
);

//DECLARATION EASYSLIDER
$(document).ready(function(){	
		$("#slider").easySlider({
			controlsBefore:	'<div id="controls">',
			controlsAfter:	'</div>',
			auto: true, 
			continuous: true,
			//prevId: 'prevBtn',
			prevText: '',
			//nextId: 'nextBtn',	
			nextText: '',				
			speed: 1000,
			pause: 8000
		});
	});	

//DECLARATION EFFET SOUS-MENU		
$(document).ready(function() {
	
	//Set the even row to different color
	$('ul.menuSecondaire li:even').addClass('even');
		
	//configure the animations
	$('ul.menuSecondaire li a ').mouseover(function() {$(this).animate( { paddingLeft:"15px" }, { queue:false, duration:200 } );}).mouseout(function() {$(this).animate( { paddingLeft:"0px" }, { queue:true, duration:200 } )});
});	  

//TEST E-MAIL
function checkform() {

if(document.news.email.value=="")
{
	alert('Veuillez saisir votre e-mail');
	document.news.email.focus();
	return false;
}
else
{
	var lemail=document.news.email.value;
	var aroba = lemail.indexOf("@");
	var point = lemail.indexOf(".", aroba);
	var point = lemail.lastIndexOf(".");
	var point2 = lemail.indexOf("..")

	if ((aroba == -1) || (point == -1) || (point == (aroba + 1)) || ((point + 1) == lemail.length) || (point2 != -1))
	{
		alert("Veuillez saisir une adresse e-mail valide.");
		document.news.email.select();
		document.news.email.focus();
		return false;
	}
	
	else
	{
		alert("E-mail valide, cliquez sur OK pour confirmer !");
	}

	var nextstep=false;
	}
}

//DECLARATION EFFET Iframe	
$(document).ready(function() { 
	$("a.single_image").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false }); /* Using custom settings */ 
	$("a#inline").fancybox({ 'hideOnContentClick': true }); 
	$("a.groupe").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false });
	$("a.images").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false });
	$("a.iframe").fancybox({ 'hideOnContentClick': true , 'frameWidth':1024, 'frameHeight':650,'overlayShow': false  });
	$("a.iframe-promo").fancybox({ 'hideOnContentClick': true , 'frameWidth':520, 'frameHeight':420,'overlayShow': false  });
	$("a.iframenews").fancybox({ 'hideOnContentClick': true , 'frameWidth':530, 'frameHeight':400,'overlayShow': false  });
	$("a.iframeCarte").fancybox({ 'hideOnContentClick': true , 'frameWidth':650, 'frameHeight':500,'overlayShow': false });
}); 

//DECLARATION EFFET MENU		
$(function(){
	$('#menu-domaine li a')
		.css( {backgroundPosition: "0 0"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0 -140px)"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:500})
		})
});	

function soumettre(id)
{
	document.getElementById(id).target = 'formulaire';
	window.open('', 'formulaire','width=800,height=600');
}

function chargementIframe()
{
   document.getElementById('chargement').style.display='none';
   document.getElementById('id_iframe').style.visibility='visible';

}