function Unsubscribe(n,t){n!=""&&$.post("/dealoftheday/Deals/Unsubscribe",{email:n,userID:t},function(){window.location.replace("/dealoftheday/deals/Unsubscribed")})}$(function(){$.getJSON("/dealoftheday/Deals/buildSubscriptionsUrl",function(n){$("#hypMoreSubscriptions").attr("href",n.url)});$(".DetailsProdImg").css("display")!=undefined&&$(".DetailsProdImg").imageFlyout({flyoutClassName:"mockupFlyout",closeImgClass:"SuperDetailedClose",minWidth:700,minHeight:420});$.fx.speeds._default=200;$("#recommendDialog").dialog({autoOpen:!1,draggable:!1,resizable:!1,show:"blind",hide:"fade"});$("#suggestDialog").dialog({autoOpen:!1,draggable:!1,resizable:!1,show:"blind",hide:"fade"});$("#subscribeDialog").dialog({autoOpen:!1,draggable:!1,resizable:!1,show:"blind",hide:"fade"});$("body").on("click","#buyNow",function(n){n.preventDefault();$.post("/dealoftheday/sop/order/BuyItNow",{DealId:$("#hfDealID").val()},function(n){window.location.replace(n.URL)},"json")});$("#recommendForm").submit(function(){if($(this).valid()){var n=$("#typeofinsert").val();n=n=="Invite"?!0:!1;$("#Surname").val()==""&&$.post("/dealoftheday/Deals/Recommend",{RecipientName:$("#RecipientName").val(),RecipientEmail:$("#RecipientEmail").val(),SenderName:$("#recommendSenderName").val(),SenderEmail:$("#recommendSenderEmail").val(),TypeofInsert:$("#typeofinsert").val()},function(t){message(t.title,t.message,"recommendDialog",n)},"json");$("#RecipientName").val("");$("#RecipientEmail").val("");$("#recommendSenderName").val("");$("#recommendSenderEmail").val("")}else message("Oops","invalidEmail","recommendDialog","",0,"",!0);return!1});$("#suggestForm").submit(function(){return $(this).valid()?($("#Surname").val()==""&&$.post("/dealoftheday/Deals/Suggest/",{SenderEmail:$("#suggestSenderEmail").val(),Suggestion:$("#Suggestion").val()},function(n){message(n.title,n.message,"suggestDialog","",0,"",!1)},"json"),$("#suggestSenderEmail").val(""),$("#Suggestion").val("")):message("Oops","invalidEmail","suggestDialog","",0,"",!0),!1});$("#subscribeForm").submit(function(){return $(this).valid()?($("#Surname").val()==""&&$.post("/dealoftheday/Deals/Subscribe/",{SenderEmail:$("#subscribeSenderEmail").val()},function(n){message(n.title,n.message,"subscribeDialog","",0,"",!1)},"json"),$("#subscribeSenderEmail").val("")):message("Oops","invalidEmail","subscribeDialog","",0,"",!0),!1})})