

function hideOnglets() {
  $("#cartes").hide(); 
  $("#sommaire").hide(); 
  $("#buy").hide();
  $("#showCartes").removeClass("selected");
  $("#showSommaire").removeClass("selected");
  $("#showBuy").removeClass("selected");
  $("#showCartes").addClass("notselected");
  $("#showSommaire").addClass("notselected");
  $("#showBuy").addClass("notselected");
  $("#cartes h2").hide();
  $("#buy h2").hide();
  $("#sommaire h2").hide();
}

function showOngletCarte() {
  hideOnglets();
  $("#cartes").show(); 
  $("#showCartes").addClass("selected");
  $("#showCartes").removeClass("notselected");
}

function showOngletSommaire() {
  hideOnglets();
  $("#sommaire").show(); 
  $("#showSommaire").addClass("selected");
  $("#showSommaire").removeClass("notselected");
}

function showOngletBuy() {
  hideOnglets();
  $("#buy").show(); 
  $("#showBuy").addClass("selected");
  $("#showBuy").removeClass("notselected");
}

function mycarousel1_itemFirstInCallback(carousel, item, idx, state) {
    $.cookie('carousel1', idx);
};

function mycarousel2_itemFirstInCallback(carousel, item, idx, state) {
    $.cookie('carousel2', idx);
};

function mycarousel3_itemFirstInCallback(carousel, item, idx, state) {
    $.cookie('carousel3', idx);
};
function get_carousel1_start(id) {
  return $.cookie('carousel1');
}
function get_carousel2_start(id) {
  return $.cookie('carousel2');
}
function get_carousel3_start(id) {
  return $.cookie('carousel3');
}


$(document).ready(function() {
  (function(){for(var l=document.links,h=window.location.hostname,i=0,a;a=l[i];i++){if(a.hostname!=h){a.target='_blank';}}})();
  $("#showSommaire").click(function () {showOngletSommaire()});
  $("#showBuy").click(function () {showOngletBuy()});
  if($("#sommaire h2").html() == "Sommaire") {
    $("#onglet-first-line").html("<span id='showSommaire'>SOMMAIRE</span>") ;
    $("#showSommaire").click(function () {showOngletSommaire();});
  }else {
    $("#onglet-first-line").hide() ;
  }
  hideOnglets();
  $("#r1p").click(function(){
//     $("#RecitsHistoire").hide();
//     $("#DictionnairesInsolites").hide();
//     $("#RecitsVoyage .descriptif").hide();
    $("#RecitsVoyage .descriptif a img").hide("slow");
    $("#RecitsVoyage .descriptif-long").show("slow");
  });
  $("#r1m").click(function(){
//     $("#RecitsHistoire").show();
//     $("#DictionnairesInsolites").show();
//     $("#RecitsVoyage .descriptif").show();
    $("#RecitsVoyage .descriptif a img").show("slow");
    $("#RecitsVoyage .descriptif-long").hide("slow");
  });
  $("#r2p").click(function(){
//     $("#RecitsVoyage").hide();
//     $("#DictionnairesInsolites").hide();
//     $("#RecitsHistoire .descriptif").hide();
    $("#RecitsHistoire .descriptif a img").hide("slow");
    $("#RecitsHistoire .descriptif-long").show("slow");
  });
  $("#r2m").click(function(){
//     $("#RecitsVoyage").show();
//     $("#DictionnairesInsolites").show();
//     $("#RecitsHistoire .descriptif").show();
    $("#RecitsHistoire .descriptif a img").show("slow");
    $("#RecitsHistoire .descriptif-long").hide("slow");
  });
  $("#r3p").click(function(){
//     $("#RecitsHistoire").hide();
//     $("#RecitsVoyage").hide();
//     $("#DictionnairesInsolites .descriptif").hide();
    $("#DictionnairesInsolites .descriptif a img").hide("slow");
    $("#DictionnairesInsolites .descriptif-long").show("slow");
  });
  $("#r3m").click(function(){
//     $("#RecitsHistoire").show();
//     $("#RecitsVoyage").show();
//     $("#DictionnairesInsolites .descriptif").show();
    $("#DictionnairesInsolites .descriptif a img").show("slow");
    $("#DictionnairesInsolites .descriptif-long").hide("slow");
  });
});