var CookbookExplorerWidget={mask:jQuery("#CookbookExplorerMask"),animationDuration:500,closedMaskHeight:"250px",openMaskHeight:"360px",closedWidgetPosition:"-25px",openWidgetPosition:"0px"};CookbookExplorerWidget.expand=function(){jQuery("#CookbookExplorerMask").animate({height:this.openMaskHeight},{duration:this.animationDuration});jQuery("#CookbookExplorer").animate({top:this.openWidgetPosition},{duration:this.animationDuration})};CookbookExplorerWidget.compact=function(){jQuery("#CookbookExplorerMask").animate({height:this.closedMaskHeight},{duration:this.animationDuration});jQuery("#CookbookExplorer").animate({top:this.closedWidgetPosition},{duration:this.animationDuration})};scale_value=function(a,e,d){var c=((d-a[0])/(a[1]-a[0]))*(e[1]-e[0]);var b=c+e[0];return b};var Cookbooks={};Cookbooks.runSimilarityIndicator=function(){var b=jQuery;var e=[];b(".similarity").each(function(){var f=Number(b(this).find(".similarityValue").text(),10);e.push(f)});var d=Math.max.apply(Math,e);var a=Math.min.apply(Math,e);idx=0;var c=[];b(".similarity").each(function(){var g=Number(b(this).find(".similarityValue").text(),10);if(false){var f=(g*20>100)?100:g*20}else{var f=scale_value([a,d],[10,100],g);c.push(f)}idx++;b(this).find(".liniarIndicator").css("width",f)})};(function(b){Array.prototype.inArray=function(d){var c;for(c=0;c<this.length;c++){if(this[c]===d){return true}}return false};var a={};a.hasCssProperty=function(d){var c=d.split("-");if(c.length>1){d=c[0];for(var e=1;e<c.length;e++){d+=c[e].substr(0,1).toUpperCase();d+=c[e].substr(1)}}var f=document.createElement("div");return(f.style[d]!==undefined)?true:false};a.supportsAdjacentSelector=function(){return a.hasCssProperty("max-height")};b("document").ready(function(){b('#adcSearchBox input[type="text"]').searchBoxBehavior();b("a.but_close").bind("click",function(h){h.preventDefault();b(this).parent().slideUp("fast");return false});if(b(".summaryList .trimmed")[0]){b(".summaryList .trimmed").each(function(){var i=b("<div>").addClass("hover");var h=b("<a>").attr({href:this.href});h.text(this.title).html();i.append(h);b(this).parent().append(i);b(this).toggleHover(i)})}b(".recipeList .recipeContainer").hoverBlock();if(b(".tabNavigation li")[0]&&b(".tabTargets>div")[0]){var g=new TabNavigator(jQuery);g.triggers=b(".tabNavigation li a");g.targets=b(".tabTargets>div");g.init()}if(b("#expandTagsPanel")){b("#expandTagsPanel").bind("click",function(h){h.preventDefault();b("#technology_homepage_cloud_more").toggle();b("#expandTagsPanel").html((b("#expandTagsPanel").html()=="More")?"Less":"More");return false})}if(!a.supportsAdjacentSelector()){b("#globalfooter li+li").addClass("sibling")}b("#cbSearchBox").bind("submit",function(){$form=b(this);var h=jQuery.trim(b("#searchTagName").val());h=h.replace(/-|\+|&|<|>|'|"|\//g,"");var i=$form.attr("action")+"/"+encodeURIComponent(h);$form.attr("action",i);b("#searchTagName").attr("disabled",true)});b(".pipeSeparator li:first-child").addClass("first-child");b(".pipeSeparator li:last-child").addClass("last-child");b("#tagList .ico_delete").bind("mouseover",function(){b(this).parent().addClass("delete")}).bind("mouseout",function(){b(this).parent().removeClass("delete")}).bind("click",function(h){c(b(this).parent());f(b("#tagSearchForm"));d();return false});b("#tagList a").bind("click",function(h){e()});b("#tagSearchForm").bind("submit",function(){e();f(b("#tagSearchForm"))});function d(){b("#tagSearchForm")[0].submit()}function e(){b("#tagSearchForm").slideUp("fast",function(){b("#tagSearchMessage").slideDown("fast")})}function c(h){if(!h||typeof h!=="object"){throw new TypeError("Invalid parameter $container. Expected jQuery object. Got: "+typeof h)}b("#newTagName").attr("disabled",true);h.find("input[name='cookbooksTagNames']").remove();h.find("input[name='removeTagName']").removeAttr("disabled")}function f(h){if(!h||typeof h!=="object"){throw new TypeError("Invalid parameter $form. Expected jQuery object. Got: "+typeof h)}var i=[];var j=function(l){var m=jQuery.trim(l.toLowerCase()).replace(/\/|\\|\,|\?|&|'|"/,"");return encodeURIComponent(m)};b("input[name='cookbooksTagNames']").each(function(){i.push(j(b(this).val()))});if(b("#newTagName:not(:disabled)").val()){i.push(j(b("#newTagName").val()))}var k=h.attr("action")+"/"+i.join(",");h.attr("action",k)}b(".accordion-controller").bind("mouseover",function(){b(this).addClass("mouseover")}).bind("mouseout",function(){b(this).removeClass("mouseover")}).toggle(function(){b(this).parent().addClass("opened").end().next().handleAccordionData()},function(){b(this).parent().removeClass("opened").end().next().slideUp("fast")});if(b(".tabNavigation")[0]){b('.tabNavigation a[name="new"]').bind("click",function(){if(s&&s.pageName){s.pageName="Cookbooks: "+b("#techName").val()+": Home: Whats New Tab";void (s.t())}});b('.tabNavigation a[name="top"]').bind("click",function(){if(s&&s.pageName){s.pageName="Cookbooks: "+b("#techName").val()+": Home: Top Content Tab";void (s.t())}})}if(b('form[name="addForm"] :submit')){b('form[name="addForm"] :submit').bind("click",function(j){var i=b("#TEMPLATE_ID")?b("#TEMPLATE_ID").val():-1;omniturePageName=(i==12)?"Cookbooks: Create a Recipe Form: Published":"Cookbooks: Request a Recipe Form: Published";var h=cbFCK.getCkId();if(h!=""){b("#"+h+"").val(cbFCK.getFCKcontent())}})}if(b('form[name="answerForm"] :submit')){b('form[name="answerForm"] :submit').bind("click",function(i){omniturePageName="Cookbooks: Answer a Request Form: Published";var h=cbFCK.getCkId();if(h!=""){b("#"+h+"").val(cbFCK.getFCKcontent())}})}if(b('form[name="editPostForm"] :submit')){b('form[name="editPostForm"] :submit').bind("click",function(j){var i=b("#TEMPLATE_CODE")?b("#TEMPLATE_CODE").val():"";omniturePageName=(i=="cookbooks_recipe")?"Cookbooks: Edit a Recipe Form: Published":"Cookbooks: Edit a Recipe Request Form: Published";var h=cbFCK.getCkId();if(h!=""){b("#"+h+"").val(cbFCK.getFCKcontent())}})}})})(jQuery);
