function popUp(e,c,b){var i=660,h=480,f=(screen.width-i)/2,g=(screen.height-h)/2,a=b+",top="+g+",left="+f,d=window.open(e,c,a);d.focus()}function showDiv(a){var b;if(document.getElementById&&document.getElementById(a)!=null)b=document.getElementById(a);else if(document.all&&document.all[a]!=null)b=document.all[a];else if(document.layers&&document.layers[a]!=null)b=document.layers[a];if(b!=null)b.style.display="block"}function hideDiv(a){var b;if(document.getElementById&&document.getElementById(a)!=null)b=document.getElementById(a);else if(document.all&&document.all[a]!=null)b=document.all[a];else if(document.layers&&document.layers[a]!=null)b=document.layers[a];if(b!=null)b.style.display="none"}function onImgErrorSmall(a){a.src="/images/Temporary/recipe-defaultthumb.jpg";a.onerror="";return true}function onImgErrorLarge(a){a.src="/images/Temporary/recipe-defaultbeautyshot.jpg";a.onerror="";return true}function WatermarkFocus(a,b){if(a.value==b)a.value=""}function WatermarkBlur(a,b){if(a.value=="")a.value=b}function setCookie(e,d,c){var a;if(c){var b=new Date;b.setTime(b.getTime()+c*24*60*60*1e3);a="; expires="+b.toGMTString()}else a="";document.cookie=e+"="+d+a+"; path=/"}function readCookie(e){for(var c=e+"=",a,d=document.cookie.split(";"),b=0;b<d.length;b++){a=d[b];while(a.charAt(0)==" ")a=a.substring(1,a.length);if(a.indexOf(c)==0)return a.substring(c.length,a.length)}return null}function FireOnSearchSpotLightTag(){var a=Math.random()+"",b=a*1e13;document.getElementById("SearchSpotLightTagContainer").innerHTML='<IFRAME SRC="http://fls.doubleclick.net/activityi;src=1869704;type=betty077;cat=searc844;ord=1;num='+b+'?" WIDTH=1 HEIGHT=1 FRAMEBORDER=0></IFRAME>';fireMarin("search_bc")}function FireSearchTemplateClick(e,b,f,a){var c=true;if(f.length>0&&typeof Page_ClientValidate=="function")if(Page_ClientValidate(f)==false)c=false;var d=jQuery(b).val();if(d=="Please Wait...")c=false;if(c){jQuery(e).removeAttr("href");jQuery(e).removeAttr("onclick");jQuery(e).attr("disabled",true);jQuery(b).attr("disabled",true);jQuery(b).css("background-color","#eaeaea");jQuery(b).attr("value","Please Wait...");FireSearchLogging(d,"",true,true,false);var g=readCookie("searchresulttype");if(g!=null){var h=new RegExp("st=[6-7]");a=a.replace(h,"st="+g)}a=a.replace("{0}",d);window.location.href=a}}function FireSearchLogging(g,a,b,d,f){var e="/Services/Search.asmx/Log",c="{'searchTerm':'"+g+"','navigationValue':'"+a+"','logWebActivity':'"+b+"','logSearch':'"+d+"'}";jQuery.ajax({type:"POST",url:e,data:c,async:f,cache:false,timeout:3e4,contentType:"application/json; charset=utf-8",dataType:"json",success:function(){return true},error:function(){return false}})}function ParseAutoCompleteResults(d){for(var b=d[1],c=[],a=0;a<b.length;a++)c[a]={data:[b[a]],value:b[a],result:[b[a]]};return c}function divExists(b){var a=false;if(document.getElementById&&document.getElementById(b)!=null)a=true;else if(document.all&&document.all[b]!=null)a=true;else if(document.layers&&document.layers[b]!=null)a=true;return a}var imagePopup="";function opneImagePopup(a){if(imagePopup.location&&!imagePopup.closed){imagePopup.location.href=a;imagePopup.focus()}else imagePopup=window.open(a,"htmlname","width=800,height=500,resizable=1")}function IsIE6(){var a=false;jQuery.each(jQuery.browser,function(b){if(b=="msie"&&jQuery.browser.version.substr(0,1)=="6")a=true});return a}function IsIE7(){var a=false;jQuery.each(jQuery.browser,function(b){if(b=="msie"&&jQuery.browser.version.substr(0,1)=="7")a=true});return a}function IsIE(){var a=false;jQuery.each(jQuery.browser,function(b){if(b=="msie")a=true});return a}function IsIE(){var a=false;jQuery.each(jQuery.browser,function(b){if(b=="msie")a=true});return a}jQuery(document).ready(function(){initHover()});function initHover(){jQuery("body").append("<div id='navArrow'></div>");function c(){jQuery("li.mega").removeClass("hovering");jQuery(this).addClass("hovering")}function b(){jQuery(this).removeClass("hovering")}var a={interval:100,sensitivity:6,over:c,timeout:500,out:b};jQuery.hoverIntent&&jQuery("li.mega").hoverIntent(a)}function OpenDialog(a){var b=jQuery("#"+a).dialog("open");b.parent().appendTo(jQuery("form:first"))}function OpenVariableDialog(a){OpenDialog(a);jQuery(".VariableWidth").css("overflow","visible").addClass("VariableWidth-ui-dialog")}function autoOpenFixForASPNet(a){jQuery(document).ready(function(){jQuery("#"+a).parent().appendTo(jQuery("form:first"))})}function autoOpenFixForASPNetVariable(a){jQuery(document).ready(function(){jQuery("#"+a).parent().appendTo(jQuery("form:first"));jQuery(".VariableWidth").css("overflow","visible").addClass("VariableWidth-ui-dialog")})}function CloseDialog(a,b){jQuery("#"+a).dialog("close");if(b){jQuery("#"+a+" input").val("");jQuery("#"+a+" textarea").val("")}}function shareSite(a){a=a.replace("THISURL",escape(document.location));window.open(a,"winShare","scrollbars=1,toolbar=0,width=800,height=600");return}function shareFacebook(d,c){var h=Math.random()+"",i=h*1e13;document.getElementById("Iframe").innerHTML='<IFRAME SRC="http://fls.doubleclick.net/activityi;src=1869704;type=betty077;cat=email720;ord=1;num='+i+'?" WIDTH=1 HEIGHT=1 FRAMEBORDER=0></IFRAME>';var f,b,g="http://www.facebook.com/share",j=encodeURIComponent,a;if(c===""){f=document;b=f.location;a=".php?src=bm&v=3&u="+j(b.href)+"&t="+d}else a=".php?src=bm&v=3&u="+c+"&t="+d;var e=function(){if(!window.open(g+"r"+a,"sharer","toolbar=0, status=0, resizable=0, width=626, height=436"))b.href=g+a};if(/Firefox/.test(navigator.userAgent))setTimeout(e,0);else e();void 0}var timer,clonedItem,cloned=false;function hidePopup(){timer=setTimeout(function(){jQuery(".share_panel_container").hide();cloned&&jQuery(clonedItem).remove()},500)}jQuery(document).ready(function(){initUtilityLinks()});function initUtilityLinks(){var a=false;jQuery.each(jQuery.browser,function(b){if(b=="msie"&&jQuery.browser.version.substr(0,1)=="6")a=true});var b=jQuery(".utility_links_recipe2").offset();jQuery(".share").hover(function(){timer&&clearTimeout(timer);var c=jQuery(this).position(),f,d=jQuery(this).parents(".utility_links").next(".share_panel_container");if(a){jQuery(d).clone(true).appendTo("#mainform");cloned=true;clonedItem=jQuery("#mainform").find(".share_panel_container:last");jQuery(clonedItem).show();if(jQuery(clonedItem).hasClass("recipe_share1"))jQuery(clonedItem).css("left",c.left-42).css("top",c.top+40);else jQuery(clonedItem).css("left",c.left-56).css("top",c.top+20)}else{if(jQuery(d).hasClass("recipe_share1")){var e=jQuery(".utility_links_recipe2");if(e.length>0&&e.hasClass("fixed")){var g=e.offset();f=g.top-b.top;jQuery(d).css("top",c.top+45+f).css("left",c.left-42)}else jQuery(d).css("top",c.top+45).css("left",c.left-42);ConsoleLog("if")}else{ConsoleLog("else");jQuery(d).css("left",c.left-56).css("top",c.top+20)}jQuery(d).show()}},function(){hidePopup()});jQuery(".share_panel_container").hover(function(){timer&&clearTimeout(timer)},function(){hidePopup()})}function OpenPopup(e,c,b){var i=660,h=480,f=(screen.width-i)/2,g=(screen.height-h)/2,a=b+",top="+g+",left="+f,d=window.open(e,c,a);d.focus()}function LoginRecipeBox(){ShowLogin("We'd love to save this recipe for you, but first you must log in or create a new account.",recipeBoxAction,15841)}function LoginGroceryList(){ShowLogin("We'd love to add these ingredients to your grocery list, but first you must log in or create a new account.",groceryListAction,15840)}function ShowLogin(b,c,a){openLogin(a,b);jQuery("#"+loginActionHiddenId).val(c)}function validDate(d){var a,h=/^\d{1,2}\/\d{1,2}\/\d{4}$/;if(h.test(d)){var b=d.split("/"),g=parseInt(b[0],10),f=parseInt(b[1],10),e=parseInt(b[2],10),c=new Date(e,g-1,f);if(c.getFullYear()==e&&c.getMonth()==g-1&&c.getDate()==f)a=true;else a=false}else a=false;return a}function checkAge(c,f,e){var b=18,d=new Date,a=new Date(parseInt(e)+b,parseInt(c)-1,parseInt(f));return d.getTime()-a.getTime()<0?false:true}function ModalLoginClose(){jQuery("#"+loginDialogId+" input").not("input[type='hidden']").val("");jQuery("#"+loginDialogId+" input").removeClass("invalid_text");jQuery(".modal_login_validation_summary").hide();if($signupPanel!=null){ConsoleLog("here");jQuery("#ModalSignupPanel").replaceWith($signupPanel)}}function ShowFirstPage(){jQuery(".modal_login_pages").hide();jQuery(".modal_login_pages:first").show();jQuery("#"+loginDialogId).dialog("option","width",630);jQuery("#"+loginDialogId).dialog("option","position","center");jQuery.watermark.show(".modal_login input")}function showNextPage(a){jQuery(".modal_login_pages").hide();jQuery("#"+a).parents(".modal_login_pages").next(".modal_login_pages").show();jQuery("#"+loginDialogId).dialog("option","width",460);jQuery("#"+loginDialogId).dialog("option","position","center")}function showValidationErrors(a){jQuery.each(Page_Validators,function(b){Page_Validators[b].validationGroup==a&&!Page_Validators[b].isvalid&&jQuery("#"+Page_Validators[b].controltovalidate).addClass("invalid_text")})}function registration_validate(a,g){var b;if(typeof Page_ClientValidate=="function")b=Page_ClientValidate(a);jQuery("#BirthdateError").remove();if(a=="ModalRegistrationPage1"){var e=jQuery("#BirthdayYear").val(),d=jQuery("#BirthdayMonth").val(),f=jQuery("#BirthdayDay").val(),h=d+"/"+f+"/"+e,c=validDate(h);if(!c)b=false;else if(!checkAge(d,f,e)){jQuery(".modal_login_pages").hide();jQuery("#AgeMessage").show();return}}if(b){showNextPage(a);trackModalRegistrationStep(g)}showValidationErrors(a);if(!c){jQuery("#BirthdayMonth").addClass("invalid_text");jQuery("#BirthdayDay").addClass("invalid_text");jQuery("#BirthdayYear").addClass("invalid_text");jQuery("#"+ValidationSummary1).show();if(jQuery("#"+ValidationSummary1+" ul").length==0)jQuery("#"+ValidationSummary1).append("<ul><li id='BirthdateError'>Oops! Please double-check your birth date.</li></ul>");else jQuery("#"+ValidationSummary1+" ul").append("<li id='BirthdateError'>Oops! Please double-check your birth date.</li>")}else{jQuery("#BirthdayMonth").removeClass("invalid_text");jQuery("#BirthdayDay").removeClass("invalid_text");jQuery("#BirthdayYear").removeClass("invalid_text")}}function SendSecureRegistration(b,c){var a;document.forms[0].action=modalRegistrationUrl;jQuery(".left_container input").removeClass("invalid_text");if(typeof Page_ClientValidate=="function")a=Page_ClientValidate(b);if(a){trackModalRegistrationStep(c);document.forms[0].submit()}else showValidationErrors(b)}function SendSecureSubscription(){if(jQuery("#modal_newsletters input:checked").length>0){document.forms[0].action=modalSubscriptionUrl;document.forms[0].submit()}else if(registrationRedirectUrl!="")document.location=registrationRedirectUrl;else closeConfirmation()}jQuery(document).ready(function(){if(jQuery().watermark){jQuery("#BirthdayMonth").watermark("mm",{className:"modal_login_watermark"});jQuery("#BirthdayDay").watermark("dd",{className:"modal_login_watermark"});jQuery("#BirthdayYear").watermark("yyyy",{className:"modal_login_watermark"})}jQuery("div.modal_login_pages").keydown(function(a){if(a.which==13){a.preventDefault();jQuery('input[type="image"]',this).not("#SignUpLink").click()}});jQuery("div.modal_login_pages input[type='image'],#modal_newsletters input[type='image']").click(function(a){a.preventDefault();switch(this.id){case"SendSecureSubscription":SendSecureSubscription();trackModalRegistrationStep(5);break;case"SignUpLink":trackModalRegistrationStep(1);showNextPage(this.id);break;case"ModalLogin":SendSecureLogin(this.id);break;case"ModalRegistrationPage1":registration_validate(this.id,2);break;case"ModalRegistrationPage2":registration_validate(this.id,3);break;case"ModalRegistrationPage3":SendSecureRegistration(this.id,4)}})});function SubmitToFacebook(a,b){FB.api("/me/feed","post",{message:a,link:b},function(a){!a||a.error})}function ConsoleLog(a){typeof console!="undefined"&&console.log(a)}function parseUri(d){var a=parseUri.options,e=a.parser[a.strictMode?"strict":"loose"].exec(d),b={},c=14;while(c--)b[a.key[c]]=e[c]||"";b[a.q.name]={};b[a.key[12]].replace(a.q.parser,function(e,c,d){if(c)b[a.q.name][c]=d});return b}parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};function getSubscriptions(){jQuery.ajax({type:"POST",url:"/Services/Registration.asmx/GetSubscriptions",contentType:"application/json; charset=utf-8",dataType:"json",success:function(a){jQuery(".newsletter h5").after(jQuery("#SubscriptionTemplate").tmpl(a.d));jQuery(".newsletter input:checkbox").click(function(){var a=jQuery(this),b=a.attr("checked")==true;processSubscription(a.next().text(),b,this)})}})}function processSubscription(d,b,a){var c=2e3;if(a)a.disabled=true;jQuery.ajax({type:"POST",url:"/Services/Registration.asmx/ProcessSubscription",contentType:"application/json; charset=utf-8",data:"{NewsletterName: '"+d+"', Subscribed: "+b+"}",dataType:"json",success:function(g){var e;if(g)if(b)e="Subscribed";else e="Unsubscribed";else return;var d=jQuery(a).next(),f=d.css("font-weight"),h=d.text();d.css("font-weight","bold").text(e);setTimeout(function(){d.text(h).css("font-weight",f)},c)},complete:function(){a&&setTimeout(function(){a.disabled=false},c)}})}var DefaultThreadCount="10",defaultDisplayPanel="NewestRecipes";function ChangeContentPanel(b){var a=jQuery(b).val();jQuery("#"+defaultDisplayPanel).hide();jQuery("#"+a).show();defaultDisplayPanel=a;switch(defaultDisplayPanel){case"TopSearches":mostPopularContent("MostPopularContent.asmx/GetTopSearchesPanel");break;case"ActiveThreads":mostPopularContent("MostPopularContent.asmx/GetActiveThreadsPanel");break;case"ViewedRecipes":mostPopularContent("MostPopularContent.asmx/GetMostViewedRecipesPanel");break;case"SavedRecipes":mostPopularContent("MostPopularContent.asmx/GetMostSavedRecipesPanel");break;case"NewestRecipes":mostPopularContent("LatestContent.asmx/GetNewestRecipesPanel");break;case"NewestArticles":mostPopularContent("LatestContent.asmx/GetNewestArticlesPanel");break;case"NewestPromotions":mostPopularContent("LatestContent.asmx/GetNewestPromotionsPanel");break;case"NewestCoupons":mostPopularContent("LatestContent.asmx/GetNewestCouponsPanel");break;default:jQuery("#"+defaultDisplayPanel).html("No results")}}function mostPopularContent(a){jQuery.ajax({type:"POST",url:"/layouts/content/"+a,contentType:"application/json; charset=utf-8",dataType:"json",success:function(a){jQuery("#"+defaultDisplayPanel).html(a.d)}})}function ShowContent(c,d,b,a){ChangeContentPanel("#"+c);jQuery("#linkMostPopular, #linkNewestItems").removeClass("active");jQuery("#"+d).addClass("active");jQuery("#PopularContent, #NewContent").hide();jQuery("#"+b).show();jQuery("#MostPopularLists, #NewestItems").hide();jQuery("#"+a).show()}function initSiteSearchButton(a,d,c,b){jQuery("#siteSearchOptionsButton").click(function(){if(jQuery("#siteSearchButtonOptions").is(":visible"))jQuery("#siteSearchButtonOptions").hide();else jQuery("#siteSearchButtonOptions").show()});jQuery("#siteSearchButtonOptions a").click(function(){jQuery("#siteSearchButtonOptions a").removeClass("current");jQuery(this).addClass("current");if(this.id=="articlesSiteSearchOption")jQuery("#"+a).val(c);else if(this.id=="communitySiteSearchOption")jQuery("#"+a).val(b);else jQuery("#"+a).val(d);jQuery("#siteSearchButtonOptions").hide();return false})}function getPollResults(b,a){jQuery.ajax({type:"POST",url:"/Services/Polls.asmx/GetResults",data:"{itemId: '"+b+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(b){ShowPollResults(b,a)},error:function(){ShowPollError(a)}})}function pollVote(b,c,a){jQuery.ajax({type:"POST",url:"/Services/Polls.asmx/Vote",data:"{itemId: '"+b+"', voteId: '"+c+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(b){ShowPollResults(b,a)},error:function(){ShowPollError(a)}})}function ShowPollResults(b,a){jQuery("#"+a+" .pollQuestion").hide();jQuery("#"+a+" .PollResults table").html(jQuery("#PollResultsTemplate").tmpl(b.d));jQuery("#"+a+"  .PollResults").show()}function ShowPollError(a){jQuery("#"+a+" .pollQuestion").hide();jQuery("#"+a+"  .PollError").show()}function Completer(f,g,c,e,d,a,b){this.submitId=f;this.inputId=g;this.completeOptions=c;this.completeUrls=e;this.waterMarkText=d;this.onFailure=null;this.onSelect=null;if(typeof a!="undefined")this.onFailure=a;if(typeof b!="undefined")this.onSelect=b}Completer.prototype.init=function(){var a=this;jQuery("#"+a.inputId).autocomplete({delay:100,minLength:3,source:a.completeOptions,select:function(d,c){a.onSelect!=null&&a.onSelect();var b=jQuery.inArray(c.item.value,a.completeOptions);if(b!==-1)a.recipeDestination=a.completeUrls[b]}}).keypress(function(b){if(b.keyCode=="13"){b.preventDefault();jQuery("#"+a.submitId).click()}}).watermark(a.waterMarkText).data("autocomplete")._renderItem=function(b,a){a.label=a.label.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+jQuery.ui.autocomplete.escapeRegex(this.term)+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");return jQuery("<li></li>").data("item.autocomplete",a).append(jQuery("<a></a>").html(a.label)).appendTo(b)};jQuery("#"+a.submitId).click(function(){if(a.recipeDestination!=null)document.location=a.recipeDestination;else a.onFailure!=null&&a.onFailure()})};var abuseEngine={dialogOpen:null,dialogClose:null,init:function(){jQuery("#ReportClick").click(function(){jQuery("#ReportAbuseValidation").hide();var d=jQuery("input[name='abuseoptions']:checked"),f=jQuery("#ReportAbuseOther:checked"),c=jQuery("#ReportAbuseOtherText");if(!d.val()||f.length==1&&c.val()=="")jQuery("#ReportAbuseValidation").show();else{if(f.length==1)abuseEngine.abuseParameters.itemComment=c.val();else abuseEngine.abuseParameters.itemComment=d.parent().text().trim();var e="/Services/RecipeHelper.asmx/ReportAbuse",b="POST",a=JSON.stringify(abuseEngine.abuseParameters);if(abuseEngine.abuseParameters.referrerPage=="SupplementalContent"){e="/Services/SupplementalContentHandler.ashx";b="GET";a={myjson:"["+JSON.stringify(abuseEngine.abuseParameters)+"]"}}jQuery.ajax({type:b,url:e,data:a,contentType:"application/json; charset=utf-8",dataType:"json",success:function(){jQuery("#report_abuse1").hide();jQuery("#report_abuse2").show()},error:function(){jQuery("#ReportAbuseValidation").show()}})}});jQuery(".report_abuse_dialog").keypress(function(a){if(a.keyCode=="13"){a.preventDefault();jQuery("#ReportClick").click()}});jQuery("#ReportAbuseOtherText").click(function(){jQuery("#ReportAbuseOther").attr("checked",true)})},onClose:function(){jQuery("input[name='abuseoptions']").attr("checked",false);jQuery("#report_abuse1").show();jQuery("#report_abuse2").hide()},openReportAbuse:function(c,d,b,a){abuseEngine.dialogOpen();abuseEngine.abuseParameters.itemId=c;abuseEngine.abuseParameters.url=d;abuseEngine.abuseParameters.itemType=b;abuseEngine.abuseParameters.referrerPage=a},abuseParameters:{itemId:null,url:null,itemType:null,itemComment:null,referrerPage:null}};jQuery(document).ready(function(a){a("div.utility_links > ul > li > a.print").click(function(a){a.preventDefault();window.print()})});jQuery.noConflict();
