try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}var gotham={src:"../swf/gotham.swf"};sIFR.activate(gotham);swfobject.registerObject("video_1","9.0.28","");swfobject.registerObject("video_2","9.0.28","");swfobject.registerObject("video_3","9.0.28","");function parseXML(a){if(window.ActiveXObject&&window.GetObject){var b=new window.ActiveXObject("Microsoft.XMLDOM");b.loadXML(a);return b}if(window.DOMParser){return new window.DOMParser().parseFromString(a,"text/xml")}throw new Error("No XML parser available")}function onPopulateListeEpicerie(c,a){if(a===null){a=true}if(c.length>25){jQuery("#liste_vide").addClass("hide");jQuery("a.b_vider").removeClass("hide");jQuery("#ma_liste_epicerie").empty();var b=parseXML(c);var f=jQuery(b);var d=f.find("detail_ingredient");var g=0;var h;d.each(function(l,i){var k=unescape(jQuery(this).find("active").text());if(k!=="true"){return}g+=1;if(!a&&g>5){return}else{if(!a&&g===5){jQuery("#ma_liste_epicerie").append(h);return}}var j=unescape(jQuery(this).find("ingredient").text());h="<li>"+j+"</li>";jQuery("#ma_liste_epicerie").append(h)});if(g>5){jQuery((a)?".b_minimiser":".b_maximiser").removeClass("hide");jQuery((a)?".b_maximiser":".b_minimiser").addClass("hide")}else{jQuery(".b_minimiser").addClass("hide");jQuery(".b_maximiser").addClass("hide")}}else{jQuery("#liste_vide").removeClass("hide");jQuery("a.b_vider").addClass("hide")}return"SUCCESS"}jQuery(function(f){sIFR.replace(gotham,{selector:"span.b_sifr, .box h3 small, .sifrText",wmode:"",css:{".sIFR-root":{color:"#1E1E1E","text-transform":"uppercase","font-size":"12px"},a:{color:"#1E1E1E","text-decoration":"none","font-size":"12px"},"a:hover":{color:"#1E1E1E","text-decoration":"underline"},".center":{"text-align":"center"}}});function j(t){var v=f(t).appendTo("#wrap").verticalCenter();if(!f("#bgcover").size()){var u=f('<div id="bgcover">&nbsp;</div>').appendTo("body").css("opacity","0.6");if(f.browser.msie&&f.browser.version<=6){u.before(f('<iframe id="bgiframe"></iframe>').css("opacity","0"))}}f("body").addClass("with_popin");return v}f.fn.verticalCenter=function(){return f(this).each(function(){var u;if(typeof window.innerWidth==="number"){u=window.innerHeight}else{u=f(window).height()}var v=f().scrollTop()+36;var t=f().scrollTop()+u/2-f(this).height()/2;if(t<v){t=v}f(this).css("top",t+"px")})};function n(){var t=f(this).parents(".popin");if(t.is("#popin_print")){t.hide()}else{t.remove()}if(!f("#wrap > div.popin").size()){f("#bgcover, #bgiframe").remove()}f("body").removeClass("with_popin");return false}f("a.b_close").livequery("click",n);function s(t,u){f(t).find("change").each(function(){var x=f(this).find("target").text();var y=f(this).find("value").text();if(!x){return false}var w=x===":context"?f(u):f(x,u);switch(f(this).attr("type")){case"append":w.append(y);break;case"replace":w.replaceWith(y);break;case"remove":w.remove();break;case"attr":var v=f(this).find("attr").text();w.attr(v,y);break}})}f("a[rel=external]").click(function(){return !window.open(this.href)}).attr("title","ouvre dans une nouvelle fenêtre");f("input:image, img.rollover").livequery("mouseover focus",function(){this.src=this.src.replace(/(?:_o)?\.([a-z]*)$/i,"_o.$1")}).livequery("mouseout blur",function(){this.src=this.src.replace(/_o\./i,".")});f("#re7x_submit").remove();f("a.b_report").livequery("click",function(){f("#frm_report").slideToggle("fast");return false});var b=f("#recette_images .cadre_enImages").slice(2);b.hide();f("#recette_images").removeClass("hide");if(b.size()===0){f("#recette_images .b_action").hide()}f("a#showallimg").show().click(function(u){u.preventDefault();var t=f(this).find("img");if(t.attr("alt")==="Voir toutes les photos"){t.attr("alt","Voir moins de photos");t.attr("src","../img/fr/b_lessImages.png");b.fadeIn(500)}else{t.attr("alt","Voir toutes les photos");t.attr("src","../img/fr/b_allImages.png");b.fadeOut(500)}});f("#b_print").show().click(function(t){var u=this.id.replace(/b_/,"popin_");f("#"+u).show().css({top:f(this).offset().top-28+"px",left:f(this).offset().left+15+"px"});return false});f("#popin_print a.b_start").click(function(){if(f(this).hasClass("noimg")){f("body").addClass("noimg")}else{f("body").removeClass("noimg")}f("#popin_print").hide()});f("#saison").bind("change",function(){var t=f(this).parents("form");f.ajax({url:t.attr("action"),method:"post",data:t.serialize()+"&isAjax=1",dataType:"xml",success:function(u){s(u)}})});f("#frm_stf").livequery("submit",function(u){u.preventDefault();var t=f(this);f.ajax({url:this.action,method:"post",data:t.serialize()+"&isAjax=1",dataType:"xml",success:function(v){s(v)}})});f("a.b_popin").livequery("click",function(){f("#wrap > div.popin").remove();f.ajax({url:f(this).attr("href"),method:"get",data:f(this).parents("form").serialize()+"&isAjax=1",success:function(t){j(t)}});return false});function o(u){var t=u.target;var x="&re7x_ing1="+f("#re7x_ing1").val();var w="&re7x_ing2="+f("#re7x_ing2").val();var v="&re7x_ing3="+f("#re7x_ing3").val();t+=x+w+v;f.ajax({url:t,method:"GET",dataType:"xml",success:function(z){var B=f(z);var C=B.find("recette").text();var y=B.find("paging").text();var D=f("#ListeRecette");D.replaceWith(C);var A=f("ul.paging");A.replaceWith(y)},error:function(){alert("onpaging error")}});return false}f("#re7_xpress .paging a").livequery("click",o);f("#__VIEWSTATE").parent().remove();function m(){var t=f("#frm_re7x");var v=f("select",t);var u=f(this);if(u.val()===""){return}var w=u.attr("id").match(/\d*$/)[0]*1;v.slice(w).empty();f.ajax({url:"../ajax/getRecetteExpress.aspx",method:"post",data:t.serialize(),dataType:"xml",success:function(z){var A=f(z);if(w<3){var x=A.find("select").text();v.eq(w).append(x)}var B=A.find("recette").text();f("#ListeRecette").replaceWith(B);var y=A.find("paging").text();f(".paging").replaceWith(y)},error:function(x){alert("ajax error")}})}f("#frm_re7x select").bind("change",m);function q(u){var t=f(".findre7_ingredient").val();top.location="../recherche/recette_express.aspx?ingredient="+t}function i(u){var v=u.target.id;var t=f("#frm_findre7");alert("onRecherche");if(v==="btn_recherche_motcle"){t.attr("action","../recherche/recherche.aspx")}}function l(u){var t=u.target;f.ajax({url:t,method:"GET",dataType:"xml",success:function(x){var w=f(x);var C=w.find("search").text();var v=w.find("paging").text();var A=w.find("tab").text();var y=f("#PageSearch");y.replaceWith(C);var z=f(".paging");z.replaceWith(v);var D=f("#result_tabs li.current");D.removeClass("current");var B=f("#tab_"+A);B.addClass("current")},error:function(){alert("onpaging error")}});return false}f("#result_tabs a").livequery("click",l);f("body.recherche ul.paging a").livequery("click",l);f("#btn_recherche_motcle").bind("click",i);f(".findre7_ingredient").bind("change",q);function r(t){f.ajax({url:t.target,method:"post",dataType:"xml",success:function(v){var w=f(v);var x=w.find("recette").text();f("#ListeRecettesIngredient").empty().append(x);var u=w.find("paging").text();f("#pagingDicoIngredient ul").replaceWith(u)},error:function(u){alert("ajax error")}});return false}function c(t){f.ajax({url:t.target,method:"post",dataType:"xml",success:function(v){var w=f(v);var x=w.find("recette").text();f("#ListeRecettesTechnique").empty().append(x);var u=w.find("paging").text();f("#pagingDicoTechnique ul").replaceWith(u)},error:function(u){alert("ajax error")}});return false}f("#pagingDicoIngredient a").livequery("click",r);f("#pagingDicoTechnique a").livequery("click",c);function k(z){var t=f("#liste_recette");var y=f("#liste_epicerie_detaillee");var u=parseXML(z);var w=f(u);var x=w.find("detail_recette");t.empty();y.empty();x.each(function(E,C){var F=unescape(f(this).find("id_recette").text());var A=unescape(f(this).find("titre").text());var D=unescape(f(this).find("url_image").text());var B='<li class="recette_item">    <span class="cadre_thumb">        <img width="144" height="81" alt="" src="../medias/images/'+D+'" alt="" />    </span>    <span class="cadre_texte">'+A+'</span>    <span class="b_remove b_action"><a id="'+F+'" class="b_delete_recette_epicerie">Retirer la recette</a></span></li>';t.append(B)});var v=w.find("detail_ingredient");v.each(function(E,B){var C=unescape(f(this).find("ingredient").text());var F=unescape(f(this).find("key").text());var D=unescape(f(this).find("active").text());if(C){var A='<tr><td class="col_del"><input class="noprint" type="checkbox" name="del[]" '+(D==="false"?"checked='checked'":"")+"/></td>"+(D==="true"?('<td id="'+F+'">- '+C+"</td>"):('<td id="'+F+'" class="noprint"><del>- '+C+"</del></td>"))+"</tr>";y.append(A)}})}f("a.b_liste").livequery("click",function(){f(".popin").hide();f.ajax({url:f(this).attr("href"),method:"get",success:function(u){j(u);var t=swfobject.getObjectById("ListeEpicerieData");var v=t.getData();k(v)}});return false});f("#liste_epicerie_detaillee input:checkbox").livequery("click",function(w){var x=f(this);var t=x.parent();var v=t.next("td");if(x.attr("checked")){v[0].innerHTML="<del>"+v[0].innerHTML+"</del>";v.addClass("noprint")}else{v[0].innerHTML=v[0].firstChild.innerHTML;v.removeClass("noprint")}var y=v.attr("id");var u=swfobject.getObjectById("ListeEpicerieData");u.changeProp(y,"active",x.attr("checked")?"false":"true")});f(".b_delete_recette_epicerie").livequery("click",function(v){var t=f(this);var x=t.attr("id");var u=swfobject.getObjectById("ListeEpicerieData");var w=u.removeRecette(x);k(w);return false});function a(){var u=f("#add_ingredient").val();var t=swfobject.getObjectById("ListeEpicerieData").addCustom(u);k(t);return false}f("#btn_add_ingredients").livequery("click",a);function g(v){var u=f(".b_minimiser").attr("class").indexOf("hide")===-1;var w=f(".b_maximiser").attr("class").indexOf("hide")===-1;var t=swfobject.getObjectById("ListeEpicerieData");var x=t.getData();onPopulateListeEpicerie(x,!u&&w);return n.call(this,arguments)}f(".b_update_mini_liste").livequery("click",g);function d(){swfobject.getObjectById("ListeEpicerieData").empty();f("a.b_minimiser").addClass("hide");f("a.b_maximiser").addClass("hide");f("#liste_vide").removeClass("hide");f("#ma_liste_epicerie").empty();return false}function p(){var t=swfobject.getObjectById("ListeEpicerieData");var u=t.getData();onPopulateListeEpicerie(u,false);return false}function h(){var t=swfobject.getObjectById("ListeEpicerieData");var u=t.getData();onPopulateListeEpicerie(u,true);return false}f("a.b_vider").livequery("click",d);f("a.b_minimiser").livequery("click",p);f("a.b_maximiser").livequery("click",h)});
