// app.js : function isNumber(evt){evt=evt?evt:window.event;var charCode=evt.which?evt.which:evt.keyCode;return charCode>31&&(charCode<48||charCode>57)?!1:!0}function getCurrentTimeSecounds(){var d=new Date,h=d.getHours()*3600,m=d.getMinutes()*60;return h+m}function removeURLParameter(url,parameter){var urlparts=url.split("?"),prefix,pars,i;if(urlparts.length>=2){for(prefix=encodeURIComponent(parameter)+"=",pars=urlparts[1].split(/[&;]/g),i=pars.length;i-->0;)pars[i].lastIndexOf(prefix,0)!==-1&&pars.splice(i,1);return urlparts[0]+(pars.length>0?"?"+pars.join("&"):"")}return url}function getTimeLeftString(open){var minleft=(open-getCurrentTimeSecounds())/60,h,m;return minleft>60?(h=Math.floor(minleft/60),m=minleft%60,h===1?"שעה ו "+m+" דקות":m>0?h+" שעות ו"+m+" דקות":h+" שעות "):minleft===60?"שעה":minleft+" דקות"}var placeSearch,autocomplete,btnScroll=!1,checkbenifitsCounter=0,checkbenifitsMs=850,DeliveryUser={orderId:0,deliveryType:"courier",selectedPromos:[],userBalance:0},startCheckbenifitsCounter=function(){checkbenifitsCounter=0},isSafari,iOS;Array.prototype.insert=function(index,item){this.splice(index,0,item)};isSafari=!!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/);iOS=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;var loadingButton={init:function(btn){var text=Dom7(btn).text();Dom7(btn).addClass("loading-button").html(""+text+"<\/span><\/i>");Dom7(btn).on("click",function(){Dom7(this).addClass("loading")})},showPreloader:function(btn){Dom7(btn).addClass("loading")},hidePreloader:function(btn){btn?Dom7(btn).removeClass("loading"):Dom7(".loading-button").removeClass("loading")}},prasePrice=function(number){return parseFloat(number)%1!=0?parseFloat(number).toFixed(1):parseFloat(number)},showOrder=function(orderId){Dom7(".view-order-show[data-order-id='"+orderId+"']").toggleClass("show")},scr=function(Framework7,$$,vcapi){function handellHiddenBtn(){$$(".user-welcome").attr("tabindex",0);User.isRegistered()?($$(".user-welcome").removeClass("not-connected"),$$(".show-members").show(),$$(".show-guest").hide(),$$(".hide-member").hide()):User.isGuest()?($$(".user-welcome").addClass("not-connected").attr("aria-label","התחברות"),$$(".show-members").hide(),$$(".show-guest").show()):($$(".user-welcome").addClass("not-connected"),$$(".show-voucher").show(),$$(".show-members:not(.show-voucher)").hide(),$$(".show-guest").hide())}function formattedNumber(number){return("0"+number).slice(-2)}function handelCalender(){var fillYear=function(elem){var myselect=elem[0],startYear=(new Date).getFullYear()-100;(function(select,val,count){do val++,count--,select.add(new Option(val,val),null);while(count)})(myselect,startYear,100)};$$("[fill-data='select-year']").each(function(){$$(this).find("option").length==1&&fillYear($$(this))});$$("[fill-data='select-day']").each(function(){if($$(this).find("option").length==1){var thisSelect=$$(this)[0],count=31,val=0;do val++,count--,thisSelect.add(new Option(val,formattedNumber(val)),null);while(count)}});$$("[fill-data='select-month']").each(function(){if($$(this).find("option").length==1){var thisSelect=$$(this)[0],count=12,val=0;do val++,count--,thisSelect.add(new Option(val,formattedNumber(val)),null);while(count)}})}function loadTemplate(data,containerId,templateId){var template=Template7.templates[templateId],templateHtml;(template||(templateHtml=document.getElementById(templateId).innerHTML,template=Template7.compile(templateHtml),Template7.templates[templateId]=template),document.getElementById(containerId)!=null)&&(document.getElementById(containerId).innerHTML=template(data))}function getTemplateHtml(data,templateId){var template=Template7.templates[templateId],templateHtml;return template||(templateHtml=document.getElementById(templateId).innerHTML,template=Template7.compile(templateHtml),Template7.templates[templateId]=template),template(data)}function loadTemplateClass(data,containerClass,templateId){var template=Template7.templates[templateId],templateHtml;template||(templateHtml=document.getElementById(templateId).innerHTML,template=Template7.compile(templateHtml),Template7.templates[templateId]=template);Dom7(containerClass).html(template(data))}function orderComplete(text){var removeAndClean,prodcts;FBid.length&&fbq("track","Purchase",{currency:"ILS",value:parseFloat(Dom7(".cart-total-price").text()).toFixed(2)});removeAndClean=function(){Cart.removeAllItems().then(function(){DeliveryUser.deliveryType="";loadCart.load();Order.cleanOrder().then(function(){Branch.removeBranch().then(function(){User.isRegistered()||valueCard.form.removeFormData("#order-sum");valueCard.dialog.create({text:'
<\/i><\/i><\/div>

'+text+'<\/h1>

תודה שקנית אצלנו!<\/p>