";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 050){ $('.header').addClass('header-top-fixed'); $('.headerBg').addClass('header-top-fixed'); $('.header .logo').show(); }else{ $('.header').removeClass('header-top-fixed'); $('.headerBg').removeClass('header-top-fixed'); $('.header .logo').hide(); }});var gallery = { imgArray:'', ossz:0, imgCount:0, init:function(imgArray,src,ossz,imgCount){ this.imgArray = imgArray; this.ossz = ossz; this.imgCount = imgCount; $.get( "absolute.html", function(data) { $('body').append(data); $('#BsAbsolute img').attr('src',src); }); }, click:function(element){ if(element.getAttribute('src')) return false; else $('#BsAbsolute').remove(); this.imgArray = ''; }, left:function(){ this.imgCount--; if(this.imgCount<0) this.imgCount = this.ossz; var src = this.imgArray[this.imgCount]; $('#BsAbsolute img').attr('src',src); }, right:function(){ this.imgCount++; if(this.imgCount>this.ossz) this.imgCount = 0; var src = this.imgArray[this.imgCount]; $('#BsAbsolute img').attr('src',src); }, noclick:function(){ }};$('.img-thumbnail').on('click',function(){ var src = $(this).attr('src'),imgCount=0,imgArray = [],ossz=0; $('#'+$(this).parent().parent()[0].id+' img').each(function(index){ imgArray.push($(this).attr('src')); if(src==$(this).attr('src')) imgCount = index; ossz = index; }); gallery.init(imgArray,src,ossz,imgCount);});let slide = { numb:0, autostart:1, time:10000, interval:'', init:function(){ if(this.autostart==0) $('.slideArrows').show(); else this.start(); }, start:function(){ clearTimeout(slide.interval); slide.interval = setTimeout(function(){ slide.left(); },this.time); }, left:function(){ this.numb--; if(this.numb < 0) this.numb = gall.ossz; var imgw = 'gall.imgw' + this.numb; var img = 'gall.img' + this.numb; var name = 'gall.a' + this.numb; var text = 'gall.t' + this.numb; $('.valtokep #valtokepwebp').fadeOut(600, function() { $('.valtokep #valtokepwebp').attr("srcset",eval(imgw)); }).fadeIn(600); $('.valtokep #valtokepjpg').fadeOut(600, function() { $('.valtokep #valtokepjpg').attr("srcset",eval(img)); }).fadeIn(600); $('.valtokep img').fadeOut(600, function() { $('.valtokep img').attr("src",eval(name)); }).fadeIn(600); if(eval(text)!=""){ $('.valtokep h1,.valtokep h2,.valtokep h3,.valtokep h4,.valtokep h5,.valtokep h6,.valtokep p').fadeOut(600, function() { $('.valtokep h1,.valtokep h2,.valtokep h3,.valtokep h4,.valtokep h5,.valtokep h6,.valtokep p').text(eval(text)); }).fadeIn(600); }else{ $('.valtokep h1,.valtokep h2,.valtokep h3,.valtokep h4,.valtokep h5,.valtokep h6,.valtokep p').fadeOut(600); } if(this.autostart==1) this.start(); }, right:function(){ this.numb++; if(this.numb > gall.ossz) this.numb = 0; var imgw = 'gall.imgw' + this.numb; var img = 'gall.img' + this.numb; var name = 'gall.a' + this.numb; var text = 'gall.t' + this.numb; $('.valtokep #valtokepwebp').fadeOut(600, function() { $('.valtokep #valtokepwebp').attr("srcset",eval(imgw)); }).fadeIn(600); $('.valtokep #valtokepjpg').fadeOut(600, function() { $('.valtokep #valtokepjpg').attr("srcset",eval(img)); }).fadeIn(600); $('.valtokep img').fadeOut(600, function() { $('.valtokep img').attr("src",eval(name)); }).fadeIn(600); if(eval(text)!=""){ $('.valtokep h1,.valtokep h2,.valtokep h3,.valtokep h4,.valtokep h5,.valtokep h6,.valtokep p').fadeOut(600, function() { $('.valtokep h1,.valtokep h2,.valtokep h3,.valtokep h4,.valtokep h5,.valtokep h6,.valtokep p').text(eval(text)); }).fadeIn(600); }else{ $('.valtokep h1,.valtokep h2,.valtokep h3,.valtokep h4,.valtokep h5,.valtokep h6,.valtokep p').fadeOut(600); } }};$(window).blur(function() { if (typeof gall !== 'undefined') clearTimeout(slide.interval);});$(window).focus(function() { if (typeof gall !== 'undefined') slide.start();});if (typeof gall !== 'undefined') slide.init(); let cart = { szuaChange:'', szalldij:0, post : async function(data){var d;var dataType = 'html';if(data.json)dataType = 'json';console.log(data);await $.ajax({type: "POST",url: "/",data: data,dataType : dataType,success: function(msg){d = msg;}});return d;},add:function(id){ $.get('/'+templateDir+'/ingredients/vasarlas.html?1', function(data){ $('#wrapper').addClass('blur'); $('body').append(data); });var data = prod['a'+id];data.form = 'addCart';data.darab = 1;$.ajax({type: "POST",url: "/",data: data, success: function(msg){ $('#shopCart span').addClass('active').text(msg); }});},del:function(id){var data = {'id':id,'form':'delCartId'}; $(`#row${id}`).remove();$.ajax({type: "POST",url: "/",data: data, dataType: 'json', success:function(msg){ if(msg.total=='0'){ location.reload(); } var szallitas = $('#szallitas').html(); szallitas = szallitas.replace(' ',''); $("#total").html(cart.moneyFormat(msg.total)); $("#osszesen").html(cart.moneyFormat(msg.total)); var fizetendo = (parseInt(msg.total) + parseInt(szallitas)); $("#fizetendo").html(cart.moneyFormat(fizetendo)); $('#shopCart span').addClass('active').text(msg.darab); }});},trashCart:function(){var data = {'all':'all','form':'delCartId'}; $(`.cartContainer`).html('A kosár üres.
');$.ajax({type: "POST",url: "/",data: data, success:function(){ location.reload(); }});}, close : function(){ $('.webshopAbsolute').remove(); $('#wrapper').removeClass('blur'); }, step1:function(){ $('#button-step-1').hide(); $('#cart-step-1').show(); $([document.documentElement, document.body]).animate({ scrollTop: $("#cart-step-1").offset().top - 80 }, 600); }, step2:function(){ $('#valid-step-1 *').removeClass('error'); var data = {};var error = 0; var inputs = $('#valid-step-1').find('input').map(function(element) { data[$(this).attr('name')] = $(this).val(); if($(this).val() == ''){ error++; $('#'+$(this).attr('name')).addClass('error'); } if($(this).attr('name') == "email"){ var valid = cart.isValidEmailAddress($(this).val()); if(valid == false ){ error++; $('#'+$(this).attr('name')).addClass('error'); } } }); if(error == 0){ $('#valid-step-1 input').prop('readonly', true); $('#button-step-2').hide(); $('#cart-step-2').show(); $([document.documentElement, document.body]).animate({ scrollTop: $("#cart-step-2").offset().top - 80 }, 600); } }, step3:function(){ $('#valid-step-2 *').removeClass('error'); var data = {};var error = 0; var inputs = $('#valid-step-2').find('input').map(function(element) { data[$(this).attr('name')] = $(this).val(); if($(this).val() == ''){ error++; $('#'+$(this).attr('name')).addClass('error'); } if($(this).attr('name') == "szemail"){ var valid = cart.isValidEmailAddress($(this).val()); if(valid == false ){ error++; $('#'+$(this).attr('name')).addClass('error'); } } }); if(error == 0){ $('#valid-step-2 input').prop('readonly', true); cart.szuaChange = 1; $('#button-step-3').hide(); $('#cart-step-3').show(); $('#osszegzes').show(); $([document.documentElement, document.body]).animate({ scrollTop: $("#cart-step-3").offset().top - 80 }, 600); } }, step4:function(){ var data = {};var error = 0; var inputs = $('.cartForm').find('input,select').map(function(element) { if($(this).attr('name')!=undefined) data[$(this).attr('name')] = $(this).val(); if($(this).val() == ''){ error++; $('#'+$(this).attr('name')).addClass('error'); return false; } }); if(error == 0){ data.szalldij = cart.szalldij; data.templateDir = templateDir; data.form = 'newOrder'; data.template = 'ingredients/paypal.html'; $.ajax({ type: "POST", url: "/", dataType:'json', data: data, success:function(msg){ if(msg.status=='true'){ location.href="/"+msg.next+"/"+msg.md5Id; }else{ $('#button-step-5').show(); } } }); } }, szua:function(){ if(cart.szuaChange) return false; if(document.getElementById("ua-1").checked){ var inputs = $('#valid-step-1').find('input').map(function(element) { $('#sz'+$(this).attr('name')).val($('#'+$(this).attr('name')).val()); }); }else{ var inputs = $('#valid-step-1').find('input').map(function(element) { $('#sz'+$(this).attr('name')).val(''); }); } }, isValidEmailAddress: function(emailAddress) { var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i); return pattern.test(emailAddress); }, priceMode:function(){$('#fizmod').removeClass('error');$('#szallmod').removeClass('error'); var data = {'id':$('#fizmod').val(),'form':'szallmod','sub':'listChild'};$.ajax({type: "POST",url: "/",data: data, success:function(msg){$('#szallmod').html(msg); var ossz = $('#osszesen').html(); ossz = ossz.replace(' ',''); $("#szallitas").html(0); $("#fizetendo").html(cart.moneyFormat(ossz)); }}); }, transportMode:function(){ $('#szallmod').removeClass('error');var data = {'id':$('#szallmod').val(),'form':'szallmod','sub':'getPrice'};$.ajax({type: "POST",url: "/",data: data, success:function(msg){ cart.szalldij = msg; var ossz = $('#osszesen').html(); ossz = ossz.replace(' ',''); var fizetendo = ((msg*1) + (ossz*1)); $("#szallitas").html(cart.moneyFormat(msg)); $("#fizetendo").html(cart.moneyFormat(fizetendo)); }}); }, moneyFormat: function(price, sign = 'Ft') { const pieces = parseFloat(price).toFixed(0).split(''); let ii = pieces.length; while ((ii-=3) > 0) { pieces.splice(ii, 0, ' '); } return pieces.join(''); }};console.log(cart.moneyFormat(5432));console.log(cart.moneyFormat(65432));console.log(cart.moneyFormat(765432));console.log(cart.moneyFormat(8765432));