

$(document).ready(function(){
						   
						   	
		/* fonction calendar*/  
	
	  calendar_fun(".jNiceSelectOpen-cal");

	
	function calendar_fun(IDofObject){
		
 
	

	 $(IDofObject ).bind('focus ',function(){
       
		    calendar_show($(IDofObject).next());
 
    });
	
	
 

	 $(IDofObject ).click(function(){
								
        calendar_show($(IDofObject).next());
		
	 
   });
	 
	 
	 $(".fermer " ).click(function(){
        calendar_hide($(IDofObject).next());
		
	 
   }); 
	
		
	
	
	
	function calendar_show(selector){
    
    $(selector).css('display', 'block');
    
}
	
	
	

	
	function calendar_hide(selector){
    $(selector).fadeOut("slow");
 
}
	
	};
	
	
	 
	/* fin fontion calendar*/



    $('.infobulle-mon-compte').css("visibility", "hidden").addClass('initilise-height-width');
	
	
	$('.infobulle-tooltips').css("visibility", "hidden").addClass('initilise-height-width');
	
	
    $('#popin-mon-compte').css("visibility", "hidden").addClass('initilise-height-width');
    
    $('.first-one').css("display", "none");
    $('.tarifs-popin-liste-pays').css("display", "none");
    $('.tarifs-liste-pays').click(function(){
        $('.tarifs-popin-liste-pays').toggle();
        return false;
    });
    
   
    
  
    
    
	

    
    /**
     * ajout des action d'overture de popup sur les button
     */
    $('#account-layer').click(function(){
        infoBull_show('.infobulle-mon-compte');
		return false;
    });
	
	
	
	 $('#account-layer').focus(function(){
        infoBull_show('.infobulle-mon-compte');
		return false;
    });
	 
	  $('.mon-compte-link-left').focusout(function(){
        infoBull_hide('.infobulle-mon-compte');
		return false;
    });
	
	/* fonction tooltips*/  
	
	  tooltips_fun("#aide1");
	  tooltips_fun("#aide2");
	  tooltips_fun("#aide3");
	  tooltips_fun("#aide4");
	  tooltips_fun("#aide5");
	  tooltips_fun("#aide6");
	  tooltips_fun("#aide7");
	  tooltips_fun("#aide8");
	  tooltips_fun("#aide9");
	  tooltips_fun("#aide10");
	  tooltips_fun("#aide11");
	  tooltips_fun("#aide12");
	  tooltips_fun("#aide13");
	  tooltips_fun("#aide14");
	   tooltips_fun("#aide16");
	    tooltips_fun("#aide17");
	 
	  
	
	function tooltips_fun(IDofObject){
		
		
	 $(IDofObject +" .toolbt").focus(function(){
        tooltip_show(IDofObject + " .infobulle-tooltips");
		return false;
    });
	
	
	 $(IDofObject +" .toolbt").focusout(function(){
        tooltip_hide(IDofObject + " .infobulle-tooltips");
		return false;
    });
	 



	 $(IDofObject +" .toolbt img").hover(function(){
        tooltip_show(IDofObject + " .infobulle-tooltips");
	 
    },function(){
       tooltip_hide(IDofObject + " .infobulle-tooltips");});
	 
	  
	
	function tooltip_show(selector){
    
    $(selector).css('visibility', 'visible');
    
}
	
	
	

	
	function tooltip_hide(selector){
    $(selector).css('visibility', 'hidden');
   
}
	
	};
	
	
	/* fin fontion tooltip*/

    $('#subscribe-layer').click(function(){
        infoBull_show('#popin-mon-compte');
		return false;
    });
    $('#popin-mon-compte-close').click(function(){
        infoBull_hide('#popin-mon-compte');
		return false;
    });
    
   
});

/*$(document).click(function(evt) {
 var menu = $(evt.target).closest(".ouvrir-infobulle");
 var menu1 = ! menu;
 
 if(menu){
 $('.infobulle-mon-compte').css('visibility','visible').removeClass('initilise-height-width');
 if(menu1){
 $('.infobulle-mon-compte').css('visibility','hidden').addClass('initilise-height-width');
 }
 }
 
 });*/
function infoBull_show(selector){
    var opened = $('.popin-layer:visible');
    if (opened.size) {
        infoBull_hide('#' + opened.attr('id'));
    }
    $(selector).css('visibility', 'visible').removeClass('initilise-height-width');
    if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
        if (document.getElementById("infobull_HideSelect") === null) {//iframe to hide select elements in ie6
            $("body").append("<div id='infobull_overlay'></div>");
            $("#infobull_overlay").click(function(){
                infoBull_hide(selector);
            });
        }
    }
    else {//all others
        if (document.getElementById("infobull_overlay") === null) {
            $("body").append("<div id='infobull_overlay'></div>");
            $("#infobull_overlay").click(function(){
                infoBull_hide(selector);
            });
        }
    }
    return false;
}

function infoBull_hide(selector){
    $(selector).css('visibility', 'hidden').addClass('initilise-height-width');
    $('#infobull_overlay').trigger("unload").unbind().remove();
    document.onkeydown = "";
    document.onkeyup = "";
    return false;
}

/*
 * animation home
 */
jid = 0;
paused = false;
window.setInterval(function(){
    this.next();
}, 20000);
function pause(){
    paused = true;
}

function scroll(){
    paused = false;
}

function next(){
    if (!paused) {
        this.jid;
        if (this.jid % 2 == 0) {
            $('.first-one').show();
            $('.second-one').hide();
        }
        else {
            $('.second-one').show();
            $('.first-one').hide();
        }
        this.jid++;
    }
}

 
 
 
 
/* test if ie6 */
var isIE6 = $.browser.msie && parseFloat($.browser.version) < 7;
 
 	jQuery(function( $ ){
 
  if(isIE6===true){
	  
	 
    
 $('.footer-barre-deplie').css("display", "none");
  
  /*$('.lien-open').click(function(){
	    if ( $('.footer-barre-deplie').css('display')=='none')
        $('.footer-barre-deplie').show();
		else   $('.footer-barre-deplie').hide();
		return false;
    });
 $('.lien-open1').click(function(){
        if ( $('.footer-barre-deplie').css('display')=='none')
        $('.footer-barre-deplie').show();
		else   $('.footer-barre-deplie').hide();
		return false;
    });
    $('.lien-close').click(function(){
        $('.footer-barre-deplie').hide();
		return false;
    });
  
 }
 
 else{
			// Get a reference to the container.
			var container = $( ".footer-barre-deplie" );
		 
			
 
            var container2 = $( ".footer-barre-replie" );
			
			// Bind the link to toggle the slide.
			$( "a.lien-open" ).click(
									
				function( event ){  
					// Prevent the default event.
					event.preventDefault();
 
					// Toggle the slide based on its current
					// visibility.
					if (container.is( ":hidden" )){
 
						// Hide - slide up.
						container.slideDown();
						container2.animate({bottom:'214'}) ;
			            
				 
 
					}  
					else {
						container.slideUp();
				        container2.animate({bottom:'0'},350) ;
						}
					 
				 
						
				}
				
				
				
			);
			
			
		
				
				$( "a.lien-open1" ).click(
									
				function( event ){  
					// Prevent the default event.
					event.preventDefault();
 
					// Toggle the slide based on its current
					// visibility.
					if (container.is( ":hidden" )){
 
						// Hide - slide up.
					  container.slideDown();
						
			          container2.animate({bottom:'214'}) ;
			           
 
					}  
					
					else {
						container.slideUp();
				        container2.animate({bottom:'0'},350) ;
						}
						
				}
				
				
				
			);
			//close
			
				$( "a.lien-close" ).click(
									
				function( event ){  
					// Prevent the default event.
					event.preventDefault();
 
					// Toggle the slide based on its current
					// visibility.
					if (container.is( ":visible" )){
 
						// Hide - slide up.
						container.slideUp();
						
						
				        container2.animate({bottom:'0'},350) ;
					 
 
					}  
				}
				
				
				
			);
				
				
 */			
}			
			

		});
 



 	
 
$(document).ready(function(){
	var currentPosition = 0;
	var slideWidth = 964;
	var slides = $('.slide');
	var numberOfSlides = slides.length;
	var timer = 4000; // 4 seconds

  // Remove scrollbar in JS
  $('#slidesContainer').css('overflow', 'hidden');

  // Wrap all .slides with #slideInner div
	slides
    .wrapAll('<div id="slideInner"></div>')
    // Float left to display horizontally, readjust .slides width
	.css({
      'float' : 'left',
      'width' : slideWidth
    });

  // Set #slideInner width equal to total width of all slides
	$('#slideInner').css('width', slideWidth * numberOfSlides);

  // Insert controls in the DOM
	$('#slideshow')
    .prepend('<span class="control" id="leftControl">Clicking moves left</span>')
    .append('<span class="control" id="rightControl">Clicking moves right</span>');

  // Hide left arrow control on first load
	manageControls(currentPosition);

  // Create event listeners for .controls clicks
	$('.control')
    .bind('click', function(){
    // Determine new position
	currentPosition = ($(this).attr('id')=='rightControl') ? currentPosition+1 : currentPosition-1;
    
	// Hide / show controls
    manageControls(currentPosition);
    // Move slideInner using margin-left
    $('#slideInner').animate({
      'marginLeft' : slideWidth*(-currentPosition)
    });
	});

  // manageControls: Hides and Shows controls depending on currentPosition
	function manageControls(position){
    // Hide left arrow if position is first slide
	if(position==0){ $('#leftControl').hide() } else{ $('#leftControl').show() }
	// Hide right arrow if position is last slide
    
	
	if(position==numberOfSlides-1 || position==numberOfSlides){  
    $('#rightControl').hide();  
	} else {  
    $('#rightControl').show();  
	}  


	if(position == numberOfSlides){ 
    currentPosition = position-1;  
	position = position - 1 ;
	start();
     //$('#leftControl').hide();  
	}  
	if(position == 0){ 
    
	start();
	$('#leftControl').hide();  
	} 
	
	 
	}	
  
  
$("ul.tabs li").click(function() {

	currentPosition = 0;
	
	$('#slideInner').animate({
      'marginLeft' : 0
    });
	
	manageControls(currentPosition);
	  
	});
  
 
  
  
   //Config  
	var retour = true;  
	var tempsTransition = 500;  
	var affichePlayPause = true;  
	var lectureAutomatique = true;  
    var tempsAttente = 10000;  
  
    
	var interval;  
	var lectureEnCours = false;   


  
	function start() {  
	lectureEnCours = true;  
		 
	if(currentPosition == ( numberOfSlides - 1) ){
	clearInterval(interval);  
	interval = setInterval(precedent, tempsAttente );  
	} else if( currentPosition == 0 ) {
	clearInterval(interval);  
	interval = setInterval(suivant, tempsAttente );  
	}
            
	} 
	
	
     
      
	function suivant(){  
	$('#rightControl').click();
	}  
 
 
 
	function precedent(){  
	$('#leftControl').click();
	}  
	
	     
	function pause() {  
	lectureEnCours = false;  
	clearInterval(interval);  
	}  
	
	//Si le diapo est activé   
 
	start();
   
	});
 

 
	
	
	
	
	
	
	
	
	
	
	
	
	
		
 
$(document).ready(function(){
	var currentPosition2 = 0;
	var slideWidth2 = 964;
	var slides2 = $('.slide2');
	var numberOfSlides2 = slides2.length;

	// Remove scrollbar in JS
	$('#slidesContainer2').css('overflow', 'hidden');

	// Wrap all .slides with #slideInner div
	slides2
    .wrapAll('<div id="slideInner2"></div>')
    // Float left to display horizontally, readjust .slides width
	.css({
      'float' : 'left',
      'width' : slideWidth2
    });

  // Set #slideInner width equal to total width of all slides
	$('#slideInner2').css('width', slideWidth2 * numberOfSlides2);

	// Insert controls in the DOM
	$('#slideshow2')
    .prepend('<span class="control2" id="leftControl2">Clicking moves left</span>')
    .append('<span class="control2" id="rightControl2">Clicking moves right</span>');

	// Hide left arrow control on first load
	manageControls2(currentPosition2);

	// Create event listeners for .controls clicks
	$('.control2')
    .bind('click', function(){
    // Determine new position
	currentPosition2 = ($(this).attr('id')=='rightControl2') ? currentPosition2+1 : currentPosition2-1;
    
	// Hide / show controls
    manageControls2(currentPosition2);
    // Move slideInner using margin-left
    $('#slideInner2').animate({
      'marginLeft' : slideWidth2*(-currentPosition2)
    });
	});

  // manageControls: Hides and Shows controls depending on currentPosition
	function manageControls2(position){
    // Hide left arrow if position is first slide
	if(position==0){ $('#leftControl2').hide() } else{ $('#leftControl2').show() }
	// Hide right arrow if position is last slide
 
 	
	if(position==numberOfSlides2-1 || position==numberOfSlides2){  
    $('#rightControl2').hide();  
	} else {  
    $('#rightControl2').show();  
	}  
 
	
	if(position == numberOfSlides2){ 
    currentPosition2 = position-1;  
	position = position - 1 ;
	start2();
     //$('#leftControl').hide();  
	}  
	if(position == 0){ 
    
	start2();
	$('#leftControl2').hide();  
	}
	

  
  
	}	
  
    	$("ul.tabs li").click(function() {
	 
		
		currentPosition2 = 0;
		
	$('#slideInner2').animate({
      'marginLeft' : 0
    });
	
		manageControls2(currentPosition2);
	});
 
  
  
	//Config  
	var retour2 = true;  
	var tempsTransition2 = 500;  
	var affichePlayPause2 = true;  
	var lectureAutomatique2 = true;  
    var tempsAttente2 = 10000;  
  
    
	var interval2;  
	var lectureEnCours2= false;   


 
	
	function start2() {  
	lectureEnCours2 = true;  
		 
	if(currentPosition2 == ( numberOfSlides2 - 1) ){
	clearInterval(interval2);  
	interval2 = setInterval(precedent2, tempsAttente2 );  
	} else if( currentPosition2 == 0 ) {
	clearInterval(interval2);  
	interval2 = setInterval(suivant2, tempsAttente2 );  
	}
	

            
	} 
	
	
     
      
	function suivant2(){  
	
	$('#rightControl2').click();
 
 
    }  
 
 
 function precedent2(){  
	$('#leftControl2').click();
 
	}  
	
	
      
	function pause2() {  
	lectureEnCours2 = false;  
	clearInterval(interval2);  
    }  
	
	//Si le diapo est activé   
 

 start2();
 
 
  
});
 
 
 
