/***************************************************************/
/*
/*
/*
/*
/***************************************************************/

//Appel du plugin jquery color
$.ajax({
	//url: "js/coloranimation.js",
	//dataType: "script",
	//async: false,
	//success: function(js){if(jQuery.browser.safari){eval(js);}}
});


$(document).ready(function(){ //Définir la fonction de clic
 
	
	//Changer le comportement hover au survol
   $('.clic').hover(function() { //mouse in
		$(this).css({
			'cursor':'pointer'
		});
		if(!jQuery.support.opacity) {
			/*$(this).stop();
			$(this).stop().animate(
				{ 
					
			}, 200);*/
			
			$(this).css({
					'overflow':'visible'
									});
			
			$(this).fadeTo(200,0.6);
		}
		else {
			$(this).stop().animate(
				{ 
				
				'opacity':0.6
			}, 200);
		}

   }, function() { //mouse out
   		if(!jQuery.support.opacity) {
			/*$(this).stop();
			$(this).stop().animate(
	  			{ 
				
				}, 200);*/
			$(this).fadeTo(200,1);
		}
		else {
			$(this).stop().animate(
				{ 
				
				'opacity':1
			}, 200);
		}
   });
   

	function effect(id, var1){
		if(var1==1){
			var lgth=$("#ss-menu"+ id+" .inside").height();
			/*var lgth = $("#sous_test"+id+" ul > li").length*30;*/
			$("#ss-menu"+id).stop(true).animate({'height':lgth+'px'},200);
		}
		else{
			$("#ss-menu"+id).stop(true).animate({'height':0+'px'},100);
		}
	}
	
	$(".MenuHorizontal1 li").hover(
      function () {
	  	var id=$(this).attr('id');
		effect(	id.substr(4,2),1)
      }, function () {
        var id=$(this).attr('id');
		effect(id.substr(4,2),0)
      }
    );	
	$(".sous_menu").hover(
      function () {
	  	var id=$(this).attr('id');
		effect(id.substr(7,2),1)
        
      }, function () {
		var id=$(this).attr('id');
		effect(id.substr(7,2),0)
      }
    );

});

$(document).ready(function() {
	$("a.thickbox, a[rel='lightbox']").fancybox({
		imageScale : true
	}); 
	$("a#box_ami, a#conseilFiche").fancybox({
	  frameWidth : 300,
	  frameHeight : 200
   }); 

	$("a#box_ml").fancybox({
		frameWidth : 650,
		frameHeight : 500
	}); 
	$(".kriffin").fancybox({'zoomSpeedIn':1000,'zoomSpeedOut':1000,'zoomSpeedChange':300,'padding':0});
	if(document.all){
		$("a#box_fav").click(function(){
			window.external.AddFavorite(location.href, document.title);
		});
	}else{
		$("a#box_fav").fancybox({ 
			'hideOnContentClick': true,
			frameWidth : 300,
			frameHeight : 100			 
		});
	}
});
function mycarousel_initCallback(carousel){
	carousel.buttonNext.bind('click', function() {
		carousel.startAuto(0);
	});
	carousel.buttonPrev.bind('click', function() {
		carousel.startAuto(0);
	});
	carousel.clip.hover(function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});
};
$(document).ready(function() {
	$('#mycarousel').jcarousel({
		auto: 4,
		wrap: 'last',
		initCallback: mycarousel_initCallback
	});
	$(".jcarousel-item").each(function(){
		var width=$(this).find("a img").width();
		$(this).width(width);
	});
});
