") + "=([^;]*)")); if (n) { let e = decodeURIComponent(n[1]); if (t) try { return JSON.parse(e) } catch (e) {} return e } } } if ( typeof (setCookie) != "function"){ function setCookie(e, t, n = { path: "/" }) { if (!e) return; (n = n || {}).expires instanceof Date && (n.expires = n.expires.toUTCString()), t instanceof Object && (t = JSON.stringify(t)); let o = encodeURIComponent(e) + "=" + encodeURIComponent(t); for (let e in n) { o += "; " + e; let t = n[e]; !0 !== t && (o += "=" + t) } document.cookie = o } } if ( typeof (deleteCookie) != "function"){ function deleteCookie(e) { setCookie(e, null, { expires: new Date, path: "/" }) } } $(function(){ data_c = getCookie("3d_files_data"); if (data_c) { data_c = JSON.parse (data_c); $("#af_name_1").val( data_c["name"] ); $("#af_company").val( data_c["org"]); $("#af_pochta_1").val( data_c["email"]); $("#af_phone").val( data_c["phone"]); //$("#form-text_1").val( data_c["message"]); //$('#af_file_type option:first').prop('selected', false).attr('selected', false); //$('#af_file_type').removeClass("empty"); $("#af_file_type option[value='"+data_c['file_type']+"']").attr('selected', 'selected').prop('selected', true); } $("form.af_example").submit(function (event) { event.preventDefault(); data_mas = {"name" : $("#af_name_1").val(), "org" : $("#af_company").val(), "email" : $("#af_pochta_1").val(), "phone" : $("#af_phone").val(), "file_type" : $("#af_file_type").val(), "href" : window.location.href, }; setCookie("3d_files_data", data_mas, 30); }); }) [[$modal_download_3d_files]]