function filterPlans(n){hideAllBanners();n==="planDetailButton"?($("#sideBarHeader").html(ResourceGlobalizer.formatMessage("ViewMyPlans/ViewPlans")),$("#billingDropPanel").hide()):n==="billingButton"?($(".billingButton").length&&$("#billingDropPanel").show(),$("#sideBarHeader").html(ResourceGlobalizer.formatMessage("ViewMyPlans/ManageBilling"))):($("#sideBarHeader").html(ResourceGlobalizer.formatMessage("ViewMyPlans/ViewClaims")),$("#billingDropPanel").hide());hideOrShowPlanWraps(n);showSpecificBanner(n)}function hideOrShowPlanWraps(n){$("#singleContent .plans-wrap").each(function(){n!="planDetailButton"?$(this).find("."+n).length==0?$(this).hide():n!="planDetailButton"&&n!="billingButton"?$(this).find(".claimStatus").length?$(this).find(".claimStatus").html().toLowerCase().indexOf("no pending")!=-1?$(this).hide():$(this).show():$(this).hide():$(this).show():$(this).show()})}function showSpecificBanner(n){$(".plans-wrap:visible").length||(n=="billingButton"&&$("#noBilling").show(),n=="planDetailButton"&&$("#noWarranties").show(),n=="fileClaimButton"&&$("#noClaims").show())}function hideAllBanners(){$("#noBilling").hide();$("#noClaims").hide();$("#noWarranties").hide()}function loadOrShowBillingSnapShot(n,t,i){$(i).closest(".plans-wrap").find(".billingSnapShotDiv").length!=0?$(i).closest(".plans-wrap").find(".billing").toggle():doInitialBillingLoad(n,t,$(i).closest(".plans-wrap").find(".billing"))}function loadOrShowStatusHistory(n,t){$(t).closest(".plans-wrap").find(".roStatusRow").length!=0?$(t).closest(".plans-wrap").find(".ro-status").toggle():doInitialRoLoad(n,$(t).closest(".plans-wrap").find(".ro-status"))}function loadOrShowMoreDetails(n,t,i){$(i).closest(".plans-wrap").find(".protectionPlanDetail").length!=0?$(i).closest(".plans-wrap").find(".more-details").toggle():doInitialMoreDetailLoad(n,t,$(i).closest(".plans-wrap").find(".more-details"))}function doInitialBillingLoad(n,t,i){var r={valNum:n,policyId:t};$.ajax({type:"POST",url:$("#billingSnapShotUrl").data("url"),contentType:"application/json",data:JSON.stringify(r),success:function(n){$(i).html(n);$(i).toggle()}})}function doInitialRoLoad(n,t){var i={roNumber:n};$.ajax({type:"POST",url:$("#roStatusUrl").data("url"),contentType:"application/json",data:JSON.stringify(i),success:function(n){$(t).html(n);$(t).toggle()}})}function doInitialMoreDetailLoad(n,t,i){var r={valNum:n,status:t};$.ajax({type:"POST",url:$("#moreDetailsUrl").data("url"),contentType:"application/json",data:JSON.stringify(r),success:function(n){$(i).html(n);$(i).toggle()}})}function select_changed(){$("a[class*='tab']").each(function(){$(this).removeClass("active")});$("select[name*='plan-select']").each(function(){var n=$(this).val();$(".tab-content").not(this).removeClass("display");$("#"+n).addClass("display");$("."+n).addClass("display");$(".breakdown").addClass("display")})}function select_plan_changed(){$("select[name*='plan-option-select']").each(function(){$(".plan-option-section").hide();var n=$(this).val();$("."+n).show()})}function postToBillingPage(n,t){$("#formPolicyId").val(n);$("#formPlanId").val(t);$("#billingPostForm").submit()}function postToFileClaim(n){$("#fileClaimVal").val(n);$("#fileForm").submit()}$(document).ready(function(){$("select[name*='plan-select']").change(function(){select_changed()});$("select[name*='plan-option-select']").change(function(){select_plan_changed()});$(".tab").click(function(){$(".tab").not(this).removeClass("active");$(this).addClass("active");var t=$(this).hasClass("active"),n=$(this).prop("id"),i=$("select[name*='plan-select']").children("option[value="+n+"]"),r="#"+n+"Content";$(i).prop("selected",!0);t==!0&&($(".noDisplay").removeClass("display"),$(this).addClass("active"),$(r).addClass("display"))});$(".filterMenu").click(function(n){n.preventDefault?n.preventDefault():n.returnValue=!1});$(".threeOptions").click(function(){$(".threeOptions").not(this).removeClass("activeExpandedItem");$(this).addClass("activeExpandedItem");var u=$(this).hasClass("activeExpandedItem"),n=$(this).attr("data-button"),t=n=="more-details",i=n=="billing",f=n=="ro-status",r=t||i?$(this).data("valnum"):$(this).data("number"),e=t?$(this).data("status"):"",o=i?$(this).data("policy"):0;u==!0&&($(this).closest(".plans-wrap").find(".expandedItem").not("."+n).hide(),t?loadOrShowMoreDetails(r,e,$(this)):i?loadOrShowBillingSnapShot(r,o,$(this)):f?loadOrShowStatusHistory($(this).data("ro"),$(this)):n=="file-claim"?postToFileClaim(r):$(this).closest(".plans-wrap").find("."+n).toggle())});$(".view-plans").on("change","#billingDropDown",function(){var n=$("option:selected",this).attr("data-policyid"),t=$("option:selected",this).attr("data-planid");typeof n!=typeof undefined&&n!==!1&&(ShowProgress(),postToBillingPage(n,t))});$(".go-btn").click(function(n){n.preventDefault();var t=$(this).data("valnum"),i=$(this).data("cmmtype");i=="add"&&($("#addFormVal").val(t),$("#addForm").submit());i=="drop"&&($("#dropFormVal").val(t),$("#dropForm").submit())});$("#selectAClaimDropDown").on("change",function(){for(var i,r=$("option:selected",this).attr("data-number"),t=$(".plans-wrap"),n=0;n<t.length;n++)i=t.eq(n).data("id"),i!=r?t.eq(n).hide():t.eq(n).show()})})