function resetDrilldowns(b){if(b){var a=false;$(".ui-slider",b).each(function(){var d=$(this).slider("value");var c=($(this).find(".excludedElement[name=sliderMin]")[0]).value;if(d!=c){$(this).slider("moveTo",c);a=true;}});$(":checkbox",b).filter(":not(.excludedElement)").each(function(){if(this.checked==true){this.checked=false;a=true;}}).end().filter(".excludedElement").each(function(){if(this.checked==false){this.checked=true;a=true;}});if(location.href.indexOf("/fs4preview")<0){_gaq.push(["_trackPageview",location.pathname+location.search+"#/suche/rezeptsuche/verfeinern"]);}if(a){return autosubmit(b,true);}else{return true;}}else{return false;}}function initSliders(a){$("#"+a+" .ui-slider").each(function(){var h=$(this).find(".sliderValue")[0];var e=h.value;var c=$(this).find(".excludedElement[name=sliderMin]")[0].value;var b=$(this).find(".excludedElement[name=sliderMax]")[0].value;var g=$(this).find(".excludedElement[name=sliderStepping]")[0].value;var f=$(this).parent();var d=$(this).find(".expandCollapseElement")[0];if(d.value=="true"){$(this).slider({slide:function(j,i){i.options.jWrapperElement.css("background-position",((i.value*277/(i.options.jMax-i.options.jMin))-271)+"px 2px");},change:function(j,i){i.options.valueElement.value=i.value;_gaq.push(["_trackPageview",location.pathname+location.search+"#/suche/rezeptsuche/verfeinern"]);autosubmit(i.options.valueElement.form);},axis:"horizontal",handle:".ui-slider-handle",max:b,min:c,startValue:e,stepping:g,valueElement:h,jWrapperElement:f,jMin:c,jMax:b});}});}function resetSliders(a){$(".ui-slider",a).each(function(){var b=($(this).find(".excludedElement[name=sliderInitial]")[0]).value;$(this).slider("moveTo",b);});if(location.href.indexOf("/fs4preview")<0){_gaq.push(["_trackPageview",location.pathname+location.search+"#/suche/rezeptsuche/verfeinern"]);}}function initMoreLess(c,a,b){$("#"+c).find("a.moreless").css("outline","none").each(function(e,d){d.jLessLIs=$(this).siblings("table").find("li").filter(":not(.moreless)");d.jRelatedLIs=$(this).siblings("table").find("li.moreless");d.valueElem=$(this).siblings(".moreLessElement")[0];d.jFilter=$(this).siblings(".filterElement");d.relatedVisible=(d.valueElem.value!="false");$(d).bind("click",function(){_gaq.push(["_trackPageview",location.pathname+location.search+"#/suche/rezeptsuche/verfeinern"]);var f=false;if(this.relatedVisible=!this.relatedVisible){this.jRelatedLIs.fadeIn(200);this.innerHTML=b;this.valueElem.value="true";this.className=this.className.replace("rightArrow","leftArrow");var g=this.jRelatedLIs.find(":checkbox").filter(":checked").filter(":not(.excludedElement)");if(g.length>0){f=true;}}else{this.jRelatedLIs.fadeOut(200);this.innerHTML=a;this.valueElem.value="false";this.className=this.className.replace("leftArrow","rightArrow");var g=this.jRelatedLIs.find(":checkbox").filter(":checked").filter(":not(.excludedElement)");if(g.length>0){f=true;}}if(f){this.jFilter.remove();autosubmit(this.valueElem.form,true);}return false;});});}function initExpandCollapse(a){$("#"+a+" h5").each(function(d,c){var f=$(c),b=$(c).next("div"),g=$(c).next("div").find(":hidden.expandCollapseElement"),e=$(c).next("div").find(":hidden.filterElement");c.refElem=b[0];c.valueElem=g[0];c.jFilterElem=e;f.bind("click",function(){_gaq.push(["_trackPageview",location.pathname+location.search+"#/suche/rezeptsuche/verfeinern"]);var h=this;$(this.refElem).slideToggle("fast",function(){$(h).toggleClass("toggleArrowClosed");h.valueElem.value=h.valueElem.value=="true"?"false":"true";if($(h.refElem).children("div").hasClass("ui-slider")){var k=parseInt($(h.refElem).find(":hidden.sliderValue")[0].value);var l=parseInt($(h.refElem).find(":hidden[name=sliderMax]")[0].value);var i=parseInt($(h.refElem).find(":hidden[name=sliderMin]")[0].value);if((k>i)&&(k<l)){autosubmit(h.valueElem.form,true);}}else{h.jFilterElem.remove();var j=$(h.refElem).find(":checkbox").filter(":checked").filter(":not(.excludedElement)").filter(":visible");if(j.length>0){autosubmit(h.valueElem.form,true);}}});return false;});});}function customSubmit(b){if(b){var a=b.action+"?"+queryStringNew(b);location.href=a;return true;}else{return false;}}function sort(d,a){var c=document.forms[d];if(c&&a&&a.options){for(var b=0;b<a.options.length;b++){if(a.options[b].selected==true){$("#"+d).find(".sortingElement").each(function(){this.value=a.options[b].value;});}}autosubmit(c,true);}if(location.href.indexOf("/fs4preview")<0){_gaq.push(["_trackPageview",location.pathname+location.search+"#/suche/rezeptsuche/sortieren"]);}return true;}function sortByValue(c,b){var a=document.forms[c];if(a){$("#"+c).find(".sortingElement").each(function(){this.value=b;});if(location.href.indexOf("/fs4preview")<0){_gaq.push(["_trackPageview",location.pathname+location.search+"#/suche/rezeptsuche/sortieren"]);}autosubmit(a,true);}return true;}function toggleIngredientBased(b){var a=document.forms[b];if(a){$("#"+b).find(".ibHidden").each(function(){if(this.value=="false"){this.value="true";}else{this.value="false";}});}}function setDisplayFormatAndSubmit(e,d){var a=document.forms[e];var c=false;if(a){$("#"+e).find(".dfHidden").each(function(){if(this.value!=d){this.value=d;c=true;}});var b=a.action;if(b.indexOf("*")>0){queryString=$("#recipeSearchQueryString").val();b=b.replace("*",queryString);a.action=b;}if(c){if(location.href.indexOf("/fs4preview")<0){_gaq.push(["_trackPageview",location.pathname+location.search+"#/suche/rezeptsuche/ansicht"]);}customSubmit(a);}}return true;}function rssd(a){if(a){qStr=queryStringNew(a);var b=a.action+"?"+qStr+"&dummy="+new Date().getTime()+"&drilldown=drilldown";createCookie("rsoq",encodeURIComponent(qStr),365);window.open("#"+qStr,"_self");$.get(b,function(h){var g=h.split("(:------------------------------------------------------- SNIP -:)");var d=g[0];var e=g[1];var f=$("#hitlist");var c=$("#drilldowns");f.html(d);c.html(e);window.blocksubmitOn=false;},"text");return true;}else{return false;}}function rssd4hash(b){$(".clickBlocker").each(function(){var c=$(this).next("div").outerWidth()+"px";var d=$(this).next("div").outerHeight()+"px";$(this).css({width:c,height:d});}).fadeIn(1,function(){if(!window.blocksubmitOn){window.blocksubmitOn=true;}});var a=$("#recipeSearchDrilldowns").attr("action")+"?"+b;$.get(a,function(h){var g=h.split("(:------------------------------------------------------- SNIP -:)");var d=g[0];var e=g[1];var f=$("#hitlist");var c=$("#drilldowns");c.html(e);f.html(d);window.blocksubmitOn=false;},"text");return true;}function push(a,c,b){if(a!=null){var d=b[c];if(!d){d=new Array();b[c]=d;}d.push(a);}}function queryString(d){var f=new Object();$(":input",d).filter(":not(.excludedElement, :submit, :reset, #resetAllDrilldowns)").filter(":checkbox").filter(".numericFieldValue").each(function(){if(this.checked){push(this.value+"y",this.name,f);}else{if(d.name=="recipeSearchDrilldowns"){push(this.value+"n",this.name,f);}}}).end().filter(":not(.numericFieldValue)").each(function(){if(this.checked){push("true",this.name,f);}else{push("false",this.name,f);}}).end().end().filter(":radio").each(function(){if(this.checked){push(this.value,this.name,f);}}).end().filter(":not(:radio, :checkbox)").each(function(){if(d.name=="recipeSearchDrilldowns"){push(this.value,this.name,f);}}).end().filter("#recipeSearchQueryString").each(function(){push(this.value,this.name,f);});var c=new Array();for(var b in f){var e=f[b];var a=encodeURIComponent(e.join("_"));c.push(b+"="+a);}var g=c.join("&");return g;}function queryStringNew(a){var c=new Object();$(":input",a).filter(":not(.excludedElement, :submit, :reset, #resetAllDrilldowns)").filter(":checkbox").filter(".numericFieldValue").each(function(){if(this.checked){push(this.value+"y",this.name,c);}else{if(a.name=="recipeSearchDrilldowns"){push(this.value+"n",this.name,c);}}}).end().filter(":not(.numericFieldValue)").each(function(){if(this.checked){push("y",this.name,c);}else{push("n",this.name,c);}}).end().end().filter(":radio").each(function(){if(this.checked){push(this.value,this.name,c);}}).end().filter(":hidden").filter(".dfHidden").each(function(){push(this.value,this.name,c);}).end().end().filter(":hidden").filter(".srcHidden").each(function(){push(this.value,this.name,c);}).end().end().filter(":hidden").filter(".ibHidden").each(function(){push(this.value,this.name,c);}).end().end().filter(":not(:radio, :checkbox)").each(function(){if(a.name=="recipeSearchDrilldowns"){push(this.value,this.name,c);}}).end().filter("#recipeSearchQueryString").each(function(){push(this.value,this.name,c);});if($(".extFormPart")){$(".extFormPart #preptimeSlider :input").filter(":not('.excludedElement, .expandCollapseElement')").each(function(){push(this.value,this.name,c);});$(".extFormPart #kcalSlider :input").filter(":not('.excludedElement, .expandCollapseElement')").each(function(){push(this.value,this.name,c);});}var i=new Array();for(var h in c){var f=c[h];var j=encodeURIComponent(f.join("_"));if(j.indexOf("n_")>0||j.indexOf("y_")>0){j=encodeSearchParams(j);}i.push(h+"="+j);}var g=i.join("&");if(g.indexOf("cal.x=")<0){var e=$(":input[name='cal.x']").val();g=g.concat("&cal.x=").concat(e);}if(g.indexOf("tim.x=")<0){var d=$(":input[name='tim.x']").val();g=g.concat("&tim.x=").concat(d);}var b=$(":input[name='target']").val();if(b!=null){return g.concat("&").concat("target=").concat(b);}else{return g;}}function encodeSearchParams(g){var c=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");var j="";var h=c.length;tokens=g.split("_");for(var d=0;d<tokens.length;d++){var b=tokens[d].substring(0,tokens[d].length-1);var a=tokens[d].charAt(tokens[d].length-1);var e="";while(b>0){var f=b%h;b=Math.floor(b/h);e=c[f]+e;}if(a=="y"){j+="_"+e;}else{j+="-"+e;}}return j;}function autosubmit(b,a){if(b){$(":hidden[name=autoSubmit]",b).each(function(){if(b.submitTimeout&&b.submitTimeout!=null){window.clearTimeout(b.submitTimeout);b.submitTimeout=null;}var c=this.value;if(a||c==0){blocksubmit(b.id);}else{b.submitTimeout=window.setTimeout("blocksubmit('"+b.id+"')",c);}});return true;}else{return false;}}function blocksubmit(a){$(".clickBlocker").each(function(){var b=$(this).next("div").outerWidth()+"px";var c=$(this).next("div").outerHeight()+"px";$(this).css({width:b,height:c});}).fadeIn(200,function(){if(!window.blocksubmitOn){window.blocksubmitOn=true;submit(a);}});}function plainSubmit(a){if(a.onsubmit()){a.submit();}}function submit(b,a){$("form[id="+b+"]").each(function(){if(this.submitTimeout&&this.submitTimeout!=null){window.clearTimeout(this.submitTimeout);this.submitTimeout=null;}if(a){this.action=a;}if(this.onsubmit()){this.submit();}});}function allx(e,b){if(e&&e.form){if(e.form.name!="recipeSearchForm"){_gaq.push(["_trackPageview",location.pathname+location.search+"#/suche/rezeptsuche/verfeinern"]);hbv.track(".recipe_search_drilldown");}if(!e.checked){e.checked=true;return false;}else{var a=e.name.substring(0,e.name.lastIndexOf(".all"));var f=a+".o";var d=a+".c";var c=a+".f";$(":checkbox[name="+f+"], :checkbox[name="+d+"]",e.form).each(function(){this.checked=!b;});$(":hidden[name="+c+"]",e.form).remove();autosubmit(e.form);return true;}}else{return false;}}function option(b,a){if(b&&b.form){if(b.form.name!="recipeSearchForm"){_gaq.push(["_trackPageview",location.pathname+location.search+"#/suche/rezeptsuche/verfeinern"]);hbv.track(".recipe_search_drilldown");}return optionOrOther(b,b.name.substring(0,b.name.lastIndexOf(".c")),a);}else{return false;}}function optionTeaser(a){if(a&&a.form){return optionOrOther(a,a.name.substring(0,a.name.lastIndexOf(".c")),invertAllLogic);}else{return false;}}function allxTeaser(e,b){if(e&&e.form){if(!e.checked){e.checked=true;return false;}else{var a=e.name.substring(0,e.name.lastIndexOf(".all"));var f=a+".o";var d=a+".c";var c=a+".f";$(":checkbox[name="+f+"], :checkbox[name="+d+"]",e.form).each(function(){this.checked=!b;});$(":hidden[name="+c+"]",e.form).remove();autosubmit(e.form);return true;}}else{return false;}}function other(b,a){if(b&&b.form){return optionOrOther(b,b.name.substring(0,b.name.lastIndexOf(".o")),a);}else{return false;}}function optionOrOther(g,h,f){if(g&&g.form){var i=h+".all";var a=h+".o";var e=h+".c";var b=h+".f";var j=$(":checkbox[name="+e+"], :checkbox[name="+a+"]",g.form);var k=$(":checkbox[name="+i+"]",g.form);var c=j.filter(":checked").length;var d=true;if((c==0&&!f)||(k.length==0)){g.checked=true;c=1;d=false;}k.each(function(){this.checked=(!f&&(j.length==c))||(f&&(c==0));});$(":hidden[name="+b+"]",g.form).remove();if(d){autosubmit(g.form);}return true;}else{return false;}}function windowSize(){var a={width:0,height:0};if(typeof(window.innerWidth)=="number"){a.width=window.innerWidth;a.height=window.innerHeight;}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){a.width=document.documentElement.clientWidth;a.height=document.documentElement.clientHeight;}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){a.width=document.body.clientWidth;a.height=document.body.clientHeight;}}}return a;}hbv.trackrefresh=function(b){if(!b){return;}if(typeof(wt_sendinfo)!="undefined"){var a=wt_be;wt_be+=b;wt_sendinfo();wt_be=a;}};$("form#recipeSearchDrilldowns input").bind("mousedown",function(){hbv.trackrefresh(".suche_verfeinern_checkbox");});$("form#recipeSearchDrilldowns div.ui-slider-handle").bind("mousedown",function(){hbv.trackrefresh(".suche_verfeinern_slider");});

