jQuery(document).ready(function(){
	easing();
	accordingFaqs();
	PoPuP();
	comboJqueryD("comboL","ListeL");
	comboJquery("Auteur","listeAuteur");
	comboJquery("departement","listeDep");
	comboJquery("Doc","listeDoc");
	comboJquery("Format","listeFormat");
	comboJquery("Theme","listeTheme");
	comboJqueryD("F_CM","F_LM");
	comboJqueryD("A_PR","A_LR");
	comboJqueryD("A_PR1","A_LR1");
	SlideBloc("#L_E_I a","#E_I",-70,0);
	SlideBloc("#A_R","#blocA_R",5,50,1);
	Accordion("#listeC_R li" , ".TopR", ".TxtEdito");
	/*HoverMenuL();*/
	SurvoleDCote(".blocLex");
	SurvoleDCote(".lienVA");
	SurvoleDCote(".tmpBlock");
	SurvoleDCote(".rightD h4");
	sousMenuC("#MenuC > li > a",".S_menu");
	CloseBB();
	SurvoleDCoteP(".btnJV");
	SurvoleDCoteP(".Title_MG");
	SurvoleDCoteP(".IMGForHover");
	heightBG();
	expandGal(".btnAgrandir");
	Accordion(".blocLex" , ".AP_PDF h3", ".txt_Tel");
	DisplayGalerie(".TypeOfDisplay li a","#B_Par_V","#B_Par_L");
	DiapoD();
	NewSearch();
	//GetWidthMenu("#MenuC");
	GetWidthMenu("#blocA_RDN");
	SurvoleDCote(".G_BET");
	replaceRef("#RefDep","#listeDep > li > a");
	casacohe();
	SurvoleDCote(".blocLex");
	SurvoleDCoteP(".M_ss3");
	SurvoleDCote(".M_fac");
	SurvoleDCote(".M_result");
	SurvoleDCote(".txtTemoignage");
	SurvoleDCote(".vignetteSecteur");
	SurvoleDCote(".detailTemoignage");
	SurvoleDCote(".detailSuccess");
	SurvoleDCote("#M_accordion .M_left");
	SurvoleDCote(".lienUtile",".resultVedio .M_result");
	SurvoleDCote(".FacOver");
	SurvoleDCote(".telechargerDoc");
	SurvoleDCote(".M_bd");
	SurvoleDCote(".M_surlvV");
	SurvoleDCote(".M_secend2");
	SurvoleDCote(".rightBlocAnn");
	CenterNav();
	checkCookie();
	replaceRef("#Ext","#listeFormat a");
	replaceRef("#type","#listeDoc a");
	replaceRef("#auteur","#listeAuteur a");
	if($('.ActuListeD2')[0])  AnimateActu2(); else  AnimateActu();
	EgHeight();
	HelpScroll();
	TabNav();
	SurvoleDCote(".ListVid li");
	SurvoleDCote(".desc_TM");
	freeForMyGuide();
	$("#bg_black , #CloseDP").live("click",function(){
    $("#DivPop").fadeOut("slow").remove();
  });
	
	// 
	$("a.modalCloseImg").hover( function(){ $(this).addClass("modalCloseImg2"); } );
	
	
	//Mehdi code
		//News/Agenda
		$("ul.ListeEv li").hover(function(){
			//$(this).closest("div.EvB").find("div.TxtChange").children("a").hide();
			var P=$(this).closest(".ListeEv");
			var id=$(this).attr("rol");
			P.children("li").removeClass("active");
			$(this).addClass("active");
			P.prev().children().hide();
			P.prev().find("a#"+id).fadeIn(200);
		},function(){});
		//Reveue de presse 
			comboJquery("departement","listeDep");
		//eNd
		//Print
			Print('#Cont',"a#Print");		
			Print('#Mon_G',"a#MyPrint");	
		//eNd
		var urlCourant =jQuery(location).attr("href");
		//Partager cette page sur faceBook	
			$("a#Facebook").click(function(){
				$(this).attr({
					href : "http://www.facebook.com/sharer.php?u="+urlCourant,
					target : "_blank"
				});							   
			});
		//eNd
		//Partager cette page sur twitter	
			$("a#Twitter").click(function(){
				$(this).attr({
					href : "http://twitter.com/share?_="+urlCourant,
					target : "_blank"
				});							   
			});
		//eNd
		
		//eNd
		
		//Mon Guide
			$('a#MyGuide').click(function(){
				var ValCookie=$.cookie('MyGuide');
				//alert(ValCookie);
				if(ValCookie!=null && ValCookie!=""){
					var TabVal=ValCookie.split("@");
					if (jQuery.inArray(Id, TabVal)==-1)  ValCookie+="@"+Id;
				}
				else{
					ValCookie=Id;
					$('#M_G').fadeIn('slow');
				}
				$.cookie('MyGuide', ValCookie);  
				freeForMyGuide(); 
				//alert(ValCookie);
			});
		//
			$('a#M_G').click(function(){
				var ValCookie=$.cookie('MyGuide');
				if(ValCookie!=null)
				{	$.ajax({
						type: "GET",
						url: 'content/myguide.php',
						data: "strIdGuide="+ValCookie+"&lang="+lang+"&type=1",
						success: function(data) {
							$('body').append('<div id="DivPop" style="display:none; position:absolute; z-index:700000; left:0; top:0; width:100%;height:100%"></div>');
							$("#DivPop").html(data).fadeIn("pretty");
							SurvoleDCoteP(".Title_MG");
							SurvoleDCoteP(".btnJV");
							heightBG();
							$("#GalMG").scrollable({size:1}).navigator();	
							$("#bg_black").click(function(){
								$("#DivPop").fadeOut("pretty");						
							});
							CenterNav();
						}
					});
				}
			});
		//eNd
		//En un clic
			$('a#EnUnClic,a#EnUnClic1').click(function(){
				$.ajax({
					type: "GET",
					url: 'content/enunclic.php',
					data: "lang="+lang,
					success: function(data) {
						$('body').append('<div id="DivPop" style="display:none; position:absolute; z-index:700000; left:0; top:0; width:100%;height:100%"></div>');
						$("#DivPop").html(data).fadeIn("pretty");
						SurvoleDCoteP(".Title_MG");
						SurvoleDCoteP(".btnJV");
						heightBG();	
						$("#bg_black").click(function(){
							$("#DivPop").fadeOut("pretty");						
						});
						$("#GalMG").scrollable().navigator();
						CenterNav();
					}
				});
			});
		//eNd 
	//eNd
});
var settime; 
/*function AnimateBGAcc(){
	$('#ForDpAcc a').bind('click', function(){
		HrefOld=recupHrefOld();
		if( ! $(this).hasClass('active') )
			setTimeout(function(){ 
							slideDP(HrefOld,true);
							/*$('.ZapHover').hide();
							$('#ForDpAcc').find('.disabled').closest('div').find('.ZapHover').show();
						} , 20 );
	});
}*/


function freeForMyGuide() {
    var ValCookie= $.cookie('MyGuide') ? $.cookie('MyGuide') : "";
		var TabVal=ValCookie.split("@");
		var nbreId=TabVal.length;
		
		for(var i=0;i<nbreId;i++){
			if(TabVal[i] == Id){
			  $("a#MyGuide").html('<img src="images/pictoInPlus.gif" style="cursor:not-allowed; filter:none" />');
			  return false;
			}
		}
		$("a#MyGuide").html('<img src="images/pictoPlus.gif" alt="" onmouseover="this.src=\'images/pictoPlusH.gif\'" onmouseout="this.src=\'images/pictoPlus.gif\'"/>');
		return true;
}


//Mehdi Function
	//mon guide
	function UpdateCookie(IdRubDelete){
		var ValCookie=$.cookie('MyGuide');
		var TabVal=ValCookie.split("@");
		var nbreId=TabVal.length;
		//alert(nbreId);
		ValCookie="";
		for(var i=0;i<nbreId;i++){
			if(TabVal[i]!=IdRubDelete){
				if(ValCookie=="")	ValCookie=TabVal[i];
				else				ValCookie+="@"+TabVal[i];
			}
			
		}
		//alert(ValCookie);
		$.cookie('MyGuide', ValCookie);	
		//btn Mon guide
		if(ValCookie=="")	$('#M_G').hide();			
		//
		$.ajax({
			type: "GET",
			url: 'content/myguide.php',
			data: "strIdGuide="+ValCookie+"&lang="+lang+"&type=0",
			success: function(data) {
				$("div#MyGuideContent").html(data);
				$("#GalMG").scrollable({size:1}).navigator();	
				freeForMyGuide();
				CenterNav();			
			}
		});
	}
	//eNd
	//Verifier si la cookie est plein ou vide
	function checkCookie(){
		var ValCookie=$.cookie('MyGuide');
		if(ValCookie==null || ValCookie==""){
			$('#M_G').hide();
		}
		else{	
			$('#M_G').fadeIn('slow');
		}
	}
	//eNd
	//Print
	function Print(divToPrint,idPrint){		
		$(idPrint).live('click',function(){
			$('#contentToPrint').attr('value',$(divToPrint).html());
			$('#formPrint').submit();
		});
	}
	//eNd	
//eNd

function CounterField(Page,Id,field,table)
{
	$.ajax({
		type:"POST",
		data:"Id="+Id+"&field="+field+"&table="+table,
		url:Page,
		success:function(msg){}});
}
function HelpScroll()
{
	if($('.jspDrag')[0])
	{
		$('.jspDrag').each(function(){
			$(this).append('<div class="jspDragCenter"></div>');
			$(this).find(".jspDragCenter").height($(this).height()-16);						
		});
		
		
	}
}
function EgHeight()
{
	
	if($("#Right_detail")[0])
	{	
		HL=$("#Left_detail").innerHeight();
		HR=$("#Right_detail").innerHeight();
		if(HR>HL) 
			{
				$("#Left_detail").height(HR);
				$("#Left_detail").css("margin-bottom","12px");
			}
	}
}
/* GetNbr */
function GetNbr2(nbP , nbT , coNav ,TxtAfficher, scroll2)
{	
  $(coNav + " a").live("click",function(){
		$P=$(this).closest(".Navigation");
		setTimeout(function(){
				var id = 0;
				if( $P.find(".active").attr("href"))
				{
					id = $P.find(".active").attr("href").substr(1);
					id = parseInt(id);
					var D,F;
					D= nbP * (id)+1;
					F= nbP * (id+1);
					if(F>nbT)	F=nbT;
					var TextPage = TxtAfficher[0]+" "+ D + " "+TxtAfficher[1]+" " + F + " ";
					$P.prev().find("span").html(TextPage);
					$(coNav + "-second").html(TextPage);
					var nh = $P.closest(".Plugin").find(".items").children("div").eq(id).height();
					$P.closest(".Plugin").find(".scrollable").animate({"height": nh }, 500 );
					if(scroll2) {
					  moveToUp2(300); 
					}
				}										
			},400);
	});
}

function replaceRef(IdHidden,LinkClick)
{
	$(LinkClick).live("click",function(){
		$(IdHidden).attr("value",$(this).attr("id"));								   
	});	
}

function PoPuP()
{
	$('.regionPos2').bind("mouseenter",function(){
		var IDR=$(this).attr('id').substring(2,$(this).attr('id').length);
		$('.POPUP').fadeOut('pretty');$('.regionPos2').removeClass('Surv');
		$('#B_'+IDR).fadeIn('pretty');$(this).addClass('Surv');
		$('#B_'+IDR).bind("mouseleave",function(e){
			$(this).fadeOut('pretty');
			$('#L_'+IDR).removeClass('Surv');
		});
		$('#H_'+IDR).bind("mouseover",function(e){
			$('#B_'+IDR).fadeOut('pretty');
			$('#L_'+IDR).removeClass('Surv');
		});
	});	
}

function Load()
{
	CenterNav();
	$(".TxtEdito ul li").not(".TxtEdito ul li ul li").prepend('<img src="images/pictoLi'+langCSS+'.gif" alt="" class="pictoLIII"/>');
	$(".TxtEdito ul li ul li").prepend('<img src="images/puce1'+langCSS+'.gif" alt="" class="pictoLIII"/>');
	$(".TxtEdito ul li ul li ul li").prepend('<img src="images/puce2'+langCSS+'.gif" alt="" class="pictoLIII"/>');
	GetHS(".scrollable div div:first",".scrollable");
	//myBorderStyle();
	//GetHS(".scrollable div div:first",".scrollable");
}
function GetWidthMenu(Elem)
{
	var w=$(Elem).innerWidth();
	$(Elem).width($(Elem).innerWidth()+10).css({marginLeft:"-"+(($(Elem).innerWidth()+3)/2)+"px",left:"50%"});	
}
function NewSearch()
{
	$("#NewSearch a").bind("click",function(){
		$('html').animate({scrollTop:$('[name=ancre]').offset().top+"px"} ,1000,function(){$("#ReLoad *").remove();});									   								   
	});
}
function DiapoD()
{
	$("#NavDiapo a").bind("click",function(){
		var Href=$(this).attr("href");
		var Title=$(this).attr("title");
		$(this).closest("#NavDiapo").prev("#imgChanged").find("img").hide().attr("src",Href).fadeIn("pretty");
		$(this).closest("#NavDiapo").prev("#imgChanged").find("h5").hide().html(Title).fadeIn("pretty");
		return false;									   
	});
}
function AnimateActu()
{
	$(".ActuListeD").bind("mouseenter mouseleave",function(e){
		if(e.type=="mouseenter") 
		{
				$(this).find(".G_DA").stop().animate({left:"0"},300);
		}
		else
		{
			$(this).find(".G_DA").stop().animate({left:"-345px"},300);	
		}
	});
}

function AnimateActu2()
{
	$(".ActuListeD").bind("mouseenter mouseleave",function(e){
		if(e.type=="mouseenter") 
		{
				$(this).find(".G_DA").stop().animate({left:"0"},300);
		}
		else
		{
			$(this).find(".G_DA").stop().animate({left:"-163px"},300);	
		}
	});
}

function DisplayGalerie(El,Bloc1,Bloc2)
{
	$(El).bind("click mouseenter mouseleave", function(e){
	   //alert("T");
		if(!$(this).hasClass("clicked"))
		{
			//alert("T_0");
		  if($(this).parent().next()[0])
			{
				if(e.type=="mouseenter")
					$(this).find("img").attr("src","images/GPHH.gif");	
				else if (e.type=="mouseleave")
					$(this).find("img").attr("src","images/GPH.gif");
				else 
				{	$(this).find("img").attr("src","images/GPH_H.gif");
					$(this).parent().next().find("img").attr("src","images/GLH.gif").parent("a").removeClass("clicked");
					$(Bloc1).fadeIn("300");$(Bloc2).hide();
					$(this).addClass("clicked");
					CenterNav();
					GetHS(".BlocNav:first","#GalLU")
				}
				
			}
			else if($(this).parent().prev()[0])
			{
				if(e.type=="mouseenter")
					$(this).find("img").attr("src","images/GLHH.gif");	
				else if (e.type=="mouseleave")
					$(this).find("img").attr("src","images/GLH.gif");
				else
				{	$(this).find("img").attr("src","images/GLH_H.gif");
					$(this).parent().prev().find("img").attr("src","images/GPH.gif").parent("a").removeClass("clicked");
					$(Bloc2).fadeIn("300");$(Bloc1).hide();
					GetHS(".BlocNav:first","#GalLU");
					CenterNav();
					$(this).addClass("clicked");
				}
			}
		}
	});
}
/*btn expand galerie */
function expandGal(TagBtn)
{
	jQuery(TagBtn).click(function()
	{
		ObjScroll=jQuery(this).closest("#BasNavigation").parent().find(".scrollable:first");
		if($(this).hasClass("activeBtn"))
		{
			jQuery(this).removeClass("activeBtn");
			jQuery(ObjScroll).removeClass("noScroll");
			jQuery(ObjScroll).height(HE);
			//jQuery(ObjScroll).animate({"height": HE },300);
			//jQuery(ObjScroll).hide().height(HE).slideDown();
			jQuery(this).closest("#BasNavigation").find(".Navigation").show().prev(".Nbr_navigation").show();
			$(".AGG").show().next().hide();
			//jQuery(this).children("img").attr({src:"images/fr/btn_agrandir.gif",alt:""});	
		}
		else
		{
			HE=jQuery(ObjScroll).innerHeight();
			jQuery(this).addClass("activeBtn");
			
			jQuery(ObjScroll).height("auto");
			//jQuery(ObjScroll).hide().height("auto").slideDown();

			jQuery(ObjScroll).addClass("noScroll");
			jQuery(this).closest("#BasNavigation").find(".Navigation").hide().prev(".Nbr_navigation").hide();;
			$(".RDG").show().prev().hide();
		}
	
	});	
}
function heightBG()
{	$("#bg_black").height($(document).height());
}
function CloseBB()
{	jQuery("body").click(function(e)
	{
		var target = $(e.target);
		if(target.is("#blocA_R")==false && target.is("#blocA_R *")==false)
		{
			$("#blocA_R").animate({top:"5px"},200);
			$("#A_R").removeClass("ClickEnter");
		}
	});
}
function CenterNav()
{	$(".Navigation").each(function(){
			$(this).css("margin-left","-" + (($(this).width()/2)-2) + "px");					  
	});	
}
/* function faqs */
function accordingFaqs()
{	$(".CRep").bind("mouseenter mouseleave click",function(event){
			if(event.type=="click") 
			{	if($(this).closest(".Faq").attr("class").indexOf("Active")==-1)
						$(this).closest(".Faq").removeClass("Hover").addClass("Active").find(".C_REP").show().parent().find(".V_REP").hide().closest(".reponse").find(".textFaqs").slideDown("pretty");
				else
						$(this).closest(".Faq").removeClass("Active").find(".C_REP").hide().parent().find(".V_REP").hide().closest(".reponse").find(".textFaqs").slideUp("fast");
			}
			else if($(this).closest(".Faq").attr("class").indexOf("Active")==-1)
			{	if(event.type=="mouseenter")
					$(this).closest(".Faq").addClass("Hover").find(".V_REP").show();
				else if(event.type=="mouseleave")
					$(this).closest(".Faq").removeClass("Hover").find(".V_REP").hide();
			}
	});
}
/* function 5 raison*/
function SurvoleDCote(ElemEnter)
{	$(ElemEnter).bind("mouseenter mouseleave",function(e){
			if(e.type=="mouseenter")
				$(this).addClass("Hover");
			else if(e.type=="mouseleave")
				$(this).removeClass("Hover");
	});
}
/* function parrent Add class*/
function SurvoleDCoteP(ElemEnter)
{	$(ElemEnter).bind("mouseenter mouseleave",function(e){
			if(e.type=="mouseenter")
				$(this).parent().addClass("Hover");
			else if(e.type=="mouseleave")
				$(this).parent().removeClass("Hover");
	});
}
/* function 5 raison*/
function Accordion(ParentFilter , BtnClick, ElmSlide)
{	$(BtnClick).bind("mouseenter mouseleave click",function(event){
		if(event.type=="click") 
		{	
			if($(this).closest(ParentFilter).attr("class").indexOf("Active")==-1)
			{
				
				$(ParentFilter).each(function(){
					$(this).removeClass("Active").find(ElmSlide).slideUp("pretty");					  
				});
				$(this).closest(ParentFilter).removeClass("Hover").addClass("Active").find(ElmSlide).slideDown("pretty");
				if($('.Scroll')[0])		jQuery('.Scroll').jScrollPane();
				HelpScroll();
			}
			else $(this).closest(ParentFilter).removeClass("Hover").removeClass("Active").find(ElmSlide).slideUp("pretty");
			var El=$(this).closest(".BlocNav");
			setTimeout(function() { GetHS(El[0],"#GalLU");},500);
		}
		else if($(this).closest(ParentFilter).attr("class").indexOf("Active")==-1)
		{	
		  if(!$(".AP_PDF")[0])	
				if(event.type=="mouseenter")
					$(this).closest(ParentFilter).addClass("Hover");
				else if(event.type=="mouseleave")
					$(this).closest(ParentFilter).removeClass("Hover");
		}
	});
}
/* Slide bloc width animate */
function SlideBloc(BTN,BLOC,VALSI,VALSF,Type)
{
	$(BTN).bind("click",function(event){
		if($(this).attr('class').indexOf("ClickEnter")==-1){
			if(Type)	
				$(BLOC).animate({top:VALSF+"px"},200);			
			else 		
				$(BLOC).animate({marginTop:VALSF+"px"},200);
			$(this).addClass("ClickEnter");
		}
		else{
			if(Type)	$(BLOC).animate({top:VALSI+"px"},200);
			else 		$(BLOC).animate({marginTop:VALSI+"px"},200);
			$(this).removeClass("ClickEnter");
		}
	});
}
/* Survole menu Left */
function HoverMenuL()
{
	$("#MenuLeft li a").each(function(){
		$(this).parent().append($(this).clone().addClass("clone")).append($(this).clone().addClass("animate"));								  
	});
	$("#MenuLeft li a").bind("mouseenter mouseleave",function(event){
			if(event.type=="mouseenter")	
			{
				$(this).parent().find(".clone").stop().animate({opacity:1} , 10);
				$(this).parent().find(".animate").stop().animate({top:"0px"} , 10);
			}
			else
			{	
				$(this).parent().find(".clone").stop().animate({opacity:0},10);
				$(this).parent().find(".animate").stop().animate({top:"30px"},10);
			}
	});
}
function TabNav()
{
	$(".NavBtn > a").live("click",function(){
		if( $(this).next()[0] )
			$(this).addClass("current").next().removeClass("current").closest(".NavBtn").nextAll(".bloc_1").fadeIn("pretty").nextAll(".bloc_2").hide();	
		else if( $(this).prev()[0] )
			$(this).addClass("current").prev().removeClass("current").closest(".NavBtn").nextAll(".bloc_1").hide().nextAll(".bloc_2").fadeIn("pretty");	
	});
	
}
/* combobox Jquery */
function comboJqueryD(IdCombo,IdList)
{
	jQuery("#"+IdCombo).click(function()
	{
		var Parent=jQuery(this).parent().get(0);
		if(Parent.className=="current")
		{
			jQuery("#"+IdList).slideUp(150);
			jQuery(Parent).removeClass("current");
		}
		else
		{			
			
			Parent.className="current";
			jQuery("#"+IdList).slideDown(150);
		}
	});
	jQuery("#"+IdList+" li a").click(function()
	{
		var Parent=jQuery("#"+IdList).parent().get(0);
		//document.getElementById(IdCombo).innerHTML=this.innerHTML;
		jQuery("#"+IdCombo+" .bg_combo").html(this.innerHTML);
		jQuery("#"+IdList).slideUp(150);
		jQuery(Parent).removeClass("current");
	});	
	
	// Update [Start]
	jQuery("body").click(function(e)
	{
		var target = $(e.target);
		var Parent=jQuery("#"+IdList).parent().get(0);
		if(target.is("#" + IdList)==false && target.is("#" + IdList + " *")==false 
		  && target.is("#" + IdCombo) == false && target.is("#" + IdCombo + " *")==false)
		{
      jQuery("#"+IdList).slideUp(150);
      jQuery(Parent).removeClass("current");
		}
	});
	// Update [End]
	
	
	
}
/* menu centrale */
function sousMenuC(ElemenL,ElementS)
{
	jQuery(ElemenL).hover(function() {
		var W_E=(jQuery(this).innerWidth()-242)/2-2;	
		//alert(jQuery(this).innerWidth());
		Curr=this;
		jQuery(this).parent().find(ElementS).slideDown(300);
		if($(this).parent().attr("class").indexOf("hasClass") == -1) 	jQuery(this).parent().find(ElementS).css("left",W_E+"px");		
		jQuery(this).addClass("HoverMenu");
		jQuery(this).parent().hover(function(){								 
		},function(){
			jQuery(this).find(ElementS).slideUp(100);
			jQuery(Curr).removeClass("HoverMenu");
		});
	});	
}
/* casa coche */
function casacohe()
{
	jQuery("#listeDep .M_cohce a").click(function()
	{
		if(this.className=="M_mactive")
		{
			$(this).removeClass("M_mactive");
		}
		else
		{
			$(this).addClass("M_mactive");
		}
	});
}

/**/
function RemoveC()
{
	jQuery("a").live("click",function(){
		var Href=jQuery(this).attr("href").toLowerCase();
		if (Href!="")	
			if(Href.indexOf("javascript") == -1 && Href.indexOf("return") == -1 && Href.indexOf(":") == -1 && Href.indexOf("www") == -1 && Href.indexOf("#") == -1)	
				$("body").remove();
	});
}
/* new */
function survCote(CL,CR)
{	
	$(CL+","+CR).live("mouseover mouseout",function(event){
		if(event.type=="mouseover")
			$(this).closest("div.download").toggleClass("Current");	
		else
			$(this).closest("div.download").toggleClass("Current");
	});
}
/* GetNbr */
function GetNbr(nbP,nbT)
{	
	$('.slidetabs a').live('click',function(){
		var id=$(this).attr("id");
		var D,F;
		D=nbP*(id-1)+1;
		F=nbP*id;
		if(F>nbT)	F=nbT;
		$(".NBE span").html(D+" � "+F);
	});
}
function HoverVD()
{	
	jQuery(".v_d").bind('mouseenter mouseleave',function(event){
		if(event.type=='mouseenter')
		{
			$(this).find('.NEB').hide();
			$(this).find('.CC').show();
			var H=$(this).find('.v_d_c').innerHeight();
			$(this).find('.v_d_c').fadeIn("pretty");
			//$(this).find('.v_d_c').stop().animate({"top":"-"+H+"px"},300);
		}
		else 
		{
			$(this).find('.NEB').show();
			$(this).find('.CC').hide();
			$(this).find('.v_d_c').fadeOut("pretty");
			//$(this).find('.v_d_c').stop().animate({"top":"0px"},400);	
		}
	});
}
function HoverLien()
{
	
	jQuery("a").bind('mouseenter mouseleave',function(event){
			/*var RGB=jQuery(this).css("color");
				RGB=RGB.replace("rgb(","");
				RGB=RGB.replace(")","");
				TabC=RGB.split(",");
				*/
			if(event.type=='mouseenter')   jQuery(this).addClass("test");
			else						   jQuery(this).removeClass("test"); 
	});	
}
/* color animation */
function GetColorAn()
{(function($) {
	$.fn.animateColor = function(C1, C2, t) {
		var fC = 100;
		var tmpClass = "ac-class-tmp";
		$(this).toggleClass(tmpClass);
		var counter = 0;	
		// Color graduation
		function  coolor_split(C1, C2, t) {
			k = 1.0 * t / fC ;
			k = t / fC ;
			dC = [(C2[0]-C1[0])/k, (C2[1]-C1[1])/k, (C2[2]-C1[2])/k];
			Res = new Array();
			for(i=0; i < k; i++) {
				Res[i] = [ parseInt(C1[0] + dC[0] * i),  parseInt(C1[1] + dC[1] * i),  parseInt(C1[2] + dC[2] * i)];
				//Res[i] = [ parseFloat(C1[0]) + parseFloat(dC[0]) * i,  parseFloat(C1[1]) + parseFloat(dC[1]) * i,  parseFloat(C1[2]) + parseFloat(dC[2]) * i];
			}
			//alert(Res[k-1][0]+" // "+C2[0]);
			return Res;
		}
		var cc = coolor_split(C1, C2, t);
		var tt = parseInt(t / fC);
		//var tt = parseFloat(t / fC);
		for(i=0; i < k; i++) {
			var strT = "$('."+tmpClass+"').css('color','rgb("+cc[counter][0]+","+cc[counter][1]+","+cc[counter][2]+")');";
			counter++;
			setTimeout(strT, tt*i);
		}
		strT = "$('."+tmpClass+"').toggleClass('"+tmpClass+"')";
		setTimeout(strT, tt*(i+1));
	};
})(jQuery);
}
/* LightBoxPerso By amine_eg */
function Ami_Box(CLASSRUB,CLASSRUBPARENT)
{
	  function AdjustLight(id){
		  widthB=jQuery("#LightBox").width();
		  heightB=jQuery("#LightBox").height();
		  //alert(widthB+" : "+heightB);
		  jQuery("#LightBox").animate({marginLeft:"-"+(widthB/2)+"px",marginTop:"-"+(heightB)/2+"px",left:"50%",top:"50%"},{easing:'easeOutSine',duration:600});
		  //jQuery("#LightBox").css("top","50%");jQuery("#LightBox").css("left","50%");
	  }
	  jQuery("."+CLASSRUB).click(function (){
			$current=jQuery(this).parent();
			jQuery("body").append("<div id=\"DP\"><div id=\"bg\"></div><div id=\"Loader\"><img src=\"images/ajax-loader_b.gif\" /></div><div id=\"LightBox\" style=\"display:none\"><div id=\"Prev\"><img src=\"images/prev.png\" alt=\"\" onmouseover=\"this.src='images/prev_h.png'\" onmouseout=\"this.src='images/prev.png'\"/></div><div id=\"Next\"><img src=\"images/next.png\" alt=\"\" onmouseover=\"this.src='images/next_h.png'\" onmouseout=\"this.src='images/next.png'\"/></div><table cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"t_l\"></td><td class=\"t_c\"></td><td class=\"t_r\"></td></tr><tr><td class=\"c_l\"></td><td class=\"c_c\" id=\"imgDF\"><img src=\""+jQuery(this).attr("alt")+"\" alt=\"\" /></td><td class=\"c_r\"></td></tr><tr><td class=\"b_l\"></td><td class=\"b_c\"><h5 class=\"titleD\" id=\"titleD\">"+jQuery(this).attr("title")+"</h5><a href=\"javascript:void(0)\" id=\"Close\"></a></td><td class=\"b_r\"></td></tr></table></div></div>");
			jQuery("."+CLASSRUBPARENT).each(function(){
						jQuery("#DP").append('<img src="'+jQuery(this).children("a").attr("alt")+'" style="display:none"/>');
			});
			if (!$current.next().attr("class"))	    jQuery("#Next").hide();
			if (!$current.prev().attr("class"))	    jQuery("#Prev").hide();
			if(navigator.userAgent.toLowerCase().indexOf('msie')!=-1){   
																		 if(navigator.userAgent.toLowerCase().indexOf('msie 6')!=-1)	correctPNG(); 
																	     jQuery("#bg").css("height",jQuery("body").height()+"px");
																	  }
			else 														 jQuery("#bg").css("height",jQuery("html").height()+"px");
			
			setTimeout(function(){jQuery("#LightBox").fadeIn(800);jQuery("#Loader").fadeOut(800);AdjustLight();},2000);
			/* Btn fermer Lightbox */
			jQuery("#Close").click(function (){
					jQuery("#LightBox").fadeOut(); jQuery("#bg").fadeOut(600);
					setTimeout(function(){ jQuery("#DP").remove();},600);
			});
			jQuery("#bg").click(function (){
					jQuery("#LightBox").fadeOut(); jQuery("#bg").fadeOut(600);
					setTimeout(function(){ jQuery("#DP").remove();},600);
			});
			/* Btn Next Lightbox */
			jQuery("#Next").click(function(){
				$current=$current.next();
				if($current.attr("class").indexOf(CLASSRUBPARENT) !=-1 )
				{
					jQuery("#imgDF").html("<img src=\""+$current.children("a").attr("alt")+"\" alt=\"\"/>");jQuery("#titleD").html(""+$current.children("a").attr("title")+"");
					jQuery("#Prev").show();
					AdjustLight();
					if(!$current.next().attr("class"))	jQuery("#Next").hide();	
				}
			});
			/* Btn prev Lightbox */
			jQuery("#Prev").click(function (){
				$current=$current.prev();
				if($current.attr("class").indexOf(CLASSRUBPARENT) !=-1)
				{
					jQuery("#imgDF").html("<img src=\""+$current.children("a").attr("alt")+"\" alt=\"\"/>");jQuery("#titleD").html(""+$current.children("a").attr("title")+"");
					jQuery("#Next").show();
					AdjustLight();
					if(!$current.prev().attr("class"))	jQuery("#Prev").hide();
				}
			});
	  });
}
/* la hauteur */
function detectionHauteur()
{	
	try{
		var RV=document.getElementById("MainR").offsetHeight;
		var RVC=document.getElementById("Content").offsetHeight;
		var GV=document.getElementById("MainL").offsetHeight;
		RVC-=64;
		if(GV>RV)  
			if(navigator.userAgent.toLowerCase().indexOf('msie 6')!=-1)	{   /*RVC-=12;*/ document.getElementById("Content").style.height=RVC+(GV-RV)+"px"; }
			else  															document.getElementById("Content").style.minHeight=RVC+(GV-RV)+"px";
		AdjustH("Content",64);
		}
	 catch(e){}
}
function getGal(id)
{
	jQuery("#Nav_Img img").each(function(){$(this).hide();});
	//jQuery("#Nav_Img p").fadeOut("pretty");
	/*setTimeout(function(){
		jQuery("#img"+id).fadeIn("pretty");
		//jQuery("#Nav_Img p").fadeIn();
	},300);*/
	jQuery("#img"+id).fadeIn("slow");
	
}
function anime()
{
	try
	{
		setTimeout(function(){
					if(navigator.userAgent.toLowerCase().indexOf('msie')!=-1)				jQuery("#logo").show();
					else 																	jQuery("#logo").fadeIn(500)
					jQuery("#NavLeft").slideDown({duration:1400, easing:'easeOutBounce'});
					jQuery("#MainL").css("padding-top","0px");
					AdjustH("N_L_CD",5);
					setTimeout(function(){detectionHauteur();},1600)			
		},3000);
	}catch(e){}
}
function AdjustH(IdDiv,PaddingDiv)
{
	try
	{
		if(!PaddingDiv)  PaddingDiv=0;
		var H=/*(document.getElementById(IdDiv).offsetHeight)*/jQuery("#"+IdDiv).innerHeight();
		var R=H%3;
		//alert(IdDiv+"//"+H);
		H-=PaddingDiv;
		if(R!=0)
		{	R=3-R;
			if(navigator.userAgent.toLowerCase().indexOf('msie 6')!=-1)	    jQuery("#"+IdDiv).css("height",H+R+"px");
			else  														    jQuery("#"+IdDiv).css("min-height",H+R+"px");
		}
	}catch(e){}
}
function GetWnav()
{
	jQuery(".navBtnPhoto").each(function(){
		var W=jQuery(this).width();
		jQuery(this).css("margin-left","-"+(W/2)+"px");
	
	});
}
function GetNbCombo()
{
	var i=300;
	jQuery(".B_Combo").each(function(){jQuery(this).css("z-index",i);i--;});
}
function Step(id)
{
	jQuery(".step").each(function(){$(this).hide();});	
	jQuery("#NavRubD a").each(function(){$(this).removeClass("active");});	
	jQuery("#Step"+id).fadeIn("pretty");
	jQuery("#RubNav"+id).addClass("active");
}

function HoverEqui(Elem)
{
	jQuery(Elem).hover(function(){
		jQuery(this).addClass("Hover");							
	},function(){
		jQuery(this).removeClass("Hover");	
	});
}
function openForm()
{
	jQuery("#btnOffre").click(function()
	{
	  if(this.className=="active")
	  {
		jQuery("#formulaireOffre").fadeOut(100);
		jQuery(this).removeClass("active");
		jQuery(this).attr({src:"images/fr/btn_repondreOffre.gif",alt:""});
	  }
	  else
	  {
		jQuery("#formulaireOffre").fadeIn(800);
		jQuery(this).addClass("active");
		jQuery(this).attr({src:"images/fr/btn_fermerFormulaire.gif",alt:""});
	  }
	});	
}
function initExpand()
{	
	jQuery(".btnExpand").each(function()
	{
		A=jQuery(this).parent().parent().get(0);
		B=jQuery(this).parent().get(0);
		jQuery(B).children(".navBtnPhoto").show();
		jQuery(this).removeClass("active");
		jQuery(A).children(".scrollable").removeClass("noScroll");
		jQuery(this).children("img").attr({src:"images/fr/btn_agrandir.gif",alt:""});	
	});
}
/* menu Accoording duplicate */
function MenuAccordingForS(Lien,BlocAffiche)
{
   	jQuery(Lien).click(function()
	{												
		P=jQuery(this).parent().get(0);
		if(P.className=="current")
		{
			jQuery(P).removeClass("current");
			jQuery(P).children(BlocAffiche).slideUp(500);
			initExpand();
		}
		else
		{
			initExpand();
			jQuery(Lien).each(function(){
				PA=jQuery(this).parent().get(0);
				jQuery(PA).removeClass("current");	
				jQuery(PA).removeClass("hover");
				jQuery(PA).children(BlocAffiche).slideUp(500);
				//alert("fermer");
			});
			jQuery(P).children(BlocAffiche).slideDown(600);
			jQuery(P).addClass("current");
			GetWnav();
		}
	});
}


function myBorderStyle() {
  var leftH2 = $(".M_borPlus").height();
  var rightH2 = $("#Right_detail").height();
  //alert(leftH2 + " # " + rightH2);
  if(leftH2 >= rightH2) {
    $(".M_borPlus").css("borderRight", "1px solid #E1E1E1");
    $("#Right_detail").css("border","0");
  }
  else {
    $("#Right_detail").css("borderLeft", "1px solid #E1E1E1");
    $(".M_borPlus").css("border","0");
  }
}

/* hauteur pour le slide */
function GetHS(Em,Re)
{	$('.scrollable').each(function(){
		var Height=$(this).find('.items').children(":first").innerHeight();
		$(this).height(Height);
	});
}
/* combobox Jquery */
function comboJquery(IdCombo,IdList)
{
	if( $("#"+IdList).hasClass("disIfTwo") && $("#"+IdList+" li").size() == 2 ) {
	  $("#"+IdList).remove();
	  $("#"+IdCombo).addClass("mydisable");
	  return false;
	}
  
  jQuery("#"+IdCombo).click(function()
	{
		var Parent=jQuery(this).parent().get(0);
		if(Parent.className=="current")
		{
			jQuery("#"+IdList).slideUp(150);
			jQuery(Parent).removeClass("current");
		}
		else
		{			
			
			Parent.className="current";
			jQuery("#"+IdList).slideDown(150);
		}
	});
	jQuery("#"+IdList+" li a").click(function()
	{
		var Parent=jQuery("#"+IdList).parent().get(0);
		document.getElementById(IdCombo).innerHTML=this.innerHTML;
		jQuery("#"+IdList).slideUp(150);
		jQuery(Parent).removeClass("current");
	});	
	
	// Update [Start]
	jQuery("body").click(function(e)
	{
		var target = $(e.target);
		var Parent=jQuery("#"+IdList).parent().get(0);
		if(target.is("#" + IdList)==false && target.is("#" + IdList + " *")==false 
		  && target.is("#" + IdCombo) == false && target.is("#" + IdCombo + " *")==false)
		{
      jQuery("#"+IdList).slideUp(150);
      jQuery(Parent).removeClass("current");
		}
	});
	// Update [End]
}
/* menu Accoording */
function MenuAccording(Lien,BlocAffiche)
{
   	jQuery(Lien).click(function()
	{												
		P=jQuery(this).parent().get(0);
		if(P.className=="current")
		{
			jQuery(P).removeClass("current");	
			jQuery(P).children(BlocAffiche).slideUp("pretty");
		}
		else
		{
			jQuery(BlocAffiche).each(function(){
				PA=jQuery(this).parent().get(0);
				jQuery(PA).removeClass("current");	
				jQuery(BlocAffiche).slideUp("pretty");
			});
			jQuery(P).children(BlocAffiche).slideDown({duration:500,easing: 'easeOutBounce'});
			jQuery(P).addClass("current");
		}
	});
}

/* menu Accoording duplicate */
function MenuAccordingForV(Lien,BlocAffiche)
{
   	jQuery(Lien).click(function()
	{												
		P=jQuery(this).parent().get(0);
		if(P.className=="b_b current")
		{
			jQuery(P).removeClass("current");
			jQuery(P).css("top","0px");
			jQuery(P).parent().attr("id","");
			jQuery(P).children(BlocAffiche).slideUp("pretty");
		}
		else
		{
			jQuery(Lien).each(function(){
				PA=jQuery(this).parent().get(0);
				jQuery(PA).removeClass("current");
				jQuery(PA).css("top","0px");
				jQuery(PA).parent().attr("id","");
				jQuery(PA).children(BlocAffiche).slideUp("pretty");
				//alert("fermer");
			});
			jQuery(P).children(BlocAffiche).slideDown("pretty");
			jQuery(P).addClass("current");
			jQuery(P).css("top","1px");
			jQuery(P).parent().attr("id","activeV");
		}
	});
}
/* survole bloc a slider*/
function HoverSlide(DivSurvole)
{
	jQuery(DivSurvole).hover(function()
	{
		b=jQuery(this).parent().get(0);
		if(b.className=="")   jQuery(b).addClass("hover");
	},function()
	{
		b=jQuery(this).parent().get(0);
		if(b.className=="hover") jQuery(b).removeClass("hover");	
	}
	);	
}
/* seul btn checked*/
function FirstChecked(objetClick)
{
	jQuery(objetClick).click(function(){
			jQuery(objetClick).each(function(){
				jQuery(this).removeClass("active");							   
			});	
			jQuery(this).addClass("active")
	});	
}
/* Tabulation Div*/
function FirstDivShow(objetClick)
{
	
	jQuery(objetClick).click(function(){
			id=new String(this.id);
			Res=id.substring(6,7);
			jQuery(objetClick).each(function(){
				jQuery(this).removeClass("active");
			});	
			jQuery(".blocS").each(function(){
				jQuery(this).hide();
			});
			jQuery(this).addClass("active");
			jQuery("#bloc"+Res).fadeIn("slow");
			GetWnav();
	});	
}
/* Tabulation Div vivre*/
function FirstDivShowV(objetClick)
{
	
	jQuery(objetClick).click(function(){
			Id=new String(this.id);
			Res=Id.substring(1,2);
			i=1;
			jQuery(objetClick).each(function(){
				jQuery(this).removeClass("active");
				jQuery(this).parent().attr("id","");
				jQuery("#V"+i).hide();
				i+=1;
			});	
			jQuery(this).addClass("active");
			jQuery(this).parent().attr("id","active");
			jQuery("#V"+Res).fadeIn(1200);
	});	
}
/* seul btn filtrer*/
function FiltrerEvent(objetClick)
{
	jQuery(objetClick).click(function(){
			jQuery(objetClick).each(function(){
				jQuery(this).removeClass("active");							   
			});	
			jQuery(this).addClass("active")
	});	
}
/* function survoleActualite */
function SurvoleActu(TagLien1,ClassLienImg,NomImg)
{
	jQuery(ClassLienImg).hover(function()
	{
		var P=jQuery(this).parent();
		jQuery(P).children("h4").addClass("active");
		jQuery(this).children("img").attr({src:"images/fr/"+NomImg+"H.gif",alt:""});
	},function()
	{
		var P=jQuery(this).parent();
		jQuery(P).children("h4").removeClass("active");
		jQuery(this).children("img").attr({src:"images/fr/"+NomImg+".gif",alt:""});
	});
	
	jQuery(TagLien1).hover(function()
	{
		var P=jQuery(this).parent();
		jQuery(this).addClass("active");
		jQuery(P).children("a").children("img").attr({src:"images/fr/"+NomImg+"H.gif",alt:""});
	},function()
	{
		var P=jQuery(this).parent();
		jQuery(this).removeClass("active");
		jQuery(P).children("a").children("img").attr({src:"images/fr/"+NomImg+".gif",alt:""});
	});	
}
/* survole deuc cote */
function survoleCote(ELeft,ERight,ImgSrc)
{
	jQuery(ERight).hover(function()
	{
		var P=jQuery(this).parent();
		var Img=jQuery(this).children().children();
		jQuery(P).children(ELeft).addClass("active");
		jQuery(Img).attr({src:"images/fr/"+ImgSrc+"H.gif",alt:""});
	},function()
	{
		var P=jQuery(this).parent();
		var Img=jQuery(this).children().children();
		jQuery(P).children(ELeft).removeClass("active");
		jQuery(Img).attr({src:"images/fr/"+ImgSrc+".gif",alt:""});
	});
	
	jQuery(ELeft).hover(function()
	{
		var P=jQuery(this).parent();
		var Img=jQuery(P).children().children().children();
		jQuery(this).addClass("active");
		jQuery(Img).attr({src:"images/fr/"+ImgSrc+"H.gif",alt:""});
	},function()
	{
		var P=jQuery(this).parent();
		var Img=jQuery(P).children().children().children();
		jQuery(this).removeClass("active");
		jQuery(Img).attr({src:"images/fr/"+ImgSrc+".gif",alt:""});
	});	
}
/* survole deux cote */
function survoleProd()
{
	jQuery(".btn_telecherger").hover(function()
	{
		var P=jQuery(this).parent().parent();
		var PG=jQuery(P).parent();
		var Img=jQuery(P).children("li").children(".btn_info").children("img");
		jQuery(PG).addClass("active");
		jQuery(Img).attr({src:"images/fr/btn_plusInfoH.gif",alt:""});
		jQuery(this).children("img").attr({src:"images/fr/btn_telechargerH.gif",alt:""});
	},function()
	{
		var P=jQuery(this).parent().parent();
		var PG=jQuery(P).parent();
		var Img=jQuery(P).children("li").children(".btn_info").children("img");
		jQuery(PG).removeClass("active");
		jQuery(Img).attr({src:"images/fr/btn_plusInfo.gif",alt:""});
		jQuery(this).children("img").attr({src:"images/fr/btn_telecharger.gif",alt:""});
	});
	
	jQuery(".btn_info").hover(function()
	{
		var P=jQuery(this).parent().parent();
		var PG=jQuery(P).parent();
		var Img=jQuery(P).children("li").children(".btn_telecherger").children("img");
		jQuery(PG).addClass("active");
		jQuery(Img).attr({src:"images/fr/btn_telechargerH.gif",alt:""});
		jQuery(this).children("img").attr({src:"images/fr/btn_plusInfoH.gif",alt:""});
	},function()
	{
		var P=jQuery(this).parent().parent();
		var PG=jQuery(P).parent();
		var Img=jQuery(P).children("li").children(".btn_telecherger").children("img");
		jQuery(PG).removeClass("active");
		jQuery(Img).attr({src:"images/fr/btn_telecharger.gif",alt:""});
		jQuery(this).children("img").attr({src:"images/fr/btn_plusInfo.gif",alt:""});
	});	
}
/* Hover Lien relative */
function HoverRel(btnS)
{
	jQuery(btnS).hover(function(){
		var par=jQuery(this).parent();
		jQuery(par).addClass("HoverRel");						
	},function(){
		var par=jQuery(this).parent();
		jQuery(par).removeClass("HoverRel");
	});	
}
/* survole destination */
function survoleDesti(Element,ImgSrc)
{
	jQuery(Element).hover(function()
	{
		var Img=jQuery(this).children().children().children();
		jQuery(this).addClass("active");
		jQuery(Img).attr({src:"images/fr/"+ImgSrc+"H.png",alt:""});
	},function()
	{
		var Img=jQuery(this).children().children().children();
		jQuery(this).removeClass("active");
		jQuery(Img).attr({src:"images/fr/"+ImgSrc+".png",alt:""});
	});
}
/* mini diapo accueil */
function miniDiapo(ElemenL)
{
	jQuery(ElemenL).hover(function(){
		jQuery(this).children("div").show({easing: 'easeOutBounce',duration:500});
		},function(){
			jQuery(this).children("div").fadeOut(800);
		});	
}
/*  */
function hoverActu()
{
	jQuery('.Actu').hover(function(){
			jQuery(this).addClass('CurrentAc');
		},function(){
			jQuery(this).removeClass('CurrentAc');
		});	
}
function getW(Element)
{
	jQuery(Element).each(function(){
		var W=jQuery(this).width();
		W=W+5;
		jQuery(this).css("width",W+"px");
		jQuery(this).css("float","none");
	});

}
/* fct ajax with $*/
function GetAjax(file,str,divSelc1,divSelc2,tst)
{
	jQuery(divSelc1).html('<p class="loader"><img src="images/loader.gif" /></p>');
	$.ajax({
		type:"POST",
		url:file,
		data:str+"&ajax=true",
		success:function(msg)
		{
		    //alert(msg);
			if(tst)
		        {
		           //alert(msg);
		           jQuery(divSelc2).hide();
		           jQuery(divSelc2).html(msg);
		           jQuery(divSelc2).fadeIn("pretty");   
		        }
			else
			{
			        jQuery("body").append('<div id="Prov" style="display:none">'+msg+'</div>');
                                jQuery(divSelc2).html(jQuery("#Div2").html());
                                jQuery(divSelc1).hide();
                                jQuery(divSelc1).html(jQuery("#Div1").html());
                                jQuery(divSelc1).fadeIn("pretty");
                        }
			/*if($("#LContent.LContent")[0] && Id==5)	
			{	jQuery("#LContent.LContent").html(jQuery("#Div3").html());
			}*/
			jQuery("#Prov").remove();
			if($(".blocDL")[0])	
			{$(".slidetabs").tabs(".items > .blocDL", {
				effect: 'fade',
				fadeOutSpeed: "pretty",
				fadeInSpeed: 1500,
				rotate: false
			   }).slideshow({clickable :false});
	    	        }
			else if($(".blocDD")[0])
			{	$(".slidetabs").tabs(".items > .blocDD", {
					effect: 'fade',
					fadeOutSpeed: "pretty",
					fadeInSpeed: 1500,
					rotate: false
					
				}).slideshow({clickable : false});
			}
			HoverVD();
			HoverLien();
			hoverActu();
			jQuery(function()
			{
				jQuery('.Scroll').jScrollPane({});
			});
			jQuery(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'light_square',slideshow:2000, autoplay_slideshow: false});
			jQuery(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'fast',slideshow:10000});
			
			jQuery("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({
				custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>',
				changepicturecallback: function(){ initialize(); }
			});
			jQuery("#custom_content a[rel^='prettyPhoto']:last").prettyPhoto({
				custom_markup: '<div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>',
				changepicturecallback: function(){ _bsap.exec(); }
			});
			sousMenuC("#ch_m li a",".S_Menu");
			if(!$(".slidetabs")[0])
				{
					$(".blocDL").show();$(".blocDD").show();$(".blocDM").show();	
				}
		}
    });
}

function GetContantAjaxGlobal(file,str,divtoreplace)
{	
	jQuery(divtoreplace).html('<p class="loader"><img src="images/loader.gif" /></p>');
	jQuery.ajax({
		type:"POST",
		url:file,
		data:str+"&ajax=true&lang="+lang,
		success:function(data)
		{	
			jQuery(divtoreplace).hide();
			jQuery(divtoreplace).html(data);
			jQuery(divtoreplace).fadeIn("fast");
			jQuery('.Scroll').jScrollPane({/*showArrows: true,arrowScrollOnHover: true*/});
			if(!$(".slidetabs")[0])
			{
				$(".blocDL").show();$(".blocDD").show();$(".blocDM").show();	
			}
		}			
	});
	/*jQuery(divtoreplace).animate({opacity:0},400);
	setTimeout(function(){
			//jQuery(divtoreplace).html('<p class="loader"><img src="images/loader.gif" /></p>');			
			jQuery.ajax({
					type:"POST",
					url:file,
					data:str+"&ajax=true&lang="+lang,
					success:function(data)
					{	
						jQuery(divtoreplace).html(dn ata);
						jQuery(divtoreplace).animate({opacity:1},400);
						jQuery(function()
						{
				
							jQuery('.Scroll').jScrollPane(
								{
									showArrows: true,
									arrowScrollOnHover: true
								}
							);
						});
					}			
				});			
			},200); 	*/
}

function GetContantAjax(file,str,divtoreplace)
{	
	jQuery(divtoreplace).html('<p class="loader"><img src="images/loader.gif" /></p>');
	jQuery.ajax({
		type:"POST",
		url:file,
		data:str+"&lang="+lang+"&ajax=true",
		success:function(data)
		{	
			jQuery(divtoreplace).hide();
			jQuery(divtoreplace).html(data);
			jQuery(divtoreplace).fadeIn("pretty");
			if(!$(".slidetabs")[0])
			{
				$(".blocDL").show();$(".blocDD").show();$(".blocDM").show();	
			}
			/*$("#Cont").width("1030px");
			$(".TxtEdito").css("width","1002px");$(".TxtEdito").css("margin","0 auto");$(".TxtEdito").css("position","relative");$(".TxtEdito").css("left","15px");*/
			jQuery(function()
			{
				jQuery('.Scroll').jScrollPane(
					{
						/*showArrows: true,
						arrowScrollOnHover: true*/
					}
				);
			});
			/*if(!$(".jspVerticalBar")[0])
			{
				$("#Cont").width("969px");
				$(".TxtEdito").css("position","static");
			}*/
		}			
	});
}

function pagerFactory(idx, slide) {
 return '<a href="#" title="#' +idx+'">&nbsp;</a>';
}
function easing()
{
	$.easing.custom = function (x, t, b, c, d) { 
	var s = 1.70158;  
	if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 
	return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	}
	//jQuery.easing['jswing'] = jQuery.easing['swing'];
	jQuery.extend( jQuery.easing,
	{
		def: 'easeOutQuad',
		swing: function (x, t, b, c, d) {
			//alert(jQuery.easing.default);
			return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
		},
		easeInQuad: function (x, t, b, c, d) {
			return c*(t/=d)*t + b;
		},
		easeOutQuad: function (x, t, b, c, d) {
			return -c *(t/=d)*(t-2) + b;
		},
		easeInOutQuad: function (x, t, b, c, d) {
			if ((t/=d/2) < 1) return c/2*t*t + b;
			return -c/2 * ((--t)*(t-2) - 1) + b;
		},
		easeInCubic: function (x, t, b, c, d) {
			return c*(t/=d)*t*t + b;
		},
		easeOutCubic: function (x, t, b, c, d) {
			return c*((t=t/d-1)*t*t + 1) + b;
		},
		easeInOutCubic: function (x, t, b, c, d) {
			if ((t/=d/2) < 1) return c/2*t*t*t + b;
			return c/2*((t-=2)*t*t + 2) + b;
		},
		easeInQuart: function (x, t, b, c, d) {
			return c*(t/=d)*t*t*t + b;
		},
		easeOutQuart: function (x, t, b, c, d) {
			return -c * ((t=t/d-1)*t*t*t - 1) + b;
		},
		easeInOutQuart: function (x, t, b, c, d) {
			if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
			return -c/2 * ((t-=2)*t*t*t - 2) + b;
		},
		easeInQuint: function (x, t, b, c, d) {
			return c*(t/=d)*t*t*t*t + b;
		},
		easeOutQuint: function (x, t, b, c, d) {
			return c*((t=t/d-1)*t*t*t*t + 1) + b;
		},
		easeInOutQuint: function (x, t, b, c, d) {
			if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
			return c/2*((t-=2)*t*t*t*t + 2) + b;
		},
		easeInSine: function (x, t, b, c, d) {
			return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
		},
		easeOutSine: function (x, t, b, c, d) {
			return c * Math.sin(t/d * (Math.PI/2)) + b;
		},
		easeInOutSine: function (x, t, b, c, d) {
			return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
		},
		easeInExpo: function (x, t, b, c, d) {
			return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
		},
		easeOutExpo: function (x, t, b, c, d) {
			return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
		},
		easeInOutExpo: function (x, t, b, c, d) {
			if (t==0) return b;
			if (t==d) return b+c;
			if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
			return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
		},
		easeInCirc: function (x, t, b, c, d) {
			return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
		},
		easeOutCirc: function (x, t, b, c, d) {
			return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
		},
		easeInOutCirc: function (x, t, b, c, d) {
			if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
			return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
		},
		easeInElastic: function (x, t, b, c, d) {
			var s=1.70158;var p=0;var a=c;
			if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
			if (a < Math.abs(c)) { a=c; var s=p/4; }
			else var s = p/(2*Math.PI) * Math.asin (c/a);
			return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		},
		easeOutElastic: function (x, t, b, c, d) {
			var s=1.70158;var p=0;var a=c;
			if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
			if (a < Math.abs(c)) { a=c; var s=p/4; }
			else var s = p/(2*Math.PI) * Math.asin (c/a);
			return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
		},
		easeInOutElastic: function (x, t, b, c, d) {
			var s=1.70158;var p=0;var a=c;
			if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
			if (a < Math.abs(c)) { a=c; var s=p/4; }
			else var s = p/(2*Math.PI) * Math.asin (c/a);
			if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
			return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
		},
		easeInBack: function (x, t, b, c, d, s) {
			if (s == undefined) s = 1.70158;
			return c*(t/=d)*t*((s+1)*t - s) + b;
		},
		easeOutBack: function (x, t, b, c, d, s) {
			if (s == undefined) s = 1.70158;
			return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
		},
		easeInOutBack: function (x, t, b, c, d, s) {
			if (s == undefined) s = 1.70158; 
			if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
			return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
		},
		easeInBounce: function (x, t, b, c, d) {
			return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
		},
		easeOutBounce: function (x, t, b, c, d) {
			if ((t/=d) < (1/2.75)) {
				return c*(7.5625*t*t) + b;
			} else if (t < (2/2.75)) {
				return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
			} else if (t < (2.5/2.75)) {
				return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
			} else {
				return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
			}
		},
		easeInOutBounce: function (x, t, b, c, d) {
			if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
			return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
		}
		});
}
