function setResponsiveClass(){var n=$R(document).width();n<tabletBreak?($R("body").addClass("tablet"),$R("body").removeClass("mobile"),n<mobileBreak&&($R("body").removeClass("tablet"),$R("body").addClass("mobile"))):($R("body").removeClass("tablet"),$R("body").removeClass("mobile"),$R(".header-top-navigation-button").parent().children("ul").attr("style",""));$R(window).resize(function(){n=$R(document).width();n<tabletBreak?($R("body").addClass("tablet"),$R("body").removeClass("mobile"),n<mobileBreak&&($R("body").removeClass("tablet"),$R("body").addClass("mobile"))):($R("body").removeClass("tablet"),$R("body").removeClass("mobile"),$R(".header-top-navigation .page > ul.menu").attr("style",""))})}function setMobileAndTabletRules(){$R(".header-top-navigation-button").click(function(){$R(".header-top-navigation .page > ul.menu").css("display")=="block"?($R(".header-top-navigation .page > ul.menu").slideUp(200),$R(this).parent().parent().removeClass("current")):($R(".header-top-navigation .page > ul.menu").slideDown(400),$R(this).parent().parent().addClass("current"))})}function initializeTiles(){$R(".tile").css("display","block");$R(".tile-wrapper, .full-tile-wrapper").tiles({itemSelector:".tile",masonry:{}})}function addIngredient(){$R(".AddIngredient").click(function(){var i=$R(this).attr("data-ingredient"),n=getCookie("_ingredients"),t=getCookie("_ingredients").split(".");t.push(i);n=t.join(".");console.log(n);deleteCookie("_ingredients");console.log("Deleted Cookie");setCookie("_ingredients",n,365);location.reload()})}function showRecipeDetails(){$R(".line-item").hover(function(){$R(this).find(".line-item-details").stop(!0,!1).show()},function(){$R(this).find(".line-item-details").stop(!0,!1).hide(0)})}function showAds(){}function initializeIngredientPush(){var n=!1;$R(".IngredientPush").click(function(){n?(getCookie("IngredientPush")!=""&&deleteCookie("IngredientPush"),setCookie("IngredientPush","0",0),n=!1,$R(".SpecificIngredients").text("Use specific ingredients?"),$R(".IngredientPushResultsIngredients").tiles("destroy"),$R(".IngredientPushResults").css("display","none"),$R(".IngredientPushResultsIngredients .tile").attr("style",""),$R(".Filter .Submit span").click()):(getCookie("IngredientPush")!=""&&deleteCookie("IngredientPush"),setCookie("IngredientPush","1",0),n=!0,$R(".SpecificIngredients").text("Hide Ingredient List?"),$R(".IngredientPushResults").css("display","block"),$R(".IngredientPushResultsIngredients .tile").css("display","block"),$R(".IngredientPushResultsIngredients").tiles({itemSelector:".tile",masonry:{}}))});$R(".OutSpecificIngredients").click(function(){getCookie("IngredientPush")!=""&&deleteCookie("IngredientPush");setCookie("IngredientPush","0",0);n=!1;$R(".SpecificIngredients").text("Use specific ingredients?");$R(".IngredientPushResultsIngredients").tiles("destroy");$R(".IngredientPushResults").css("display","none");$R(".IngredientPushResultsIngredients .tile").attr("style","");$R(".Filter .Submit span").click()})}function initializeDecider(){$R(".decider-page .decider-button").click(function(){var t=$R(this).attr("data-filter-by"),i=$R(this).attr("data-filter-value"),r=$R(this).attr("data-filter-answer"),u=$R(this).attr("data-filter-categories"),f=$R(this).attr("data-filter-corners"),n=getCookie("_deciderFilters");return n!=""?n+="*"+t+"|"+i+"|"+r+"|"+u+"|"+f:n=t+"|"+i+"|"+r+"|"+u+"|"+f,setCookie("_deciderFilters",n,0),!0})}function InitializeCarousels(){$R(".cycle-carousel").each(function(){var n=$R(this),u="fade",f="1000",e="5000",o=!1,s=!1,r=null,t=null,i=null,h=function(){};$R.fn.cycle.updateActivePagerLink=function(){};n.attr("data-animation").length>0&&(u=$R(this).attr("data-animation"));n.attr("data-transition-speed").length>0&&(f=n.attr("data-transition-speed"));n.attr("data-transition-frequency").length>0&&(e=n.attr("data-transition-frequency"));n.attr("data-pause").length>0&&n.attr("data-pause").toLowerCase()=="true"&&(o=!0);n.attr("data-sync").length>0&&n.attr("data-sync").toLowerCase()=="true"&&(s=!0);n.after('<ul class="paging-bullets"><\/ul>');r=n.siblings(".paging-bullets");h=function(){return"<li><a><\/a><\/li>"};$R.fn.cycle.updateActivePagerLink=function(n,t){t=t;r.children("li").removeClass("current");r.children("li").eq(t).addClass("current")};n.after('<span class="slideshow-left"><\/span><span class="slideshow-right"><\/span>');t=n.siblings(".slideshow-right");i=n.siblings(".slideshow-left");n.hover(function(){i.addClass("show");t.addClass("show")},function(){i.removeClass("show");t.removeClass("show")});t.hover(function(){i.addClass("show")},function(){i.removeClass("show")});i.hover(function(){t.addClass("show")},function(){t.removeClass("show")});n.cycle({fx:u,speed:f,timeout:e,pager:r,pause:o,delay:1e3,sync:s,next:t,prev:i,pagerAnchorBuilder:function(n,t){return h(n,t)}});n.leftSwipe(function(){n.cycle("next")}).rightSwipe(function(){n.cycle("prev")});n.animate({opacity:"1"},400)})}function loginPopup(){FB.login(function(){checkLoginState()})}function Login_paypal(n,t){$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/api/RegisterUser/Logindetail",data:{email:n,password:t},success:function(n){var t,i;console.log(n);n.email!==null?(statusChangeCallback(n),t=getCookie("ShowAds"),(t===""||t===undefined)&&setCookie("PaidMember",n.paidmember,365),i=getCookie("Email"),(i===""||i===undefined)&&setCookie("Email",n.email,365),document.Reg.submit()):(document.getElementById("txtEmail").value="",document.getElementById("txtpassword").value="",alert("Email/Password may be incorrect or this Email is never being registered"))},error:function(n,t){console.log(n);console.log(t)}})}function Login(n,t){$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/api/RegisterUser/Logindetail",data:{email:n,password:t},success:function(n){var t,i;console.log(n);n.email!==null?(statusChangeCallback(n),t=getCookie("ShowAds"),(t===""||t===undefined)&&setCookie("PaidMember",n.paidmember,365),i=getCookie("Email"),(i===""||i===undefined)&&setCookie("Email",n.email,365),window.confirm("User Signed in Successfully")&&(window.location.href="/")):(document.getElementById("txtEmail").value="",document.getElementById("txtpassword").value="",alert("Email/Password may be incorrect or this Email is never being registered"))},error:function(n,t){console.log(n);console.log(t)}})}function statusChangeCallbackold(n){n.status==="connected"?logInSuccess():n.status==="not_authorized"?(deleteCookie("member"),$R(".Login").click(function(){loginPopup()})):(deleteCookie("member"),$R(".Login").click(function(){loginPopup()}))}function statusChangeCallback(n){n.status==="connected"?logInSuccess(n):n.status==="not_authorized"?(deleteCookie("member"),$R(".Login").click(function(){})):(deleteCookie("member"),$R(".Login").click(function(){}))}function checkLoginState(n){var t=getCookie("member"),i,r;(t===""||t===undefined)&&(i=$R(n),r=i.attr("data-recipe-id"),window.location="/login?bookmarkid="+r)}function Login1(n,t,i){$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/api/RegisterUser/Logindetail",data:{email:n,password:t},success:function(n){var t,r;console.log(n);n.email!==null?(statusChangeCallback(n),t=getCookie("ShowAds"),(t===""||t===undefined)&&setCookie("PaidMember",n.paidmember,365),r=getCookie("Email"),(r===""||r===undefined)&&setCookie("Email",n.email,365),window.confirm("User Sign in Successfully")&&Bookmarkafterlogin(i)):alert("Email/Password may be incorrect or this Email is never being registered")},error:function(n,t){console.log(n);console.log(t)}})}function Bookmarkafterlogin(n){var t=getCookie("member");$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/Api/Recipes/GetAddBookmark",data:{email:t,recipeId:n},success:function(){window.confirm("BookMarked")&&(window.location="/search-by-ingredients")},error:function(n,t,i){alert(n+"\n"+t+"\n"+i)}})}function BookmarkID(n){let t=$R(n),i=t.parent();const r=t.attr("data-recipe-id"),u=getCookie("member");t.text("Bookmarked");n.removeAttribute("onClick");i.addClass("bookmarked");$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/Api/Recipes/GetAddBookmark",data:{email:u,recipeId:r}})}function DeleteBookmarks(n){var t=$R(n),i=t.attr("data-recipe-id"),r=getCookie("member"),t=$R(n),i=t.attr("data-recipe-id");$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/Api/Recipes/GetDeleteBookmark",data:{email:r,recipeId:i},success:function(){t.parent().parent().parent().hide(200);t.parent().parent().parent().remove()},error:function(){}})}function logInSuccessold(){FB.api("/me",function(n){var t=getCookie("member");t==""||t==undefined?(setCookie("member",n.id,365),location.reload()):($R(".Login").addClass("Logout").removeClass("Login").text("Logout"),$R("body").attr("data-username",n.name),n.email!=null&&$R("body").attr("data-useremail",n.email),$R(".Logout").click(function(){deleteCookie("member");FB.logout(function(){$R("body").append('<div class="black-cover" style="text-align:center;background:rgba(0,0,0,0.6);width:100%;height:100%;position:fixed;top:0;left:0;display:none;z-index:10;"><div style="background:#efefef;padding:20px;text-align:center;display:inline-block;margin:0 auto;margin-top:60px;"><h1>You logged out!<\/h1><\/div><\/div>');$R(".black-cover").fadeIn(1e3);setTimeout(function(){location.reload()},2e3)})}),$R(".LoggedOutBookmark").hide(),$R(".LoggedInBookmark").show(),$R(".LoggedInBookmark .button").click(function(){var t=$R(this),i=t.attr("data-recipe-id");$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/Api/Recipes/GetAddBookmark",data:{email:n.id,recipeId:i},success:function(n){t.removeClass("button");t.text(n)},error:function(n,t,i){alert(n+"\n"+t+"\n"+i)}})}),$R(".DeleteBookmark").click(function(){var t=$R(this),i=t.attr("data-recipe-id");$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/Api/Recipes/GetDeleteBookmark",data:{email:n.id,recipeId:i},success:function(){t.parent().parent().parent().hide(200);t.parent().parent().parent().remove()},error:function(){}})}),getCookie("_ingredients")==""&&($R(".Clear > .remove")[0].click,$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/Api/Ingredients/GetMemberIngredients",data:{email:n.id},success:function(n){var i,t;if(n!=null&&n!="")for(i=n.split("."),t=0;t<i.length;t++)$R('.ingredient-check[value="'+i[t]+'"]').click()},error:function(){}})))})}function logInSuccess(n){var t=getCookie("member");console.log("response"+n);t===""||t===undefined?setCookie("member",n.id,365):($R(".Login").addClass("Logout").removeClass("Login").text("Logout"),$R("body").attr("data-username",n.name),n.email!=null&&$R("body").attr("data-useremail",n.email),$R(".LoggedOutBookmark").hide(),$R(".LoggedInBookmark").show(),$R(".LoggedInBookmark .button").click(function(){var t=$R(this),i=t.attr("data-recipe-id");$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/Api/Recipes/GetAddBookmark",data:{email:n.id,recipeId:i},success:function(n){t.removeClass("button");t.text(n)},error:function(n,t,i){alert(n+"\n"+t+"\n"+i)}})}),$R(".DeleteBookmark").click(function(){var t=$R(this),i=t.attr("data-recipe-id");$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/Api/Recipes/GetDeleteBookmark",data:{email:n.id,recipeId:i},success:function(){t.parent().parent().parent().hide(200);t.parent().parent().parent().remove()},error:function(){}})}),getCookie("_ingredients")==""&&($R(".Clear > .remove")[0].click,$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/Api/Ingredients/GetMemberIngredients",data:{email:n.id},success:function(n){var i,t;if(n!=null&&n!="")for(i=n.split("."),t=0;t<i.length;t++)$R('.ingredient-check[value="'+i[t]+'"]').click()},error:function(){}})))}function logoutfn(){var i,n;for(deleteCookie("ShowAds"),deleteCookie("member"),deleteCookie("Email"),i=document.cookie.split(";"),n=0;n<i.length;n++){var r=i[n],u=r.indexOf("="),t=u>-1?r.substr(0,u):r;t.indexOf("_ingredients")-1&&(document.cookie=t+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT",document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:00 GMT",document.cookie=t+"=;path=/bookmarks;expires=Thu, 01 Jan 1970 00:00:00 GMT")}$R("body").append('<div class="black-cover" style="text-align:center;background:rgba(0,0,0,0.6);width:100%;height:100%;position:fixed;top:0;left:0;display:none;z-index:10;"><div style="background:#efefef;padding:20px;text-align:center;display:inline-block;margin:0 auto;margin-top:60px;"><h1>You logged out!<\/h1><\/div><\/div>');$R(".black-cover").fadeIn(1e3);setTimeout(function(){location.reload()},2e3)}function setChecks(){function r(n){let t=$R(n).children('[type="checkbox"]');return t.prop("checked")?t.prop("checked",!1):t.prop("checked",!0),t}var t,i,n;if($R(".tile-wrapper .check-box").click(function(){$R(this).children(".ingredient-check").click()}),$R(".IngredientPushResults .check-box").click(function(){$R(this).children(".decider-ingredient").click()}),$R(".decider-ingredient").click(function(){updateUserDeciderChecks()}),$R(".ingredient-check").click(function(){var n=$R(this).val(),t=$R(this).attr("data-umbrella-ingredient"),i=$R(this).siblings(".ingredient-checkbox-label").text();$R(this).prop("checked")==!0?($R(".checked-ingredients > .List").append('<div class="remove" title="Click to remove '+i+' from your ingredients" data-value="'+n+'" onclick="removeThisCheck(\''+n+'\');$R(this).slideUp(400,function(){$R(this).remove()});"><span class="close"><\/span>'+i+"<\/div>"),$R('.ingredient-check[value="'+t+'"]').prop("checked")==!1&&$R('.ingredient-check[value="'+t+'"]').click()):removeThisCheck(n);checksCheck();updateUserChecks()}),$R(".Clear > .remove").click(function(){$R(".checked-ingredients > .List > .remove").each(function(){var n=$R(this).attr("data-value");$R(this).slideUp(400,function(){$R(this).remove()});$R('.ingredient-check[value="'+n+'"]').click()});checksCheck();updateUserChecks()}),t=getCookie("_ingredients").split("."),t!="")for(n=0;n<t.length;n++)$R('.ingredient-check[value="'+t[n]+'"]').click();if(i=getCookie("_deciderIngredients").split("."),i!="")for(n=0;n<i.length;n++)$R('.decider-ingredient[value="'+i[n]+'"]').click();$R(".FilterItem").click(function(){r(this)});$R(".ingredient-filter-item").click(function(){const n=r(this);n.prop("checked")?(getCookie("IngredientPush")!=""&&deleteCookie("IngredientPush"),setCookie("IngredientPush","1",0)):$R(".decider-ingredient:checked").length===0&&(getCookie("IngredientPush")!=""&&deleteCookie("IngredientPush"),setCookie("IngredientPush","0",0));updateUserDeciderChecks()})}function removeThisCheck(n){$R('.checked-ingredients > .List > .remove[data-value="'+n+'"]').remove();$R('.ingredient-check[value="'+n+'"]').click();var t=$R('.ingredient-check[value="'+n+'"]').attr("data-umbrella-ingredient"),i=!1;$R('.ingredient-check[data-umbrella-ingredient="'+t+'"]').each(function(){$R(this).prop("checked")&&(i=!0)})}function checksCheck(){$R(".checked-ingredients > .List").children().length>0?($R(".checked-ingredients > .Empty").hide(),$R(".checked-ingredients > .Clear").show(),$R(".checked-ingredients > .List").show(),$R(".checked-ingredients > .Submit").show()):($R(".checked-ingredients > .Empty").show(),$R(".checked-ingredients > .Clear").hide(),$R(".checked-ingredients > .List").hide(),$R(".checked-ingredients > .Submit").hide())}function deciderChecksString(){var n="",t=0;return $R(".decider-ingredient:checked").each(function(){var i=$R(this).val();t==0?n=i:n+="."+i;t++}),n}function checksString(){var n="",t=0;return $R(".checked-ingredients > .List > .remove").each(function(){var i=$R(this).attr("data-value");t==0?n=i:n+="."+i;t++}),n}function updateUserDeciderChecks(){getCookie("_deciderIngredients")!=""&&deleteCookie("_deciderIngredients");setCookie("_deciderIngredients",deciderChecksString(),0)}function updateUserChecks(){getCookie("_ingredients")!=""&&deleteCookie("_ingredients");setCookie("_ingredients",checksString(),365)}function findRecipes(){var n=getCookie("Email");n===""||n===undefined||getCookie("Email")===null?window.location="/search-by-ingredients":$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/api/Ingredients/GetMemberIngredients",data:{email:n.toString(),ingredientsString:checksString()},success:function(){window.location="/search-by-ingredients"},error:function(){}})}function filterRecipes(){$R(".SpecificFilter").click(function(){$R(".Filter .Submit span").click()});$R(".Filter .submit .button").click(function(){var t="?corners=",r=0,n,i,u,f;$R('#Corners [type="checkbox"]:checked').each(function(){t+=r==0?$R(this).val():","+$R(this).val();r++});n="&categories=";i=0;$R('#Categories [type="checkbox"]:checked').each(function(){n+=i==0?$R(this).val():","+$R(this).val();i++});u="&calories="+$R("#Calories option:selected").val();f=location.protocol+"//"+location.host+location.pathname+t+n+u;window.location=f})}function stickyChecks(){var o=$R(document).width(),n;if(o>1060&&(n=$R(".checked-ingredients"),n.length>0)){var r=$R(window),t=r.scrollTop(),u=$R(".left-wrapper"),f=u.offset(),i=f.top,e=r.width();t>=i&&e>1060?n.stop(!0,!1).animate({top:t-(i-173)+"px"},150):n.stop(!0,!1).animate({top:"0px"},150);function s(){t=r.scrollTop();f=u.offset();i=f.top;e=r.width();t>=i&&e>1060?$R("footer").offset().top>t+n.height()+72?(n.stop(!0,!1).animate({top:t-(i-173)+"px","margin-top":"0px"},150),n.parent().height()<n.height()+($R(window).scrollTop()-(i-173))&&u.height()+200>n.parent().height()&&n.parent().height(n.height()+(t-100))):(n.stop(!0,!1).animate({top:$R("footer").offset().top-(n.height()+390)+"px","margin-top":"0px"},150),n.parent().height()<n.height()+($R(window).scrollTop()-(i-173))&&u.height()+200>n.parent().height()&&n.parent().height(n.height()+(t-100))):(n.stop(!0,!1).animate({top:"0px"},150),$R(".checked-ingredients.detailed").css("margin-top","52px"))}r.scroll(function(){s()})}}function searchInitialize(){$R(".search-icon").click(function(){$R(this).parent().parent().hasClass("current")?($R(this).parent().parent().removeClass("current"),$R("#search-box").slideUp(400)):($R(this).parent().parent().addClass("current"),$R("html, body").animate({scrollTop:0},200),$R("#search-box").slideDown(400).focus())});$R("#search-box").keyup(function(){$R(this).val().length>0?$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/api/Recipes/GetKeydownSearchRecipes",data:{q:$R(this).val()},success:function(n){ViewModels.KeydownSearchRecipes(n);$R("#searchAutoCompleteResults").slideDown(100);$R("#ViewAllContainer").slideDown(100)}}):setTimeout(function(){$R("#searchAutoCompleteResults").slideUp(100);$R("#ViewAllContainer").slideUp(100)},400)});$R("#search-box").focus(function(){$R(this).val().length>0?$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/api/Recipes/GetKeydownSearchRecipes",data:{q:$R(this).val()},success:function(n){ViewModels.KeydownSearchRecipes(n);$R("#searchAutoCompleteResults").slideDown(100);$R("#ViewAllContainer").slideDown(100)}}):setTimeout(function(){$R("#searchAutoCompleteResults").slideUp(100)},400)});$R("#search-box").blur(function(){setTimeout(function(){$R("#searchAutoCompleteResults").slideUp(100);$R("#ViewAllContainer").slideUp(100)},400)})}function searchBox(){$R("#search-boxButton, #ViewAll").click(function(n){n.preventDefault();var t=$R("#search-box").val().replace(/[^a-zA-Z 0-9]+/g,"");t.length<1||(document.location.href="/Search?q="+t)});$R("#search-box").keyup(function(n){if(n.which==13){n.preventDefault();var t=$R("#search-box").val().replace(/[^a-zA-Z 0-9]+/g,"");t.length<1||(document.location.href="/Search?q="+t)}})}function initializeComments(){$R("#userCommentSubmit").click(function(){var n=$R("#userCommentTextArea").val(),t=$R(this).attr("data-node");submitComment(t,n)})}function submitComment(n,t){t.length>5&&t.length<=250?$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/Api/Comments/GetComment",data:{nodeId:n,body:t},success:function(n){var t='<div class="comment slideDown" style="display:none;"><div class="comment-date"><span>'+n.Date+'<\/span><\/div><div class="comment-comment"><p>'+n.Body+"<\/p><\/div><\/div>";$R("#comments h3").after(t);$R(".comment.slideDown").slideDown(400);$R("#commentSubmit").slideUp(400,function(){$R("#commentSubmit").remove()})},error:function(){}}):alert("Comment must be between 5 and 250 characters long! Oh, and no url's!")}function initializeRecipeForm(){$R(".SubmitRecipe").click(function(){submitUserRecipeForm()})}function recipeFormIsValid(){return!0}function submitUserRecipeForm(){var n,t;if(recipeFormIsValid()&&(n={},t=document.getElementById("recipePic").files,window.FormData)){var r=new FormData,u=t.length,i;if(u>0){if(i=t[0],i.type.match(/image.*/)){if(i.size>2e5){alert("The image you are tring to upload is too big! Please resize it, image cannot exeed 200kb.");return}r&&(r.append("images",i),$R.ajax({url:"/Umbraco/Api/Recipes/PostImage",type:"POST",data:r,processData:!1,contentType:!1,success:function(){n.ParentId=$R(".RecipeForm").attr("data-node");n.RecipeName=$R(".txtRecipeName").val();n.Author=$R(".txtEmail").val();n.Email=$R(".txtAuthor").val();n.Photo=t[0].name;n.PhotoBy=$R(".txtCredit").val();n.Description=$R(".txtDescription").val();n.CookingTime=$R(".slctTimes option:selected").val();n.Servings=$R(".slctServings option:selected").val();n.Ingredients=$R(".txtIngredients").val();n.Directions=$R(".txtDirections").val();$R(".RecipeForm").slideUp(400,function(){$R(this).remove()});$R.ajax({type:"POST",contentType:"application/json",url:"/Umbraco/Api/Recipes/Post",dataType:"json",data:JSON.stringify(n),success:function(n){$R(".RecipeFormSuccess").text(n)},error:function(){$R(".RecipeFormSuccess").text("There was an error with your submission...")}})}}))}}else n.ParentId=$R(".RecipeForm").attr("data-node"),n.RecipeName=$R(".txtRecipeName").val(),n.Author=$R(".txtEmail").val(),n.Email=$R(".txtAuthor").val(),n.Description=$R(".txtDescription").val(),n.CookingTime=$R(".slctTimes option:selected").val(),n.Servings=$R(".slctServings option:selected").val(),n.Ingredients=$R(".txtIngredients").val(),n.Directions=$R(".txtDirections").val(),$R(".RecipeForm").slideUp(400,function(){$R(this).remove()}),$R.ajax({type:"POST",contentType:"application/json",url:"/Umbraco/Api/Recipes/Post",dataType:"json",data:JSON.stringify(n),success:function(n){$R(".RecipeFormSuccess").text(n)},error:function(){$R(".RecipeFormSuccess").text("There was an error with your submission...")}})}}function initializeSurveys(){$R(".survey-answer").click(function(){$R(this).children(".survey-answer-radio").children("input")[0].click()});$R(".survey").each(function(){var t=$R(this).find("input").attr("name"),n=$R(this).find(".surveySubmit");getCookie("_survey"+t)=="1"&&$R.ajax({type:"GET",contentType:"application/json",url:"/Umbraco/Api/Surveys/GetVotes",dataType:"json",data:{parentId:t},success:function(t){var i,r;for(n.parent().find(".survey-answer-radio").remove(),i=0,index=0;index<t.length;index++)i+=t[index];r=0;n.parent().find(".survey-answer-content").each(function(){$R(this).append('<p class="survey-answer-votes">~'+Math.round(t[r]/i*100)+"% of the votes!<\/p>");r++});n.parent().children("h3").text("Thanks for voting!");n.remove()},error:function(){}})});$R(".surveySubmit").click(function(){var n=$R(this),i=n.parent().find("input:checked").attr("name"),r=n.parent().find("input:checked").val(),t;r!=undefined?(t={},t.ThisId=r,t.ParentId=i,$R.ajax({type:"POST",contentType:"application/json",url:"/Umbraco/Api/Surveys/PostAnswer",dataType:"json",data:JSON.stringify(t),success:function(t){var r,u;for(setCookie("_survey"+i,"1",365),n.parent().find(".survey-answer-radio").remove(),r=0,index=0;index<t.length;index++)r+=t[index];u=0;n.parent().find(".survey-answer-content").each(function(){$R(this).append('<p class="survey-answer-votes">~'+Math.round(t[u]/r*100)+"% of the votes!<\/p>");u++});n.parent().children("h3").text("Thanks for voting!");n.remove()},error:function(){}})):alert("You must make a selection to vote!")})}var loggedIn,ViewModels;(function(n){function i(i){n.fn.cycle.debug&&t(i)}function t(){window.console&&window.console.log&&window.console.log("[cycle] "+Array.prototype.join.call(arguments," "))}function h(i,u,f){function s(i,u,f){if(!i&&u===!0){var o=n(f).data("cycle.opts");if(!o)return t("options not found, can not resume"),!1;f.cycleTimeout&&(clearTimeout(f.cycleTimeout),f.cycleTimeout=0);r(o.elements,o,1,!e.rev&&!e.backwards)}}var e,o;if(i.cycleStop==undefined&&(i.cycleStop=0),(u===undefined||u===null)&&(u={}),u.constructor==String){switch(u){case"destroy":case"stop":return(e=n(i).data("cycle.opts"),!e)?!1:(i.cycleStop++,i.cycleTimeout&&clearTimeout(i.cycleTimeout),i.cycleTimeout=0,n(i).removeData("cycle.opts"),u=="destroy"&&c(e),!1);case"toggle":return i.cyclePause=i.cyclePause===1?0:1,s(i.cyclePause,f,i),!1;case"pause":return i.cyclePause=1,!1;case"resume":return i.cyclePause=0,s(!1,f,i),!1;case"prev":case"next":return(e=n(i).data("cycle.opts"),!e)?(t('options not found, "prev/next" ignored'),!1):(n.fn.cycle[u](e),!1);default:u={fx:u}}return u}return u.constructor==Number?(o=u,u=n(i).data("cycle.opts"),!u)?(t("options not found, can not advance slide"),!1):o<0||o>=u.elements.length?(t("invalid slide index: "+o),!1):(u.nextSlide=o,i.cycleTimeout&&(clearTimeout(i.cycleTimeout),i.cycleTimeout=0),typeof f=="string"&&(u.oneTimeFx=f),r(u.elements,u,1,o>=u.currSlide),!1):u}function f(t,i){if(!n.support.opacity&&i.cleartype&&t.style.filter)try{t.style.removeAttribute("filter")}catch(r){}}function c(t){t.next&&n(t.next).unbind(t.prevNextEvent);t.prev&&n(t.prev).unbind(t.prevNextEvent);(t.pager||t.pagerAnchorBuilder)&&n.each(t.pagerAnchors||[],function(){this.unbind().remove()});t.pagerAnchors=null;t.destroy&&t.destroy(t)}function l(i,e,s,h,c){var l=n.extend({},n.fn.cycle.defaults,h||{},n.metadata?i.metadata():n.meta?i.data():{}),ot,nt,p,st,k,d,tt,ft,ht,et,b;if(l.autostop&&(l.countdown=l.autostopCount||s.length),ot=i[0],i.data("cycle.opts",l),l.$cont=i,l.stopCount=ot.cycleStop,l.elements=s,l.before=l.before?[l.before]:[],l.after=l.after?[l.after]:[],l.after.unshift(function(){l.busy=0}),!n.support.opacity&&l.cleartype&&l.after.push(function(){f(this,l)}),l.continuous&&l.after.push(function(){r(s,l,0,!l.rev&&!l.backwards)}),a(l),n.support.opacity||!l.cleartype||l.cleartypeNoBg||o(e),i.css("position")=="static"&&i.css("position","relative"),l.width&&i.width(l.width),l.height&&l.height!="auto"&&i.height(l.height),l.startingSlide?l.startingSlide=parseInt(l.startingSlide):l.backwards&&(l.startingSlide=s.length-1),l.random){for(l.randomMap=[],nt=0;nt<s.length;nt++)l.randomMap.push(nt);l.randomMap.sort(function(){return Math.random()-.5});l.randomIndex=1;l.startingSlide=l.randomMap[1]}else l.startingSlide>=s.length&&(l.startingSlide=0);if(l.currSlide=l.startingSlide||0,p=l.startingSlide,e.css({position:"absolute",top:0,left:0}).hide().each(function(t){var i;i=l.backwards?p?t<=p?s.length+(t-p):p-t:s.length-t:p?t>=p?s.length-(t-p):p-t:s.length-t;n(this).css("z-index",i)}),n(s[p]).css("opacity",1).show(),f(s[p],l),l.fit&&l.width&&e.width(l.width),l.fit&&l.height&&l.height!="auto"&&e.height(l.height),st=l.containerResize&&!i.innerHeight(),st){for(k=0,d=0,tt=0;tt<s.length;tt++){var g=n(s[tt]),it=g[0],rt=g.outerWidth(),ut=g.outerHeight();rt||(rt=it.offsetWidth||it.width||g.attr("width"));ut||(ut=it.offsetHeight||it.height||g.attr("height"));k=rt>k?rt:k;d=ut>d?ut:d}k>0&&d>0&&i.css({width:k+"px",height:d+"px"})}if((l.pause&&i.hover(function(){this.cyclePause++},function(){this.cyclePause--}),v(l)===!1)||(ft=!1,h.requeueAttempts=h.requeueAttempts||0,e.each(function(){var i=n(this);if(this.cycleH=l.fit&&l.height?l.height:i.height()||this.offsetHeight||this.height||i.attr("height")||0,this.cycleW=l.fit&&l.width?l.width:i.width()||this.offsetWidth||this.width||i.attr("width")||0,i.is("img")){var r=n.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete,u=n.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete,f=n.browser.opera&&(this.cycleW==42&&this.cycleH==19||this.cycleW==37&&this.cycleH==17)&&!this.complete,e=this.cycleH==0&&this.cycleW==0&&!this.complete;if(r||u||f||e){if(c.s&&l.requeueOnImageNotLoaded&&++h.requeueAttempts<100)return t(h.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH),setTimeout(function(){n(c.s,c.c).cycle(h)},l.requeueTimeout),ft=!0,!1;t("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}}return!0}),ft))return!1;if(l.cssBefore=l.cssBefore||{},l.animIn=l.animIn||{},l.animOut=l.animOut||{},e.not(":eq("+p+")").css(l.cssBefore),l.cssFirst&&n(e[p]).css(l.cssFirst),l.timeout)for(l.timeout=parseInt(l.timeout),l.speed.constructor==String&&(l.speed=n.fx.speeds[l.speed]||parseInt(l.speed)),l.sync||(l.speed=l.speed/2),ht=l.fx=="shuffle"?500:250;l.timeout-l.speed<ht;)l.timeout+=l.speed;if(l.easing&&(l.easeIn=l.easeOut=l.easing),l.speedIn||(l.speedIn=l.speed),l.speedOut||(l.speedOut=l.speed),l.slideCount=s.length,l.currSlide=l.lastSlide=p,l.random?(++l.randomIndex==s.length&&(l.randomIndex=0),l.nextSlide=l.randomMap[l.randomIndex]):l.nextSlide=l.backwards?l.startingSlide==0?s.length-1:l.startingSlide-1:l.startingSlide>=s.length-1?0:l.startingSlide+1,!l.multiFx)if(et=n.fn.cycle.transitions[l.fx],n.isFunction(et))et(i,e,l);else if(l.fx!="custom"&&!l.multiFx)return t("unknown transition: "+l.fx,"; slideshow terminating"),!1;return b=e[p],l.before.length&&l.before[0].apply(b,[b,b,l,!0]),l.after.length>1&&l.after[1].apply(b,[b,b,l,!0]),l.next&&n(l.next).bind(l.prevNextEvent,function(){return u(l,l.rev?-1:1)}),l.prev&&n(l.prev).bind(l.prevNextEvent,function(){return u(l,l.rev?1:-1)}),(l.pager||l.pagerAnchorBuilder)&&w(s,l),y(l,s),l}function a(t){t.original={before:[],after:[]};t.original.cssBefore=n.extend({},t.cssBefore);t.original.cssAfter=n.extend({},t.cssAfter);t.original.animIn=n.extend({},t.animIn);t.original.animOut=n.extend({},t.animOut);n.each(t.before,function(){t.original.before.push(this)});n.each(t.after,function(){t.original.after.push(this)})}function v(r){var u,f,e=n.fn.cycle.transitions,o,s,h;if(r.fx.indexOf(",")>0){for(r.multiFx=!0,r.fxs=r.fx.replace(/\s*/g,"").split(","),u=0;u<r.fxs.length;u++)o=r.fxs[u],f=e[o],f&&e.hasOwnProperty(o)&&n.isFunction(f)||(t("discarding unknown transition: ",o),r.fxs.splice(u,1),u--);if(!r.fxs.length)return t("No valid transitions named; slideshow terminating."),!1}else if(r.fx=="all"){r.multiFx=!0;r.fxs=[];for(p in e)f=e[p],e.hasOwnProperty(p)&&n.isFunction(f)&&r.fxs.push(p)}if(r.multiFx&&r.randomizeEffects){for(s=Math.floor(Math.random()*20)+30,u=0;u<s;u++)h=Math.floor(Math.random()*r.fxs.length),r.fxs.push(r.fxs.splice(h,1)[0]);i("randomized fx sequence: ",r.fxs)}return!0}function y(t,i){t.addSlide=function(r,u){var f=n(r),e=f[0];if(t.autostopCount||t.countdown++,i[u?"unshift":"push"](e),t.els&&t.els[u?"unshift":"push"](e),t.slideCount=i.length,f.css("position","absolute"),f[u?"prependTo":"appendTo"](t.$cont),u&&(t.currSlide++,t.nextSlide++),n.support.opacity||!t.cleartype||t.cleartypeNoBg||o(f),t.fit&&t.width&&f.width(t.width),t.fit&&t.height&&t.height!="auto"&&$slides.height(t.height),e.cycleH=t.fit&&t.height?t.height:f.height(),e.cycleW=t.fit&&t.width?t.width:f.width(),f.css(t.cssBefore),(t.pager||t.pagerAnchorBuilder)&&n.fn.cycle.createPagerAnchor(i.length-1,e,n(t.pager),i,t),n.isFunction(t.onAddSlide))t.onAddSlide(f);else f.hide()}}function r(t,u,f,o){var y,a,p,c,v;if(f&&u.busy&&u.manualTrump&&(i("manualTrump in go(), stopping active transition"),n(t).stop(!0,!0),u.busy=!1),u.busy){i("transition active, ignoring new tx request");return}var l=u.$cont[0],h=t[u.currSlide],s=t[u.nextSlide];if(l.cycleStop==u.stopCount&&(l.cycleTimeout!==0||f)){if(!f&&!l.cyclePause&&!u.bounce&&(u.autostop&&--u.countdown<=0||u.nowrap&&!u.random&&u.nextSlide<u.currSlide)){u.end&&u.end(u);return}y=!1;(f||!l.cyclePause)&&u.nextSlide!=u.currSlide&&(y=!0,a=u.fx,h.cycleH=h.cycleH||n(h).height(),h.cycleW=h.cycleW||n(h).width(),s.cycleH=s.cycleH||n(s).height(),s.cycleW=s.cycleW||n(s).width(),u.multiFx&&((u.lastFx==undefined||++u.lastFx>=u.fxs.length)&&(u.lastFx=0),a=u.fxs[u.lastFx],u.currFx=a),u.oneTimeFx&&(a=u.oneTimeFx,u.oneTimeFx=null),n.fn.cycle.resetState(u,a),u.before.length&&n.each(u.before,function(n,t){l.cycleStop==u.stopCount&&t.apply(s,[h,s,u,o])}),p=function(){n.each(u.after,function(n,t){l.cycleStop==u.stopCount&&t.apply(s,[h,s,u,o])})},i("tx firing; currSlide: "+u.currSlide+"; nextSlide: "+u.nextSlide),u.busy=1,u.fxFn?u.fxFn(h,s,u,p,o,f&&u.fastOnEvent):n.isFunction(n.fn.cycle[u.fx])?n.fn.cycle[u.fx](h,s,u,p,o,f&&u.fastOnEvent):n.fn.cycle.custom(h,s,u,p,o,f&&u.fastOnEvent));(y||u.nextSlide==u.currSlide)&&(u.lastSlide=u.currSlide,u.random?(u.currSlide=u.nextSlide,++u.randomIndex==t.length&&(u.randomIndex=0),u.nextSlide=u.randomMap[u.randomIndex],u.nextSlide==u.currSlide&&(u.nextSlide=u.currSlide==u.slideCount-1?0:u.currSlide+1)):u.backwards?(c=u.nextSlide-1<0,c&&u.bounce?(u.backwards=!u.backwards,u.nextSlide=1,u.currSlide=0):(u.nextSlide=c?t.length-1:u.nextSlide-1,u.currSlide=c?0:u.nextSlide+1)):(c=u.nextSlide+1==t.length,c&&u.bounce?(u.backwards=!u.backwards,u.nextSlide=t.length-2,u.currSlide=t.length-1):(u.nextSlide=c?0:u.nextSlide+1,u.currSlide=c?t.length-1:u.nextSlide-1)));y&&u.pager&&u.updateActivePagerLink(u.pager,u.currSlide,u.activePagerClass);v=0;u.timeout&&!u.continuous?v=e(t[u.currSlide],t[u.nextSlide],u,o):u.continuous&&l.cyclePause&&(v=10);v>0&&(l.cycleTimeout=setTimeout(function(){r(t,u,0,!u.rev&&!u.backwards)},v))}}function e(n,t,r,u){if(r.timeoutFn){for(var f=r.timeoutFn.call(n,n,t,r,u);f-r.speed<250;)f+=r.speed;if(i("calculated timeout: "+f+"; speed: "+r.speed),f!==!1)return f}return r.timeout}function u(t,i){var u=t.elements,e=t.$cont[0],o=e.cycleTimeout,f;if(o&&(clearTimeout(o),e.cycleTimeout=0),t.random&&i<0)t.randomIndex--,--t.randomIndex==-2?t.randomIndex=u.length-2:t.randomIndex==-1&&(t.randomIndex=u.length-1),t.nextSlide=t.randomMap[t.randomIndex];else if(t.random)t.nextSlide=t.randomMap[t.randomIndex];else if(t.nextSlide=t.currSlide+i,t.nextSlide<0){if(t.nowrap)return!1;t.nextSlide=u.length-1}else if(t.nextSlide>=u.length){if(t.nowrap)return!1;t.nextSlide=0}return f=t.onPrevNextEvent||t.prevNextClick,n.isFunction(f)&&f(i>0,t.nextSlide,u[t.nextSlide]),r(u,t,1,i>=0),!1}function w(t,i){var r=n(i.pager);n.each(t,function(u,f){n.fn.cycle.createPagerAnchor(u,f,r,t,i)});i.updateActivePagerLink(i.pager,i.startingSlide,i.activePagerClass)}function o(t){function r(n){return n=parseInt(n).toString(16),n.length<2?"0"+n:n}function u(t){for(var i,u;t&&t.nodeName.toLowerCase()!="html";t=t.parentNode){if(i=n.css(t,"background-color"),i.indexOf("rgb")>=0)return u=i.match(/\d+/g),"#"+r(u[0])+r(u[1])+r(u[2]);if(i&&i!="transparent")return i}return"#ffffff"}i("applying clearType background-color hack");t.each(function(){n(this).css("background-color",u(this))})}var s="2.88";n.support==undefined&&(n.support={opacity:!n.browser.msie});n.fn.cycle=function(u,f){var o={s:this.selector,c:this.context};return this.length===0&&u!="stop"?!n.isReady&&o.s?(t("DOM not ready, queuing slideshow"),n(function(){n(o.s,o.c).cycle(u,f)}),this):(t("terminating; zero elements found by selector"+(n.isReady?"":" (DOM not ready)")),this):this.each(function(){var c=h(this,u,f),s,a;if(c!==!1){c.updateActivePagerLink=c.updateActivePagerLink||n.fn.cycle.updateActivePagerLink;this.cycleTimeout&&clearTimeout(this.cycleTimeout);this.cycleTimeout=this.cyclePause=0;var y=n(this),p=c.slideExpr?n(c.slideExpr,this):y.children(),v=p.get();if(v.length<2){t("terminating; too few slides: "+v.length);return}(s=l(y,p,v,c,o),s!==!1)&&(a=s.continuous?10:e(v[s.currSlide],v[s.nextSlide],s,!s.rev),a&&(a+=s.delay||0,a<10&&(a=10),i("first timeout: "+a),this.cycleTimeout=setTimeout(function(){r(v,s,0,!s.rev&&!c.backwards)},a)))}})};n.fn.cycle.resetState=function(t,i){i=i||t.fx;t.before=[];t.after=[];t.cssBefore=n.extend({},t.original.cssBefore);t.cssAfter=n.extend({},t.original.cssAfter);t.animIn=n.extend({},t.original.animIn);t.animOut=n.extend({},t.original.animOut);t.fxFn=null;n.each(t.original.before,function(){t.before.push(this)});n.each(t.original.after,function(){t.after.push(this)});var r=n.fn.cycle.transitions[i];n.isFunction(r)&&r(t.$cont,n(t.elements),t)};n.fn.cycle.updateActivePagerLink=function(t,i,r){n(t).each(function(){n(this).children().removeClass(r).eq(i).addClass(r)})};n.fn.cycle.next=function(n){u(n,n.rev?-1:1)};n.fn.cycle.prev=function(n){u(n,n.rev?1:-1)};n.fn.cycle.createPagerAnchor=function(t,u,f,e,o){var h,s,c;(n.isFunction(o.pagerAnchorBuilder)?(h=o.pagerAnchorBuilder(t,u),i("pagerAnchorBuilder("+t+", el) returned: "+h)):h='<a href="#">'+(t+1)+"<\/a>",h)&&(s=n(h),s.parents("body").length===0&&(c=[],f.length>1?(f.each(function(){var t=s.clone(!0);n(this).append(t);c.push(t[0])}),s=n(c)):s.appendTo(f)),o.pagerAnchors=o.pagerAnchors||[],o.pagerAnchors.push(s),s.bind(o.pagerEvent,function(i){var u,f,s;i.preventDefault();o.nextSlide=t;u=o.$cont[0];f=u.cycleTimeout;f&&(clearTimeout(f),u.cycleTimeout=0);s=o.onPagerEvent||o.pagerClick;n.isFunction(s)&&s(o.nextSlide,e[o.nextSlide]);r(e,o,1,o.currSlide<t)}),/^click/.test(o.pagerEvent)||o.allowPagerClickBubble||s.bind("click.cycle",function(){return!1}),o.pauseOnPagerHover&&s.hover(function(){o.$cont[0].cyclePause++},function(){o.$cont[0].cyclePause--}))};n.fn.cycle.hopsFromLast=function(n,t){var i=n.lastSlide,r=n.currSlide;return t?r>i?r-i:n.slideCount-i:r<i?i-r:i+n.slideCount-r};n.fn.cycle.commonReset=function(t,i,r,u,f,e){n(r.elements).not(t).hide();r.cssBefore.opacity=1;r.cssBefore.display="block";u!==!1&&i.cycleW>0&&(r.cssBefore.width=i.cycleW);f!==!1&&i.cycleH>0&&(r.cssBefore.height=i.cycleH);r.cssAfter=r.cssAfter||{};r.cssAfter.display="none";n(t).css("zIndex",r.slideCount+(e===!0?1:0));n(i).css("zIndex",r.slideCount+(e===!0?0:1))};n.fn.cycle.custom=function(t,i,r,u,f,e){var h=n(t),c=n(i),l=r.speedIn,o=r.speedOut,a=r.easeIn,v=r.easeOut,s;c.css(r.cssBefore);e&&(l=typeof e=="number"?o=e:o=1,a=v=null);s=function(){c.animate(r.animIn,l,a,u)};h.animate(r.animOut,o,v,function(){r.cssAfter&&h.css(r.cssAfter);r.sync||s()});r.sync&&s()};n.fn.cycle.transitions={fade:function(t,i,r){i.not(":eq("+r.currSlide+")").css("opacity",0);r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r);r.cssBefore.opacity=0});r.animIn={opacity:1};r.animOut={opacity:0};r.cssBefore={top:0,left:0}}};n.fn.cycle.ver=function(){return s};n.fn.cycle.defaults={fx:"fade",timeout:4e3,timeoutFn:null,continuous:0,speed:1e3,speedIn:null,speedOut:null,next:null,prev:null,onPrevNextEvent:null,prevNextEvent:"click.cycle",pager:null,onPagerEvent:null,pagerEvent:"click.cycle",allowPagerClickBubble:!1,pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!n.support.opacity,cleartypeNoBg:!1,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:!0,requeueOnImageNotLoaded:!0,requeueTimeout:250,activePagerClass:"activeSlide",updateActivePagerLink:null,backwards:!1}})(jQuery),function(n){n.fn.cycle.transitions.none=function(t,i,r){r.fxFn=function(t,i,r,u){n(i).show();n(t).hide();u()}};n.fn.cycle.transitions.scrollUp=function(t,i,r){t.css("overflow","hidden");r.before.push(n.fn.cycle.commonReset);var u=t.height();r.cssBefore={top:u,left:0};r.cssFirst={top:0};r.animIn={top:0};r.animOut={top:-u}};n.fn.cycle.transitions.scrollDown=function(t,i,r){t.css("overflow","hidden");r.before.push(n.fn.cycle.commonReset);var u=t.height();r.cssFirst={top:0};r.cssBefore={top:-u,left:0};r.animIn={top:0};r.animOut={top:u}};n.fn.cycle.transitions.scrollLeft=function(t,i,r){t.css("overflow","hidden");r.before.push(n.fn.cycle.commonReset);var u=t.width();r.cssFirst={left:0};r.cssBefore={left:u,top:0};r.animIn={left:0};r.animOut={left:0-u}};n.fn.cycle.transitions.scrollRight=function(t,i,r){t.css("overflow","hidden");r.before.push(n.fn.cycle.commonReset);var u=t.width();r.cssFirst={left:0};r.cssBefore={left:-u,top:0};r.animIn={left:0};r.animOut={left:u}};n.fn.cycle.transitions.scrollHorz=function(t,i,r){t.css("overflow","hidden").width();r.before.push(function(t,i,r,u){n.fn.cycle.commonReset(t,i,r);r.cssBefore.left=u?i.cycleW-1:1-i.cycleW;r.animOut.left=u?-t.cycleW:t.cycleW});r.cssFirst={left:0};r.cssBefore={top:0};r.animIn={left:0};r.animOut={top:0}};n.fn.cycle.transitions.scrollVert=function(t,i,r){t.css("overflow","hidden");r.before.push(function(t,i,r,u){n.fn.cycle.commonReset(t,i,r);r.cssBefore.top=u?1-i.cycleH:i.cycleH-1;r.animOut.top=u?t.cycleH:-t.cycleH});r.cssFirst={top:0};r.cssBefore={left:0};r.animIn={top:0};r.animOut={left:0}};n.fn.cycle.transitions.slideX=function(t,i,r){r.before.push(function(t,i,r){n(r.elements).not(t).hide();n.fn.cycle.commonReset(t,i,r,!1,!0);r.animIn.width=i.cycleW});r.cssBefore={left:0,top:0,width:0};r.animIn={width:"show"};r.animOut={width:0}};n.fn.cycle.transitions.slideY=function(t,i,r){r.before.push(function(t,i,r){n(r.elements).not(t).hide();n.fn.cycle.commonReset(t,i,r,!0,!1);r.animIn.height=i.cycleH});r.cssBefore={left:0,top:0,height:0};r.animIn={height:"show"};r.animOut={height:0}};n.fn.cycle.transitions.shuffle=function(t,i,r){var u,f=t.css("overflow","visible").width();for(i.css({left:0,top:0}),r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!0,!0,!0)}),r.speedAdjusted||(r.speed=r.speed/2,r.speedAdjusted=!0),r.random=0,r.shuffle=r.shuffle||{left:-f,top:15},r.els=[],u=0;u<i.length;u++)r.els.push(i[u]);for(u=0;u<r.currSlide;u++)r.els.push(r.els.shift());r.fxFn=function(t,i,r,u,f){var e=f?n(t):n(i),o;n(i).css(r.cssBefore);o=r.slideCount;e.animate(r.shuffle,r.speedIn,r.easeIn,function(){for(var l=n.fn.cycle.hopsFromLast(r,f),i,h,c,s=0;s<l;s++)f?r.els.push(r.els.shift()):r.els.unshift(r.els.pop());if(f)for(i=0,h=r.els.length;i<h;i++)n(r.els[i]).css("z-index",h-i+o);else c=n(t).css("z-index"),e.css("z-index",parseInt(c)+1+o);e.animate({left:0,top:0},r.speedOut,r.easeOut,function(){n(f?this:t).hide();u&&u()})})};r.cssBefore={display:"block",opacity:1,top:0,left:0}};n.fn.cycle.transitions.turnUp=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!0,!1);r.cssBefore.top=i.cycleH;r.animIn.height=i.cycleH});r.cssFirst={top:0};r.cssBefore={left:0,height:0};r.animIn={top:0};r.animOut={height:0}};n.fn.cycle.transitions.turnDown=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!0,!1);r.animIn.height=i.cycleH;r.animOut.top=t.cycleH});r.cssFirst={top:0};r.cssBefore={left:0,top:0,height:0};r.animOut={height:0}};n.fn.cycle.transitions.turnLeft=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!1,!0);r.cssBefore.left=i.cycleW;r.animIn.width=i.cycleW});r.cssBefore={top:0,width:0};r.animIn={left:0};r.animOut={width:0}};n.fn.cycle.transitions.turnRight=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!1,!0);r.animIn.width=i.cycleW;r.animOut.left=t.cycleW});r.cssBefore={top:0,left:0,width:0};r.animIn={left:0};r.animOut={width:0}};n.fn.cycle.transitions.zoom=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!1,!1,!0);r.cssBefore.top=i.cycleH/2;r.cssBefore.left=i.cycleW/2;r.animIn={top:0,left:0,width:i.cycleW,height:i.cycleH};r.animOut={width:0,height:0,top:t.cycleH/2,left:t.cycleW/2}});r.cssFirst={top:0,left:0};r.cssBefore={width:0,height:0}};n.fn.cycle.transitions.fadeZoom=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!1,!1);r.cssBefore.left=i.cycleW/2;r.cssBefore.top=i.cycleH/2;r.animIn={top:0,left:0,width:i.cycleW,height:i.cycleH}});r.cssBefore={width:0,height:0};r.animOut={opacity:0}};n.fn.cycle.transitions.blindX=function(t,i,r){var u=t.css("overflow","hidden").width();r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r);r.animIn.width=i.cycleW;r.animOut.left=t.cycleW});r.cssBefore={left:u,top:0};r.animIn={left:0};r.animOut={left:u}};n.fn.cycle.transitions.blindY=function(t,i,r){var u=t.css("overflow","hidden").height();r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r);r.animIn.height=i.cycleH;r.animOut.top=t.cycleH});r.cssBefore={top:u,left:0};r.animIn={top:0};r.animOut={top:u}};n.fn.cycle.transitions.blindZ=function(t,i,r){var u=t.css("overflow","hidden").height(),f=t.width();r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r);r.animIn.height=i.cycleH;r.animOut.top=t.cycleH});r.cssBefore={top:u,left:f};r.animIn={top:0,left:0};r.animOut={top:u,left:f}};n.fn.cycle.transitions.growX=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!1,!0);r.cssBefore.left=this.cycleW/2;r.animIn={left:0,width:this.cycleW};r.animOut={left:0}});r.cssBefore={width:0,top:0}};n.fn.cycle.transitions.growY=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!0,!1);r.cssBefore.top=this.cycleH/2;r.animIn={top:0,height:this.cycleH};r.animOut={top:0}});r.cssBefore={height:0,left:0}};n.fn.cycle.transitions.curtainX=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!1,!0,!0);r.cssBefore.left=i.cycleW/2;r.animIn={left:0,width:this.cycleW};r.animOut={left:t.cycleW/2,width:0}});r.cssBefore={top:0,width:0}};n.fn.cycle.transitions.curtainY=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!0,!1,!0);r.cssBefore.top=i.cycleH/2;r.animIn={top:0,height:i.cycleH};r.animOut={top:t.cycleH/2,height:0}});r.cssBefore={left:0,height:0}};n.fn.cycle.transitions.cover=function(t,i,r){var u=r.direction||"left",f=t.css("overflow","hidden").width(),e=t.height();r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r);u=="right"?r.cssBefore.left=-f:u=="up"?r.cssBefore.top=e:u=="down"?r.cssBefore.top=-e:r.cssBefore.left=f});r.animIn={left:0,top:0};r.animOut={opacity:1};r.cssBefore={top:0,left:0}};n.fn.cycle.transitions.uncover=function(t,i,r){var u=r.direction||"left",f=t.css("overflow","hidden").width(),e=t.height();r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!0,!0,!0);u=="right"?r.animOut.left=f:u=="up"?r.animOut.top=-e:u=="down"?r.animOut.top=e:r.animOut.left=-f});r.animIn={left:0,top:0};r.animOut={opacity:1};r.cssBefore={top:0,left:0}};n.fn.cycle.transitions.toss=function(t,i,r){var u=t.css("overflow","visible").width(),f=t.height();r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!0,!0,!0);r.animOut.left||r.animOut.top?r.animOut.opacity=0:r.animOut={left:u*2,top:-f/2,opacity:0}});r.cssBefore={left:0,top:0};r.animIn={left:0}};n.fn.cycle.transitions.wipe=function(t,i,r){var u=t.css("overflow","hidden").width(),f=t.height(),e,s,h;r.cssBefore=r.cssBefore||{};r.clip&&(/l2r/.test(r.clip)?e="rect(0px 0px "+f+"px 0px)":/r2l/.test(r.clip)?e="rect(0px "+u+"px "+f+"px "+u+"px)":/t2b/.test(r.clip)?e="rect(0px "+u+"px 0px 0px)":/b2t/.test(r.clip)?e="rect("+f+"px "+u+"px "+f+"px 0px)":/zoom/.test(r.clip)&&(s=parseInt(f/2),h=parseInt(u/2),e="rect("+s+"px "+h+"px "+s+"px "+h+"px)"));r.cssBefore.clip=r.cssBefore.clip||e||"rect(0px 0px 0px 0px)";var o=r.cssBefore.clip.match(/(\d+)/g),c=parseInt(o[0]),l=parseInt(o[1]),a=parseInt(o[2]),v=parseInt(o[3]);r.before.push(function(t,i,r){var s,h,e,o;t!=i&&(s=n(t),h=n(i),n.fn.cycle.commonReset(t,i,r,!0,!0,!1),r.cssAfter.display="block",e=1,o=parseInt(r.speedIn/13)-1,function y(){var n=c?c-parseInt(e*(c/o)):0,t=v?v-parseInt(e*(v/o)):0,i=a<f?a+parseInt(e*((f-a)/o||1)):f,r=l<u?l+parseInt(e*((u-l)/o||1)):u;h.css({clip:"rect("+n+"px "+r+"px "+i+"px "+t+"px)"});e++<=o?setTimeout(y,13):s.css("display","none")}())});r.cssBefore={display:"block",opacity:1,top:0,left:0};r.animIn={left:0};r.animOut={left:0}}}(jQuery);!function(n,t){"use strict";var r,it=n.document,p=it.documentElement,i=n.Modernizr,o=function(n){return n.charAt(0).toUpperCase()+n.slice(1)},w="Moz Webkit O Ms".split(" "),f=function(n){var i,r=p.style,t,u;if("string"==typeof r[n])return n;for(n=o(n),t=0,u=w.length;u>t;t++)if(i=w[t]+n,"string"==typeof r[i])return i},s=f("transform"),b=f("transitionProperty"),e={csstransforms:function(){return!!s},csstransforms3d:function(){var n=!!f("perspective"),r,i;return n&&"webkitPerspective"in p.style&&(r=t("<style>@media (transform-3d),(-webkit-transform-3d){#modernizr{height:3px}}<\/style>").appendTo("head"),i=t('<div id="modernizr" />').appendTo("html"),n=3===i.height(),i.remove(),r.remove()),n},csstransitions:function(){return!!b}},h,c,k,l,d,g,a,u,nt,tt,v,y;if(i)for(r in e)i.hasOwnProperty(r)||i.addTest(r,e[r]);else{i=n.Modernizr={_version:"1.6ish: miniModernizr for tiles"};c=" ";for(r in e)h=e[r](),i[r]=h,c+=" "+(h?"":"no-")+r;t("html").addClass(c)}i.csstransforms&&(k=i.csstransforms3d?{translate:function(n){return"translate3d("+n[0]+"px, "+n[1]+"px, 0) "},scale:function(n){return"scale3d("+n+", "+n+", 1) "}}:{translate:function(n){return"translate("+n[0]+"px, "+n[1]+"px) "},scale:function(n){return"scale("+n+") "}},l=function(n,i,r){var u,o,f=t.data(n,"isoTransform")||{},h={},e={};h[i]=r;t.extend(f,h);for(u in f)o=f[u],e[u]=k[u](o);var c=e.translate||"",l=e.scale||"",a=c+l;t.data(n,"isoTransform",f);n.style[s]=a},t.cssNumber.scale=!0,t.cssHooks.scale={set:function(n,t){l(n,"scale",t)},get:function(n){var i=t.data(n,"isoTransform");return i&&i.scale?i.scale:1}},t.fx.step.scale=function(n){t.cssHooks.scale.set(n.elem,n.now+n.unit)},t.cssNumber.translate=!0,t.cssHooks.translate={set:function(n,t){l(n,"translate",t)},get:function(n){var i=t.data(n,"isoTransform");return i&&i.translate?i.translate:[0,0]}});i.csstransitions&&(d={WebkitTransitionProperty:"webkitTransitionEnd",MozTransitionProperty:"transitionend",OTransitionProperty:"oTransitionEnd otransitionend",transitionProperty:"transitionend"}[b],g=f("transitionDuration"));u=t.event;nt=t.event.handle?"handle":"dispatch";u.special.smartresize={setup:function(){t(this).bind("resize",u.special.smartresize.handler)},teardown:function(){t(this).unbind("resize",u.special.smartresize.handler)},handler:function(n,t){var i=this,r=arguments;n.type="smartresize";a&&clearTimeout(a);a=setTimeout(function(){u[nt].apply(i,r)},"execAsap"===t?0:100)}};t.fn.smartresize=function(n){return n?this.bind("smartresize",n):this.trigger("smartresize",["execAsap"])};t.tiles=function(n,i,r){this.element=t(i);this._create(n);this._init(r)};tt=["width","height"];v=t(n);t.tiles.settings={resizable:!0,layoutMode:"masonry",containerClass:"tiles",itemClass:"tiles-item",hiddenClass:"tiles-hidden",hiddenStyle:{opacity:0,scale:.001},visibleStyle:{opacity:1,scale:1},containerStyle:{position:"relative",overflow:"hidden"},animationEngine:"best-available",animationOptions:{queue:!1,duration:800},sortBy:"original-order",sortAscending:!0,resizesContainer:!0,transformsEnabled:!0,itemPositionDataEnabled:!1};t.tiles.prototype={_create:function(n){var e,r,i,u,o,s,f;this.options=t.extend({},t.tiles.settings,n);this.styleQueue=[];this.elemCount=0;e=this.element[0].style;this.originalStyle={};r=tt.slice(0);for(i in this.options.containerStyle)r.push(i);for(u=0,o=r.length;o>u;u++)i=r[u],this.originalStyle[i]=e[i]||"";this.element.css(this.options.containerStyle);this._updateAnimationEngine();this._updateUsingTransforms();s={"original-order":function(n,t){return t.elemCount++,t.elemCount},random:function(){return Math.random()}};this.options.getSortData=t.extend(this.options.getSortData,s);this.reloadItems();this.offset={left:parseInt(this.element.css("padding-left")||0,10),top:parseInt(this.element.css("padding-top")||0,10)};f=this;setTimeout(function(){f.element.addClass(f.options.containerClass)},0);this.options.resizable&&v.bind("smartresize.tiles",function(){f.resize()});this.element.delegate("."+this.options.hiddenClass,"click",function(){return!1})},_getAtoms:function(n){var i=this.options.itemSelector,t=i?n.filter(i).add(n.find(i)):n,r={position:"absolute"};return t=t.filter(function(n,t){return 1===t.nodeType}),this.usingTransforms&&(r.left=0,r.top=0),t.css(r).addClass(this.options.itemClass),this.updateSortData(t,!0),t},_init:function(n){this.$filteredAtoms=this._filter(this.$allAtoms);this._sort();this.reLayout(n)},option:function(n){var i,r;if(t.isPlainObject(n)){this.options=t.extend(!0,this.options,n);for(r in n)i="_update"+o(r),this[i]&&this[i]()}},_updateAnimationEngine:function(){var n,t=this.options.animationEngine.toLowerCase().replace(/[ _\-]/g,"");switch(t){case"css":case"none":n=!1;break;case"jquery":n=!0;break;default:n=!i.csstransitions}this.isUsingJQueryAnimation=n;this._updateUsingTransforms()},_updateTransformsEnabled:function(){this._updateUsingTransforms()},_updateUsingTransforms:function(){var n=this.usingTransforms=this.options.transformsEnabled&&i.csstransforms&&i.csstransitions&&!this.isUsingJQueryAnimation;n||(delete this.options.hiddenStyle.scale,delete this.options.visibleStyle.scale);this.getPositionStyles=n?this._translate:this._positionAbs},_filter:function(n){var t=""===this.options.filter?"*":this.options.filter,e;if(!t)return n;var i=this.options.hiddenClass,u="."+i,f=n.filter(u),r=f;return"*"!==t&&(r=f.filter(t),e=n.not(u).not(t).addClass(i),this.styleQueue.push({$el:e,style:this.options.hiddenStyle})),this.styleQueue.push({$el:r,style:this.options.visibleStyle}),r.removeClass(i),n.filter(t)},updateSortData:function(n,i){var u,r,e=this,f=this.options.getSortData;n.each(function(){u=t(this);r={};for(var n in f)r[n]=i||"original-order"!==n?f[n](u,e):t.data(this,"tiles-sort-data")[n];t.data(this,"tiles-sort-data",r)})},_sort:function(){var t=this.options.sortBy,n=this._getSorter,i=this.options.sortAscending?1:-1,r=function(r,u){var f=n(r,t),e=n(u,t);return f===e&&"original-order"!==t&&(f=n(r,"original-order"),e=n(u,"original-order")),(f>e?1:e>f?-1:0)*i};this.$filteredAtoms.sort(r)},_getSorter:function(n,i){return t.data(n,"tiles-sort-data")[i]},_translate:function(n,t){return{translate:[n,t]}},_positionAbs:function(n,t){return{left:n,top:t}},_pushPosition:function(n,t,i){t=Math.round(t+this.offset.left);i=Math.round(i+this.offset.top);var r=this.getPositionStyles(t,i);this.styleQueue.push({$el:n,style:r});this.options.itemPositionDataEnabled&&n.data("tiles-item-position",{x:t,y:i})},layout:function(n,t){var i=this.options.layoutMode,r;(this["_"+i+"Layout"](n),this.options.resizesContainer)&&(r=this["_"+i+"GetContainerSize"](),this.styleQueue.push({$el:this.element,style:r}));this._processStyleQueue(n,t);this.isLaidOut=!0},_processStyleQueue:function(n,r){var l,f,e,o,s=this.isLaidOut?this.isUsingJQueryAnimation?"animate":"css":"css",u=this.options.animationOptions,a=this.options.onLayout,b;if(f=function(n,t){t.$el[s](t.style,u)},this._isInserting&&this.isUsingJQueryAnimation)f=function(n,t){l=t.$el.hasClass("no-transition")?"css":s;t.$el[l](t.style,u)};else if(r||a||u.complete){var v=!1,y=[r,a,u.complete],p=this;if(e=!0,o=function(){if(!v){for(var t,i=0,r=y.length;r>i;i++)t=y[i],"function"==typeof t&&t.call(p.element,n,p);v=!0}},this.isUsingJQueryAnimation&&"animate"===s)u.complete=o,e=!1;else if(i.csstransitions){for(var c,k=0,w=this.styleQueue[0],h=w&&w.$el;!h||!h.length;){if(c=this.styleQueue[k++],!c)return;h=c.$el}b=parseFloat(getComputedStyle(h[0])[g]);b>0&&(f=function(n,t){t.$el[s](t.style,u).one(d,o)},e=!1)}}t.each(this.styleQueue,f);e&&o();this.styleQueue=[]},resize:function(){this["_"+this.options.layoutMode+"ResizeChanged"]()&&this.reLayout()},reLayout:function(n){this["_"+this.options.layoutMode+"Reset"]();this.layout(this.$filteredAtoms,n)},addItems:function(n,t){var i=this._getAtoms(n);this.$allAtoms=this.$allAtoms.add(i);t&&t(i)},insert:function(n,t){this.element.append(n);var i=this;this.addItems(n,function(n){var r=i._filter(n);i._addHideAppended(r);i._sort();i.reLayout();i._revealAppended(r,t)})},appended:function(n,t){var i=this;this.addItems(n,function(n){i._addHideAppended(n);i.layout(n);i._revealAppended(n,t)})},_addHideAppended:function(n){this.$filteredAtoms=this.$filteredAtoms.add(n);n.addClass("no-transition");this._isInserting=!0;this.styleQueue.push({$el:n,style:this.options.hiddenStyle})},_revealAppended:function(n,t){var i=this;setTimeout(function(){n.removeClass("no-transition");i.styleQueue.push({$el:n,style:i.options.visibleStyle});i._isInserting=!1;i._processStyleQueue(n,t)},10)},reloadItems:function(){this.$allAtoms=this._getAtoms(this.element.children())},remove:function(n,t){this.$allAtoms=this.$allAtoms.not(n);this.$filteredAtoms=this.$filteredAtoms.not(n);var r=this,i=function(){n.remove();t&&t.call(r.element)};n.filter(":not(."+this.options.hiddenClass+")").length?(this.styleQueue.push({$el:n,style:this.options.hiddenStyle}),this._sort(),this.reLayout(i)):i()},shuffle:function(n){this.updateSortData(this.$allAtoms);this.options.sortBy="random";this._sort();this.reLayout(n)},destroy:function(){var r=this.usingTransforms,n=this.options,i,t;this.$allAtoms.removeClass(n.hiddenClass+" "+n.itemClass).each(function(){var n=this.style;n.position="";n.top="";n.left="";n.opacity="";r&&(n[s]="")});i=this.element[0].style;for(t in this.originalStyle)i[t]=this.originalStyle[t];this.element.unbind(".tiles").undelegate("."+n.hiddenClass,"click").removeClass(n.containerClass).removeData("tiles");v.unbind(".tiles")},_getSegments:function(n){var t,i=this.options.layoutMode,r=n?"rowHeight":"columnWidth",u=n?"height":"width",s=n?"rows":"cols",f=this.element[u](),e=this.options[i]&&this.options[i][r]||this.$filteredAtoms["outer"+o(u)](!0)||f;t=Math.floor(f/e);t=Math.max(t,1);this[i][s]=t;this[i][r]=e},_checkIfSegmentsChanged:function(n){var t=this.options.layoutMode,i=n?"rows":"cols",r=this[t][i];return this._getSegments(n),this[t][i]!==r},_masonryReset:function(){this.masonry={};this._getSegments();var n=this.masonry.cols;for(this.masonry.colYs=[];n--;)this.masonry.colYs.push(0)},_masonryLayout:function(n){var r=this,i=r.masonry;n.each(function(){var f=t(this),u=Math.ceil(f.outerWidth(!0)/i.columnWidth),o,n,s,e;if(u=Math.min(u,i.cols),1===u)r._masonryPlaceBrick(f,i.colYs);else{for(s=i.cols+1-u,e=[],n=0;s>n;n++)o=i.colYs.slice(n,n+u),e[n]=Math.max.apply(Math,o);r._masonryPlaceBrick(f,e)}})},_masonryPlaceBrick:function(n,t){for(var e,o,s,h,r=Math.min.apply(Math,t),u=0,i=0,f=t.length;f>i;i++)if(t[i]===r){u=i;break}for(e=this.masonry.columnWidth*u,o=r,this._pushPosition(n,e,o),s=r+n.outerHeight(!0),h=this.masonry.cols+1-f,i=0;h>i;i++)this.masonry.colYs[u+i]=s},_masonryGetContainerSize:function(){var n=Math.max.apply(Math,this.masonry.colYs);return{height:n}},_masonryResizeChanged:function(){return this._checkIfSegmentsChanged()},_fitRowsReset:function(){this.fitRows={x:0,y:0,height:0}},_fitRowsLayout:function(n){var r=this,u=this.element.width(),i=this.fitRows;n.each(function(){var n=t(this),f=n.outerWidth(!0),e=n.outerHeight(!0);0!==i.x&&f+i.x>u&&(i.x=0,i.y=i.height);r._pushPosition(n,i.x,i.y);i.height=Math.max(i.y+e,i.height);i.x+=f})},_fitRowsGetContainerSize:function(){return{height:this.fitRows.height}},_fitRowsResizeChanged:function(){return!0},_cellsByRowReset:function(){this.cellsByRow={index:0};this._getSegments();this._getSegments(!0)},_cellsByRowLayout:function(n){var r=this,i=this.cellsByRow;n.each(function(){var n=t(this),u=i.index%i.cols,f=Math.floor(i.index/i.cols),e=(u+.5)*i.columnWidth-n.outerWidth(!0)/2,o=(f+.5)*i.rowHeight-n.outerHeight(!0)/2;r._pushPosition(n,e,o);i.index++})},_cellsByRowGetContainerSize:function(){return{height:Math.ceil(this.$filteredAtoms.length/this.cellsByRow.cols)*this.cellsByRow.rowHeight+this.offset.top}},_cellsByRowResizeChanged:function(){return this._checkIfSegmentsChanged()},_straightDownReset:function(){this.straightDown={y:0}},_straightDownLayout:function(n){var i=this;n.each(function(){var n=t(this);i._pushPosition(n,0,i.straightDown.y);i.straightDown.y+=n.outerHeight(!0)})},_straightDownGetContainerSize:function(){return{height:this.straightDown.y}},_straightDownResizeChanged:function(){return!0},_masonryHorizontalReset:function(){this.masonryHorizontal={};this._getSegments(!0);var n=this.masonryHorizontal.rows;for(this.masonryHorizontal.rowXs=[];n--;)this.masonryHorizontal.rowXs.push(0)},_masonryHorizontalLayout:function(n){var r=this,i=r.masonryHorizontal;n.each(function(){var f=t(this),u=Math.ceil(f.outerHeight(!0)/i.rowHeight),o,n,s,e;if(u=Math.min(u,i.rows),1===u)r._masonryHorizontalPlaceBrick(f,i.rowXs);else{for(s=i.rows+1-u,e=[],n=0;s>n;n++)o=i.rowXs.slice(n,n+u),e[n]=Math.max.apply(Math,o);r._masonryHorizontalPlaceBrick(f,e)}})},_masonryHorizontalPlaceBrick:function(n,t){for(var e,o,s,h,r=Math.min.apply(Math,t),u=0,i=0,f=t.length;f>i;i++)if(t[i]===r){u=i;break}for(e=r,o=this.masonryHorizontal.rowHeight*u,this._pushPosition(n,e,o),s=r+n.outerWidth(!0),h=this.masonryHorizontal.rows+1-f,i=0;h>i;i++)this.masonryHorizontal.rowXs[u+i]=s},_masonryHorizontalGetContainerSize:function(){var n=Math.max.apply(Math,this.masonryHorizontal.rowXs);return{width:n}},_masonryHorizontalResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_fitColumnsReset:function(){this.fitColumns={x:0,y:0,width:0}},_fitColumnsLayout:function(n){var r=this,u=this.element.height(),i=this.fitColumns;n.each(function(){var n=t(this),e=n.outerWidth(!0),f=n.outerHeight(!0);0!==i.y&&f+i.y>u&&(i.x=i.width,i.y=0);r._pushPosition(n,i.x,i.y);i.width=Math.max(i.x+e,i.width);i.y+=f})},_fitColumnsGetContainerSize:function(){return{width:this.fitColumns.width}},_fitColumnsResizeChanged:function(){return!0},_cellsByColumnReset:function(){this.cellsByColumn={index:0};this._getSegments();this._getSegments(!0)},_cellsByColumnLayout:function(n){var r=this,i=this.cellsByColumn;n.each(function(){var n=t(this),u=Math.floor(i.index/i.rows),f=i.index%i.rows,e=(u+.5)*i.columnWidth-n.outerWidth(!0)/2,o=(f+.5)*i.rowHeight-n.outerHeight(!0)/2;r._pushPosition(n,e,o);i.index++})},_cellsByColumnGetContainerSize:function(){return{width:Math.ceil(this.$filteredAtoms.length/this.cellsByColumn.rows)*this.cellsByColumn.columnWidth}},_cellsByColumnResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_straightAcrossReset:function(){this.straightAcross={x:0}},_straightAcrossLayout:function(n){var i=this;n.each(function(){var n=t(this);i._pushPosition(n,i.straightAcross.x,0);i.straightAcross.x+=n.outerWidth(!0)})},_straightAcrossGetContainerSize:function(){return{width:this.straightAcross.x}},_straightAcrossResizeChanged:function(){return!0}};t.fn.imagesLoaded=function(n){function u(){n.call(i,r)}function f(n){var i=n.target;i.src!==o&&-1===t.inArray(i,s)&&(s.push(i),--e<=0&&(setTimeout(u),r.unbind(".imagesLoaded",f)))}var i=this,r=i.find("img").add(i.filter("img")),e=r.length,o="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",s=[];return e||u(),r.bind("load.imagesLoaded error.imagesLoaded",f).each(function(){var n=this.src;this.src=o;this.src=n}),i};y=function(t){n.console&&n.console.error(t)};t.fn.tiles=function(n,i){if("string"==typeof n){var r=Array.prototype.slice.call(arguments,1);this.each(function(){var i=t.data(this,"tiles");return i?t.isFunction(i[n])&&"_"!==n.charAt(0)?void i[n].apply(i,r):void y("no such method '"+n+"' for tiles instance"):void y("cannot call methods on tiles prior to initialization; attempted to call method '"+n+"'")})}else this.each(function(){var r=t.data(this,"tiles");r?(r.option(n),r._init(i)):t.data(this,"tiles",new t.tiles(n,this,i))});return this}}(window,jQuery),function(){(function(n){var r=this||eval("this"),i=r.document,f=r.navigator,t=r.jQuery,u=r.JSON;(function(n){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(module.exports||exports):"function"==typeof define&&define.amd?define(["exports"],n):n(r.ko={})})(function(e){function a(n,t){return null===n||typeof n in p?n===t:!1}function w(t,i){var r;return function(){r||(r=setTimeout(function(){r=n;t()},i))}}function b(n,t){var i;return function(){clearTimeout(i);i=setTimeout(n,t)}}function v(n,t,i,r){o.d[n]={init:function(n,u,f,e,s){var c,h;return o.ba(function(){var l=o.a.c(u()),f=!i!=!l,e=!h;(e||t||f!==c)&&(e&&o.ca.fa()&&(h=o.a.lb(o.e.childNodes(n),!0)),f?(e||o.e.U(n,o.a.lb(h)),o.gb(r?r(s,l):s,n)):o.e.da(n),c=f)},null,{G:n}),{controlsDescendantBindings:!0}}};o.g.aa[n]=!1;o.e.Q[n]=!0}var o="undefined"!=typeof e?e:{},p,h,s,c,y,l;o.b=function(n,t){for(var i=n.split("."),r=o,u=0;u<i.length-1;u++)r=r[i[u]];r[i[i.length-1]]=t};o.s=function(n,t,i){n[t]=i};o.version="3.1.0";o.b("version",o.version);o.a=function(){function s(n,t){for(var i in n)n.hasOwnProperty(i)&&t(i,n[i])}function c(n,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return n}function l(n,t){return n.__proto__=t,n}var a={__proto__:[]}instanceof Array,h={},v={},y,e;return h[f&&/Firefox\/2/i.test(f.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],h.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),s(h,function(n,t){if(t.length)for(var i=0,r=t.length;i<r;i++)v[t[i]]=n}),y={propertychange:!0},e=i&&function(){for(var t=3,r=i.createElement("div"),u=r.getElementsByTagName("i");r.innerHTML="<!--[if gt IE "+ ++t+"]><i><\/i><![endif]-->",u[0];);return 4<t?t:n}(),{mb:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],r:function(n,t){for(var i=0,r=n.length;i<r;i++)t(n[i],i)},l:function(n,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(n,t);for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return i;return-1},hb:function(n,t,i){for(var r=0,u=n.length;r<u;r++)if(t.call(i,n[r],r))return n[r];return null},ma:function(n,t){var i=o.a.l(n,t);0<i?n.splice(i,1):0===i&&n.shift()},ib:function(n){n=n||[];for(var i=[],t=0,r=n.length;t<r;t++)0>o.a.l(i,n[t])&&i.push(n[t]);return i},ya:function(n,t){n=n||[];for(var r=[],i=0,u=n.length;i<u;i++)r.push(t(n[i],i));return r},la:function(n,t){n=n||[];for(var r=[],i=0,u=n.length;i<u;i++)t(n[i],i)&&r.push(n[i]);return r},$:function(n,t){if(t instanceof Array)n.push.apply(n,t);else for(var i=0,r=t.length;i<r;i++)n.push(t[i]);return n},Y:function(n,t,i){var r=o.a.l(o.a.Sa(n),t);0>r?i&&n.push(t):i||n.splice(r,1)},na:a,extend:c,ra:l,sa:a?l:c,A:s,Oa:function(n,t){if(!n)return n;var r={},i;for(i in n)n.hasOwnProperty(i)&&(r[i]=t(n[i],i,n));return r},Fa:function(n){for(;n.firstChild;)o.removeNode(n.firstChild)},ec:function(n){n=o.a.R(n);for(var r=i.createElement("div"),t=0,u=n.length;t<u;t++)r.appendChild(o.M(n[t]));return r},lb:function(n,t){for(var r,i=0,f=n.length,u=[];i<f;i++)r=n[i].cloneNode(!0),u.push(t?o.M(r):r);return u},U:function(n,t){if(o.a.Fa(n),t)for(var i=0,r=t.length;i<r;i++)n.appendChild(t[i])},Bb:function(n,t){var r=n.nodeType?[n]:n;if(0<r.length){for(var f=r[0],e=f.parentNode,i=0,u=t.length;i<u;i++)e.insertBefore(t[i],f);for(i=0,u=r.length;i<u;i++)o.removeNode(r[i])}},ea:function(n,t){if(n.length){for(t=8===t.nodeType&&t.parentNode||t;n.length&&n[0].parentNode!==t;)n.shift();if(1<n.length){var i=n[0],r=n[n.length-1];for(n.length=0;i!==r;)if(n.push(i),i=i.nextSibling,!i)return;n.push(r)}}return n},Db:function(n,t){7>e?n.setAttribute("selected",t):n.selected=t},ta:function(t){return null===t||t===n?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},oc:function(n,t){for(var r,u=[],f=(n||"").split(t),i=0,e=f.length;i<e;i++)r=o.a.ta(f[i]),""!==r&&u.push(r);return u},kc:function(n,t){return n=n||"",t.length>n.length?!1:n.substring(0,t.length)===t},Sb:function(n,t){if(n===t)return!0;if(11===n.nodeType)return!1;if(t.contains)return t.contains(3===n.nodeType?n.parentNode:n);if(t.compareDocumentPosition)return 16==(t.compareDocumentPosition(n)&16);for(;n&&n!=t;)n=n.parentNode;return!!n},Ea:function(n){return o.a.Sb(n,n.ownerDocument.documentElement)},eb:function(n){return!!o.a.hb(n,o.a.Ea)},B:function(n){return n&&n.tagName&&n.tagName.toLowerCase()},q:function(n,i,r){var s=e&&y[i],u,f;if(!s&&t)t(n).bind(i,r);else if(s||"function"!=typeof n.addEventListener)if("undefined"!=typeof n.attachEvent)u=function(t){r.call(n,t)},f="on"+i,n.attachEvent(f,u),o.a.u.ja(n,function(){n.detachEvent(f,u)});else throw Error("Browser doesn't support addEventListener or attachEvent");else n.addEventListener(i,r,!1)},ha:function(n,u){if(!n||!n.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var f;if("input"===o.a.B(n)&&n.type&&"click"==u.toLowerCase()?(f=n.type,f="checkbox"==f||"radio"==f):f=!1,t&&!f)t(n).trigger(u);else if("function"==typeof i.createEvent)if("function"==typeof n.dispatchEvent)f=i.createEvent(v[u]||"HTMLEvents"),f.initEvent(u,!0,!0,r,0,0,0,0,0,!1,!1,!1,!1,0,n),n.dispatchEvent(f);else throw Error("The supplied element doesn't support dispatchEvent");else if(f&&n.click)n.click();else if("undefined"!=typeof n.fireEvent)n.fireEvent("on"+u);else throw Error("Browser doesn't support triggering events");},c:function(n){return o.v(n)?n():n},Sa:function(n){return o.v(n)?n.o():n},ua:function(n,t,i){if(t){var r=/\S+/g,u=n.className.match(r)||[];o.a.r(t.match(r),function(n){o.a.Y(u,n,i)});n.className=u.join(" ")}},Xa:function(t,i){var r=o.a.c(i),u;(null===r||r===n)&&(r="");u=o.e.firstChild(t);!u||3!=u.nodeType||o.e.nextSibling(u)?o.e.U(t,[t.ownerDocument.createTextNode(r)]):u.data=r;o.a.Vb(t)},Cb:function(n,t){if(n.name=t,7>=e)try{n.mergeAttributes(i.createElement("<input name='"+n.name+"'/>"),!1)}catch(r){}},Vb:function(n){9<=e&&(n=1==n.nodeType?n:n.parentNode,n.style&&(n.style.zoom=n.style.zoom))},Tb:function(n){if(e){var t=n.style.width;n.style.width=0;n.style.width=t}},ic:function(n,t){n=o.a.c(n);t=o.a.c(t);for(var r=[],i=n;i<=t;i++)r.push(i);return r},R:function(n){for(var i=[],t=0,r=n.length;t<r;t++)i.push(n[t]);return i},mc:6===e,nc:7===e,oa:e,ob:function(n,t){for(var r=o.a.R(n.getElementsByTagName("input")).concat(o.a.R(n.getElementsByTagName("textarea"))),f="string"==typeof t?function(n){return n.name===t}:function(n){return t.test(n.name)},u=[],i=r.length-1;0<=i;i--)f(r[i])&&u.push(r[i]);return u},fc:function(n){return"string"==typeof n&&(n=o.a.ta(n))?u&&u.parse?u.parse(n):new Function("return "+n)():null},Ya:function(n,t,i){if(!u||!u.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return u.stringify(o.a.c(n),t,i)},gc:function(n,t,r){var c,e,h,f,u,l;r=r||{};var a=r.params||{},v=r.includeFields||this.mb,c=n;if("object"==typeof n&&"form"===o.a.B(n))for(c=n.action,e=v.length-1;0<=e;e--)for(h=o.a.ob(n,v[e]),f=h.length-1;0<=f;f--)a[h[f].name]=h[f].value;t=o.a.c(t);u=i.createElement("form");u.style.display="none";u.action=c;u.method="post";for(l in t)n=i.createElement("input"),n.name=l,n.value=o.a.Ya(o.a.c(t[l])),u.appendChild(n);s(a,function(n,t){var r=i.createElement("input");r.name=n;r.value=t;u.appendChild(r)});i.body.appendChild(u);r.submitter?r.submitter(u):u.submit();setTimeout(function(){u.parentNode.removeChild(u)},0)}}}();o.b("utils",o.a);o.b("utils.arrayForEach",o.a.r);o.b("utils.arrayFirst",o.a.hb);o.b("utils.arrayFilter",o.a.la);o.b("utils.arrayGetDistinctValues",o.a.ib);o.b("utils.arrayIndexOf",o.a.l);o.b("utils.arrayMap",o.a.ya);o.b("utils.arrayPushAll",o.a.$);o.b("utils.arrayRemoveItem",o.a.ma);o.b("utils.extend",o.a.extend);o.b("utils.fieldsIncludedWithJsonPost",o.a.mb);o.b("utils.getFormFields",o.a.ob);o.b("utils.peekObservable",o.a.Sa);o.b("utils.postJson",o.a.gc);o.b("utils.parseJson",o.a.fc);o.b("utils.registerEventHandler",o.a.q);o.b("utils.stringifyJson",o.a.Ya);o.b("utils.range",o.a.ic);o.b("utils.toggleDomNodeCssClass",o.a.ua);o.b("utils.triggerEvent",o.a.ha);o.b("utils.unwrapObservable",o.a.c);o.b("utils.objectForEach",o.a.A);o.b("utils.addOrRemoveItem",o.a.Y);o.b("unwrap",o.a.c);Function.prototype.bind||(Function.prototype.bind=function(n){var i=this,t=Array.prototype.slice.call(arguments);return n=t.shift(),function(){return i.apply(n,t.concat(Array.prototype.slice.call(arguments)))}});o.a.f=new function(){function r(r,f){var e=r[t];if(!e||"null"===e||!i[e]){if(!f)return n;e=r[t]="ko"+u++;i[e]={}}return i[e]}var u=0,t="__ko__"+(new Date).getTime(),i={};return{get:function(t,i){var u=r(t,!1);return u===n?n:u[i]},set:function(t,i,u){(u!==n||r(t,!1)!==n)&&(r(t,!0)[i]=u)},clear:function(n){var r=n[t];return r?(delete i[r],n[t]=null,!0):!1},L:function(){return u+++t}}};o.b("utils.domData",o.a.f);o.b("utils.domData.clear",o.a.f.clear);o.a.u=new function(){function i(t,i){var r=o.a.f.get(t,u);return r===n&&i&&(r=[],o.a.f.set(t,u,r)),r}function r(n){var t=i(n,!1),u;if(t)for(t=t.slice(0),u=0;u<t.length;u++)t[u](n);if(o.a.f.clear(n),o.a.u.cleanExternalData(n),f[n.nodeType])for(t=n.firstChild;n=t;)t=n.nextSibling,8===n.nodeType&&r(n)}var u=o.a.f.L(),e={1:!0,8:!0,9:!0},f={1:!0,9:!0};return{ja:function(n,t){if("function"!=typeof t)throw Error("Callback must be a function");i(n,!0).push(t)},Ab:function(t,r){var f=i(t,!1);f&&(o.a.ma(f,r),0==f.length&&o.a.f.set(t,u,n))},M:function(n){var t,i,u;if(e[n.nodeType]&&(r(n),f[n.nodeType]))for(t=[],o.a.$(t,n.getElementsByTagName("*")),i=0,u=t.length;i<u;i++)r(t[i]);return n},removeNode:function(n){o.M(n);n.parentNode&&n.parentNode.removeChild(n)},cleanExternalData:function(n){t&&"function"==typeof t.cleanData&&t.cleanData([n])}}};o.M=o.a.u.M;o.removeNode=o.a.u.removeNode;o.b("cleanNode",o.M);o.b("removeNode",o.removeNode);o.b("utils.domNodeDisposal",o.a.u);o.b("utils.domNodeDisposal.addDisposeCallback",o.a.u.ja);o.b("utils.domNodeDisposal.removeDisposeCallback",o.a.u.Ab),function(){o.a.Qa=function(n){var u,f;if(t){if(t.parseHTML)u=t.parseHTML(n)||[];else if((u=t.clean([n]))&&u[0]){for(n=u[0];n.parentNode&&11!==n.parentNode.nodeType;)n=n.parentNode;n.parentNode&&n.parentNode.removeChild(n)}}else{for(f=o.a.ta(n).toLowerCase(),u=i.createElement("div"),f=f.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","<\/table>"]||!f.indexOf("<tr")&&[2,"<table><tbody>","<\/tbody><\/table>"]||(!f.indexOf("<td")||!f.indexOf("<th"))&&[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"]||[0,"",""],n="ignored<div>"+f[1]+n+f[2]+"<\/div>","function"==typeof r.innerShiv?u.appendChild(r.innerShiv(n)):u.innerHTML=n;f[0]--;)u=u.lastChild;u=o.a.R(u.lastChild.childNodes)}return u};o.a.Va=function(i,r){if(o.a.Fa(i),r=o.a.c(r),null!==r&&r!==n)if("string"!=typeof r&&(r=r.toString()),t)t(i).html(r);else for(var f=o.a.Qa(r),u=0;u<f.length;u++)i.appendChild(f[u])}}();o.b("utils.parseHtmlFragment",o.a.Qa);o.b("utils.setHtml",o.a.Va);o.w=function(){function i(n,t){var r;if(n)if(8==n.nodeType)r=o.w.xb(n.nodeValue),null!=r&&t.push({Rb:n,cc:r});else if(1==n.nodeType)for(var r=0,u=n.childNodes,f=u.length;r<f;r++)i(u[r],t)}var t={};return{Na:function(n){if("function"!=typeof n)throw Error("You can only pass a function to ko.memoization.memoize()");var i=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return t[i]=n,"<!--[ko_memo:"+i+"]-->"},Hb:function(i,r){var u=t[i];if(u===n)throw Error("Couldn't find any memo with ID "+i+". Perhaps it's already been unmemoized.");try{return u.apply(null,r||[]),!0}finally{delete t[i]}},Ib:function(n,t){var f=[],u,s,r,e;for(i(n,f),u=0,s=f.length;u<s;u++)r=f[u].Rb,e=[r],t&&o.a.$(e,t),o.w.Hb(f[u].cc,e),r.nodeValue="",r.parentNode&&r.parentNode.removeChild(r)},xb:function(n){return(n=n.match(/^\[ko_memo\:(.*?)\]$/))?n[1]:null}}}();o.b("memoization",o.w);o.b("memoization.memoize",o.w.Na);o.b("memoization.unmemoize",o.w.Hb);o.b("memoization.parseMemoText",o.w.xb);o.b("memoization.unmemoizeDomNodeAndDescendants",o.w.Ib);o.Ga={throttle:function(n,t){n.throttleEvaluation=t;var i=null;return o.h({read:n,write:function(r){clearTimeout(i);i=setTimeout(function(){n(r)},t)}})},rateLimit:function(n,t){var i,r,u;"number"==typeof t?i=t:(i=t.timeout,r=t.method);u="notifyWhenChangesStop"==r?b:w;n.Ma(function(n){return u(n,i)})},notify:function(n,t){n.equalityComparer="always"==t?null:a}};p={undefined:1,boolean:1,number:1,string:1};o.b("extenders",o.Ga);o.Fb=function(n,t,i){this.target=n;this.za=t;this.Qb=i;this.sb=!1;o.s(this,"dispose",this.F)};o.Fb.prototype.F=function(){this.sb=!0;this.Qb()};o.N=function(){o.a.sa(this,o.N.fn);this.H={}};h="change";e={V:function(n,t,i){var r=this,u;return i=i||h,u=new o.Fb(r,t?n.bind(t):n,function(){o.a.ma(r.H[i],u)}),r.o&&r.o(),r.H[i]||(r.H[i]=[]),r.H[i].push(u),u},notifySubscribers:function(n,t){if(t=t||h,this.qb(t))try{o.k.jb();for(var u=this.H[t].slice(0),r=0,i;i=u[r];++r)i.sb||i.za(n)}finally{o.k.end()}},Ma:function(n){var t=this,e=o.v(t),r,u,i,f;t.ia||(t.ia=t.notifySubscribers,t.notifySubscribers=function(n,i){i&&i!==h?"beforeChange"===i?t.bb(n):t.ia(n,i):t.cb(n)});f=n(function(){e&&i===t&&(i=t());r=!1;t.Ka(u,i)&&t.ia(u=i)});t.cb=function(n){r=!0;i=n;f()};t.bb=function(n){r||(u=n,t.ia(n,"beforeChange"))}},qb:function(n){return this.H[n]&&this.H[n].length},Wb:function(){var n=0;return o.a.A(this.H,function(t,i){n+=i.length}),n},Ka:function(n,t){return!this.equalityComparer||!this.equalityComparer(n,t)},extend:function(n){var t=this;return n&&o.a.A(n,function(n,i){var r=o.Ga[n];"function"==typeof r&&(t=r(t,i)||t)}),t}};o.s(e,"subscribe",e.V);o.s(e,"extend",e.extend);o.s(e,"getSubscriptionsCount",e.Wb);o.a.na&&o.a.ra(e,Function.prototype);o.N.fn=e;o.tb=function(n){return null!=n&&"function"==typeof n.V&&"function"==typeof n.notifySubscribers};o.b("subscribable",o.N);o.b("isSubscribable",o.tb);o.ca=o.k=function(){function t(t){r.push(n);n=t}function i(){n=r.pop()}var r=[],n,u=0;return{jb:t,end:i,zb:function(t){if(n){if(!o.tb(t))throw Error("Only subscribable things can act as dependencies");n.za(t,t.Kb||(t.Kb=++u))}},t:function(n,r,u){try{return t(),n.apply(r,u||[])}finally{i()}},fa:function(){if(n)return n.ba.fa()},pa:function(){if(n)return n.pa}}}();o.b("computedContext",o.ca);o.b("computedContext.getDependenciesCount",o.ca.fa);o.b("computedContext.isInitial",o.ca.pa);o.m=function(n){function t(){return 0<arguments.length?(t.Ka(i,arguments[0])&&(t.P(),i=arguments[0],t.O()),this):(o.k.zb(t),i)}var i=n;return o.N.call(t),o.a.sa(t,o.m.fn),t.o=function(){return i},t.O=function(){t.notifySubscribers(i)},t.P=function(){t.notifySubscribers(i,"beforeChange")},o.s(t,"peek",t.o),o.s(t,"valueHasMutated",t.O),o.s(t,"valueWillMutate",t.P),t};o.m.fn={equalityComparer:a};s=o.m.hc="__ko_proto__";o.m.fn[s]=o.m;o.a.na&&o.a.ra(o.m.fn,o.N.fn);o.Ha=function(t,i){return null===t||t===n||t[s]===n?!1:t[s]===i?!0:o.Ha(t[s],i)};o.v=function(n){return o.Ha(n,o.m)};o.ub=function(n){return"function"==typeof n&&n[s]===o.m||"function"==typeof n&&n[s]===o.h&&n.Yb?!0:!1};o.b("observable",o.m);o.b("isObservable",o.v);o.b("isWriteableObservable",o.ub);o.T=function(n){if(n=n||[],"object"!=typeof n||!("length"in n))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return n=o.m(n),o.a.sa(n,o.T.fn),n.extend({trackArrayChanges:!0})};o.T.fn={remove:function(n){for(var u,r=this.o(),i=[],f="function"!=typeof n||o.v(n)?function(t){return t===n}:n,t=0;t<r.length;t++)u=r[t],f(u)&&(0===i.length&&this.P(),i.push(u),r.splice(t,1),t--);return i.length&&this.O(),i},removeAll:function(t){if(t===n){var i=this.o(),r=i.slice(0);return this.P(),i.splice(0,i.length),this.O(),r}return t?this.remove(function(n){return 0<=o.a.l(t,n)}):[]},destroy:function(n){var i=this.o(),r="function"!=typeof n||o.v(n)?function(t){return t===n}:n,t;for(this.P(),t=i.length-1;0<=t;t--)r(i[t])&&(i[t]._destroy=!0);this.O()},destroyAll:function(t){return t===n?this.destroy(function(){return!0}):t?this.destroy(function(n){return 0<=o.a.l(t,n)}):[]},indexOf:function(n){var t=this();return o.a.l(t,n)},replace:function(n,t){var i=this.indexOf(n);0<=i&&(this.P(),this.o()[i]=t,this.O())}};o.a.r("pop push reverse shift sort splice unshift".split(" "),function(n){o.T.fn[n]=function(){var t=this.o();return this.P(),this.kb(t,n,arguments),t=t[n].apply(t,arguments),this.O(),t}});o.a.r(["slice"],function(n){o.T.fn[n]=function(){var t=this();return t[n].apply(t,arguments)}});o.a.na&&o.a.ra(o.T.fn,o.m.fn);o.b("observableArray",o.T);c="arrayChange";o.Ga.trackArrayChanges=function(n){function u(){var f,u;r||(r=!0,f=n.notifySubscribers,n.notifySubscribers=function(n,t){return t&&t!==h||++i,f.apply(this,arguments)},u=[].concat(n.o()||[]),t=null,n.V(function(r){if(r=[].concat(r||[]),n.qb(c)){var f;(!t||1<i)&&(t=o.a.Aa(u,r,{sparse:!0}));f=t;f.length&&n.notifySubscribers(f,c)}u=r;t=null;i=0}))}if(!n.kb){var r=!1,t=null,i=0,f=n.V;n.V=n.subscribe=function(n,t,i){return i===c&&u(),f.apply(this,arguments)};n.kb=function(n,u,f){function c(n,t,i){return l[l.length]={status:n,value:t,index:i}}if(r&&!i){var l=[],e=n.length,h=f.length,s=0;switch(u){case"push":s=e;case"unshift":for(u=0;u<h;u++)c("added",f[u],s+u);break;case"pop":s=e-1;case"shift":e&&c("deleted",n[s],s);break;case"splice":u=Math.min(Math.max(0,0>f[0]?e+f[0]:f[0]),e);for(var e=1===h?e:Math.min(u+(f[1]||0),e),h=u+h-2,s=Math.max(e,h),a=[],v=[],y=2;u<s;++u,++y)u<e&&v.push(c("deleted",n[u],u)),u<h&&a.push(c("added",f[y],u));o.a.nb(v,a);break;default:return}t=l}}}};o.ba=o.h=function(n,t,i){function k(){p=!0;o.a.A(h,function(n,t){t.F()});h={};u=0;c=!1}function it(){var n=r.throttleEvaluation;n&&0<=n?(clearTimeout(nt),nt=setTimeout(a,n)):r.wa?r.wa():a()}function a(){var n,i,s;if(!v&&!p){if(b&&b()){if(!y){l();return}}else y=!1;v=!0;try{n=h;i=u;o.k.jb({za:function(t,r){p||(i&&n[r]?(h[r]=n[r],++u,delete n[r],--i):h[r]||(h[r]=t.V(it),++u))},ba:r,pa:!u});h={};u=0;try{s=t?f.call(t):f()}finally{o.k.end();i&&o.a.A(n,function(n,t){t.F()});c=!1}r.Ka(e,s)&&(r.notifySubscribers(e,"beforeChange"),e=s,r.wa&&!r.throttleEvaluation||r.notifySubscribers(e))}finally{v=!1}u||l()}}function r(){if(0<arguments.length){if("function"==typeof g)g.apply(t,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return c&&a(),o.k.zb(r),e}function d(){return c||0<u}var e,c=!0,v=!1,y=!1,p=!1,f=n,tt;if(f&&"object"==typeof f?(i=f,f=i.read):(i=i||{},f||(f=i.read)),"function"!=typeof f)throw Error("Pass a function that returns the value of the ko.computed");var g=i.write,s=i.disposeWhenNodeIsRemoved||i.G||null,w=i.disposeWhen||i.Da,b=w,l=k,h={},u=0,nt=null;return t||(t=i.owner),o.N.call(r),o.a.sa(r,o.h.fn),r.o=function(){return c&&!u&&a(),e},r.fa=function(){return u},r.Yb="function"==typeof i.write,r.F=function(){l()},r.ga=d,tt=r.Ma,r.Ma=function(n){tt.call(r,n);r.wa=function(){r.bb(e);c=!0;r.cb(r)}},o.s(r,"peek",r.o),o.s(r,"dispose",r.F),o.s(r,"isActive",r.ga),o.s(r,"getDependenciesCount",r.fa),s&&(y=!0,s.nodeType&&(b=function(){return!o.a.Ea(s)||w&&w()})),!0!==i.deferEvaluation&&a(),s&&d()&&s.nodeType&&(l=function(){o.a.u.Ab(s,l);k()},o.a.u.ja(s,l)),r};o.$b=function(n){return o.Ha(n,o.h)};e=o.m.hc;o.h[e]=o.m;o.h.fn={equalityComparer:a};o.h.fn[e]=o.h;o.a.na&&o.a.ra(o.h.fn,o.N.fn);o.b("dependentObservable",o.h);o.b("computed",o.h);o.b("isComputed",o.$b),function(){function t(u,f,e){if(e=e||new i,u=f(u),"object"!=typeof u||null===u||u===n||u instanceof Date||u instanceof String||u instanceof Number||u instanceof Boolean)return u;var o=u instanceof Array?[]:{};return e.save(u,o),r(u,function(i){var r=f(u[i]),s;switch(typeof r){case"boolean":case"number":case"string":case"function":o[i]=r;break;case"object":case"undefined":s=e.get(r);o[i]=s!==n?s:t(r,f,e)}}),o}function r(n,t){if(n instanceof Array){for(var i=0;i<n.length;i++)t(i);"function"==typeof n.toJSON&&t("toJSON")}else for(i in n)t(i)}function i(){this.keys=[];this.ab=[]}o.Gb=function(n){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(n,function(n){for(var t=0;o.v(n)&&10>t;t++)n=n();return n})};o.toJSON=function(n,t,i){return n=o.Gb(n),o.a.Ya(n,t,i)};i.prototype={save:function(n,t){var i=o.a.l(this.keys,n);0<=i?this.ab[i]=t:(this.keys.push(n),this.ab.push(t))},get:function(t){return t=o.a.l(this.keys,t),0<=t?this.ab[t]:n}}}();o.b("toJS",o.Gb);o.b("toJSON",o.toJSON),function(){o.i={p:function(t){switch(o.a.B(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?o.a.f.get(t,o.d.options.Pa):7>=o.a.oa?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?o.i.p(t.options[t.selectedIndex]):n;default:return t.value}},X:function(t,i,r){switch(o.a.B(t)){case"option":switch(typeof i){case"string":o.a.f.set(t,o.d.options.Pa,n);"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__;t.value=i;break;default:o.a.f.set(t,o.d.options.Pa,i);t.__ko__hasDomDataOptionValue__=!0;t.value="number"==typeof i?i:""}break;case"select":(""===i||null===i)&&(i=n);for(var f=-1,u=0,s=t.options.length,e;u<s;++u)if(e=o.i.p(t.options[u]),e==i||""==e&&i===n){f=u;break}(r||0<=f||i===n&&1<t.size)&&(t.selectedIndex=f);break;default:(null===i||i===n)&&(i="");t.value=i}}}}();o.b("selectExtensions",o.i);o.b("selectExtensions.readValue",o.i.p);o.b("selectExtensions.writeValue",o.i.X);o.g=function(){function n(n){var c,r,i;n=o.a.ta(n);123===n.charCodeAt(0)&&(n=n.slice(1,-1));var a=[],s=n.match(t),h,u,l=0;if(s)for(s.push(","),c=0;r=s[c];++c){if(i=r.charCodeAt(0),44===i){if(0>=l){h&&a.push(u?{key:h,value:u.join("")}:{unknown:h});h=u=l=0;continue}}else if(58===i){if(!u)continue}else if(47===i&&c&&1<r.length)(i=s[c-1].match(f))&&!e[i[0]]&&(n=n.substr(n.indexOf(r)+1),s=n.match(t),s.push(","),c=-1,r="/");else if(40===i||123===i||91===i)++l;else if(41===i||125===i||93===i)--l;else if(!h&&!u){h=34===i||39===i?r.slice(1,-1):r;continue}u?u.push(r):u=[r]}return a}var r=["true","false","null","undefined"],u=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,t=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),f=/[\])"'A-Za-z0-9_$]+$/,e={"in":1,"return":1,"typeof":1},i={};return{aa:[],W:i,Ra:n,qa:function(t,f){function e(n,t){var l,f=o.getBindingHandler(n);(f&&f.preprocess?t=f.preprocess(t,n,e):1)&&((f=i[n])&&(l=t,0<=o.a.l(r,l)?l=!1:(f=l.match(u),l=null===f?!1:f[1]?"Object("+f[1]+")"+f[2]:l),f=l),f&&s.push("'"+n+"':function(_z){"+l+"=_z}"),c&&(t="function(){return "+t+" }"),h.push("'"+n+"':"+t))}f=f||{};var h=[],s=[],c=f.valueAccessors,l="string"==typeof t?n(t):t;return o.a.r(l,function(n){e(n.key||n.unknown,n.value)}),s.length&&e("_ko_property_writers","{"+s.join(",")+" }"),h.join(",")},bc:function(n,t){for(var i=0;i<n.length;i++)if(n[i].key==t)return!0;return!1},va:function(n,t,i,r,u){n&&o.v(n)?!o.ub(n)||u&&n.o()===r||n(r):(n=t.get("_ko_property_writers"))&&n[i]&&n[i](r)}}}();o.b("expressionRewriting",o.g);o.b("expressionRewriting.bindingRewriteValidators",o.g.aa);o.b("expressionRewriting.parseObjectLiteral",o.g.Ra);o.b("expressionRewriting.preProcessBindings",o.g.qa);o.b("expressionRewriting._twoWayBindings",o.g.W);o.b("jsonExpressionRewriting",o.g);o.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",o.g.qa),function(){function n(n){return 8==n.nodeType&&e.test(t?n.text:n.nodeValue)}function r(n){return 8==n.nodeType&&s.test(t?n.text:n.nodeValue)}function u(t,i){for(var u=t,f=1,e=[];u=u.nextSibling;){if(r(u)&&(f--,0===f))return e;e.push(u);n(u)&&f++}if(!i)throw Error("Cannot find closing comment tag to match: "+t.nodeValue);return null}function f(n,t){var i=u(n,t);return i?0<i.length?i[i.length-1].nextSibling:n.nextSibling:null}var t=i&&"<!--test-->"===i.createComment("test").text,e=t?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=t?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,h={ul:!0,ol:!0};o.e={Q:{},childNodes:function(t){return n(t)?u(t):t.childNodes},da:function(t){if(n(t)){t=o.e.childNodes(t);for(var i=0,r=t.length;i<r;i++)o.removeNode(t[i])}else o.a.Fa(t)},U:function(t,i){if(n(t)){o.e.da(t);for(var u=t.nextSibling,r=0,f=i.length;r<f;r++)u.parentNode.insertBefore(i[r],u)}else o.a.U(t,i)},yb:function(t,i){n(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},rb:function(t,i,r){r?n(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):o.e.yb(t,i)},firstChild:function(t){return n(t)?!t.nextSibling||r(t.nextSibling)?null:t.nextSibling:t.firstChild},nextSibling:function(t){return n(t)&&(t=f(t)),t.nextSibling&&r(t.nextSibling)?null:t.nextSibling},Xb:n,lc:function(n){return(n=(t?n.text:n.nodeValue).match(e))?n[1]:null},wb:function(t){var s,i,u,e;if(h[o.a.B(t)]&&(s=t.firstChild,s))do if(1===s.nodeType){if(i=s.firstChild,u=null,i)do u?u.push(i):n(i)?(e=f(i,!0),e?i=e:u=[i]):r(i)&&(u=[i]);while(i=i.nextSibling);if(i=u)for(u=s.nextSibling,e=0;e<i.length;e++)u?t.insertBefore(i[e],u):t.appendChild(i[e])}while(s=s.nextSibling)}}}();o.b("virtualElements",o.e);o.b("virtualElements.allowedBindings",o.e.Q);o.b("virtualElements.emptyNode",o.e.da);o.b("virtualElements.insertAfter",o.e.rb);o.b("virtualElements.prepend",o.e.yb);o.b("virtualElements.setDomNodeChildren",o.e.U),function(){o.J=function(){this.Nb={}};o.a.extend(o.J.prototype,{nodeHasBindings:function(n){switch(n.nodeType){case 1:return null!=n.getAttribute("data-bind");case 8:return o.e.Xb(n);default:return!1}},getBindings:function(n,t){var i=this.getBindingsString(n,t);return i?this.parseBindingsString(i,t,n):null},getBindingAccessors:function(n,t){var i=this.getBindingsString(n,t);return i?this.parseBindingsString(i,t,n,{valueAccessors:!0}):null},getBindingsString:function(n){switch(n.nodeType){case 1:return n.getAttribute("data-bind");case 8:return o.e.lc(n);default:return null}},parseBindingsString:function(n,t,i,r){var u,f,e,h,c;try{return u=this.Nb,f=n+(r&&r.valueAccessors||""),(e=u[f])||(c="with($context){with($data||{}){return{"+o.g.qa(n,r)+"}}}",h=new Function("$context","$element",c),e=u[f]=h),e(t,i)}catch(s){throw s.message="Unable to parse bindings.\nBindings value: "+n+"\nMessage: "+s.message,s;}}});o.J.instance=new o.J}();o.b("bindingProvider",o.J),function(){function v(n){return function(){return n}}function u(n){return n()}function s(n){return o.a.Oa(o.k.t(n),function(t,i){return function(){return n()[i]}})}function y(n,t){return s(this.getBindings.bind(this,n,t))}function h(n,t,i){var r,u=o.e.firstChild(t),f=o.J.instance,e=f.preprocessNode;if(e){for(;r=u;)u=o.e.nextSibling(r),e.call(f,r);u=o.e.firstChild(t)}for(;r=u;)u=o.e.nextSibling(r),c(n,r,i)}function c(n,t,i){var u=!0,r=1===t.nodeType;r&&o.e.wb(t);(r&&i||o.J.instance.nodeHasBindings(t))&&(u=l(t,null,n,i).shouldBindDescendants);u&&!a[o.a.B(t)]&&h(n,t,!r)}function p(n){var i=[],r={},t=[];return o.a.A(n,function u(f){if(!r[f]){var e=o.getBindingHandler(f);e&&(e.after&&(t.push(f),o.a.r(e.after,function(i){if(n[i]){if(-1!==o.a.l(t,i))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+t.join(", "));u(i)}}),t.length--),i.push({key:f,pb:e}));r[f]=!0}}),i}function l(t,i,r,e){var v=o.a.f.get(t,f),s,l,a,c;if(!i){if(v)throw Error("You cannot apply bindings multiple times to the same element.");o.a.f.set(t,f,!0)}if(!v&&e&&o.Eb(t,r),i&&"function"!=typeof i)s=i;else{var w=o.J.instance,b=w.getBindingAccessors||y,h=o.h(function(){return(s=i?i(r,t):b.call(w,t,r))&&r.D&&r.D(),s},null,{G:t});s&&h.ga()||(h=null)}return s&&(a=h?function(n){return function(){return u(h()[n])}}:function(n){return s[n]},c=function(){return o.a.Oa(h?h():s,u)},c.get=function(n){return s[n]&&u(a(n))},c.has=function(n){return n in s},e=p(s),o.a.r(e,function(i){var e=i.pb.init,h=i.pb.update,u=i.key;if(8===t.nodeType&&!o.e.Q[u])throw Error("The binding '"+u+"' cannot be used with virtual elements");try{"function"==typeof e&&o.k.t(function(){var i=e(t,a(u),c,r.$data,r);if(i&&i.controlsDescendantBindings){if(l!==n)throw Error("Multiple bindings ("+l+" and "+u+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");l=u}});"function"==typeof h&&o.h(function(){h(t,a(u),c,r.$data,r)},null,{G:t})}catch(f){throw f.message='Unable to process binding "'+u+": "+s[u]+'"\nMessage: '+f.message,f;}})),{shouldBindDescendants:l===n}}function i(n){return n&&n instanceof o.I?n:new o.I(n)}var a,f,e;o.d={};a={script:!0};o.getBindingHandler=function(n){return o.d[n]};o.I=function(t,i,r,u){var f=this,h="function"==typeof t&&!o.v(t),s,e=o.h(function(){var s=h?t():t,n=o.a.c(s);return i?(i.D&&i.D(),o.a.extend(f,i),e&&(f.D=e)):(f.$parents=[],f.$root=n,f.ko=o),f.$rawData=s,f.$data=n,r&&(f[r]=n),u&&u(f,i,n),f.$data},null,{Da:function(){return s&&!o.a.eb(s)},G:!0});e.ga()&&(f.D=e,e.equalityComparer=null,s=[],e.Jb=function(t){s.push(t);o.a.u.ja(t,function(t){o.a.ma(s,t);s.length||(e.F(),f.D=e=n)})})};o.I.prototype.createChildContext=function(n,t,i){return new o.I(n,this,t,function(n,t){n.$parentContext=t;n.$parent=t.$data;n.$parents=(t.$parents||[]).slice(0);n.$parents.unshift(n.$parent);i&&i(n)})};o.I.prototype.extend=function(n){return new o.I(this.D||this.$data,this,null,function(t,i){t.$rawData=i.$rawData;o.a.extend(t,"function"==typeof n?n():n)})};f=o.a.f.L();e=o.a.f.L();o.Eb=function(n,t){if(2==arguments.length)o.a.f.set(n,e,t),t.D&&t.D.Jb(n);else return o.a.f.get(n,e)};o.xa=function(n,t,r){return 1===n.nodeType&&o.e.wb(n),l(n,t,i(r),!0)};o.Lb=function(n,t,r){return r=i(r),o.xa(n,"function"==typeof t?s(t.bind(null,r,n)):o.a.Oa(t,v),r)};o.gb=function(n,t){1!==t.nodeType&&8!==t.nodeType||h(i(n),t,!0)};o.fb=function(n,u){if(!t&&r.jQuery&&(t=r.jQuery),u&&1!==u.nodeType&&8!==u.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");u=u||r.document.body;c(i(n),u,!0)};o.Ca=function(t){switch(t.nodeType){case 1:case 8:var i=o.Eb(t);if(i)return i;if(t.parentNode)return o.Ca(t.parentNode)}return n};o.Pb=function(t){return(t=o.Ca(t))?t.$data:n};o.b("bindingHandlers",o.d);o.b("applyBindings",o.fb);o.b("applyBindingsToDescendants",o.gb);o.b("applyBindingAccessorsToNode",o.xa);o.b("applyBindingsToNode",o.Lb);o.b("contextFor",o.Ca);o.b("dataFor",o.Pb)}();y={"class":"className","for":"htmlFor"};o.d.attr={update:function(t,i){var r=o.a.c(i())||{};o.a.A(r,function(i,r){r=o.a.c(r);var u=!1===r||null===r||r===n;u&&t.removeAttribute(i);8>=o.a.oa&&i in y?(i=y[i],u?t.removeAttribute(i):t[i]=r):u||t.setAttribute(i,r.toString());"name"===i&&o.a.Cb(t,u?"":r.toString())})}},function(){o.d.checked={after:["value","attr"],init:function(t,i,r){function u(){return r.has("checkedValue")?o.a.c(r.get("checkedValue")):t.value}function c(){var c=t.checked,n=a?u():c,s;o.ca.pa()||f&&!c||(s=o.k.t(i),e?h!==n?(c&&(o.a.Y(s,n,!0),o.a.Y(s,h,!1)),h=n):o.a.Y(s,n,c):o.g.va(s,r,"checked",n,!0))}function l(){var n=o.a.c(i());t.checked=e?0<=o.a.l(n,u()):s?n:u()===n}var s="checkbox"==t.type,f="radio"==t.type;if(s||f){var e=s&&o.a.c(i())instanceof Array,h=e?u():n,a=f||e;f&&!t.name&&o.d.uniqueName.init(t,function(){return!0});o.ba(c,null,{G:t});o.a.q(t,"click",c);o.ba(l,null,{G:t})}}};o.g.W.checked=!0;o.d.checkedValue={update:function(n,t){n.value=o.a.c(t())}}}();o.d.css={update:function(n,t){var i=o.a.c(t());"object"==typeof i?o.a.A(i,function(t,i){i=o.a.c(i);o.a.ua(n,t,i)}):(i=String(i||""),o.a.ua(n,n.__ko__cssValue,!1),n.__ko__cssValue=i,o.a.ua(n,i,!0))}};o.d.enable={update:function(n,t){var i=o.a.c(t());i&&n.disabled?n.removeAttribute("disabled"):i||n.disabled||(n.disabled=!0)}};o.d.disable={update:function(n,t){o.d.enable.update(n,function(){return!o.a.c(t())})}};o.d.event={init:function(n,t,i,r,u){var f=t()||{};o.a.A(f,function(f){"string"==typeof f&&o.a.q(n,f,function(n){var s,h=t()[f],e;if(h){try{e=o.a.R(arguments);r=u.$data;e.unshift(r);s=h.apply(r,e)}finally{!0!==s&&(n.preventDefault?n.preventDefault():n.returnValue=!1)}!1===i.get(f+"Bubble")&&(n.cancelBubble=!0,n.stopPropagation&&n.stopPropagation())}})})}};o.d.foreach={vb:function(n){return function(){var i=n(),t=o.a.Sa(i);return!t||"number"==typeof t.length?{foreach:i,templateEngine:o.K.Ja}:(o.a.c(i),{foreach:t.data,as:t.as,includeDestroyed:t.includeDestroyed,afterAdd:t.afterAdd,beforeRemove:t.beforeRemove,afterRender:t.afterRender,beforeMove:t.beforeMove,afterMove:t.afterMove,templateEngine:o.K.Ja})}},init:function(n,t){return o.d.template.init(n,o.d.foreach.vb(t))},update:function(n,t,i,r,u){return o.d.template.update(n,o.d.foreach.vb(t),i,r,u)}};o.g.aa.foreach=!1;o.e.Q.foreach=!0;o.d.hasfocus={init:function(n,t,i){function r(r){var u,f;if(n.__ko_hasfocusUpdating=!0,u=n.ownerDocument,"activeElement"in u){try{f=u.activeElement}catch(e){f=u.body}r=f===n}u=t();o.g.va(u,i,"hasfocus",r,!0);n.__ko_hasfocusLastValue=r;n.__ko_hasfocusUpdating=!1}var u=r.bind(null,!0),f=r.bind(null,!1);o.a.q(n,"focus",u);o.a.q(n,"focusin",u);o.a.q(n,"blur",f);o.a.q(n,"focusout",f)},update:function(n,t){var i=!!o.a.c(t());n.__ko_hasfocusUpdating||n.__ko_hasfocusLastValue===i||(i?n.focus():n.blur(),o.k.t(o.a.ha,null,[n,i?"focusin":"focusout"]))}};o.g.W.hasfocus=!0;o.d.hasFocus=o.d.hasfocus;o.g.W.hasFocus=!0;o.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t){o.a.Va(n,t())}};v("if");v("ifnot",!1,!0);v("with",!0,!1,function(n,t){return n.createChildContext(t)});l={};o.d.options={init:function(n){if("select"!==o.a.B(n))throw Error("options binding applies only to SELECT elements");for(;0<n.length;)n.remove(0);return{controlsDescendantBindings:!0}},update:function(t,i,r){function c(){return o.a.la(t.options,function(n){return n.selected})}function a(n,t,i){var r=typeof t;return"function"==r?t(n):"string"==r?n[t]:i}function v(n,i){if(f.length){var r=0<=o.a.l(f,o.i.p(i[0]));o.a.Db(i[0],r);h&&!r&&o.k.t(o.a.ha,null,[t,"change"])}}var e=0!=t.length&&t.multiple?t.scrollTop:null,u=o.a.c(i()),y=r.get("optionsIncludeDestroyed"),s,f,h;i={};f=t.multiple?o.a.ya(c(),o.i.p):0<=t.selectedIndex?[o.i.p(t.options[t.selectedIndex])]:[];u&&("undefined"==typeof u.length&&(u=[u]),s=o.a.la(u,function(t){return y||t===n||null===t||!o.a.c(t._destroy)}),r.has("optionsCaption")&&(u=o.a.c(r.get("optionsCaption")),null!==u&&u!==n&&s.unshift(l)));h=!1;i.beforeRemove=function(n){t.removeChild(n)};u=v;r.has("optionsAfterRender")&&(u=function(t,i){v(0,i);o.k.t(r.get("optionsAfterRender"),null,[i[0],t!==l?t:n])});o.a.Ua(t,s,function(i,u,e){return e.length&&(f=e[0].selected?[o.i.p(e[0])]:[],h=!0),u=t.ownerDocument.createElement("option"),i===l?(o.a.Xa(u,r.get("optionsCaption")),o.i.X(u,n)):(e=a(i,r.get("optionsValue"),i),o.i.X(u,o.a.c(e)),i=a(i,r.get("optionsText"),e),o.a.Xa(u,i)),[u]},i,u);o.k.t(function(){r.get("valueAllowUnset")&&r.has("value")?o.i.X(t,o.a.c(r.get("value")),!0):(t.multiple?f.length&&c().length<f.length:f.length&&0<=t.selectedIndex?o.i.p(t.options[t.selectedIndex])!==f[0]:f.length||0<=t.selectedIndex)&&o.a.ha(t,"change")});o.a.Tb(t);e&&20<Math.abs(e-t.scrollTop)&&(t.scrollTop=e)}};o.d.options.Pa=o.a.f.L();o.d.selectedOptions={after:["options","foreach"],init:function(n,t,i){o.a.q(n,"change",function(){var u=t(),r=[];o.a.r(n.getElementsByTagName("option"),function(n){n.selected&&r.push(o.i.p(n))});o.g.va(u,i,"selectedOptions",r)})},update:function(n,t){if("select"!=o.a.B(n))throw Error("values binding applies only to SELECT elements");var i=o.a.c(t());i&&"number"==typeof i.length&&o.a.r(n.getElementsByTagName("option"),function(n){var t=0<=o.a.l(i,o.i.p(n));o.a.Db(n,t)})}};o.g.W.selectedOptions=!0;o.d.style={update:function(n,t){var i=o.a.c(t()||{});o.a.A(i,function(t,i){i=o.a.c(i);n.style[t]=i||""})}};o.d.submit={init:function(n,t,i,r,u){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");o.a.q(n,"submit",function(i){var r,f=t();try{r=f.call(u.$data,n)}finally{!0!==r&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}};o.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t){o.a.Xa(n,t())}};o.e.Q.text=!0;o.d.uniqueName={init:function(n,t){if(t()){var i="ko_unique_"+ ++o.d.uniqueName.Ob;o.a.Cb(n,i)}}};o.d.uniqueName.Ob=0;o.d.value={after:["options","foreach"],init:function(n,t,i){function e(){f=!1;var r=t(),u=o.i.p(n);o.g.va(r,i,"value",u)}var r=["change"],u=i.get("valueUpdate"),f=!1;u&&("string"==typeof u&&(u=[u]),o.a.$(r,u),r=o.a.ib(r));!o.a.oa||"input"!=n.tagName.toLowerCase()||"text"!=n.type||"off"==n.autocomplete||n.form&&"off"==n.form.autocomplete||-1!=o.a.l(r,"propertychange")||(o.a.q(n,"propertychange",function(){f=!0}),o.a.q(n,"focus",function(){f=!1}),o.a.q(n,"blur",function(){f&&e()}));o.a.r(r,function(t){var i=e;o.a.kc(t,"after")&&(i=function(){setTimeout(e,0)},t=t.substring(5));o.a.q(n,t,i)})},update:function(n,t,i){var r=o.a.c(t()),u;t=o.i.p(n);r!==t&&("select"===o.a.B(n)?(u=i.get("valueAllowUnset"),i=function(){o.i.X(n,r,u)},i(),u||r===o.i.p(n)?setTimeout(i,0):o.k.t(o.a.ha,null,[n,"change"])):o.i.X(n,r))}};o.g.W.value=!0;o.d.visible={update:function(n,t){var i=o.a.c(t()),r="none"!=n.style.display;i&&!r?n.style.display="":!i&&r&&(n.style.display="none")}},function(n){o.d[n]={init:function(t,i,r,u,f){return o.d.event.init.call(this,t,function(){var t={};return t[n]=i(),t},r,u,f)}}}("click");o.C=function(){};o.C.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");};o.C.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};o.C.prototype.makeTemplateSource=function(n,t){if("string"==typeof n){t=t||i;var r=t.getElementById(n);if(!r)throw Error("Cannot find template with ID "+n);return new o.n.j(r)}if(1==n.nodeType||8==n.nodeType)return new o.n.Z(n);throw Error("Unknown template type: "+n);};o.C.prototype.renderTemplate=function(n,t,i,r){return n=this.makeTemplateSource(n,r),this.renderTemplateSource(n,t,i)};o.C.prototype.isTemplateRewritten=function(n,t){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(n,t).data("isRewritten")};o.C.prototype.rewriteTemplate=function(n,t,i){n=this.makeTemplateSource(n,i);t=t(n.text());n.text(t);n.data("isRewritten",!0)};o.b("templateEngine",o.C);o.Za=function(){function n(n,t,i,r){var s,f,u,e;for(n=o.g.Ra(n),s=o.g.aa,f=0;f<n.length;f++)if(u=n[f].key,s.hasOwnProperty(u))if(e=s[u],"function"==typeof e){if(u=e(n[f].value))throw Error(u);}else if(!e)throw Error("This template engine does not support the '"+u+"' binding within its templates");return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+o.g.qa(n,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')",r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Ub:function(n,t,i){t.isTemplateRewritten(n,i)||t.rewriteTemplate(n,function(n){return o.Za.dc(n,t)},i)},dc:function(r,u){return r.replace(t,function(t,i,r,f,e){return n(e,i,r,u)}).replace(i,function(t,i){return n(i,"<!-- ko -->","#comment",u)})},Mb:function(n,t){return o.w.Na(function(i,r){var u=i.nextSibling;u&&u.nodeName.toLowerCase()===t&&o.xa(u,n,r)})}}}();o.b("__tr_ambtns",o.Za.Mb),function(){var i,t;o.n={};o.n.j=function(n){this.j=n};o.n.j.prototype.text=function(){var n=o.a.B(this.j),n="script"===n?"text":"textarea"===n?"value":"innerHTML",t;if(0==arguments.length)return this.j[n];t=arguments[0];"innerHTML"===n?o.a.Va(this.j,t):this.j[n]=t};i=o.a.f.L()+"_";o.n.j.prototype.data=function(n){if(1===arguments.length)return o.a.f.get(this.j,i+n);o.a.f.set(this.j,i+n,arguments[1])};t=o.a.f.L();o.n.Z=function(n){this.j=n};o.n.Z.prototype=new o.n.j;o.n.Z.prototype.text=function(){if(0==arguments.length){var i=o.a.f.get(this.j,t)||{};return i.$a===n&&i.Ba&&(i.$a=i.Ba.innerHTML),i.$a}o.a.f.set(this.j,t,{$a:arguments[0]})};o.n.j.prototype.nodes=function(){if(0==arguments.length)return(o.a.f.get(this.j,t)||{}).Ba;o.a.f.set(this.j,t,{Ba:arguments[0]})};o.b("templateSources",o.n);o.b("templateSources.domElement",o.n.j);o.b("templateSources.anonymousTemplate",o.n.Z)}(),function(){function t(n,t,i){var r;for(t=o.e.nextSibling(t);n&&(r=n)!==t;)n=o.e.nextSibling(r),i(r,n)}function f(n,i){if(n.length){var r=n[0],u=n[n.length-1],f=r.parentNode,e=o.J.instance,s=e.preprocessNode;if(s){if(t(r,u,function(n,t){var f=n.previousSibling,i=s.call(e,n);i&&(n===r&&(r=i[0]||t),n===u&&(u=i[i.length-1]||f))}),n.length=0,!r)return;r===u?n.push(r):(n.push(r,u),o.a.ea(n,f))}t(r,u,function(n){1!==n.nodeType&&8!==n.nodeType||o.fb(i,n)});t(r,u,function(n){1!==n.nodeType&&8!==n.nodeType||o.w.Ib(n,[i])});o.a.ea(n,f)}}function i(n){return n.nodeType?n:0<n.length?n[0]:null}function e(n,t,u,e,s){s=s||{};var h=n&&i(n),h=h&&h.ownerDocument,c=s.templateEngine||r;if(o.Za.Ub(u,c,h),u=c.renderTemplate(u,e,s,h),"number"!=typeof u.length||0<u.length&&"number"!=typeof u[0].nodeType)throw Error("Template engine must return an array of DOM nodes");h=!1;switch(t){case"replaceChildren":o.e.U(n,u);h=!0;break;case"replaceNode":o.a.Bb(n,u);h=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t);}return h&&(f(u,e),s.afterRender&&o.k.t(s.afterRender,null,[u,e.$data])),u}var r,u;o.Wa=function(t){if(t!=n&&!(t instanceof o.C))throw Error("templateEngine must inherit from ko.templateEngine");r=t};o.Ta=function(t,u,f,s,h){if(f=f||{},(f.templateEngine||r)==n)throw Error("Set a template engine before calling renderTemplate");if(h=h||"replaceChildren",s){var c=i(s);return o.h(function(){var n=u&&u instanceof o.I?u:new o.I(o.a.c(u)),r=o.v(t)?t():"function"==typeof t?t(n.$data,n):t,n=e(s,h,r,n,f);"replaceNode"==h&&(s=n,c=i(s))},null,{Da:function(){return!c||!o.a.Ea(c)},G:c&&"replaceNode"==h?c.parentNode:c})}return o.w.Na(function(n){o.Ta(t,u,f,n,"replaceNode")})};o.jc=function(t,i,r,u,s){function c(n,t){f(t,h);r.afterRender&&r.afterRender(t,n)}function l(n,i){h=s.createChildContext(n,r.as,function(n){n.$index=i});var u="function"==typeof t?t(n,h):t;return e(null,"ignoreTargetNode",u,h,r)}var h;return o.h(function(){var t=o.a.c(i)||[];"undefined"==typeof t.length&&(t=[t]);t=o.a.la(t,function(t){return r.includeDestroyed||t===n||null===t||!o.a.c(t._destroy)});o.k.t(o.a.Ua,null,[u,t,l,r,c])},null,{G:u})};u=o.a.f.L();o.d.template={init:function(n,t){var i=o.a.c(t());return"string"==typeof i||i.name?o.e.da(n):(i=o.e.childNodes(n),i=o.a.ec(i),new o.n.Z(n).nodes(i)),{controlsDescendantBindings:!0}},update:function(t,i,r,f,e){var h=i(),s;i=o.a.c(h);r=!0;f=null;"string"==typeof i?i={}:(h=i.name,"if"in i&&(r=o.a.c(i["if"])),r&&"ifnot"in i&&(r=!o.a.c(i.ifnot)),s=o.a.c(i.data));"foreach"in i?f=o.jc(h||t,r&&i.foreach||[],i,t,e):r?(e="data"in i?e.createChildContext(s,i.as):e,f=o.Ta(h||t,e,i,t)):o.e.da(t);e=f;(s=o.a.f.get(t,u))&&"function"==typeof s.F&&s.F();o.a.f.set(t,u,e&&e.ga()?e:n)}};o.g.aa.template=function(n){return n=o.g.Ra(n),1==n.length&&n[0].unknown||o.g.bc(n,"name")?null:"This template engine does not support anonymous templates nested within its templates"};o.e.Q.template=!0}();o.b("setTemplateEngine",o.Wa);o.b("renderTemplate",o.Ta);o.a.nb=function(n,t,i){if(n.length&&t.length)for(var o,r,f,e,u=o=0;(!i||u<i)&&(f=n[o]);++o){for(r=0;e=t[r];++r)if(f.value===e.value){f.moved=e.index;e.moved=f.index;t.splice(r,1);u=r=0;break}u+=r}};o.a.Aa=function(){function n(n,t,i,r,u){for(var s=Math.min,l=Math.max,a=[],c=n.length,f,h=t.length,v=h-c||1,w=c+h+1,y,p,b,e=0;e<=c;e++)for(p=y,a.push(y=[]),b=s(h,e+v),f=l(0,e-1);f<=b;f++)y[f]=f?e?n[e-1]===t[f-1]?p[f-1]:s(p[f]||w,y[f-1]||w)+1:f+1:e+1;for(s=[],l=[],v=[],e=c,f=h;e||f;)h=a[e][f]-1,f&&h===a[e][f-1]?l.push(s[s.length]={status:i,value:t[--f],index:f}):e&&h===a[e-1][f]?v.push(s[s.length]={status:r,value:n[--e],index:e}):(--f,--e,u.sparse||s.push({status:"retained",value:t[f]}));return o.a.nb(l,v,10*c),s.reverse()}return function(t,i,r){return r="boolean"==typeof r?{dontLimitMoves:r}:r||{},t=t||[],i=i||[],t.length<=i.length?n(t,i,"added","deleted",r):n(i,t,"deleted","added",r)}}();o.b("utils.compareArrays",o.a.Aa),function(){function i(t,i,r,u,f){var e=[],s=o.h(function(){var n=i(r,f,o.a.ea(e,t))||[];0<e.length&&(o.a.Bb(e,n),u&&o.k.t(u,null,[r,n,f]));e.length=0;o.a.$(e,n)},null,{G:t,Da:function(){return!o.a.eb(e)}});return{S:e,h:s.ga()?s:n}}var t=o.a.f.L();o.a.Ua=function(r,u,f,e,s){function rt(n,t){h=d[t];nt!==t&&(it[n]=h);h.Ia(nt++);o.a.ea(h.S,r);g.push(h);w.push(h)}function y(n,t){if(n)for(var i=0,r=t.length;i<r;i++)t[i]&&o.a.r(t[i].S,function(r){n(r,i,t[i].ka)})}var c,v,ut;u=u||[];e=e||{};var v=o.a.f.get(r,t)===n,d=o.a.f.get(r,t)||[],p=o.a.ya(d,function(n){return n.ka}),l=o.a.Aa(p,u,e.dontLimitMoves),g=[],a=0,nt=0,tt=[],w=[];u=[];for(var it=[],p=[],h,c=0,b,k;b=l[c];c++)switch(k=b.moved,b.status){case"deleted":k===n&&(h=d[a],h.h&&h.h.F(),tt.push.apply(tt,o.a.ea(h.S,r)),e.beforeRemove&&(u[c]=h,w.push(h)));a++;break;case"retained":rt(c,a++);break;case"added":k!==n?rt(c,k):(h={ka:b.value,Ia:o.m(nt++)},g.push(h),w.push(h),v||(p[c]=h))}for(y(e.beforeMove,it),o.a.r(tt,e.beforeRemove?o.M:o.removeNode),c=0,v=o.e.firstChild(r);h=w[c];c++){for(h.S||o.a.extend(h,i(r,f,h.ka,s,h.Ia)),a=0;l=h.S[a];v=l.nextSibling,ut=l,a++)l!==v&&o.e.rb(r,l,ut);!h.Zb&&s&&(s(h.ka,h.S,h.Ia),h.Zb=!0)}y(e.beforeRemove,u);y(e.afterMove,it);y(e.afterAdd,p);o.a.f.set(r,t,g)}}();o.b("utils.setDomNodeChildrenFromArrayMapping",o.a.Ua);o.K=function(){this.allowTemplateRewriting=!1};o.K.prototype=new o.C;o.K.prototype.renderTemplateSource=function(n){var t=(9>o.a.oa?0:n.nodes)?n.nodes():null;return t?o.a.R(t.cloneNode(!0).childNodes):(n=n.text(),o.a.Qa(n))};o.K.Ja=new o.K;o.Wa(o.K.Ja);o.b("nativeTemplateEngine",o.K),function(){o.La=function(){var n=this.ac=function(){if(!t||!t.tmpl)return 0;try{if(0<=t.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(n){}return 1}();this.renderTemplateSource=function(r,u,f){if(f=f||{},2>n)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var e=r.data("precompiled");return e||(e=r.text()||"",e=t.template(null,"{{ko_with $item.koBindingContext}}"+e+"{{/ko_with}}"),r.data("precompiled",e)),r=[u.$data],u=t.extend({koBindingContext:u},f.templateOptions),u=t.tmpl(e,r,u),u.appendTo(i.createElement("div")),t.fragments={},u};this.createJavaScriptEvaluatorBlock=function(n){return"{{ko_code ((function() { return "+n+" })()) }}"};this.addTemplate=function(n,t){i.write("<script type='text/html' id='"+n+"'>"+t+"<\/script>")};0<n&&(t.tmpl.tag.ko_code={open:"__.push($1 || '');"},t.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};o.La.prototype=new o.C;var n=new o.La;0<n.ac&&o.Wa(n);o.b("jqueryTmplTemplateEngine",o.La)}()})})()}();loggedIn=!1;setResponsiveClass();setMobileAndTabletRules();initializeIngredientPush();addIngredient();initializeDecider();$R(".content-main img").length>0?imagesLoaded(".content-main",function(){initializeTiles()}):initializeTiles();$R(document).ready(function(){var r=$R("body").attr("class"),n,t,i;console.log(r);getCookie("Email")!=""?(n=getCookie("Email"),$R.ajax({type:"GET",contentType:"application/json;charset=utf-8",url:"/Umbraco/api/RegisterUser/CheckShowAds",data:{email:n},success:function(n){var r,t,i;setCookie("PaidMember",n.paidmember,365);r=getCookie("ShowAds");n.paidmember.toLowerCase()=="false"&&(t=$R(".bannerAds").detach(),t.prependTo(".bannerAdContainer"),i=$R(".content-rail-items").detach(),i.prependTo(".content-rail"),$R(".bannerAdContainer").removeAttr("style"),$R(".bannerAdContainer").slideDown(400))},error:function(n){console.log(n)}})):(t=$R(".bannerAds").detach(),t.prependTo(".bannerAdContainer"),i=$R(".content-rail-items").detach(),i.prependTo(".content-rail"),$R(".bannerAdContainer").removeAttr("style"),$R(".bannerAdContainer").slideDown(400))});InitializeCarousels();setChecks();stickyChecks();filterRecipes();ViewModels={KeydownSearchRecipes:ko.observableArray([]),showResults:function(n){n.nodeType===1&&$R(n).hide().fadeIn()}};searchBox();searchInitialize();typeof ko!="undefined"&&ko.applyBindings(ViewModels);initializeComments();initializeRecipeForm();initializeSurveys()