$(document).ready(function(){
	
	/*$("#hidePanel").click(function(){
		$("#panel").animate({marginLeft:"-375px"}, 500 );
		$("#colleft").animate({width:"0%", opacity:0}, 400 );
		$("#showPanel").show("normal").animate({width:"36px", opacity:1}, 20);
		$("#colright").animate({width:"80%"}, 500);
		
		$("#searchIndex").animate({width:"70%", opacity:1}, 200 );
		$("#jacket").show(500);
		
		//fiche
		$("#leftCol").animate({width:"70%", opacity:1}, 400 );
		$("#rightCol").show(800);
		
		
	});
	$("#showPanel").click(function(){
		$("#colright").animate({width:"35%"}, 200);
		$("#panel").animate({marginLeft:"0px"}, 400 );
		$("#colleft").animate({width:"50%", opacity:1}, 400 );
		$("#showPanel").animate({ opacity:0}, 20).hide("slow");
		$("#rightCol").hide(200);
		$("#leftCol").animate({width:"100%", opacity:1}, 400 );
		$("#jacket").hide();
		$("#searchIndex").animate({width:"100%", opacity:1}, 400 );
		
	});	*/
	
	
 //When page loads...
 	 $(".tab_content").hide(); //Hide all content
 	 $("ul.onglets li:first").addClass("active").show(); //Activate first tab
 	 $(".tab_content:first").show(); //Show first tab content


//On Click Event
 	 $("ul.onglets li").click(function() {
     $("ul.onglets li").removeClass("active"); //Remove any "active" class
 	 $(this).addClass("active"); //Add "active" class to selected tab
 	 $(".tab_content").hide(); //Hide all tab content
 
 	 var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
 	 $(activeTab).fadeIn(); //Fade in the active ID content
 	 return false;
 	 });

// size font

	$(".ficheCsize").cSize();
	

		
// third example


 $('a[rel*=facebox]').facebox();

	$('.check_every_checkbox').click(function() {
	      $(this).parents('form').find('input:checkbox').attr('checked', $(this).is(':checked'));   
	});
	
	  $(function(){
		
		     $("#extruderLeft2").buildMbExtruder({
		        position:"left",
		        width:700,
		        positionFixed:false,
		        top:0,
		        extruderOpacity:.8,
		        onExtOpen:function(){},
		        onExtContentLoad:function(){},
		        onExtClose:function(){}
		      });
		    });
		    
		$(".hide").click(
		function () {
			$(this).parent().fadeTo(500, 0, function () { // Links with the class "close" will close parent
				$(this).slideUp(500);
			});
			return false;
		}
	);
	
	/* affichage au click sur le bouton mon profil */
	
	
	$('.profil').click(function(e) {
       $('#profil_smenu').toggleClass('showMenu').toggleClass('hideMenu');
       e.stopPropagation();
       });

 $(document).click(function(){
               if($('#profil_smenu').hasClass('showMenu')) {
               $('#profil_smenu').removeClass('#showMenu').addClass('hideMenu');
               }
 });

$("#red").treeview({
		animated: "fast",
		collapsed: true,
		unique: false,
		/*persist: "cookie",*/
		toggle: function() {
			window.console && console.log("%o was toggled", this);
		}
	});

	$("#red2").treeview({
			animated: "fast",
			collapsed: true,
			unique: false,
			/*persist: "cookie",*/
			toggle: function() {
				window.console && console.log("%o was toggled", this);
			}
		});


	
});

