function setDropdownSelectValue(n,t){$(`select[name="${n}"]`).find("option").each(function(){parseFloat($(this).val())===parseFloat(t)&&$(this).prop("selected",!0)})}function addToCart(n,t,i){window.location.href="/build-frame.aspx?sfid="+n+"&SCID="+t+"&TC_AddToCart=1&DipSId="+i}function calculatePrice(){var c=$("#IsCustomDiploma").val(),n=$("#NumberOfDiploma").val(),a=$("#add2cartSchoolId").val(),l=$("#add2cartProductId").val(),v=$("#add2cartResellerId").val(),t=0,i=0,r=0,u=0,f=0,e=0,o=0,s=0,h;c==1&&(n==1?(t=$('select[name="CustomDiploma1"]').find(":selected").attr("data-width"),i=$('select[name="CustomDiploma1"]').find(":selected").attr("data-height")):n==2?(t=$('select[name="CustomDiploma1"]').find(":selected").attr("data-width"),i=$('select[name="CustomDiploma1"]').find(":selected").attr("data-height"),r=$('select[name="CustomDiploma2"]').find(":selected").attr("data-width"),u=$('select[name="CustomDiploma2"]').find(":selected").attr("data-height")):n==3?(t=$('select[name="CustomDiploma1"]').find(":selected").attr("data-width"),i=$('select[name="CustomDiploma1"]').find(":selected").attr("data-height"),r=$('select[name="CustomDiploma2"]').find(":selected").attr("data-width"),u=$('select[name="CustomDiploma2"]').find(":selected").attr("data-height"),f=$('select[name="CustomDiploma3"]').find(":selected").attr("data-width"),e=$('select[name="CustomDiploma3"]').find(":selected").attr("data-height")):n==4&&(t=$('select[name="CustomDiploma1"]').find(":selected").attr("data-width"),i=$('select[name="CustomDiploma1"]').find(":selected").attr("data-height"),r=$('select[name="CustomDiploma2"]').find(":selected").attr("data-width"),u=$('select[name="CustomDiploma2"]').find(":selected").attr("data-height"),f=$('select[name="CustomDiploma3"]').find(":selected").attr("data-width"),e=$('select[name="CustomDiploma3"]').find(":selected").attr("data-height"),o=$('select[name="CustomDiploma4"]').find(":selected").attr("data-width"),s=$('select[name="CustomDiploma4"]').find(":selected").attr("data-height")));h=!1;$(".defaultDiplomaSize").each(function(){$(this).val()>0&&(h=!0)});h&&(n==1?(t=$('select[name="Width1"]').find(":selected").attr("data-width"),i=$('select[name="Height1"]').find(":selected").attr("data-height")):n==2?(t=$('select[name="Width1"]').find(":selected").attr("data-width"),i=$('select[name="Height1"]').find(":selected").attr("data-height"),r=$('select[name="Width2"]').find(":selected").attr("data-width"),u=$('select[name="Height2"]').find(":selected").attr("data-height")):n==3?(t=$('select[name="Width1"]').find(":selected").attr("data-width"),i=$('select[name="Height1"]').find(":selected").attr("data-height"),r=$('select[name="Width2"]').find(":selected").attr("data-width"),u=$('select[name="Height2"]').find(":selected").attr("data-height"),f=$('select[name="Width3"]').find(":selected").attr("data-width"),e=$('select[name="Height3"]').find(":selected").attr("data-height")):n==4&&(t=$('select[name="Width1"]').find(":selected").attr("data-width"),i=$('select[name="Height1"]').find(":selected").attr("data-height"),r=$('select[name="Width2"]').find(":selected").attr("data-width"),u=$('select[name="Height2"]').find(":selected").attr("data-height"),f=$('select[name="Width3"]').find(":selected").attr("data-width"),e=$('select[name="Height3"]').find(":selected").attr("data-height"),o=$('select[name="Width4"]').find(":selected").attr("data-width"),s=$('select[name="Height4"]').find(":selected").attr("data-height")));$.ajax({type:"GET",url:"/getproductprice",data:{id:l,NumberOfDiploma:n,Width1:t,Width2:r,Width3:f,Width4:o,Height1:i,Height2:u,Height3:e,Height4:s},success:function(n){if(n.success){const t=parseFloat(n.Price.replace(/[^0-9.]/g,"")),i=parseFloat(n.OriginalPrice.replace(/[^0-9.]/g,""));$("#DynamicPriceSection").addClass("price-value");t<i?$("#DynamicPriceSection").html(`
                        ${n.Price}
                        <span class="text-decoration-line-through">${n.OriginalPrice}</span>
                    `):$("#DynamicPriceSection").text(n.Price)}else $("#DynamicPriceSection").text("$0.00")},error:function(n){$("#DynamicPriceSection").addClass("price-value");$("#DynamicPriceSection").text("$0.00");$("#loginmsg").text(n.responseText)},beforeSend:function(){$("#DynamicPriceSection").removeClass("price-value");$("#DynamicPriceSection").text("Price loading. Please wait...")}})}function validateOpening(){var n=!1,t=!1,i=$("#IsCustomDiploma").val();return i==0?$(".defaultDiplomaSize").each(function(){$(this).val()==0&&(n=!0)}):($(".defaultDiplomaSize").each(function(){$(this).val()>0&&(t=!0)}),t?$(".defaultDiplomaSize").each(function(){$(this).val()==0&&(n=!0)}):$(".customDiplomaSize").each(function(){$(this).val()==0&&(n=!0)})),n?!1:!0}function lucentFrameSizeAdjustmentHeight(n){n==6?$("select[name='Width1']").val("8.00"):n==8?$("select[name='Width1']").val("6.00"):n==7?$("select[name='Width1']").val("9.00"):n==9?$("select[name='Width1']").val("7.00"):n==8?$("select[name='Width1']").val("10.00"):n==10?$("select[name='Width1']").val("8.00"):n==8.5?$("select[name='Width1']").val("11.00"):n==11?$("select[name='Width1']").val("8.50"):n==11?$("select[name='Width1']").val("14.00"):n==14&&$("select[name='Width1']").val("11.00")}function lucentFrameSizeAdjustmentWidth(n){n==6?$("select[name='Height1']").val("8.00"):n==8?$("select[name='Height1']").val("6.00"):n==7?$("select[name='Height1']").val("9.00"):n==9?$("select[name='Height1']").val("7.00"):n==8?$("select[name='Height1']").val("10.00"):n==10?$("select[name='Height1']").val("8.00"):n==8.5?$("select[name='Height1']").val("11.00"):n==11?$("select[name='Height1']").val("8.50"):n==11?$("select[name='Height1']").val("14.00"):n==14&&$("select[name='Height1']").val("11.00")}$(document).on("click",".build_ur_onw_frame",function(n){n.preventDefault();$(".ajax-loader").removeClass("d-none");var i=$(this).attr("data-scurl"),t=$(this).attr("data-scid");window.location.href="/design-frame/"+i+"/"+t+"?sfid=39&NEWSCID="+t+"&IsDefault=1";$(".ajax-loader").addClass("d-none")});$(document).on("change",".school_list",function(){$(".ajax-loader").removeClass("d-none");window.location.href=$(this).find(":selected").attr("data-school-url");$(".ajax-loader").addClass("d-none")});$(document).on("click",".add-frame-to-cart, .add-frame-to-cart-repeat",function(n){n.preventDefault();$("#errorAddtoCart").text("");var t=$(this).attr("data-allow-moulding");t=t==null||t=="null"||t==undefined||t=="undefined"||t==""?0:t;$(".ajax-loader").removeClass("d-none");$.ajax({type:"GET",url:"/productbyidforuf/"+$(this).attr("data-id"),data:"",success:function(n){var c,f,h,l;if($(".ajax-loader").addClass("d-none"),n.success){var r=n.productDetails,u=0,y=r.Opening1,p=r.Opening2,w=r.Opening3,b=r.Opening4,i=r.StyleId;if(r.isMouldingAvailable==!1&&t==0){$(".btn-continue-moulding").attr("data-id",r.ProductId);$(".btn-continue-moulding").attr("data-scid",r.SCID);$(".btn-continue-moulding").attr("href","/design-frame/"+r.SchoolURL+"/"+r.SCID+"?sfid="+r.ProductId+"&IsCustomize=1&nextUrl=/diploma-frames/"+r.SchoolURL+"/"+r.SCID);$("#moulding-alert-text-moulding").html("This moulding is currently out of stock. Please choose a different moulding by clicking the customize button.");$(".ajax-loader").addClass("d-none");$("#modal-moulding-warning").modal("show");return}if($("#modal-moulding-warning").modal("hide"),c=!1,(i==1||i==2||i==5||i==6||i==37||i==38||i==43||i==48||i==49||i==53||i==34||i==5802||i==5803||i==5804||i==63||i==5811)&&(c=!0),c){addToCart(r.ProductId,r.SCID,0);return}var k="0.00",d="0.00",g="0.00",nt="0.00",tt="0.00",it="0.00",rt="0.00",ut="0.00";y!=""&&(f=y.split("|"),k=f[1].trim().toString(),tt=f[2].trim().toString(),u=1);p!=""&&(f=p.split("|"),d=f[1].trim().toString(),it=f[2].trim().toString(),u=2);w!=""&&(f=w.split("|"),g=f[1].trim().toString(),rt=f[2].trim().toString(),u=3);b!=""&&(f=b.split("|"),nt=f[1].trim().toString(),ut=f[2].trim().toString(),u=4);h=r.SCID;l=r.ResellerId;$("#add2cartSchoolId").val(h);$("#add2cartProductId").val(r.ProductId);$("#add2cartResellerId").val(l);var s=0,a="",v=!1,e="",o="";$.ajax({type:"GET",url:"/webapi/getdiplomasizebyschoolandreselleruserside/"+l+"/"+h,data:"",success:function(n){if(n.length!=undefined&&n.length!=0&&n.length!="data.length"){n=jQuery.parseJSON(n);e+='<option data-id="0" data-width="0" data-height="0" value="0">---Select Document Size---<\/option>';$.each(n.DiplomaSize,function(n,t){v=!0;e+='<option data-id="'+t.Id+'" data-width="'+t.Width+'" data-height="'+t.Height+'" value="'+t.Id+'">'+t.Description+"<\/option>";s++;a=t.Description});o+=i==5812?'<option data-id="0" data-width="0" data-height="0" value="0">---Select Creed Size---<\/option>':'<option data-id="0" data-width="0" data-height="0" value="0">---Select Announcement Size---<\/option>';$.each(n.AnnouncementSize,function(n,t){o+='<option data-id="'+t.Id+'" data-width="'+t.Width+'" data-height="'+t.Height+'" value="'+t.Id+'">'+t.Description+"<\/option>";s==1&&(i==11||i==12||i==68||i==72||i==5812)&&(a+="<br />"+t.Description)});var t="";u==1?(t+='<div class="form-group customDiplomaArea"><label class="col-sm-4 text-right">Document Size :<\/label>',t+='<div class="col-sm-8">',t+='<select name="CustomDiploma1" class="form-control customDiplomaSize">',t+=e,t+="<\/select>",t+="<\/div><\/div>"):u==2?(t+='<div class="form-group customDiplomaArea"><label class="col-sm-4 text-right">Document Size 1(Top):<\/label>',t+='<div class="col-sm-8">',t+='<select name="CustomDiploma1" class="form-control customDiplomaSize">',t+=e,t+="<\/select>",t+="<\/div><\/div>",t+=i==11||i==12?'<div class="form-group customDiplomaArea"><label class="col-sm-4 text-right">Announcement Size:<\/label>':i==5812?'<div class="form-group customDiplomaArea"><label class="col-sm-4 text-right">Creed Size:<\/label>':'<div class="form-group customDiplomaArea"><label class="col-sm-4 text-right">Document Size 2(Bottom):<\/label>',t+='<div class="col-sm-8">',t+='<select name="CustomDiploma2" class="form-control customDiplomaSize">',t+=i==11||i==12||i==5812?o:e,t+="<\/select>",t+="<\/div><\/div>"):u==3?(t+='<div class="form-group customDiplomaArea"><label class="col-sm-4 text-right">Document Size 1(Top):<\/label>',t+='<div class="col-sm-8">',t+='<select name="CustomDiploma1" class="form-control customDiplomaSize">',t+=e,t+="<\/select>",t+="<\/div><\/div>",t+='<div class="form-group customDiplomaArea"><label class="col-sm-4 text-right">Document Size 2(Bottom):<\/label>',t+='<div class="col-sm-8">',t+='<select name="CustomDiploma2" class="form-control customDiplomaSize">',t+=e,t+="<\/select>",t+="<\/div><\/div>",t+=i==68||i==72?'<div class="form-group customDiplomaArea"><label class="col-sm-4 text-right">Announcement Size:<\/label>':'<div class="form-group customDiplomaArea"><label class="col-sm-4 text-right">Document Size 3(Right):<\/label>',t+='<div class="col-sm-8">',t+='<select name="CustomDiploma3" class="form-control customDiplomaSize">',t+=i==68||i==72?o:e,t+="<\/select>",t+="<\/div><\/div>"):u==4&&(t+='<div class="form-group customDiplomaArea"><label class="col-sm-4 text-right">Document Size 1(Top):<\/label>',t+='<div class="col-sm-8">',t+='<select name="CustomDiploma1" class="form-control customDiplomaSize">',t+=e,t+="<\/select>",t+="<\/div><\/div>",t+='<div class="form-group customDiplomaArea"><label class="col-sm-4 text-right">Document Size 2(Bottom):<\/label>',t+='<div class="col-sm-8">',t+='<select name="CustomDiploma2" class="form-control customDiplomaSize">',t+=e,t+="<\/select>",t+="<\/div><\/div>",t+='<div class="form-group customDiplomaArea"><label class="col-sm-4 text-right">Document Size 3 (Top Left):<\/label>',t+='<div class="col-sm-8">',t+='<select name="CustomDiploma3" class="form-control customDiplomaSize">',t+=e,t+="<\/select>",t+="<\/div><\/div>",t+='<div class="form-group customDiplomaArea"><label class="col-sm-4 text-right">Document Size 4 (Top Right):<\/label>',t+='<div class="col-sm-8">',t+='<select name="CustomDiploma4" class="form-control customDiplomaSize">',t+=e,t+="<\/select>",t+="<\/div><\/div>");v?($("#IsCustomDiploma").val(1),$("#customDiploma").show(),s==1&&i!=5812?(t+="<div class='form-group'>",t+="<h2>Size Details: <strong style='color: #2b629a;'>"+a+"<\/strong><\/h2>",t+="<h2 style='text-align:center;color: #2b629a;'>Price: <strong class='price_section1'>"+r.Price+"<\/strong><\/h2>",t+="<\/div>",t+="<div class='form-group'>",t+="<div class='col-sm-12 text-center'><button type='submit' class='btn btn-sm btn-preview-store btn-new-store-other DiplomaAddTocartButton customDiplomaButton btn-banner hvr-sweep-to-right'><i class='fa fa-cart-plus'><\/i> Add To Cart <\/button><\/div>",t+="<\/div>"):(t+="<div class='form-group'><h2 style='text-align:center;color: #2b629a;'>Price: <strong class='price_section'>"+r.Price+"<\/strong><\/h2><\/div>",t+="<div class='form-group'>",t+="<div class='col-sm-12 text-center add_to_c_btns'><button type='button' class='btn btn-sm btn-preview-store btn-new-store-other resetsizeselection btn-banner hvr-sweep-to-right'><i class='fa fa-remove'><\/i> Reset Selection <\/button>",t+="<button type='submit' class='btn btn-sm btn-preview-store btn-new-store-other DiplomaAddTocartButton customDiplomaButton btn-banner hvr-sweep-to-right'><i class='fa fa-cart-plus'><\/i> Add To Cart <\/button><\/div>",t+="<\/div>"),$("#customDiploma").html(t),s==1&&i!=5812?($(".customDiplomaArea").addClass("hidden"),u==1?$('select[name="CustomDiploma1"]').prop("selectedIndex",1):u==2?($('select[name="CustomDiploma1"]').prop("selectedIndex",1),$('select[name="CustomDiploma2"]').prop("selectedIndex",1)):u==3?($('select[name="CustomDiploma1"]').prop("selectedIndex",1),$('select[name="CustomDiploma2"]').prop("selectedIndex",1),$('select[name="CustomDiploma3"]').prop("selectedIndex",1)):u==4&&($('select[name="CustomDiploma1"]').prop("selectedIndex",1),$('select[name="CustomDiploma2"]').prop("selectedIndex",1),$('select[name="CustomDiploma3"]').prop("selectedIndex",1),$('select[name="CustomDiploma4"]').prop("selectedIndex",1))):$(".customDiplomaArea").removeClass("hidden")):($("#IsCustomDiploma").val(0),$("#customDiploma").hide());$("#NumberOfDiploma").val(u);t="";v?$(".dip_head").show():$(".dip_head").hide();$.ajax({type:"GET",url:"/webapi/getdiplomasizes/"+i+"/1/"+h,data:"",success:function(n){if($(".ajax-loader").addClass("d-none"),n.length!=undefined&&n.length!=0&&n.length!="undefined"){n=jQuery.parseJSON(n);var f="",e="";$.each(n.DiplomaSize,function(t,r){var u=!0,o=!0,s="",h="";n.RestrictedSize&&n.RestrictedSize.length>0&&(u=!1,o=!1,$.each(n.RestrictedSize,function(n,t){var f=parseFloat(t.Width),e=parseFloat(t.Height),i=parseFloat(r.ValueField);i===f&&(h=t.Height,u=!0);i===e&&(s=t.Width,o=!0)}));u===!0&&(f+='<option data-style-id="'+i+'" data-id="0" data-width="'+r.ValueField+'" data-height="'+r.ValueField+'" value="'+r.ValueField+'" data-alternate-size = "'+h+'">'+r.TextField+"<\/option>");o===!0&&(e+='<option data-style-id="'+i+'" data-id="0" data-width="'+r.ValueField+'" data-height="'+r.ValueField+'" value="'+r.ValueField+'" data-alternate-size = "'+s+'">'+r.TextField+"<\/option>")});o="";$.each(n.AnnouncementSize,function(n,t){o+='<option data-id="0" data-width="'+t.ValueField+'" data-height="'+t.ValueField+'" value="'+t.ValueField+'">'+t.TextField+"<\/option>"});u==1?(t+='<div class="pd-box mt-5">',t+='<h3 class="box-head"><small>Document Size:<\/small><\/h3>',t+='<div class="row">',t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Height:<\/label>",t+='<select name="Height1" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Height---<\/option>',t+=e,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Width:<\/label>",t+='<select name="Width1" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Width---<\/option>',t+=f,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+="<\/div>"):u==2?(t+='<div class="pd-box mt-5">',t+='<h3 class="box-head"><small>Document Size 1(Top):<\/small><\/h3>',t+='<div class="row">',t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Height:<\/label>",t+='<select name="Height1" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Height---<\/option>',t+=e,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Width:<\/label>",t+='<select name="Width1" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Width---<\/option>',t+=f,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+='<div class="pd-box mt-5">',t+=i==11||i==12?'<h3 class="box-head"><small>Announcement Size:<\/small><\/h3>':i==5812?'<h3 class="box-head"><small>Creed Size:<\/small><\/h3>':'<h3 class="box-head"><small>Document Size  2(Bottom):<\/small><\/h3>',t+='<div class="row">',t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Height:<\/label>",t+='<select name="Height2" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Height---<\/option>',t+=i==11||i==12?o:e,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Width:<\/label>",t+='<select name="Width2" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Width---<\/option>',t+=i==11||i==12?o:f,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+="<\/div>"):u==3?(t+='<div class="pd-box mt-5">',t+='<h3 class="box-head"><small>Document Size 1(Top):<\/small><\/h3>',t+='<div class="row">',t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Height:<\/label>",t+='<select name="Height1" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Height---<\/option>',t+=e,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Width:<\/label>",t+='<select name="Width1" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Width---<\/option>',t+=f,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+='<div class="pd-box mt-5">',t+='<h3 class="box-head"><small>Document Size  2(Bottom):<\/small><\/h3>',t+='<div class="row">',t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Height:<\/label>",t+='<select name="Height2" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Height---<\/option>',t+=e,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Width:<\/label>",t+='<select name="Width2" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Width---<\/option>',t+=f,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+='<div class="pd-box mt-5">',t+=i==68||i==72?'<h3 class="box-head"><small>Announcement Size:<\/small><\/h3>':'<h3 class="box-head"><small>Document Size  3(Right):<\/small><\/h3>',t+='<div class="row">',t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Height:<\/label>",t+='<select name="Height3" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Height---<\/option>',t+=i==68||i==72?o:e,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Width:<\/label>",t+='<select name="Width3" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Width---<\/option>',t+=i==68||i==72?o:f,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+="<\/div>"):u==4&&(t+='<div class="pd-box mt-5">',t+='<h3 class="box-head"><small>Document Size 1(Top):<\/small><\/h3>',t+='<div class="row">',t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Height:<\/label>",t+='<select name="Height1" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Height---<\/option>',t+=e,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Width:<\/label>",t+='<select name="Width1" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Width---<\/option>',t+=f,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+='<div class="pd-box mt-5">',t+='<h3 class="box-head"><small>Document Size  2(Bottom):<\/small><\/h3>',t+='<div class="row">',t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Height:<\/label>",t+='<select name="Height2" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Height---<\/option>',t+=e,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Width:<\/label>",t+='<select name="Width2" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Width---<\/option>',t+=f,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+='<div class="pd-box mt-5">',t+='<h3 class="box-head"><small>Document Size  3(Bottom Left):<\/small><\/h3>',t+='<div class="row">',t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Height:<\/label>",t+='<select name="Height3" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Height---<\/option>',t+=e,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Width:<\/label>",t+='<select name="Width3" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Width---<\/option>',t+=f,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+='<div class="pd-box mt-5">',t+='<h3 class="box-head"><small>Document Size  4(Bottom Right):<\/small><\/h3>',t+='<div class="row">',t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Height:<\/label>",t+='<select name="Height4" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Height---<\/option>',t+=e,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+='<div class="col-md-6">',t+='<div class="mb-4 mb-md-0">',t+="<label>Width:<\/label>",t+='<select name="Width4" class="form-control form-select defaultDiplomaSize">',t+='<option value="0">---Width---<\/option>',t+=f,t+="<\/select>",t+="<\/div>",t+="<\/div>",t+="<\/div>",t+="<\/div>");const h=parseFloat(r.Price),c=parseFloat(r.OriginalPrice);t+='<div class="form-group mt-4">';t+='<div class="flex-btn justify-content-center">';t+='<div class="price-box-global">';t+='<h2 class="price-value m-0" id="DynamicPriceSection">';t+=`$${r.Price} `;h<c&&(t+=`<span class="text-decoration-line-through">$${r.OriginalPrice}</span>`);t+="<\/h2>";t+="<\/div>";t+="<\/div>";t+="<\/div>";s==-100?(t+="<div class='form-group'>",t+="<div class='flex-btn justify-content-center'><button type='submit' class='btn-main btn-blue btn-deep DiplomaAddTocartButton defaultDiplomaButton'><i class='far fa-bag-shopping'><\/i> Add To Cart <\/button><\/div>",t+="<\/div>"):(t+="<div class='form-group'>",t+="<div class='flex-btn justify-content-center'><button type='button' class='btn-main resetsizeselection'><i class='fa fa-remove'><\/i> Reset Selection <\/button>",t+="<button type='submit' class='btn-main btn-blue btn-deep DiplomaAddTocartButton defaultDiplomaButton'><i class='far fa-bag-shopping'><\/i> Add To Cart <\/button><\/div>",t+="<\/div>");$("#diplomaSize").html(t);$(".licent-section-div").html("");(i==5807||i==5808)&&$(".licent-section-div").html('<div class="text-center alert alert-danger p-1"><p class="m-0"><small>Wood background is for visual only. It is not part of the Lucent frame.<\/small><\/p><\/div>');const l={Height1:k,Width1:tt,Height2:d,Width2:it,Height3:g,Width3:rt,Height4:nt,Width4:ut};$.each(l,function(){});$("#DynamicPriceSection").text("$0.00");$("#modal-diploma-size").modal("show")}}})}}})}else{$("#moulding-alert-text-moulding").html(n.msg);$("#modal-moulding-warning").modal("show");return}},beforeSend:function(){$(".ajax-loader").removeClass("d-none")}})});$(document).on("click",".resetsizeselection",function(){var n=$('select[name="CustomDiploma1"] > option').length;n=$.isNumeric(n)?n-1:0;n==1?($(".defaultDiplomaSize").val(0),$("#diplomaSize").css("opacity",1),$("#customDiploma").css("opacity",1),$(".customDiplomaButton").removeAttr("disabled"),$(".defaultDiplomaButton").removeAttr("disabled"),$(".customDiplomaSize").removeAttr("disabled"),$(".defaultDiplomaSize").removeAttr("disabled"),$("#errorAddtoCart").text(""),$("#DynamicPriceSection").text("$0.00")):($(".customDiplomaSize").val(0),$(".defaultDiplomaSize").val(0),$("#diplomaSize").css("opacity",1),$("#customDiploma").css("opacity",1),$(".customDiplomaButton").removeAttr("disabled"),$(".defaultDiplomaButton").removeAttr("disabled"),$(".customDiplomaSize").removeAttr("disabled"),$(".defaultDiplomaSize").removeAttr("disabled"),$("#errorAddtoCart").text(""),$("#DynamicPriceSection").text("$0.00"))});$(document).on("submit","#DiplomaAddTocart",function(n){var s,l;if(n.preventDefault(),$(".ajax-loader").removeClass("d-none"),s=validateOpening(),s)$("#errorAddtoCart").text("");else{$(".ajax-loader").addClass("d-none");$("#errorAddtoCart").text("Please select your diploma's height and width to continue");return}var a=$("#IsCustomDiploma").val(),t=$("#NumberOfDiploma").val(),v=$("#add2cartSchoolId").val(),y=$("#add2cartProductId").val(),p=$("#add2cartResellerId").val(),i=0,r=0,u=0,f=0,e=0,o=0,h=0,c=0;a==1&&(t==1?(i=$('select[name="CustomDiploma1"]').find(":selected").attr("data-width"),r=$('select[name="CustomDiploma1"]').find(":selected").attr("data-height")):t==2?(i=$('select[name="CustomDiploma1"]').find(":selected").attr("data-width"),r=$('select[name="CustomDiploma1"]').find(":selected").attr("data-height"),u=$('select[name="CustomDiploma2"]').find(":selected").attr("data-width"),f=$('select[name="CustomDiploma2"]').find(":selected").attr("data-height")):t==3?(i=$('select[name="CustomDiploma1"]').find(":selected").attr("data-width"),r=$('select[name="CustomDiploma1"]').find(":selected").attr("data-height"),u=$('select[name="CustomDiploma2"]').find(":selected").attr("data-width"),f=$('select[name="CustomDiploma2"]').find(":selected").attr("data-height"),e=$('select[name="CustomDiploma3"]').find(":selected").attr("data-width"),o=$('select[name="CustomDiploma3"]').find(":selected").attr("data-height")):t==4&&(i=$('select[name="CustomDiploma1"]').find(":selected").attr("data-width"),r=$('select[name="CustomDiploma1"]').find(":selected").attr("data-height"),u=$('select[name="CustomDiploma2"]').find(":selected").attr("data-width"),f=$('select[name="CustomDiploma2"]').find(":selected").attr("data-height"),e=$('select[name="CustomDiploma3"]').find(":selected").attr("data-width"),o=$('select[name="CustomDiploma3"]').find(":selected").attr("data-height"),h=$('select[name="CustomDiploma4"]').find(":selected").attr("data-width"),c=$('select[name="CustomDiploma4"]').find(":selected").attr("data-height")));l=!1;$(".defaultDiplomaSize").each(function(){$(this).val()>0&&(l=!0)});l&&(t==1?(i=$('select[name="Width1"]').find(":selected").attr("data-width"),r=$('select[name="Height1"]').find(":selected").attr("data-height")):t==2?(i=$('select[name="Width1"]').find(":selected").attr("data-width"),r=$('select[name="Height1"]').find(":selected").attr("data-height"),u=$('select[name="Width2"]').find(":selected").attr("data-width"),f=$('select[name="Height2"]').find(":selected").attr("data-height")):t==3?(i=$('select[name="Width1"]').find(":selected").attr("data-width"),r=$('select[name="Height1"]').find(":selected").attr("data-height"),u=$('select[name="Width2"]').find(":selected").attr("data-width"),f=$('select[name="Height2"]').find(":selected").attr("data-height"),e=$('select[name="Width3"]').find(":selected").attr("data-width"),o=$('select[name="Height3"]').find(":selected").attr("data-height")):t==4&&(i=$('select[name="Width1"]').find(":selected").attr("data-width"),r=$('select[name="Height1"]').find(":selected").attr("data-height"),u=$('select[name="Width2"]').find(":selected").attr("data-width"),f=$('select[name="Height2"]').find(":selected").attr("data-height"),e=$('select[name="Width3"]').find(":selected").attr("data-width"),o=$('select[name="Height3"]').find(":selected").attr("data-height"),h=$('select[name="Width4"]').find(":selected").attr("data-width"),c=$('select[name="Height4"]').find(":selected").attr("data-height")));s&&$.ajax({type:$(this).attr("method"),url:$(this).attr("action"),data:{NumberOfDiploma:t,Width1:i,Width2:u,Width3:e,Width4:h,Height1:r,Height2:f,Height3:o,Height4:c},success:function(n){n.success?addToCart(y,v,n.id):($(".ajax-loader").addClass("d-none"),$("#errorAddtoCart").text(n.msg))},error:function(n){$(".ajax-loader").addClass("d-none");$("#errorAddtoCart").text(n.responseText)}})});$(document).on("change",".customDiplomaSize",function(){$(".defaultDiplomaSize").val(0);$("#diplomaSize").css("opacity",.5);$(".defaultDiplomaSize").attr("disabled","disabled");$(".defaultDiplomaButton").attr("disabled","disabled");$("#customDiploma").css("opacity",1);$(".customDiplomaSize").removeAttr("disabled");$(".customDiplomaButton").removeAttr("disabled");$("#errorAddtoCart").text("");$("#DynamicPriceSection").text("$0.00");var n=validateOpening();n&&calculatePrice()});$(document).on("change",".defaultDiplomaSize",function(){var r=$('select[name="CustomDiploma1"] > option').length,t,i,u,n,f;r=$.isNumeric(r)?r-1:0;r==1?($("#customDiploma").css("opacity",.5),$(".customDiplomaSize").attr("disabled","disabled"),$(".customDiplomaButton").attr("disabled","disabled"),$("#diplomaSize").css("opacity",1),$(".defaultDiplomaSize").removeAttr("disabled"),$(".defaultDiplomaButton").removeAttr("disabled"),$("#errorAddtoCart").text(""),$("##DynamicPriceSection").text("$0.00")):($(".customDiplomaSize").val(0),$("#customDiploma").css("opacity",.5),$(".customDiplomaSize").attr("disabled","disabled"),$(".customDiplomaButton").attr("disabled","disabled"),$("#diplomaSize").css("opacity",1),$(".defaultDiplomaSize").removeAttr("disabled"),$(".defaultDiplomaButton").removeAttr("disabled"),$("#errorAddtoCart").text(""),$("#DynamicPriceSection").text("$0.00"));t=$(this).attr("name")||"";t=t.toLowerCase();i=$(this).find(":selected").attr("data-style-id");i=$.isNumeric(i)?i:0;u=$(this).find(":selected").attr("data-alternate-size")||"";n=t;u!==""&&n!==""&&(n==="width1"?n="Height1":n==="height1"&&(n="Width1"),n==="width2"?n="Height2":n==="height2"&&(n="Width2"),n==="width3"?n="Height3":n==="height3"&&(n="Width3"),n==="width4"?n="Height4":n==="height4"&&(n="Width4"),$('select[name="'+n+'"]').val(u));(i==5807||i==5808)&&(t.indexOf("width")>=0?lucentFrameSizeAdjustmentWidth($(this).val()):t.indexOf("height")>=0&&lucentFrameSizeAdjustmentHeight($(this).val()));f=validateOpening();f&&calculatePrice()});$(document).on("click",".enlarge_product_image",function(n){n.preventDefault();var t=$(this).attr("data-scid"),i=$(this).attr("data-scurl"),r=$(this).attr("data-id"),u=$(this).attr("data-styleurl"),f="/design-frame/"+i+"/"+t+"?sfid="+r+"&IsCustomize=1&nextUrl=/diploma-frames/"+i+"/"+t,e="/frame-details/"+i+"/"+u+"/"+r;$(".product_title_extra").text($(this).attr("title"));$(".view_image_extra").attr("src",$(this).attr("data-href"));$(".view_details_extra").attr("data-scid",t).attr("data-scurl",i).attr("data-id",r).attr("data-styleurl",u).attr("href",e);$(".add_to_cart_extra").attr("data-scid",t).attr("data-id",r);$(".customize_btn_extra").attr("data-scid",t).attr("data-id",r).attr("data-scurl",i).attr("href",f);$(".enlarge_product_image").removeClass("active_link_enlarge_image");$(this).addClass("active_link_enlarge_image");$("#modal-view-image").modal("show")});$(document).on("click",".productThumbImage",function(){var n=$(this).attr("data-name")||"";n?(n=n.toLowerCase(),n=="seal"||n=="imprint"?$(".productThumbImageTabDivContent").addClass("bg-light-dark"):$(".productThumbImageTabDivContent").removeClass("bg-light-dark")):$(".productThumbImageTabDivContent").removeClass("bg-light-dark")})