// JavaScript Document

jQuery().ready(function(){
	
		$("#accueil").mouseover(function(){ 
			$(this).css("color","#7eb93e");
			$(this).css('background-image', 'url(images/menu_color_hover.jpg)');
		});
	
        $("#vlsf_fr").mouseover(function(){ 
		    $(this).find('.subnav').stop().animate({height: '225px', opacity:'1'},{queue:false, duration:1000, easing: 'easeOutElastic'})
			$(this).css("color","#7eb93e");
            $(this).css('background-image', 'url(images/menu_color_hover.jpg)');
		});
		
        $("#presentation").mouseover(function(){ 
		    $(this).find('.subnav').stop().animate({height: '135px', opacity:'1'},{queue:false, duration:1000, easing: 'easeOutElastic'})
			$(this).css("color","#7eb93e");
            $(this).css('background-image', 'url(images/menu_color_hover.jpg)');
		});
		
		$("#cours_lsf").mouseover(function(){
		    $(this).find('.subnav').stop().animate({height: '280px', opacity:'1'},{queue:false, duration:1000, easing: 'easeOutElastic'})
            $(this).css("color","#7eb93e");
            $(this).css('background-image', 'url(images/menu_color_hover.jpg)');
		});
		
		$("#form_lsf").mouseover(function(){ 
		      $(this).find('.subnav').stop().animate({height: '210px', opacity:'1'},{queue:false, duration:1000, easing: 'easeOutElastic'})
			   $(this).css("color","#7eb93e");
            $(this).css('background-image', 'url(images/menu_color_hover.jpg)');
		});
		
		$("#form_courtes").mouseover(function(){ 
		      $(this).find('.subnav').stop().animate({height: '120px', opacity:'1'},{queue:false, duration:1000, easing: 'easeOutElastic'})
			   $(this).css("color","#7eb93e");
            $(this).css('background-image', 'url(images/menu_color_hover.jpg)');
		});
		
	$("#contacts").mouseover(function(){ 
		$(this).css("color","#7eb93e");
		$(this).css('background-image', 'url(images/menu_color_hover.jpg)');
	});
		
	$("ul.blockeasing li.main").mouseout(function(){ 
		$(this).find('.subnav').stop().animate({height:'0px', opacity:'0'},{queue:false, duration:1000, easing: 'easeOutElastic'})
		$(this).css("color","#000000");
		$(this).css('background-image', 'url(images/menu_color.jpg)');
	});
		
		
	//Menu ascenseur
	$(".ascenseur").next("div").hide();
	$(".ascenseur").click(function(){
		if($(this).next("div").is(":hidden")){
			$(".ascenseur").next("div:visible").slideUp();
			$(this).next("div").slideDown();
		}
	});

		
	//------?
	$(".example5").colorbox();
	$(".example8").colorbox({width:"50%", inline:true, href:"#inline_example1"});
				
				
	//------?
	$.tools.tabs.addEffect("slide", function(i, done) {
		// 1. upon hiding, the active pane has a ruby background color
		this.getPanes().slideUp().css({backgroundColor: "#b8128f"});
		// 2. after a pane is revealed, its background is set to its original color (transparent)
		this.getPanes().eq(i).slideDown(function()  {
			$(this).css({backgroundColor: 'transparent'});
			done.call();// the supplied callback must be called after the effect has finished its job
		});
	});
	
	
});

function btn(code,file){
	var lien_page = 'index.php?filephp='+file+'&page='+code;
	document.location.href=lien_page;
}
function btnregion(code){
	var lien_page = 'index.php?filephp='+code+'&region=IDF';
	document.location.href=lien_page;
}

function btnaccueil(){
	var lien_page = 'index.php';
	document.location.href=lien_page;
}

function btn_pdf(nomfile,typefile){
	var lien_pdf = typefile+'/'+nomfile+'.pdf';
	window.open(lien_pdf);
}
function btn_video(nomfile,typefile){
	var lien_video = typefile+'/'+nomfile;
	window.open(lien_video);
}
