function lightbox(racine){
 $("img.imgcontent").each(function(){
    $(this).replaceWith("<a href=\""+$(this).attr('src')+"\" class=\"inline\" rel=\"gallery\"><img src=\""+$(this).attr('src')+"\" class=\"imgcontent\" align=\"left\" title=\""+$(this).attr('title')+"\" alt=\""+$(this).attr('alt')+"\"/></a>");
   }
   );
   $("blockquote").each(function(){
      content=$(this).html();

      
      //on recherche le noeud precedent ayant le texte
      myobj=$(this).prev();
      contentin=myobj.html().trim();
      while(contentin.substring(contentin.length-1,contentin.length)==">"){
        myobj=myobj.find("*:last-child");
        contentin=myobj.html().trim();
      }
      myobj.replaceWith(myobj.html()+" <a href=\"#\" class=\"accordeon\"><img src=\"/tpl/images/accordeon.jpg\" title=\"Plus d'information\"></a><br><div class=\"divaccordeon\">"+content+"</div>");
      $(this).replaceWith("");
     }
   );
  $("a.inline").fancybox({
  'overlayOpacity'	:	0.7,
	'overlayColor'		:	'#000',
	'hideOnContentClick': false,
	'showCloseButton':true
   });

  $(".accordeon img").tooltip({position: "top right", effect: "fade", tip:"#extdiv"});
  $(".accordeon").toggle(function() {
    $(this).next().next().show('slow');
  }, function() {
    $(this).next().next().hide('slow');
  });
   $("a.forgotpassword").fancybox({
    'overlayOpacity'	:	0.7,
		'overlayColor'		:	'#000',
		'hideOnContentClick': false,
		'showCloseButton':false,
		'frameWidth':355,
		'frameHeight':150
	   });
    $(".datepicker").datepicker();     
}
var zoomIs = 0;
var maxZoom = 11;
var minZoom = 0;
function plusmoins(){
  $("#boutonstexte1").click(function (){
        //alert('jeclic')
				if(zoomIs<=maxZoom-1){
				  //alert($("#contentzoom").html())
          $("#contentzoom").attr('class','');	
					zoomIs++;	
					//alert(zoomIs)
					if(zoomIs>0){
					 $("#contentzoom").attr('class','zoomIs_'+(zoomIs-1));
					}
					//alert($("#contentzoom").attr('class'))
				}
			});
  $("#boutonstexte").click(function (){
        //alert('jeclic')
        if(zoomIs>minZoom){
          $("#contentzoom").attr('class','');	
					zoomIs--;	
					if(zoomIs>0){
						$("#contentzoom").attr('class','zoomIs_'+(zoomIs-1));
					}
				}
      });
}
function checkAll(obj,element){
  if(obj.checked){
    form=obj.form;
    for(i=0;i<form.elements[element].length;i++){
      form.elements[element][i].checked=true
    }
  }
}
function majelemcombine(name1,name2,obj){
  //alert(obj.value)
  obj2=obj.form.elements[name2];
  deletelem3(obj2);
  tab=listetablissement;
  //alert(tab[obj.value].length)
  //alert(obj.value)
  o=new Option("","");
  obj2.options[obj2.options.length]=o;
  if(typeof(tab[obj.value])!="undefined"){
    for(i=0;i<tab[obj.value].length;i++){
      o=new Option(tab[obj.value][i][0],tab[obj.value][i][1]);
      obj2.options[obj2.options.length]=o;
    }
  }
}
