$(document).ready(function() {
$("#sidebar h3").addClass("hideul");
$("#sidebar h3 + ul").hide().end();
$("#sidebar h3").click(function() {
        var answer = $(this).next();
        if (answer.is(":visible")) {
            answer.slideUp("fast");
			$(this).removeClass("showul");
			$(this).addClass("hideul");
        } else {
            answer.slideDown("slow");
			$(this).removeClass("hideul");
			$(this).addClass("showul");
        }
    });
/*We need to keep the current menu open*/
    $("#sidebar h3.active").removeClass("hideul");
    $("#sidebar h3.active").addClass("showul");
    $("#sidebar h3.active + ul").show().end();
/*some ajax to call country maps*/
$("#header h2 a.map").click(function() {
      var url=($(this).attr("href"));
      url+=" #content p";
      getContent("#content",url);
      return false;
});
/*just a simple fade effect*/
function getContent(selector, url) {
  $(selector).fadeOut(1200, function() {
    $(selector).load(url).fadeIn(1200);
    return false;
  } );
}
$("#content .slide").css("cursor","pointer");
$("#content .slide").next().slideUp("fast");
$("#content .slide:first").next().slideDown("slow");
$("#content .slide").click(function(){
   var answer = $(this).next();
   answer.slideToggle("slow");
    return false;

});
$("a[href$='#edito']").click(function(){
  $("#content #edito").next().slideDown("slow");
$("#content #confiance").next().slideUp("slow");
$("#content #organisation").next().slideUp("slow");
return false;
});
$("a[href$='#confiance']").click(function(){
  $("#content #edito").next().slideUp("slow");
$("#content #confiance").next().slideDown("slow");
$("#content #organisation").next().slideUp("slow");
return false;
});
$("a[href$='#organisation']").click(function(){
  $("#content #edito").next().slideUp("slow");
$("#content #confiance").next().slideUp("slow");
$("#content #organisation").next().slideDown("slow");
return false;
});
});

$.modal.prototype.params.loader_img = 'images/loading.gif';
$.modal.prototype.params.close_img = 'images/close.png';
$(function() {
	$('a.modal').modalWeb($(window).width()-120,$(window).height()-120);
});

