$(document).ready(function()
{

	//ACCORDEON MENU
	$(".ssmenu").click(function(){

		//$(".collapsed").parent().next("div").slideUp(600);
		var select = $(this);
		
		if($("div", select).hasClass("collapsed")){
			if($("div").hasClass("expanded")){
				$(".expanded").parent().next("div").animate({height:"0px"}, 600, function(){
					$(".expanded").toggleClass("expanded");
					$("div", select).toggleClass("expanded");
					$(select).next("div.ssmenu2").animate({height:"120px"}, 800);
				})
			} else {
			
				$("div", select).toggleClass("expanded");
				$(select).next("div.ssmenu2").animate({height:"120px"}, 800);
			
			}
		}
	});

	//SCROLLBAR ACTU - AGENDA
	$('.scroll-pane').jScrollPane({scrollbarWidth:8, scrollbarMargin:2, arrowSize:5 }); 

	//EFFETS SUR IMAGES ACCUEIL
	$('#obligation').mouseover(function(){
	
		$(this).fadeTo("fast", 0.70);
	
	})

	$('#obligation').mouseout(function(){
	
		$(this).fadeTo("slow", 1);
	
	})

	$('#redevance').mouseover(function(){
	
		$(this).fadeTo("fast", 0.70);
	
	})

	$('#redevance').mouseout(function(){
	
		$(this).fadeTo("slow", 1);
	
	})
	//ZOOM IMAGE
	$("a.zoom").fancybox({'hideOnContentClick': true, 'overlayShow': true, 'padding':10, 'zoomSpeedIn': 500,'zoomSpeedOut': 500})
	
	//down file
	$("a.down").fancybox({'hideOnContentClick': false, 'frameWidth': 400, 'frameHeight':100});
	
	//TEXT FENETRE MODAL
	$("a.fancy").fancybox({'hideOnContentClick': true, 'overlayShow': true, 'padding':10, 'zoomSpeedIn': 500,'zoomSpeedOut': 500, 'frameWidth': 700, 'frameHeight':600})
	
	//BORD ARRONDI STYLE1
	$('.arrondi1-violet1, .arrondi1-violet2, .arrondi1-violet3, .arrondi1-bleu1, .arrondi1-bleu2, .arrondi1-bleu3, .arrondi1-bleu4, .arrondi1-vert-part1, .arrondi1-vert-part2, .arrondi1-vert-part3, .arrondi1-vert-pro1, .arrondi1-vert-pro2, .arrondi1-vert-pro3, .arrondi1-vert-collec1, .arrondi1-vert-collec2, .arrondi1-vert-collec3, .arrondi1-jaune, .arrondi1-orange, .arrondi1-orange2, .arrondi1-violet1-contact, .arrondi1-bleu5').corner();
	
	//BORD ARRONDI STYLE2
	$('.arrondi2-violet1, .arrondi2-violet2, .arrondi2-violet3, .arrondi2-bleu1, .arrondi2-bleu2, .arrondi2-bleu3, .arrondi2-bleu4, .arrondi2-vert-part1, .arrondi2-vert-part2, .arrondi2-vert-part3, .arrondi2-vert-pro1, .arrondi2-vert-pro2, .arrondi2-vert-pro3, .arrondi2-vert-collec1, .arrondi2-vert-collec2, .arrondi2-vert-collec3, .arrondi2-jaune, .arrondi2-orange, .arrondi2-orange2').corner({
		tl: { radius: 20 },
		tr: false,
		bl: false,
		br: { radius: 20 },
		antiAlias: true,
		autoPad: true,
		validTags: ["p"]
	});

	//SLIDE HEADER
	 $('#header').agile_carousel({
		 next_prev_buttons: "no",
		path_to_slides: "carousel/agile_carousel_slides",
		slide_directory: "carousel/agile_carousel_slides", // must contain the phrase "agile_carousel"
		timer_length: "12000",
		transition_duration: 1000,
		transition_type: "fade",
		water_mark: "no",
		php_doc_location:"/make_slides.php"
	 });

})
