jQuery(document).ready
( function()
  { init_carousels_bas();
  }
);

function init_carousels_bas()
{ active_carousel_references();
  jQuery(".references_simtic a").click
  ( function()
   { active_carousel_references();
   }
  );
  jQuery(".reseaux_simtic a").click
  ( function()
    { active_carousel_reseaux();
    }
  );
}

function raz_carousels()
{ var ul_carousel_references = "<div id=\"bandeau_references\"><ul id=\"carousel_references\" class=\"jcarousel-skin-tango\">" + jQuery("#carousel_references").html() + "</ul></div>";
  var ul_carousel_reseaux = "<div id=\"bandeau_reseaux\"><ul id=\"carousel_reseaux\" class=\"jcarousel-skin-tango\">" + jQuery("#carousel_reseaux").html() + "</ul></div>";
  jQuery("#bandeau_references").remove();
  jQuery("#bandeau_reseaux").remove();
  jQuery("#bandeau_bas").append(ul_carousel_references);
  jQuery("#bandeau_bas").append(ul_carousel_reseaux);
}

function active_carousel_references()
{ raz_carousels();
  jQuery("#bandeau_reseaux").css("display", "none");
  jQuery("#bandeau_references").css("display", "block");
  jQuery('#carousel_references').jcarousel();
  jQuery('#onglets_bas_references').css("backgroundImage", "url(" + site_root + "/wp-content/themes/simtic/images/onglet_on.png)");
  jQuery('#onglets_bas_reseaux').css("backgroundImage", "url(" + site_root + "/wp-content/themes/simtic/images/onglet_out.png)");
}

function active_carousel_reseaux()
{ raz_carousels();
  jQuery("#bandeau_references").css("display", "none");
  jQuery("#bandeau_reseaux").css("display", "block");
  jQuery('#carousel_reseaux').jcarousel();
  jQuery('#onglets_bas_references').css("backgroundImage", "url(" + site_root + "/wp-content/themes/simtic/images/onglet_out.png)");
  jQuery('#onglets_bas_reseaux').css("backgroundImage", "url(" + site_root + "/wp-content/themes/simtic/images/onglet_on.png)");
}

