function CrossSellOfferDataManipulation(n,t,i,r,u,f){n.length!=0&&SetCrossSellOfferListJson(t,r,n,i,u,f)}function SetCrossSellOfferListJson(n,t,i,r,u,f){var e={pageConfigId:t,countryId:0,offeritemTypeId:u,landingPageConfigId:f};AjaxGet(n,e,function(n){var t=n;window.crossSellOfferListJson=t;SetCrossSellOfferListJsonAjaxCallBack(i,r,i.val())},LoadOfferWgtListErrorCallback,{IsAysnc:!1})}function SetCrossSellOfferListJsonAjaxCallBack(n,t){n.val()!=""&&(CSDisplayDisclosureMsg(n,t),UpdateOrderTotal(!1),$("#PageType").val()=="Gift"&&UpdateGiftOrderTotal())}function CSDisplayDisclosureMsg(n,t){var r,e,u;if(window.crossSellOfferListJson!=undefined){var o=window.crossSellOfferListJson.indexOfOfferWgtId(t),i=window.crossSellOfferListJson[o],f=i.AutomaticOrManual;CSResetControls(t);n.is(":checked")&&(f=="1"?(r=i.DisclosureTxt,r!=null&&($("#DisclosureTextOfferAutoDiv_"+t).text(r),$("#DisclosureTextOfferAutoDiv_"+t).show(),$("#DisclosureTextOfferParentDiv_"+t).show())):f=="0"&&(e=i.IsDefaultChecked,u=i.OptTxt,u!=null&&($("#OptInTxtOffer_"+t).text(u),e==!0?$("#IsManualRenewOffer_"+t).attr("checked","checked"):$("#IsManualRenewOffer_"+t).removeAttr("checked","checked"),$("#DisclosureTextOfferManualDiv_"+t).show(),$("#DisclosureTextOfferParentDiv_"+t).show())))}}function CSShowHideDoNotCreateProfileRb(n){if(window.crossSellOfferListJson!=undefined){var t=window.crossSellOfferListJson.indexOfOfferWgtId(n.val()),i=window.crossSellOfferListJson[t],r=i.IsProfileReq;$(".DoNotCreateRb").hide();r=="True"?$(".DoNotCreateRb").hide():$(".DoNotCreateRb").show()}}function CSUpdateOrderTotalOfferWgt(n){var t=window.crossSellOfferListJson.indexOfOfferWgtId(n.val()),i=window.crossSellOfferListJson[t],r=i.StandardRate;$("#OrderTotal").val(r)}function LoadOfferWgtListErrorCallback(){}function CSResetControls(n){$("#DisclosureTextOfferAutoDiv_"+n).hide();$("#DisclosureTextOfferAutoDiv_"+n).text("");$("#DisclosureTextOfferManualDiv_"+n).hide();$("#DisclosureTextOfferParentDiv_"+n).hide();$("#IsManualRenewOffer_"+n).removeAttr("checked","checked");$("#OptInTxtOffer_"+n).text("")}Array.prototype.indexOfOfferWgtId=function(n){for(var t=0;t<this.length;t++)if(this[t].OfferWgtId===parseInt(n))return t;return-1}