function openLB(i,t){jQuery.magnificPopup.open({type:"inline",items:{src:jQuery(i)},callbacks:{open:function(){null!=t?jQuery(document).trigger("idc_lightbox_level_select",t):jQuery(document).trigger("idc_lightbox_general");var i,e=jQuery('.idc_lightbox:visible select[name="level_select"] option').length;if(1==e){jQuery('.idc_lightbox:visible select[name="level_select"]').val(),jQuery(".idc_lightbox:visible input.total").val()}else 0==e&&jQuery(".idc_lightbox:visible .lb_level_submit").val("No Levels Available").attr("disabled","disabled");jQuery('.idc_lightbox:visible input[name="total"]').change(function(){var i=jQuery(this).val().replace(/[^0-9\.]+/g,"");jQuery(document).trigger("idc_lightbox_price_change",i)})},close:function(){}}})}function openLBGlobal(i,t,e){var l,i;"object"==typeof i?source="iframe"==(l=i.type)?i.source:jQuery(i):(l="inline",source=jQuery(i)),jQuery.magnificPopup.open({type:l,items:{src:source},callbacks:{open:function(){jQuery(document).trigger("idc_lightbox_global",i)},close:function(){jQuery(document).trigger("idc_close_lightbox_global",i)}}})}function closeLBGlobal(){jQuery.magnificPopup.close()}function adjustHeights(i){(jQuery(i).height()>jQuery(i).parent().height()||jQuery(i).width()>jQuery(i).parent().width())&&jQuery(i).css("font-size",jQuery(i).css("font-size").substr(0,2)-2+"px").css("line-height",jQuery(i).css("font-size").substr(0,2)+"px")}jQuery(document).ready(function(){"wc"==idf_platform?jQuery.each(jQuery(".level-binding"),function(i,t){console.log("k: "+i+" v: "+t);var e=jQuery(this).attr("href");if(e){var l=e.indexOf("?add-to-cart="),n=e.substring(l+13);jQuery(this).data("id",n),jQuery('.idc_lightbox select[name="level_select"] option[value="'+(i+1)+'"]').data("id",n)}}):"edd"==idf_platform&&jQuery.each(jQuery(".level-binding"),function(i,t){var e=jQuery(this).attr("href");if(e){var l=e.indexOf("&download_id="),n=e.indexOf("&edd_options"),a=l+13,o=e.substring(a,a+(n-a));jQuery(this).data("id",o),jQuery('.idc_lightbox select[name="level_select"] option').eq(i).data("id",o)}}),jQuery.each(jQuery(".id-full .btn-container a, .level-binding, .ign-supportnow a"),function(){var i=jQuery(this).attr("href");void 0!==i&&(i.length>1&&i.indexOf("purchaseform")>0?(jQuery(this).attr("href",".idc_lightbox"),jQuery(this).data("href",i)):i.length>1&&i.indexOf("add-to-cart")>0?(jQuery(this).attr("href",".idc_lightbox"),jQuery(this).data("href",i)):i.length>1&&i.indexOf("add_to_cart")>0&&(jQuery(this).attr("href",".idc_lightbox"),jQuery(this).data("href",i)),jQuery(document).trigger("idcfSupportButtonSet",[i]))}),jQuery(".id-full .btn-container a, .ign-supportnow a").on("click",function(i){var t=jQuery(this).data("href");if(".idc_lightbox"==jQuery(this).attr("href")){i.preventDefault();var e=jQuery(this).parents().length;jQuery(this).parents().each(function(i,l){if(jQuery(this).find(".idc_lightbox").length>0)return openLB(jQuery(this).find(".idc_lightbox"),null),!1;void 0!==t&&i==e-1&&(location.href=t)})}}),jQuery(".level-binding").on("click",function(i){if(i.preventDefault(),jQuery(this).data("href"),".idc_lightbox"==jQuery(this).attr("href")){var t=jQuery(this).index();jQuery(this).parents().each(function(){if(jQuery(this).children(".idc_lightbox").length>0)return openLB(jQuery(this).children(".idc_lightbox"),t),!1})}}),jQuery(document).on("idc_lightbox_price_change",function(i,t){jQuery('.idc_lightbox:visible input[name="total"]').val(t);var e=jQuery('.idc_lightbox:visible select[name="level_select"]').prop("selectedIndex"),l=jQuery('.idc_lightbox:visible select[name="level_select"] option').eq(e).data("price");parseFloat(t)<parseFloat(l)&&jQuery('.idc_lightbox:visible input[name="total"]').val(l)}),jQuery('input[name="lb_level_submit"]').on("click",function(i){i.preventDefault(),jQuery(".idc_lightbox:visible input.total").removeClass("error");var t=jQuery('.idc_lightbox:visible select[name="level_select"]').val(),e=jQuery(".idc_lightbox:visible input.total").val();if(void 0==e)var e=jQuery(".idc_lightbox:visible span.total").data("value");var l=jQuery(".idc_lightbox:visible form").attr("action"),n=jQuery('.idc_lightbox:visible select[name="level_select"] option:selected').data("id");"wc"==idf_platform?l=idf_checkout_url+"?add-to-cart="+n:"edd"==idf_platform?l=idf_checkout_url+"?edd_action=add_to_cart&download_id="+n+"&edd_options[price_id]="+(t-1):("idc"==idf_platform&&(l=l.replace("prodid","mdid_checkout")),l=l+"&level="+t+"&price="+e),jQuery(".idc_lightbox:visible form").attr("action",l),jQuery(".idc_lightbox:visible form").submit()})});