$(function(){jlocal_fullsiteflag||$("#wrapperinner #products").length&&$("#wrapperinner #productsmobile").length&&$("#wrapperinner #productsmobile").html($("#wrapperinner #products").html());$(".related-view-all").click(function(){return $(".related-all").slideDown(),$(this).hide(),!1})});$(function(){$(".add-to-favorites").click(function(n){var t,i,r;n.preventDefault();t=$(this);i=$(".addto-txt",this);t.find("a").css("cursor","wait");r=$(this).hasClass("active")?$.ajax({url:"/MyNASFAA/RemoveFavorite",type:"post",data:{contentTypeId:t.data("contenttypeid"),contentId:t.data("contentid")},dataType:"html",success:function(n){if(n=="Not Logged In"){window.location="/MyAccount/Logon";return}t.removeClass("active").attr("title","Add to Favorites").css("cursor","");t.find("a").css("cursor","");i.html("ADD TO FAVORITES")}}):$.ajax({url:"/MyNASFAA/AddFavorite",type:"post",data:{contentTypeId:t.data("contenttypeid"),contentId:t.data("contentid")},dataType:"html",success:function(n){if(n=="Not Logged In"){window.location="/MyAccount/Logon";return}t.hasClass("no-remove")||(t.addClass("active").attr("title","Remove from Favorites"),t.find("a").css("cursor",""),i.html("FAVORITE"))}})})});$(function(){$("#comment-submit").click(function(){return $("#comment-form").submit(),!1});$("#comment-form").submit(function(){var t=$(this).find("[name=Comment]"),n=$.trim(t.val()),i=$(this).find("[name=PageID]").val(),r=$(this).find("[name=ContentTypeId]").val(),u=$(this).find("[name=ContentId]").val();return n.length==0?(alert("You must enter something into the Comments field."),!1):n.length>2e3?(alert("Comments are limited to 2000 characters.  Your comment has "+n.length+" characters."),!1):($(this).css("cursor","wait").find("input[type=submit]").addClass("disabled"),$.ajax({url:"/SiteComment/Add",type:"post",data:$(this).serialize(),dataType:"json",success:function(n){n.Spam?alert("Your comment has been identified as possible spam and has not been recorded."):n.Success?($("#comments-list").load("/SiteComment/List?viewName=_CommentList&pageID="+i+"&contentTypeId="+r+"&contentId="+u),alert("Thank you for your comment.")):alert("There was an error saving your comment.");$("#comment-form").css("cursor","").find("input[type=submit]").removeClass("disabled");$("#comment-form textarea").val("")},error:function(n,t){alert("Error: "+t)}}),!1)})})