/*Erelia Gestion DHTML*/
function menuHome(){
	$('menu-droite').firstDescendant().childElements().each(function(menuhp){
		menuhp.firstDescendant().firstDescendant().removeAttribute('href');
	});
	$('menu-droite').firstDescendant().childElements()[0].observe('click', function(){		
		$('sous-logo').next('h2').setStyle({
			top : '-5000px'
		});
		$('menu-droite').next('img').writeAttribute({
			src:'media/images/visuels-home/haute-lys.jpg',
			alt:''
		});
		$('menu-droite').firstDescendant().childElements()[0].writeAttribute({
			'class': 'on'
		});
		$('menu-droite').firstDescendant().childElements()[1].writeAttribute({
			'class': 'off'
		});
		$('menu-droite').firstDescendant().childElements()[2].writeAttribute({
			'class':'off2'
		});
	});
	
	$('menu-droite').firstDescendant().childElements()[1].observe('click', function(){		
		$('sous-logo').next('h2').setStyle({
			top : '-5000px'
		});
		$('menu-droite').next('img').writeAttribute({
			src:'media/images/visuels-home/haut-des-ailes.jpg',
			alt:''
		});
		$('menu-droite').firstDescendant().childElements()[0].writeAttribute({
			'class': 'off'
		});
		$('menu-droite').firstDescendant().childElements()[1].writeAttribute({
			'class': 'on'
		});
		$('menu-droite').firstDescendant().childElements()[2].writeAttribute({
			'class':'off2'
		});
	});
	
	$('menu-droite').firstDescendant().childElements()[2].observe('click', function(){		
		$('sous-logo').next('h2').setStyle({
			top : '-5000px'
		});
		$('menu-droite').next('img').writeAttribute({
			src:'media/images/visuels-home/mont-de-bezard.jpg',
			alt:''
		});
		$('menu-droite').firstDescendant().childElements()[0].writeAttribute({
			'class': 'off'
		});
		$('menu-droite').firstDescendant().childElements()[1].writeAttribute({
			'class': 'off'
		});
		$('menu-droite').firstDescendant().childElements()[2].writeAttribute({
			'class':'on2'
		});
	});
}

function accordion(){

	$('liste-parcs').firstDescendant().childElements().each( function(parc){
		if(parc != $('liste-parcs').firstDescendant().childElements().first()){parc.childElements()[1].writeAttribute({
			'class': 'masque'
		});}
	});	
	$('liste-parcs').firstDescendant().childElements().each(function(parc){
		parc.observe('click', function(){
			$('liste-parcs').firstDescendant().childElements().each(function(parcContent){
				parcContent.childElements()[1].writeAttribute({
					'class': 'masque'
				});
			});
			parc.childElements()[1].writeAttribute({
				'class': 'visible'
			});
		});
	});
}

function faqdion(){
	$$('.reponse').each(function(answer){
		if(!answer.hasClassName('masque')){answer.addClassName('masque');}
	});
	
	$$('#faq-liste h5').each(function(question){
		question.observe('click', function(){
			if(question.next('div').hasClassName('masque')){
				$$('.reponse').each(function(answer){
					if(!answer.hasClassName('masque')){answer.addClassName('masque');}
				});
				question.next('div').removeClassName('masque');
			}
			else{
				question.next('div').addClassName('masque');
			}
		});
	});
}
