function getTotals(n){$(n).find(".hdnTotal").val("0");$(n).find(".clsBundle").each(function(t,i){var r=$(i).find(".chkBundleProduct").prop("checked");r==!0&&$(i).find(".clsPrice").each(function(t,i){var r=$(i).prop("checked");if(r){var u=$(i).attr("data-price"),f=$(n).find(".hdnTotal").val(),e=parseFloat(f)+parseFloat(u);$(n).find(".hdnTotal").val(e.toFixed(2))}})});$(n).find(".spnTotal").html(parseFloat($(n).find(".hdnTotal").val())).addClass("dollarsign")}function GetTotalsForType3(n){$(n).find(".hdnTotal").val("0");var t=0;$(n).find(".clsBundleType3").each(function(i,r){var o=$(r).find(".chkBundleType3").prop("checked"),u,f,e;o?(u=$(n).find(".hdnTotal").val(),f=$(r).find(".spnBundlePrice").html(),t=parseFloat(t)+parseFloat($(r).find(".spnRegularPrice").html()),e=parseFloat(u)+parseFloat(f),$(r).find(".spnRegularPrice").addClass("dollarsign"),$(r).find(".spnBundlePrice").addClass("dollarsign"),$(n).find(".hdnTotal").val(e.toFixed(2))):($(r).find(".spnRegularPrice").html("0"),$(r).find(".spnBundlePrice").html("0"),$(r).find(".spnRegularPrice").addClass("dollarsign"),$(r).find(".spnBundlePrice").addClass("dollarsign"))});$(n).find(".spnTotal").html($(n).find(".hdnTotal").val());$(n).find(".spnTotalRegular").html(t.toFixed(2));$(n).find(".spnTotal").addClass("dollarsign");$(n).find(".spnTotalRegular").addClass("dollarsign")}function checkRadioBundle(n){$(n).each(function(){$(this).is(":checked")&&$(this).closest("label").length>0?$(this).closest("label").addClass("active"):$(this).closest("label").length>0&&$(this).closest("label").removeClass("active")})}function checkAllRegistrantTypeQuestions(){$(listProductsForBundle).each(function(n,t){var i=t.productId,r=t.productPriceId,f=t.productTypeId,e=t.EventTimeId,o=t.productPrice,u;if(CurrentProductId=i,listProductsForBundle.splice(0,1),listProductsForBundle.length==0&&(isValidateRegistrantQuestions=!0),u=IsRegistrantTypeQuestionSetAvailable(r,e,i,f),u)return $.magnificPopup.open({items:{src:"/search/registranttypequestionset?productId="+i+"&discountId="+r+"&priceType="+o},type:"iframe",closeOnBgClick:!1,mainClass:"CustomPop",callbacks:{close:function(){isValidateRegistrantQuestions=!1;listProductsForBundle=[];arrRandomOrderItemId=[]}}}),!1;isValidateRegistrantQuestions&&$(btnAddtoCart).trigger("click")})}function addToCartProductAfterRegistrantTypeQuestionSet(n){arrRandomOrderItemId.push({productId:CurrentProductId,randomOrderItemId:n});isValidateRegistrantQuestions?$(btnAddtoCart).trigger("click"):checkAllRegistrantTypeQuestions()}function checkRegistrantTypeProducts(){var t=!0,n;return listProductsForBundle.filter(function(n){return n.ProductRegistrantTypeId>0}).length>0?(n=$(listProductsForBundle.map(function(n){return n.productPriceId})).get().join(","),n&&$.ajax({type:"GET",url:"/items/getregistranttypeproducts",dataType:"json",data:{discountIds:n},async:!1,success:function(n){var i=n.split(",");listProductsForBundle=listProductsForBundle.filter(function(n){return $.inArray(n.productId,i)>-1});listProductsForBundle.length>0&&(checkAllRegistrantTypeQuestions(),t=!1)},error:function(){}})):listProductsForBundle=[],t}var BUNDLE_ADDTOCART_LINK="/bundle1/addtocart/",CurrentProductId;$(document).ready(function(){var t=$(".hdnGroupStatus").val(),n;t=="0"&&$(".clsBundleType2").length>0?($(".hdnTotal").val("0"),n=0,$(".clsBundleType2").each(function(t,i){var r=$(this).attr("data-eventCount"),u;$(i).find(".spnRegularPrice").addClass("dollarsign");$(i).find(".spnBundlePrice").addClass("dollarsign");r&&r>0&&(u=$(i).find(".spnBundlePrice").html(),n+=parseFloat(u))}),$(".hdnTotal").val(n.toFixed(2)),$(".spnTotal").html(parseFloat(n.toFixed(2))).addClass("dollarsign")):t!="0"&&$(".clsBundleType2").length>0&&($(".hdnTotal").val("0"),n=0,$(".clsBundleType2").each(function(t,i){if($(i).find(".chkBundleType2").prop("checked")){var r=$(".hdnTotal").val(),u=$(i).find(".spnBundlePrice").html();n=parseFloat(r)+parseFloat(u);$(".hdnTotal").val(n.toFixed(2))}}),$(".spnTotal").html(parseFloat(n.toFixed(2))).addClass("dollarsign"))});$("body").on("change",".chkBundleProduct",function(){getTotals($(this).closest(".clsBundleDiv"))});$("body").on("click",".clsPrice",function(){getTotals($(this).closest(".clsBundleDiv"))});$("body").on("change",".chkBundleType2",function(){var n=$(this).closest(".clsBundleDiv");$(n).find(".hdnTotal").val("0");$(n).find(".clsBundleType2").each(function(t,i){if($(i).find(".chkBundleType2").prop("checked")){var r=$(n).find(".hdnTotal").val(),u=$(i).find(".spnBundlePrice").html(),f=parseFloat(r)+parseFloat(u);$(n).find(".hdnTotal").val(f.toFixed(2))}});$(n).find(".spnTotal").html(parseFloat($(n).find(".hdnTotal").val())).addClass("dollarsign")});var isValidateRegistrantQuestions=!1,listProductsForBundle=[],arrRandomOrderItemId=[],btnAddtoCart;$("body").on("click",".btnAddToCart",function(n){var t,e,r,f,i,u;if(n.preventDefault(),$(".divProgress").show(),btnAddtoCart=$(this),t=$(this).closest(".clsBundleDiv"),hdnBundleType=$(t).find(".hdnBundleType").val(),hdnBundleType=="1")if(e=$(t).find(".hdnGroupStatus").val(),e=="0")if(r="",$(t).find(".clsBundle").each(function(n,t){var i=$(t).find(".chkBundleProduct").prop("checked");i&&(r="Yes")}),r=="Yes"){if(i=[],u=$(t).find(".hdnBundleId").val(),$(t).find(".clsBundle").each(function(n,t){var r=$(t).find(".chkBundleProduct").prop("checked");r==!0&&$(t).find(".clsPrice").each(function(n,t){var o=$(t).prop("checked"),r,f,e;o&&(r=$(t).attr("data-eventtimeId"),f=$(t).attr("data-productTypeId"),f=="3"&&(r=$(t).closest(".rdbprice").find("#clsEventTime :selected").val()),e=arrRandomOrderItemId.filter(function(n){return n.productId==$(t).attr("data-productid")}),i.push({productId:$(t).attr("data-productid"),quantity:"1",productPriceId:$(t).attr("data-priceid"),EventTimeId:r,productPrice:$(t).attr("data-price"),priceType:$(t).attr("data-priceType"),productTypeId:f,basePrice:$(t).attr("data-base"),bundleProductId:$(t).attr("data-bundleProductId"),bundleId:u,RegistrantTypeOrderItemId:e.length>0?e[0].randomOrderItemId:null,ProductRegistrantTypeId:$(t).attr("data-productRegistrantTypId")}))})}),!isValidateRegistrantQuestions&&(listProductsForBundle.length==0&&(listProductsForBundle=i),!checkRegistrantTypeProducts()))return $(".divProgress").hide(),!1;$.ajax({type:"POST",url:BUNDLE_ADDTOCART_LINK,dataType:"json",data:{listCart:JSON.stringify(i)},success:function(n){var i,r;if($(".divProgress").hide(),n&&n.addToCartItemDetails&&(i=JSON.parse(n.addToCartItemDetails),googleAnalytics.addToCartEvent(i),facebookMetaPixel.addToCartEvent(i)),n.isSendCustomerToCart==undefined||n.isSendCustomerToCart!=!0||n.IsBundleCECreditPrice)n.isSendCustomerToCart!=undefined&&n.isSendCustomerToCart==!1&&displayCartMessages(btnAddtoCart,n,"bundlePage");else return window.parent.location.href="/shoppingcart",!1;n.CartCount!=null&&n.CartCount!=""&&n.CartCount!="0"&&(r=n.Message,r!=""&&$(t).find(".btnAddToCart").attr("disabled","disabled").removeClass("btnAddToCart"),parent.$("#cartspancount").html(n.CartCount),parent.$("#cartItemList").load("/shoppingcart/getcart"));n.isCompareProduct!=undefined&&n.isCompareProduct==!0&&(parent.$("#compareProductcartspancount").html(n.compareProductCount),parent.$("#compareProductcartItemList").load(GET_COMPAREPRODUCTCART_URL));n.IsBundleCECreditPrice&&typeof displayBundlePurchaseCEMessage=="function"&&displayBundlePurchaseCEMessage(u)},error:function(){$(".divProgress").hide()}})}else $(".divProgress").hide(),alert("Please select atleast one seminar");else if(r="",f=!1,$(t).find(".clsBundleType2Group2").each(function(n,t){r="";$(t).find(".chkBundleProduct").length>0&&($(t).find(".chkBundleProduct").each(function(n,t){var i=$(t).prop("checked");i&&(r="Yes")}),r!="Yes"&&(f=!0))}),f==!0)$(".divProgress").hide(),alert("You must select atleast one seminar from each section.");else{if(i=[],u=$(t).find(".hdnBundleId").val(),$(t).find(".clsBundle").each(function(n,t){var r=$(t).find(".chkBundleProduct").prop("checked");r==!0&&$(t).find(".clsPrice").each(function(n,t){var o=$(t).prop("checked"),r,f,e;o&&(r=$(t).attr("data-eventtimeId"),f=$(t).attr("data-productTypeId"),f=="3"&&(r=$(t).closest(".rdbprice").find("#clsEventTime :selected").val()),e=arrRandomOrderItemId.filter(function(n){return n.productId==$(t).attr("data-productid")}),i.push({productId:$(t).attr("data-productid"),quantity:"1",productPriceId:$(t).attr("data-priceid"),EventTimeId:r,productPrice:$(t).attr("data-price"),priceType:$(t).attr("data-priceType"),productTypeId:f,basePrice:$(t).attr("data-base"),bundleProductId:$(t).attr("data-bundleProductId"),bundleId:u,RegistrantTypeOrderItemId:e.length>0?e[0].randomOrderItemId:null,ProductRegistrantTypeId:$(t).attr("data-productRegistrantTypId")}))})}),!isValidateRegistrantQuestions&&(listProductsForBundle.length==0&&(listProductsForBundle=i),!checkRegistrantTypeProducts()))return $(".divProgress").hide(),!1;$.ajax({type:"POST",url:BUNDLE_ADDTOCART_LINK,dataType:"json",data:{listCart:JSON.stringify(i)},success:function(n){var i,r,f;if($(".divProgress").hide(),n&&n.addToCartItemDetails&&(i=JSON.parse(n.addToCartItemDetails),googleAnalytics.addToCartEvent(i),facebookMetaPixel.addToCartEvent(i)),n.isSendCustomerToCart!=undefined&&n.isSendCustomerToCart==!0&&!n.IsBundleCECreditPrice)return window.parent.location.href="/shoppingcart",!1;n.CartCount!=null&&n.CartCount!=""&&n.CartCount!="0"?($(t).siblings(".divBundleMessage").show(),r=n.Message,r!=""?($(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(r),$(t).find(".btnAddToCart").attr("disabled","disabled").removeClass("btnAddToCart")):$(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(n.ErrorMessage),parent.$("#cartspancount").html(n.CartCount),parent.$("#cartItemList").load("/shoppingcart/getcart")):($(t).siblings(".divBundleMessage").show(),f=n.ErrorMessage,f!=""&&$(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(f));n.isCompareProduct!=undefined&&n.isCompareProduct==!0&&(parent.$("#compareProductcartspancount").html(n.compareProductCount),parent.$("#compareProductcartItemList").load(GET_COMPAREPRODUCTCART_URL));n.IsBundleCECreditPrice&&typeof displayBundlePurchaseCEMessage=="function"&&displayBundlePurchaseCEMessage(u)},error:function(){$(".divProgress").hide()}})}if(hdnBundleType=="2"||hdnBundleType=="4"){var i=[],u=$(t).find(".hdnBundleId").val(),e=$(t).find(".hdnGroupStatus").val();if(e==0){if($(t).find(".clsBundleType2").each(function(n,t){$(t).find(".clsPriceBundle2").each(function(n,t){var o=$(t).prop("checked"),r,f,e;o&&(r=$(t).attr("data-eventtimeId"),f=$(t).attr("data-productTypeId"),f=="3"&&(r=$(t).closest(".rdbprice").find("#clsEventTime :selected").val()),e=arrRandomOrderItemId.filter(function(n){return n.productId==$(t).attr("data-productid")}),i.push({productId:$(t).attr("data-productid"),quantity:"1",productPriceId:$(t).attr("data-priceid"),EventTimeId:r,productPrice:$(t).attr("data-bundleprice"),priceType:$(t).attr("data-priceType"),productTypeId:f,basePrice:$(t).attr("data-base"),bundleProductId:$(t).attr("data-bundleProductId"),bundleId:u,RegistrantTypeOrderItemId:e.length>0?e[0].randomOrderItemId:null,ProductRegistrantTypeId:$(t).attr("data-productRegistrantTypId")}))})}),!isValidateRegistrantQuestions&&(listProductsForBundle.length==0&&(listProductsForBundle=i),!checkRegistrantTypeProducts()))return $(".divProgress").hide(),!1;$.ajax({type:"POST",url:BUNDLE_ADDTOCART_LINK,dataType:"json",data:{listCart:JSON.stringify(i)},success:function(n){var i,r,f;if($(".divProgress").hide(),n&&n.addToCartItemDetails&&(i=JSON.parse(n.addToCartItemDetails),googleAnalytics.addToCartEvent(i),facebookMetaPixel.addToCartEvent(i)),n.isSendCustomerToCart!=undefined&&n.isSendCustomerToCart==!0&&!n.IsBundleCECreditPrice)return window.parent.location.href="/shoppingcart",!1;n.CartCount!=null&&n.CartCount!=""&&n.CartCount!="0"?($(t).siblings(".divBundleMessage").show(),r=n.Message,r!=""?($(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(r),$(t).find(".btnAddToCart").attr("disabled","disabled").removeClass("btnAddToCart")):$(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(n.ErrorMessage),parent.$("#cartspancount").html(n.CartCount),parent.$("#cartItemList").load("/shoppingcart/getcart")):($(t).siblings(".divBundleMessage").show(),f=n.ErrorMessage,f!=""&&$(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(f));n.isCompareProduct!=undefined&&n.isCompareProduct==!0&&(parent.$("#compareProductcartspancount").html(n.compareProductCount),parent.$("#compareProductcartItemList").load(GET_COMPAREPRODUCTCART_URL));n.IsBundleCECreditPrice&&typeof displayBundlePurchaseCEMessage=="function"&&displayBundlePurchaseCEMessage(u)},error:function(){$(".divProgress").hide()}})}else{if(r="",f=!1,$(t).find(".clsGroupStatus2").each(function(n,t){r="";$(t).find(".chkBundleType2").length>0&&($(t).find(".chkBundleType2").each(function(n,t){var i=$(t).prop("checked");i&&(r="Yes")}),r!="Yes"&&(f=!0))}),f==!0)$(".divProgress").hide(),alert("You must select atleast one seminar from each section.");else{if($(t).find(".clsBundleType2").each(function(n,t){$(t).find(".chkBundleType2").prop("checked")&&$(t).find(".clsPriceBundle2").each(function(n,t){var o=$(t).prop("checked"),r,f,e;o&&(r=$(t).attr("data-eventtimeId"),f=$(t).attr("data-productTypeId"),f=="3"&&(r=$(t).closest(".rdbprice").find("#clsEventTime :selected").val()),e=arrRandomOrderItemId.filter(function(n){return n.productId==$(t).attr("data-productid")}),i.push({productId:$(t).attr("data-productid"),quantity:"1",productPriceId:$(t).attr("data-priceid"),EventTimeId:r,productPrice:$(t).attr("data-bundleprice"),priceType:$(t).attr("data-priceType"),productTypeId:f,basePrice:$(t).attr("data-base"),bundleProductId:$(t).attr("data-bundleProductId"),bundleId:u,RegistrantTypeOrderItemId:e.length>0?e[0].randomOrderItemId:null,ProductRegistrantTypeId:$(t).attr("data-productRegistrantTypId")}))})}),!isValidateRegistrantQuestions&&(listProductsForBundle.length==0&&(listProductsForBundle=i),!checkRegistrantTypeProducts()))return $(".divProgress").hide(),!1;$.ajax({type:"POST",url:BUNDLE_ADDTOCART_LINK,dataType:"json",data:{listCart:JSON.stringify(i)},success:function(n){var i,r,f;if($(".divProgress").hide(),n&&n.addToCartItemDetails&&(i=JSON.parse(n.addToCartItemDetails),googleAnalytics.addToCartEvent(i),facebookMetaPixel.addToCartEvent(i)),n.isSendCustomerToCart!=undefined&&n.isSendCustomerToCart==!0&&!n.IsBundleCECreditPrice)return window.parent.location.href="/shoppingcart",!1;n.CartCount!=null&&n.CartCount!=""&&n.CartCount!="0"?($(t).siblings(".divBundleMessage").show(),r=n.Message,r!=""?($(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(r),$(t).find(".btnAddToCart").attr("disabled","disabled").removeClass("btnAddToCart")):$(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(n.ErrorMessage),setTimeout(function(){$(".divBundleMessage").hide()},5e3),$("#cartspancount").html(n.CartCount),$("#cartItemList").load("/shoppingcart/getcart")):($(t).siblings(".divBundleMessage").show(),f=n.ErrorMessage,f!=""&&$(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(f),setTimeout(function(){$(".divBundleMessage").hide()},5e3));n.isCompareProduct!=undefined&&n.isCompareProduct==!0&&($("#compareProductcartspancount").html(n.compareProductCount),$("#compareProductcartItemList").load(GET_COMPAREPRODUCTCART_URL));n.IsBundleCECreditPrice&&typeof displayBundlePurchaseCEMessage=="function"&&displayBundlePurchaseCEMessage(u)},error:function(){$(".divProgress").hide()}})}return!1}}if(hdnBundleType=="3")if(e=$(t).find(".hdnGroupStatus").val(),e=="0")if(r="",$(t).find(".clsBundleType3").each(function(n,t){var i=$(t).find(".chkBundleType3").prop("checked");i&&(r="Yes")}),r=="Yes"){if(i=[],u=$(t).find(".hdnBundleId").val(),$(t).find(".clsBundleType3").each(function(n,t){var r=$(t).find(".chkBundleType3").prop("checked");r==!0&&$(t).find(".clsPriceBundle3").each(function(n,t){var o=$(t).prop("checked"),r,f,e;o&&(r=$(t).attr("data-eventtimeId"),f=$(t).attr("data-productTypeId"),f=="3"&&(r=$(t).closest(".rdbprice").find("#clsEventTime :selected").val()),e=arrRandomOrderItemId.filter(function(n){return n.productId==$(t).attr("data-productid")}),i.push({productId:$(t).attr("data-productid"),quantity:"1",productPriceId:$(t).attr("data-priceid"),EventTimeId:r,productPrice:$(t).attr("data-bundleprice"),priceType:$(t).attr("data-priceType"),productTypeId:f,basePrice:$(t).attr("data-base"),bundleProductId:$(t).attr("data-bundleProductId"),bundleId:u,RegistrantTypeOrderItemId:e.length>0?e[0].randomOrderItemId:null,ProductRegistrantTypeId:$(t).attr("data-productRegistrantTypId")}))})}),!isValidateRegistrantQuestions&&(listProductsForBundle.length==0&&(listProductsForBundle=i),!checkRegistrantTypeProducts()))return $(".divProgress").hide(),!1;$.ajax({type:"POST",url:BUNDLE_ADDTOCART_LINK,dataType:"json",data:{listCart:JSON.stringify(i)},success:function(n){var i,r,f;if($(".divProgress").hide(),n&&n.addToCartItemDetails&&(i=JSON.parse(n.addToCartItemDetails),googleAnalytics.addToCartEvent(i),facebookMetaPixel.addToCartEvent(i)),n.isSendCustomerToCart==undefined||n.isSendCustomerToCart!=!0||n.IsBundleCECreditPrice)n.isSendCustomerToCart||displayCartMessages(btnAddtoCart,n,"bundlePage");else return window.parent.location.href="/shoppingcart",!1;n.CartCount!=null&&n.CartCount!=""&&n.CartCount!="0"?($(t).siblings(".divBundleMessage").show(),r=n.Message,r!=""?($(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(r),$(t).find(".btnAddToCart").attr("disabled","disabled").removeClass("btnAddToCart")):$(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(n.ErrorMessage),setTimeout(function(){$(".divBundleMessage").hide()},5e3),parent.$("#cartspancount").html(n.CartCount),parent.$("#cartItemList").load("/shoppingcart/getcart")):($(t).siblings(".divBundleMessage").show(),f=n.ErrorMessage,f!=""&&$(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(f),setTimeout(function(){$(".divBundleMessage").hide()},5e3));n.isCompareProduct!=undefined&&n.isCompareProduct==!0&&(parent.$("#compareProductcartspancount").html(n.compareProductCount),parent.$("#compareProductcartItemList").load(GET_COMPAREPRODUCTCART_URL));n.IsBundleCECreditPrice&&typeof displayBundlePurchaseCEMessage=="function"&&displayBundlePurchaseCEMessage(u)},error:function(){$(".divProgress").hide()}})}else $(".divProgress").hide(),alert("Please select atleast one seminar");else if(r="",f=!1,$(t).find(".clsGroupStatus3").each(function(n,t){r="";$(t).find(".chkBundleType3").length>0&&($(t).find(".chkBundleType3").each(function(n,t){var i=$(t).prop("checked");i&&(r="Yes")}),r!="Yes"&&(f=!0))}),f==!0)$(".divProgress").hide(),alert("You must select atleast one seminar from each section.");else{if(i=[],u=$(t).find(".hdnBundleId").val(),$(t).find(".clsBundleType3").each(function(n,t){var r=$(t).find(".chkBundleType3").prop("checked");r==!0&&$(t).find(".clsPriceBundle3").each(function(n,t){var o=$(t).prop("checked"),r,f,e;o&&(r=$(t).attr("data-eventtimeId"),f=$(t).attr("data-productTypeId"),f=="3"&&(r=$(t).closest(".rdbprice").find("#clsEventTime :selected").val()),e=arrRandomOrderItemId.filter(function(n){return n.productId==$(t).attr("data-productid")}),i.push({productId:$(t).attr("data-productid"),quantity:"1",productPriceId:$(t).attr("data-priceid"),EventTimeId:r,productPrice:$(t).attr("data-bundleprice"),priceType:$(t).attr("data-priceType"),productTypeId:f,basePrice:$(t).attr("data-base"),bundleProductId:$(t).attr("data-bundleProductId"),bundleId:u,RegistrantTypeOrderItemId:e.length>0?e[0].randomOrderItemId:null,ProductRegistrantTypeId:$(t).attr("data-productRegistrantTypId")}))})}),!isValidateRegistrantQuestions&&(listProductsForBundle.length==0&&(listProductsForBundle=i),!checkRegistrantTypeProducts()))return $(".divProgress").hide(),!1;$.ajax({type:"POST",url:BUNDLE_ADDTOCART_LINK,dataType:"json",data:{listCart:JSON.stringify(i)},success:function(n){var i,r,f;if($(".divProgress").hide(),n&&n.addToCartItemDetails&&(i=JSON.parse(n.addToCartItemDetails),googleAnalytics.addToCartEvent(i),facebookMetaPixel.addToCartEvent(i)),n.isSendCustomerToCart!=undefined&&n.isSendCustomerToCart==!0&&!n.IsBundleCECreditPrice)return window.parent.location.href="/shoppingcart",!1;n.CartCount!=null&&n.CartCount!=""&&n.CartCount!="0"?($(t).siblings(".divBundleMessage").show(),r=n.Message,r!=""?($(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(r),$(t).find(".btnAddToCart").attr("disabled","disabled").removeClass("btnAddToCart")):$(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(n.ErrorMessage),setTimeout(function(){$(".divBundleMessage").hide()},5e3),parent.$("#cartspancount").html(n.CartCount),parent.$("#cartItemList").load("/shoppingcart/getcart")):($(t).siblings(".divBundleMessage").show(),f=n.ErrorMessage,f!=""&&$(t).siblings(".divBundleMessage").find(".spndivBundleMessage").html(f),setTimeout(function(){$(".divBundleMessage").hide()},5e3));n.isCompareProduct!=undefined&&n.isCompareProduct==!0&&(parent.$("#compareProductcartspancount").html(n.compareProductCount),parent.$("#compareProductcartItemList").load(GET_COMPAREPRODUCTCART_URL));n.IsBundleCECreditPrice&&typeof displayBundlePurchaseCEMessage=="function"&&displayBundlePurchaseCEMessage(u)},error:function(){$(".divProgress").hide()}})}});$("body").on("click",".clsPriceBundle2",function(){var n=$(this).closest(".clsBundleDiv"),r=$(n).find(".hdnGroupStatus").val(),i,t;r=="0"?(i=$(this).attr("data-price"),t=$(this).attr("data-bundleprice"),$(this).closest(".clsBundleType2").find(".spnRegularPrice").html(i).addClass("dollarsign"),$(this).closest(".clsBundleType2").find(".spnBundlePrice").html(t).addClass("dollarsign"),$(n).find(".hdnTotal").val("0"),$(n).find(".clsBundleType2").each(function(t,i){var r=$(this).attr("data-eventCount");if(r&&r>0){var u=$(n).find(".hdnTotal").val(),f=$(i).find(".spnBundlePrice").html(),e=parseFloat(u)+parseFloat(f);$(n).find(".hdnTotal").val(e.toFixed(2))}}),$(n).find(".spnTotal").html(parseFloat($(n).find(".hdnTotal").val())).addClass("dollarsign")):($(n).find(".hdnTotal").val("0"),i=$(this).attr("data-price"),t=$(this).attr("data-bundleprice"),t=parseFloat(t).toFixed(2),$(this).closest(".clsBundleType2").find(".spnRegularPrice").html(i).addClass("dollarsign"),$(this).closest(".clsBundleType2").find(".spnBundlePrice").html(t).addClass("dollarsign"),$(n).find(".clsBundleType2").each(function(t,i){if($(i).find(".chkBundleType2").prop("checked")){var r=$(n).find(".hdnTotal").val(),u=$(i).find(".spnBundlePrice").html(),f=parseFloat(r)+parseFloat(u);$(n).find(".hdnTotal").val(f.toFixed(2))}}),$(n).find(".spnTotal").html(parseFloat($(n).find(".hdnTotal").val())).addClass("dollarsign"))});$("body").on("change",".chkBundleType3",function(){var n=$(this).closest(".clsBundleDiv"),t=0,f=$(n).find(".hdnBundleId").val();if($(n).find(".clsBundleType3").each(function(n,i){var r=$(i).find(".chkBundleType3").prop("checked");r&&(t=t+1)}),t>0){var r=!1,i=0,u=!1;$.ajax({type:"POST",url:"/bundle1/calculatebundlerange",dataType:"json",data:{checkedCount:t,BundleId:f},success:function(n){n.isRangeAvailable&&(r=n.isPercentage,i=n.discountAmount,u=n.isRangeAvailable)},complete:function(){u?$(n).find(".clsBundleType3").each(function(t,u){var f=$(u).find(".chkBundleType3").prop("checked");f?$(u).find(".clsPriceBundle3").each(function(t,u){var o=$(u).prop("checked"),e=$(u).attr("data-price"),f=0;f=r?e-e*(i/100):e-i;f<0&&(f=0);$(u).attr("data-bundleprice",f.toFixed(2));o&&($(u).parents(".clsBundleType3").find(".spnRegularPrice").html(e),$(u).parents(".clsBundleType3").find(".spnBundlePrice").html(f.toFixed(2)),$(u).parents(".clsBundleType3").find(".spnRegularPrice").addClass("dollarsign"),$(u).parents(".clsBundleType3").find(".spnBundlePrice").addClass("dollarsign"));GetTotalsForType3($(n))}):($(u).find(".spnRegularPrice").html("0"),$(u).find(".spnBundlePrice").html("0"),$(u).find(".spnRegularPrice").addClass("dollarsign"),$(u).find(".spnBundlePrice").addClass("dollarsign"))}):$(n).find(".clsBundleType3").each(function(t,i){var r=$(i).find(".chkBundleType3").prop("checked");r&&$(i).find(".clsPriceBundle3").each(function(t,i){var u=$(i).prop("checked"),r=$(i).attr("data-price");$(i).attr("data-bundleprice",r);u&&($(i).parents(".clsBundleType3").find(".spnRegularPrice").html(r),$(i).parents(".clsBundleType3").find(".spnBundlePrice").html(r),$(i).parents(".clsBundleType3").find(".spnRegularPrice").addClass("dollarsign"),$(i).parents(".clsBundleType3").find(".spnBundlePrice").addClass("dollarsign"));GetTotalsForType3($(n))})})},error:function(){alert("Error please try later")}})}else $(n).find(".clsBundleType3").each(function(t,i){$(i).find(".spnRegularPrice").html("0");$(i).find(".spnBundlePrice").html("0");$(i).find(".spnRegularPrice").addClass("dollarsign");$(i).find(".spnBundlePrice").addClass("dollarsign");GetTotalsForType3($(n))})});$("body").on("click",".clsPriceBundle3",function(){var i=$(this).closest(".clsBundleDiv"),r=$(this).closest(".clsBundleType3").find(".chkBundleType3").prop("checked"),n,t;r&&(n=$(this).attr("data-price"),t=$(this).attr("data-bundleprice"),$(this).closest(".clsBundleType3").find(".spnRegularPrice").html(n),$(this).closest(".clsBundleType3").find(".spnBundlePrice").html(t));GetTotalsForType3($(i))});$("body").on("change","#clsEventTime",function(){var n=$("option:selected",this).attr("data-sku");n?($(this).closest(".rdbprice").find("#spnProductSKU").html(n).show(),$(this).closest(".rdbprice").find("#lblProductSKU").show()):$(this).closest(".rdbprice").find("#spnProductSKU,#lblProductSKU").hide()});CurrentProductId=0