function MyConfirm(Txt) {
  if (confirm(Txt)) {
    return true; }
  else {
    return false; }
}

function SkinInterface() {
  $(document).ready(function(){ 
	$("#Btn0").click(function() {
	  window.location.href='/';
	});
	$("#Btn1").click(function() {
	  window.location.href='/les_actualites_de_la_chasse';
	});
	$("#Btn2").click(function() {
	  window.location.href='/la_migration_de_la_sauvagine';
	});
	$("#Btn3").click(function() {
	  window.location.href='/la_communaute_des_sauvaginiers';
	});
	$("#Btn4").click(function() {
	  window.location.href='/les_petites_annonces_des_sauvaginiers';
	});
	$("#Btn5").click(function() {
	  window.location.href='/la_chasse_du_gibier_d_eau';
	});
  }); 
}

/*************************************/
/* Librairie de fonctions Javascript */
/*************************************/

/********** SLIDERS ***********/
function MySlider(SlideClass,ContainerID){
  var currentPosition = 0;
  var slideWidth = 133;
  var slides = $(SlideClass);
  var numberOfSlides = slides.length;
  var direction=1;
  // Remove scrollbar in JS
  $(ContainerID).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">Gauche</span>')
    .append('<span class="control" id="rightControl">Droite</span>');

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

  // 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
   	currentPosition = currentPosition+direction;
   	direction=manageControls(currentPosition,numberOfSlides);
    // Move slideInner using margin-left
    $('#slideInner').animate({
      'marginLeft' : slideWidth*(-currentPosition)
    });
  });
  
 // SliderAnimate(AutoDelay);
}

// manageControls: Hides and Shows controls depending on currentPosition
function manageControls(position,numberOfSlides){
  if (position==numberOfSlides-1) direction=-1;
  if (position==0) direction=1;

  // 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){ $('#rightControl').hide() } else{ $('#rightControl').show() }
  return direction;
}	

function SliderAnimate(Delay)
{
	setInterval("SliderAuto()",Delay);
}

function SliderAuto() {
$('#rightControl').click();
}

/********* ACTUALITES **************/

function ActusFieldset(Date) {
	$('.ActusByYear').hide();
	$('#Actus'+Date).fadeIn(1000);
}
