function fieldFocus(b){if(b.value==b.defaultValue){b.value=""}}function fieldBlur(b){if(b.value==""){b.value=b.defaultValue}}function adjustFilterCols(d,c){var a=0;var g=$(d+" "+c).length;if(g!=2){var e=Math.floor(($(d).innerWidth()-g+1)/g)-20;$(d+" "+c).css("width",e+"px")}else{var f=$(d).innerWidth()-1;var e=Math.floor(f/4);var b=f-e-20;var e=e-20;var h=0;$(d+" "+c).each(function(){if(h==0){$(this).css("width",e+"px")}else{$(this).addClass("special").css("width",b+"px")}h++})}$(d+" "+c).each(function(){if($(this).innerHeight()>a){a=$(this).innerHeight()}});$(d+" "+c).css("height",(a-15)+"px")}function checkForm(v,s){if(typeof(s.offset)=="undefined"){s.offset={left:0,top:10}}else{if(typeof(s.offset.left)=="undefined"){s.offset.left=0}if(typeof(s.offset.top)=="undefined"){s.offset.top=10}}if(typeof($(v).attr("status"))=="undefined"&&$(v).attr("status")!="initialized"){$(v).attr("status","initialized");var u=new Array();if(typeof(s.required)!="undefined"){for(var p=0;p<s.required.elements.length;p++){if(jQuery.inArray(s.required.elements[p],u)==-1){u.push(s.required.elements[p])}}}if(typeof(s.compare)!="undefined"){for(var p=0;p<s.compare.elements.length;p++){if(jQuery.inArray(s.compare.elements[p][1],u)==-1){u.push(s.compare.elements[p][1])}}}if(typeof(s.radio)!="undefined"){for(var p=0;p<s.radio.elements.length;p++){if(jQuery.inArray(s.radio.elements[p],u)==-1){u.push(s.radio.elements[p])}}}if(typeof(s.email)!="undefined"){for(var p=0;p<s.email.elements.length;p++){if(jQuery.inArray(s.email.elements[p],u)==-1){u.push(s.email.elements[p])}}}if(typeof(s.date)!="undefined"){for(var p=0;p<s.date.elements.length;p++){if(jQuery.inArray(s.date.elements[p],u)==-1){u.push(s.date.elements[p])}}}if(typeof(s.custom)!="undefined"){for(var p=0;p<s.custom.length;p++){if(jQuery.inArray(s.custom[p].element,u)==-1){u.push(s.custom[p].element)}}}for(var p=0;p<u.length;p++){var n=$("#"+u[p]);checkFormFeedback(n,{id:p,offset:s.offset,message:"",position:n.offset()})}}var i=0;if(typeof(s.email)!="undefined"){for(var p=0;p<s.email.elements.length;p++){var n=$("#"+s.email.elements[p]);updateFeedback(n,s.offset,s.email.message);var t=/^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,3}$/;if(t.exec(n.val())==null){$(n).parent().addClass("error");i++}}}if(typeof(s.date)!="undefined"){for(var p=0;p<s.date.elements.length;p++){var n=$("#"+s.date.elements[p]);updateFeedback(n,s.offset,s.date.message);var t=/^[0-9]{2}[/]{1}[0-9]{2}[/]{1}[0-9]{4}$/;if(t.exec(n.val())==null){$(n).parent().addClass("error");i++}}}if(typeof(s.compare)!="undefined"){for(var p=0;p<s.compare.elements.length;p++){var o=$("#"+s.compare.elements[p][0]);var q=$("#"+s.compare.elements[p][1]);updateFeedback(q,s.offset.top,s.compare.message);if(q.val()!=o.val()){$(q).addClass("error");i++}}}if(typeof(s.radio)!="undefined"){for(var p=0;p<s.radio.elements.length;p++){var n=$("#"+s.radio.elements[p]);var r=0;$('input[name="'+(n.attr("name"))+'"]').each(function(){if($(this).is(":checked")){r++}});if(!r){n.parent().addClass("error");updateFeedback(n,s.offset,s.radio.message);i++}}}if(typeof(s.custom)!="undefined"){for(var p=0;p<s.custom.length;p++){var n=$("#"+s.custom[p].element);updateFeedback(n,s.offset,s.custom[p].message);if(s.custom[p].reg.exec(n.val())==null){$(n).parent().addClass("error");i++}}}if(typeof(s.required)!="undefined"){for(var p=0;p<s.required.elements.length;p++){var n=$("#"+s.required.elements[p]);var m=document.getElementById(s.required.elements[p]).defaultValue;if(n.is("input")){if(n.attr("type")=="text"||n.attr("type")=="password"){if(n.val()==""||n.val()==m){n.parent().addClass("error");updateFeedback(n,s.offset,s.required.message);i++}}else{if(n.attr("type")=="checkbox"||n.attr("type")=="radio"){if(!n.is(":checked")){n.parent().addClass("error");updateFeedback(n,s.offset,s.required.message);i++}}}}else{if(n.is("select")){if($("option:selected",n).val()==""){n.parent().addClass("error");updateFeedback(n,s.offset,s.required.message);i++}}else{if(n.is("textarea")){if(n.val()==""||n.val()==m){n.parent().addClass("error");updateFeedback(n,s.offset,s.required.message);i++}}}}}}if(!i){return true}else{return false}}function updateFeedback(j,i,g){$("#"+j.attr("related_to")+" .message").html(g);if(j.attr("type")!="checkbox"&&j.attr("type")!="radio"){if($("#"+j.attr("related_to")).outerWidth()>j.outerWidth()){var h=j.outerWidth()-parseFloat($("#"+j.attr("related_to")).css("paddingLeft"))-parseFloat($("#"+j.attr("related_to")).css("paddingRight"));$("#"+j.attr("related_to")).css("width",h+"px")}else{$("#"+j.attr("related_to")).css("width","auto")}}var k=Math.round(j.offset().top)-$("#"+j.attr("related_to")).outerHeight()+i.top;$("#"+j.attr("related_to")).css("top",k+"px");var l=Math.round(j.offset().left)+i.left;$("#"+j.attr("related_to")).css("left",l+"px")}function checkFormFeedback(g,f){g.attr("related_to","checkFormFeedback_"+f.id);$("body").append('<div class="errorFeedback" id="checkFormFeedback_'+f.id+'" style="display:none;"><span class="message">'+f.message+'</span><span class="appendice"></span></div>');$("#checkFormFeedback_"+f.id).attr("form_element",g.attr("id"));var h=Math.round(f.position.top)-$("#checkFormFeedback_"+f.id).outerHeight()+f.offset.top;$("#checkFormFeedback_"+f.id).css("top",h+"px");var e=Math.round(f.position.left)+f.offset.left;$("#checkFormFeedback_"+f.id).css("left",e+"px");if(g.is("input")&&(g.attr("type")=="checkbox"||g.attr("type")=="radio")){g.parent().find("label").hover(function(){if($(this).parent().hasClass("error")){$("#checkFormFeedback_"+f.id).fadeIn("fast")}},function(){if($(this).parent().hasClass("error")){$("#checkFormFeedback_"+f.id).fadeOut("fast")}})}else{g.focus(function(){if($(this).parent().hasClass("error")){$("#checkFormFeedback_"+f.id).fadeIn("fast")}});g.blur(function(){if($(this).parent().hasClass("error")){$("#checkFormFeedback_"+f.id).fadeOut("fast")}})}if(g.is("input")&&g.attr("type")=="radio"){$('input[name="'+g.attr("name")+'"]').change(function(){if($(this).parent().hasClass("error")){$("#checkFormFeedback_"+f.id).fadeOut("fast",function(){var a=$(this).attr("form_element");$("#"+a).parent().removeClass("error")})}})}else{g.change(function(){if($(this).parent().hasClass("error")){$("#checkFormFeedback_"+f.id).fadeOut("fast",function(){var a=$(this).attr("form_element");$("#"+a).parent().removeClass("error")})}})}}function ie6Fixes(){$("#mainMenu, #footer .pushes .culture .specialLink").wrap("<div />");$("#header").prepend('<p style="color:#ffffff;background:#cc0000;padding:10px 0;font:16px/normal Arial, Verdana, Sans-serif;text-align:center;">Vous visionnez ce site avec un navigateur qui ne vous permet pas d\'afficher correctement son contenu.<span style="display:block;padding-top:5px;font-size:12px;color:#000000;">Pour y remédier, vous pouvez <a href="http://windows.microsoft.com/fr-FR/internet-explorer/downloads/ie" target="_blank" style="color:#000000;">mettre à jour vers Internet Explorer 8</a></span></p>')}function pngFix(a){$(a).each(function(){var b=$(this).attr("src");var c="";$(this).css("visibility","hidden");$(this).parents("li").attr("style",'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+c+b+'", sizingMethod="image");')})}function mainMenuTips(){$("#mainMenu dl:not(.recettes, .services)").hover(function(){mainMenuBgShow();if(!$(this).hasClass("nutrition")){$("#mainMenu dt .content .msg").hide();$(this).find("dt .content .msg").show()}},function(){mainMenuBgHide();$("#mainMenu dt .content .msg").show()})}function mainMenuBgShow(){if(!$("#mainMenuBg").length){$("#content").prepend('<div id="mainMenuBg" style="display:none;" />');$("#mainMenuBg").mouseover(function(){$(this).hide()});$("#mainMenuBg").css("opacity",0.2)}if($("#content").innerHeight()+$("#footer").innerHeight()>$(window).height()){$("#mainMenuBg").css("height",$("#content").innerHeight()+$("#footer").innerHeight()+"px")}else{$("#mainMenuBg").css("height",$(window).height()+"px")}$("#mainMenuBg").show()}function mainMenuBgHide(){$("#mainMenuBg").hide()}function expandFooter(a){if(!$(a).hasClass("opened")){$(a).addClass("opened");$("#expandInfosBlock").show();return true}else{$(a).removeClass("opened");$("#expandInfosBlock").hide();return false}}var greyBoxDefaultConfig={top:50,duration:0.6,opacity:0.6};var greyBoxEffectDuration=Math.round((greyBoxDefaultConfig.duration*1000)/2);function greyBoxShow(f,j,i,g){if(!$("#overlay").length){$("body").append('<div id="overlay" onclick="greyBoxHide();"></div>');if(jQuery.browser.msie&&jQuery.browser.version=="6.0"){$(window).scroll(function(){$("#overlay").css("top",$(window).scrollTop()+"px")})}}if(!$("#greyBox").length){$("body").append('<div id="greyBox"><div id="greyBoxContent"></div><div onclick="greyBoxHide();" class="close"></div></div>')}if(typeof(g)!="undefined"){if(typeof(g.duration)=="undefined"){greyBoxEffectDuration=Math.round((greyBoxDefaultConfig.duration*1000)/2)}else{greyBoxEffectDuration=Math.round((g.duration*1000)/2)}if(typeof(g.top)=="undefined"){g.top=greyBoxDefaultConfig.top}if(typeof(g.opacity)=="undefined"){g.opacity=greyBoxDefaultConfig.opacity}if(typeof(g.height)=="undefined"&&typeof(greyBoxDefaultConfig.height)!="undefined"){g.height=greyBoxDefaultConfig.height}if(typeof(g.closeText)=="undefined"&&typeof(greyBoxDefaultConfig.closeText)!="undefined"){g.closeText=greyBoxDefaultConfig.closeText}if(typeof(g.title)=="undefined"&&typeof(greyBoxDefaultConfig.title)!="undefined"){g.title='<h1 class="title greybox"><span>'+greyBoxDefaultConfig.title+"</span></h1>"}else{if(typeof(g.title)=="undefined"&&typeof(greyBoxDefaultConfig.title)=="undefined"){g.title=""}else{g.title='<h1 class="title greybox"><span>'+g.title+"</span></h1>"}}if(typeof(g.error)=="undefined"&&typeof(greyBoxDefaultConfig.error)!="undefined"){g.error=greyBoxDefaultConfig.error}if(typeof(g.background)=="undefined"&&typeof(greyBoxDefaultConfig.background)!="undefined"){g.background=greyBoxDefaultConfig.background}if(typeof(g.style)=="undefined"&&typeof(greyBoxDefaultConfig.style)!="undefined"){g.style=greyBoxDefaultConfig.style}if(typeof(g.className)=="undefined"&&typeof(greyBoxDefaultConfig.className)!="undefined"){g.className=greyBoxDefaultConfig.className}if(typeof(g.loading)=="undefined"&&typeof(greyBoxDefaultConfig.loading)!="undefined"){g.loading=greyBoxDefaultConfig.loading}if(typeof(g.data)=="undefined"&&typeof(greyBoxDefaultConfig.data)!="undefined"){g.data=greyBoxDefaultConfig.data}if(typeof(g.customFunction)=="undefined"&&typeof(greyBoxDefaultConfig.customFunction)!="undefined"){g.customFunction=greyBoxDefaultConfig.customFunction}}else{greyBoxEffectDuration=Math.round((greyBoxDefaultConfig.duration*1000)/2);g=greyBoxDefaultConfig;g.title=""}$("#overlay").removeAttr("style");$("#greyBox .close").html("");$("#greyBox").removeAttr("class");$("#greyBoxContent").removeAttr("style");if(typeof(g.height)!="undefined"&&i!="iframe"&&i!="youtube"&&i!="dailymotion"){$("#greyBoxContent").css("overflow","auto").css("height",g.height+"px")}if(typeof(g.closeText)!="undefined"){$("#greyBox .close").html(g.closeText)}if(typeof(g.background)!="undefined"){$("#overlay").css("background",g.background)}if(typeof(g.style)!="undefined"){$("#greyBoxContent").attr("style",g.style)}if(typeof(g.className)!="undefined"){$("#greyBox").addClass(g.className)}$("#greyBoxContent").html('<div id="greyBoxLoader"></div>');if(typeof(g.loading)!="undefined"){$("#greyBoxLoader").html(g.loading)}$("#greyBox").css("width",j+"px").css("left","-"+(Math.ceil(j/2))+"px");if(typeof(g.customFunction)=="undefined"){switch(i){case"html":var h=function(){$("#greyBoxContent").html(g.title+f)};greyBoxDisplay(h,g.opacity,g.top);break;case"get":var h=function(){$.ajax({type:"GET",url:f,success:function(a){$("#greyBoxContent").html(g.title+a)},error:function(){$("#greyBoxContent").html(g.title+g.error)}})};greyBoxDisplay(h,g.opacity,g.top);break;case"post":var h=function(){$.ajax({type:"POST",url:f,data:g.data,success:function(a){$("#greyBoxContent").html(g.title+a)},error:function(){$("#greyBoxContent").html(g.title+g.error)}})};greyBoxDisplay(h,g.opacity,g.top);break;case"iframe":var h=function(){var a=400;if(typeof(g.height)!="undefined"){a=g.height}$("#greyBoxContent").html(g.title+'<iframe src="'+f+'" border="0" frameborder="0" width="100%" height="'+a+'" allowTransparency="true"></iframe>')};greyBoxDisplay(h,g.opacity,g.top);break;case"youtube":var h=function(){var a="";if(typeof(g.height)!="undefined"){a=' height="'+g.height+'"'}$("#greyBoxContent").html(g.title+'<iframe class="youtube" title="YouTube video player" style="width:100%;display:block;"'+a+' src="http://www.youtube.com/embed/'+f+'?wmode=transparent" frameborder="0" allowfullscreen></iframe>')};greyBoxDisplay(h,g.opacity,g.top);break;case"dailymotion":var h=function(){var a=400;if(typeof(g.height)!="undefined"){a=g.height}$("#greyBoxContent").html(g.title+'<object width="100%" height="'+a+'" style="display:block;"><param name="movie" value="http://www.dailymotion.com/swf/video/'+f+'"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed type="application/x-shockwave-flash" src="http://www.dailymotion.com/swf/video/'+f+'" width="100%" height="'+a+'" allowfullscreen="true" allowscriptaccess="always"></embed></object>')};greyBoxDisplay(h,g.opacity,g.top);break;case"image":var h=function(){$("#greyBoxContent").html($("#greyBoxContent").html()+'<img src="'+f+'" alt="" style="display:none;" id="greyBoxImage" />');$("#greyBoxImage").load(function(){$("#greyBoxImage").fadeOut(0);$("#greyBoxLoader").remove();$("#greyBoxContent").prepend(g.title);$("#greyBoxImage").fadeIn("medium");$("#greyBoxContent").css("width",Math.floor($("#greyBoxImage").outerWidth())+"px");$("#greyBox").css("width","auto").css("left","-"+(Math.ceil($("#greyBoxContent").outerWidth()/2))+"px")})};greyBoxDisplay(h,g.opacity,g.top);break;default:break}}else{greyBoxDisplay(g.customFunction,g.opacity,g.top)}return false}function greyBoxDisplay(f,e,d){if($("#greyBox").attr("status")!="running"){$("#greyBox").attr("status","running");$("#greyBox").css("top",($(window).scrollTop()+d)+"px");if(jQuery.browser.msie&&jQuery.browser.version=="6.0"){$("#overlay").css("position","absolute").css("height",$(window).height()+"px").css("top",$(window).scrollTop()+"px");$("#greyBoxLoader").css("height","200px")}$("object:not(.keep-visible), embed").css("visibility","hidden");if(jQuery.browser.msie&&jQuery.browser.version=="6.0"){$("select").css("visibility","hidden")}$("#overlay").fadeTo(greyBoxEffectDuration,e,function(){$("#greyBox").fadeIn(greyBoxEffectDuration,function(){$("#greyBox").attr("status","done");f()})})}}function greyBoxHide(){if($("#greyBox").attr("status")!="running"){$("#greyBox").attr("status","running");$("#greyBox").fadeOut(greyBoxEffectDuration,function(){$("#greyBox").hide();$("#overlay").fadeOut(greyBoxEffectDuration,function(){$("object:not(.keep-visible), embed").css("visibility","visible");if(jQuery.browser.msie&&jQuery.browser.version=="6.0"){$("select").css("visibility","visible")}$("#greyBox").attr("status","done")})})}}function familyCompareInitialize(){$('#masterpageFamily .list ul .compare input[type="radio"]:checked').each(function(){$(this).parent("p.compare").addClass("on")})}function familyCompare(a){if(!$(a).parent("p.compare").hasClass("on")){$(a).parent("p.compare").addClass("on");$(a).prev().attr("checked",true)}else{$(a).parent("p.compare").removeClass("on");$(a).prev().attr("checked",false)}return false}function killCompareCol(b){var c=$(b).parents("td")[0];var d=0;var a=null;$(b).parents("tr").find("td").each(function(){if(c==this){a=d}d++});$("#compare .list tr").each(function(){$(this).find("td").eq(a).remove()});$("#compare .list tr").each(function(){if($(this).hasClass("products")){$(this).append('<td><div class="item"></div></td>')}else{$(this).append("<td />")}});return false}function prodToolbarItemHighlight(a,b){if(b<10){b++;if(a.css("display")=="block"){a.hide()}else{a.show()}setTimeout(function(){prodToolbarItemHighlight(a,b)},75)}}function prodActivateSection(b,a){if($("#highlight .viewport").attr("status")!="running"&&!$(b).parents("dl").hasClass("active")){$("#highlight .viewport").attr("status","running");if($("#highlight .toolbar dl.active").length){$("#highlight .viewport > div.active").hide().removeClass("active");$("#highlight .toolbar dl.active dt .icon").html("");$("#highlight .toolbar dl.active").removeClass("active").find("dd").animate({opacity:0,top:"30px"},200,function(){$(this).hide();prodActivateSectionProceed(b,a)})}else{prodActivateSectionProceed(b,a)}}return false}function prodActivateSectionProceed(c,b){var a=prodSectionCheckItems(b);$(c).html(1);if(a>1){$("#highlight .viewport ."+b+" .slideshow li").hide();$("#highlight .viewport ."+b+" .slideshow li:eq(0)").show();$("#highlight .viewport ."+b+" .slideshow").attr("length",a).attr("current",0);$(c).parents("dl").addClass("active").find("dd").show().css("opacity",0).css("top","0px").animate({opacity:1,top:"20px"},600,function(){prodToolbarItemHighlight($(this),0)})}else{$(c).parents("dl").find("dd").hide();$(c).parents("dl").addClass("active")}$("#highlight .viewport ."+b).addClass("active").fadeIn(800,function(){if(b=="pictures"&&a>1){$("#highlight .viewport ."+b+" .slideshow").attr("mode","auto");var d=5;setTimeout(function(){prodSlideshowRecursive(c,d*1000,"auto")},d*1000)}$("#highlight .viewport").attr("status","ok")})}function prodSectionCheckItems(a){var b=0;$("#highlight .viewport ."+a+" .slideshow li").each(function(){b++});return b}function prodSlideshowRecursive(a,c,b){if($("#highlight .viewport > div.active .slideshow").attr("mode")=="auto"){prodSlideshowNext(a,b);setTimeout(function(){prodSlideshowRecursive(a,c,b)},c)}}function prodSlideshowProceed(a,b,c,d){if(!$(a).hasClass("icon")){$(a).parents("dl").find("dt .icon").html(c+1)}else{$(a).html(c+1)}if(typeof(d)=="undefined"){$("#highlight .viewport > div.active .slideshow").attr("mode","manual")}$("#highlight .viewport > div.active .slideshow li:eq("+b+")").fadeOut("medium",function(){$("#highlight .viewport > div.active .slideshow li:eq("+c+")").fadeIn("medium",function(){$("#highlight .viewport").attr("status","ok")})})}function prodSlideshowNext(a,f){if($("#highlight .viewport").attr("status")!="running"){$("#highlight .viewport").attr("status","running");var e=$("#highlight .viewport > div.active .slideshow");var c=parseInt(e.attr("length"));var d=parseInt(e.attr("current"));var b=d;d++;if(d==c){d=0}e.attr("current",d);prodSlideshowProceed(a,b,d,f)}}function prodSlideshowPrev(a,f){if($("#highlight .viewport").attr("status")!="running"){$("#highlight .viewport").attr("status","running");var e=$("#highlight .viewport > div.active .slideshow");var c=parseInt(e.attr("length"));var d=parseInt(e.attr("current"));var b=d;d--;if(d<0){d=c-1}e.attr("current",d);prodSlideshowProceed(a,b,d,f)}}function showTab(b){if(!$(b).parents("li").hasClass("current")&&$("#tabs").attr("status")!="running"){var a=$(b).attr("href");a=a.substr(1,a.length);if($("#tabs .tab."+a).length){$("#tabs").attr("status","running");$("#tabs .tab.current").fadeOut("fast",function(){$(this).removeClass("current");$(b).parents("li").siblings(".current").removeClass("current");$(b).parents("li").addClass("current");$("#tabs .tab."+a).fadeIn("fast",function(){$(this).addClass("current");$("#tabs").attr("status","ok")})})}}return false}function displayFaqSection(b){if(!$(b).parents("li").hasClass("current")&&$("#tabs").attr("status")!="running"){var a=$(b).attr("href");a=a.substr(1,a.length);if($("#faq ."+a).length){$("#tabs").attr("status","running");$("#faq .section.current").animate({opacity:0,left:"-15px"},400,function(){$(this).removeClass("current").removeAttr("style","");$(b).parents("li").siblings(".current").removeClass("current");$(b).parents("li").addClass("current");$("#faq .section."+a).css("left","-15px").css("opacity","0").css("display","block");$("#faq .section."+a).animate({opacity:1,left:"0px"},400,function(){$(this).addClass("current").removeAttr("style","");$("#tabs").attr("status","ok")})})}}return false}function displayFaqSectionContent(a){if(!$(a).parents("li").hasClass("current")&&$("#tabs").attr("status")!="running"){$("#tabs").attr("status","running");$(a).parents("li").siblings("li.current").find(".sectionContent").slideUp("fast",function(){$(this).parents("li").removeClass("current");$(a).next(".sectionContent").slideDown("fast",function(){$(this).parents("li").addClass("current");$("#tabs").attr("status","ok")})})}return false}function makeCarousel(s,t){var r=0;$("#"+s+" > li").each(function(){$(this).attr("offset",r);r+=$(this).outerWidth(true)});var u="";var n="";if(typeof(t.viewport)!="undefined"){if(typeof(t.viewport.width)!="undefined"){u="width:"+t.viewport.width+"px;"}if(typeof(t.viewport.height)!="undefined"){n="height:"+t.viewport.height+"px;"}}if(typeof(t.range)!="undefined"){$("#"+s).attr("range",t.range)}else{t.range=1;$("#"+s).attr("range",1)}if(typeof(t.mode)=="undefined"){t.mode="fade"}var p="left";if(typeof($("#"+s).css("float"))!="undefined"){p=$("#"+s).css("float")}switch(t.mode){case"fade":$("#"+s+" > li").hide();$("#"+s+" > li:eq(0)").show();var q=parseInt($("#"+s).css("padding-top"));var o=parseInt($("#"+s).css("padding-left"));var l=parseInt($("#"+s).css("padding-top"));var m=parseInt($("#"+s).css("padding-left"));$("#"+s).css("width",(t.viewport.width-o-l)+"px").css("height",(t.viewport.height-q-m)+"px");$("#"+s+" > li").css("position","absolute").css("left",o+"px").css("top",q+"px");break;case"slide":$("#"+s).css("float","left").css("position","relative").css("left","0").css("width",r+"px");$("#"+s+" > li").css("float","left");break}if(typeof(t.pagination)!="undefined"&&t.pagination){$("#"+s).after(makeCarouselPagination("full",t.mode,s,t.lang,t.duration))}else{$("#"+s).after(makeCarouselPagination("simple",t.mode,s,t.lang,t.duration))}$("#"+s).wrap('<div class="carouselWindow" style="float:'+p+";position:relative;overflow:hidden;"+u+n+'" />');$("#"+s).attr("length",$("#"+s+" > li").length).attr("current",0).attr("status","ok");$("#"+s).attr("mode","manual");if(typeof(t.autoDefil)!="undefined"){$("#"+s).attr("mode","auto");var v=t.autoDefil*1000;setTimeout(function(){carouselRecursiveNext(t.mode,s,t.duration,v)},v)}}function makeCarouselPagination(n,j,i,k,m){var h="";if($("#"+i+" > li").length>1){h='<ul id="'+i+'Pagination" class="pagination">';h+='<li class="prev" onclick="carouselPrev(\''+j+"', '"+i+"', '"+m+"');\">"+k.prev+"</li>";if(n=="full"){var l=0;$("#"+i+" > li").each(function(){var a="";if(l==0){a=' class="current"'}h+="<li"+a+" onclick=\"carouselAccess('"+j+"', '"+i+"', "+m+", "+l+');">'+(l+1)+"</li>";l++})}h+='<li class="next" onclick="carouselNext(\''+j+"', '"+i+"', '"+m+"');\">"+k.next+"</li>";h+="</ul>"}return h}function carouselRecursiveNext(h,f,e,g){if($("#"+f).attr("mode")=="auto"){carouselNext(h,f,e,true);setTimeout(function(){carouselRecursiveNext(h,f,e,g)},g)}}function carouselAccess(i,g,j,h){$("#"+g).attr("mode","manual");if($("#"+g).attr("status")!="running"){$("#"+g).attr("status","running");var f=$("#"+g).attr("current");$("#"+g).attr("current",h);carouselReachItem(f,h,g,i,j)}}function carouselPrev(k,j,l){$("#"+j).attr("mode","manual");if($("#"+j).attr("status")!="running"){$("#"+j).attr("status","running");var m=parseInt($("#"+j).attr("current"));var n=parseInt($("#"+j).attr("length"));var i=parseInt($("#"+j).attr("range"));var o=m;m-=i;if(m<0&&o==0){m=$("#"+j+" > li").length-i}else{if(m<0&&o>0){m=0}}$("#"+j).attr("current",m);var p=m;carouselReachItem(o,p,j,k,l)}}function carouselNext(m,q,p,k){if(typeof(k)=="undefined"){$("#"+q).attr("mode","manual")}if($("#"+q).attr("status")!="running"){$("#"+q).attr("status","running");var j=parseInt($("#"+q).attr("current"));var r=parseInt($("#"+q).attr("length"));var n=parseInt($("#"+q).attr("range"));var l=j;j+=n;if(j>($("#"+q+" > li").length-n)&&j<$("#"+q+" > li").length){j=$("#"+q+" > li").length-n}if(j>=$("#"+q+" > li").length){j=0}$("#"+q).attr("current",j);var o=j;carouselReachItem(l,o,q,m,p);if(j>($("#"+q+" > li").length-n)){$("#"+q).attr("current",($("#"+q+" > li").length))}}}function carouselReachItem(l,g,h,i,k){if($("#"+h+"Pagination li:not(.prev, .next):eq("+g+")").length){$("#"+h+"Pagination li:not(.prev, .next)").removeClass("current");$("#"+h+"Pagination li:not(.prev, .next):eq("+g+")").addClass("current")}switch(i){case"fade":k=Math.floor((k*1000)/2);$("#"+h+" > li:eq("+l+")").fadeOut(k,function(){$("#"+h+" > li:eq("+g+")").fadeIn(k,function(){$("#"+h).attr("status","ok")})});break;case"slide":k=k*1000;var j=$("#"+h+" > li:eq("+g+")").attr("offset");$("#"+h).animate({left:"-"+j+"px"},k,function(){$("#"+h).attr("status","ok")});break}}function ajaxEffect(b,a){$("#"+b).css("position","relative");if(!$("#"+b).find("div.ajaxSignifier").length){$("#"+b).append('<div class="ajaxSignifier" style="width:'+$("#"+b).outerWidth()+"px;height:"+$("#"+b).outerHeight()+'px;" />')}$("#"+b+" .ajaxSignifier").fadeTo("fast",0.6,function(){if(typeof(a)!="undefined"){return a()}})}function anchorReacher(a){var b=$($(a).attr("href")).position().top;$("html,body").animate({scrollTop:b},1500);return false}function anchorGenerator(c,f,b){var e=1;var a="";if($(c).length){var d="";if(typeof(b)!="undefined"&&b!=""){d=' class="'+b+'"'}a+="<ul"+d+">";$(c).each(function(){$(this).attr("id","anchor-"+e);a+='<li><a href="#anchor-'+e+'" onclick="return anchorReacher(this);">'+$(this).html()+"</a></li>";e++});a+="</ul>"}if(a!=""){$(f).append(a)}}function topPage(){$("html,body").animate({scrollTop:0},1500);return false}function initializeFilter(a){$("#masterpageFamily.filter .header .reset").click(function(){$(".product_feature").each(function(){if($(this).is(":checked")){$(this).removeAttr("checked")}});getProducts(a)})}function getProducts(a){var d="{";var c=0;$("#masterpageFamily.filter .header .col").each(function(){nid=$(this).attr("id").replace("filterGroup_","");d+='"'+nid+'":{';if($(this).hasClass("OR")){op="OR"}if($(this).hasClass("AND")){op="AND"}d+='"op":"'+op+'",';d+='"data":{';var e=0;$(this).find(".product_feature").each(function(){if($(this).is(":checked")){d+='"'+$(this).val()+'":1'}else{d+='"'+$(this).val()+'":0'}var f=", ";if(e==($(this).parents(".col").find(".product_feature").length-1)){f=""}d+=f;e++});d+="}";if(c==($("#masterpageFamily.filter .header .col").length-1)){d+="}"}else{d+="}, "}c++});d+="}";order=$("#quickFilterSelect").val();var b=function(){$.ajax({type:"POST",url:"/_masterpage-famille_list.php",data:"tid_familly="+a+"&order="+order+"&features="+d,success:function(e){$(".list").html(e);$("#masterpageFamilyContainer div.ajaxSignifier").fadeOut("slow")}});return false};ajaxEffect("masterpageFamilyContainer",b)}function sortBooks(a){var d=$(a).val();if(d!=""){$(a).parents("form").siblings("div.section").hide();$("#books-section-"+d).show();$("#books-section-"+d+" ul").addClass("last");var b=$("#books-section-"+d+" ul li").length;var e=0;$("#books-section-"+d+" ul li").each(function(){if(e%3==0){$(this).addClass("lineFirstchild")}if(e>=(b-4)){$(this).addClass("lastLine")}e++})}else{var c=0;var b=$(a).parents("form").siblings("div.section").length;$(a).parents("form").siblings("div.section").each(function(){var f=$(this).find("li").length;var g=0;$(this).find("li").each(function(){if(g>=f-4&&c==b-1){$(this).addClass("lastLine")}else{$(this).removeClass("lastLine")}if(g%3==0){$(this).addClass("lineFirstchild")}else{$(this).removeClass("lineFirstchild")}g++});if(c==b-1){$(this).find("ul").addClass("last")}else{$(this).find("ul").removeClass("last")}$(this).show();c++})}}function gotocomparator(c,a,b,d){nids="";first=true;if($('#masterpageFamily .list ul .compare input[type="radio"]:checked').length<1){greyBoxShow("<p>"+d+"</p>",300,"html",{title:b,className:"error hasTitle",top:Math.floor($(window).height()/3)})}else{if($('#masterpageFamily .list ul .compare input[type="radio"]:checked').length>4){greyBoxShow("<p>"+d+"</p>",300,"html",{title:b,className:"error hasTitle",top:Math.floor($(window).height()/3)})}else{$('#masterpageFamily .list ul .compare input[type="radio"]:checked').each(function(){if(!first){nids=nids+"+"}nids=nids+$(this).val();first=false});if(!first){$(location).attr("href",c+"comparator/"+nids+"/"+a)}}}return false}function searchRecettesByTerms(b,a){$("#recetteSearchForm")[0].reset();if(b!=null&&a!=null){if(b=="search_ng"){$("#"+b).attr("checked",true)}else{$("#"+b).val(a)}}$("#recetteSearchForm").submit()}if(jQuery.browser.msie&&jQuery.browser.version=="7.0"){$(document).ready(function(){$("#mainMenu dl dd .productList li a .picture img").click(function(){document.location.href=$(this).parents("a").attr("href")})})};
