// Cart
const cartItems = '0';
const cartTotalNoDelivery = '0.00';
const backParams = '';
if (document.readyState !== "loading") {
cartProcessing();
} else {
document.addEventListener("DOMContentLoaded", cartProcessing);
}
function cartProcessing() {
const parentE = document.getElementById('cart-content');
html = '';
if (cartItems > 0) {
if (cartItems == 1) {
html += 'מוצר אחד';
} else {
html += '' + cartItems + ' מוצרים';
}
html += '
';
html += 'עלות: ';
html += '' + cartTotalNoDelivery + ' ₪';
html += '
';
html += '+ משלוח';
html += '
';
html += 'לפירוט לחץ כאן';
} else {
html += 'העגלה ריקה';
}
parentE.innerHTML = html;
}
if (document.readyState !== "loading") {
disconnectedProcessing();
} else {
document.addEventListener("DOMContentLoaded", disconnectedProcessing);
}
function connectedProcessing() {
// Desktop mode
const registerNav = document.getElementById('register-nav');
if (registerNav != null) {
const li1 = document.createElement('li');
const disconnectLink1 = document.createElement('a');
disconnectLink1.href = '/login.php?mode=logout&redirect=/';
disconnectLink1.title = logoutTitle;
disconnectLink1.innerText = logoutString;
li1.appendChild(disconnectLink1);
registerNav.replaceChildren(li1);
registerNav.style.display = 'initial';
}
// Mobile mode
const loginMenu = document.getElementById('login-menu');
if (loginMenu != null) {
const li2 = document.createElement('li');
const disconnectLink2 = document.createElement('a');
disconnectLink2.href = '/login.php?mode=logout&redirect=/';
disconnectLink2.title = logoutTitle;
disconnectLink2.innerText = logoutString;
li2.appendChild(disconnectLink2);
loginMenu.replaceChildren(li2);
loginMenu.style.display = 'initial';
}
}
function disconnectedProcessing() {
// Desktop mode
const registerNav = document.getElementById('register-nav');
if (registerNav != null) {
registerNav.style.display = 'initial';
}
// Mobile mode
const loginMenu = document.getElementById('login-menu');
if (loginMenu != null) {
loginMenu.style.display = 'initial';
}
}
// Announcement
const announcementContent = 'עברנו למחסן חדש!
כתובתינו החדשה - דרך העצמאות 43, יהוד. המחסן נמצא בחלקו האחורי של הבניין.
יש חניה בכחול-לבן לאורך הרחוב. נכנסים למתחם של הבניין דרך כניסה א` ועוקפים אותו מבחוץ.
פרטים נוספים בעמוד צור קשר.';
const announcementStyle = 'border-color:#FF0000';
if (document.readyState !== "loading") {
announcementProcessing();
} else {
document.addEventListener("DOMContentLoaded", announcementProcessing);
}
function announcementProcessing() {
const parentE = document.getElementById('announcement-section');
const noScript = document.createElement('noscript');
noScript.innerHTML =
`
אתר זה מותאם לעבודה עם דפדפנים התומכים ב-JavaScript.
גילינו שדפדפן שלך לא תומך באפשרות זו או שהתמיכה ב-JavaScript מבוטלת.
עקב כך כנראה שתתקל בקשיים בגלישה באתר. אנו ממליצים לאפשר את ביצוע ה-JavaScript בדפדפן שלכם כדי לעבוד בצורה תקינה עם האתר.
`;
const divAnnouncement = document.createElement('div');
divAnnouncement.className = 'global-announcement';
divAnnouncement.innerHTML = announcementContent; // External variable
divAnnouncement.setAttribute('data-nosnippet', '');
divAnnouncement.setAttribute('style', announcementStyle); // External variable
parentE.prepend(noScript, divAnnouncement);
}
// Dynamic analytics
const gtagID = 'G-K2SJB5JNQ1';
const customerUUID = '';
const facebookID = '739494796447171';
if (document.readyState !== "loading") {
dynamicAnalyticsProcessing();
} else {
document.addEventListener("DOMContentLoaded", dynamicAnalyticsProcessing);
}
function dynamicAnalyticsProcessing() {
// The analytics was already reported from the static page
if (staticAnalytics == 1) return;
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
if (customerUUID != '') {
gtag('config', gtagID, {
'user_id': customerUUID
});
} else {
gtag('config', gtagID);
}
const loadScript = document.createElement('script');
loadScript.src = 'https://www.googletagmanager.com/gtag/js?id=' + gtagID;
loadScript.async = true;
document.head.appendChild(loadScript);
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', facebookID);
fbq('track', 'PageView');
}
// Left tips
tipID = 'tip-available-stock';
tipDelay = '1.0s';
tipHeader = 'האם המוצר במלאי?';
tipContent = 'עמוד המוצר מציג את רמת המלאי האמיתית, הזמינה במחסנינו.
פרטים נוספים';
if (document.readyState !== "loading") {
rightTipProcessing();
} else {
document.addEventListener("DOMContentLoaded", rightTipProcessing);
}
// Left tips
tipID = 'tip-how-to-order';
tipDelay = '1.3s';
tipHeader = 'איך מזמינים ומשלמים?';
tipContent = 'ההזמנה והתשלום מתבצעים רק דרך האתר.';
if (document.readyState !== "loading") {
rightTipProcessing();
} else {
document.addEventListener("DOMContentLoaded", rightTipProcessing);
}
// Left tips
tipID = 'tip-delivery-options';
tipDelay = '1.6s';
tipHeader = 'איסוף או משלוח? כמה זה יעלה?';
tipContent = 'האתר מציע 5 אפשרויות משלוח וגם אפשרות לאיסוף עצמי מהמחסן.
אחרי הוספת המוצרים לעגלת הקניות, אפשר לראות בה את האפשרויות, המחירים והערכת זמני הגעת המשלוח.
המחיר יחושב לפי גודל ומשקל המוצרים שבחרת.
פרטים נוספים';
if (document.readyState !== "loading") {
rightTipProcessing();
} else {
document.addEventListener("DOMContentLoaded", rightTipProcessing);
}
// Left tips
tipID = 'tip-fast-order-prepare';
tipDelay = '1.9s';
tipHeader = 'מתי ההזמנה מוכנה?';
tipContent = 'אין צורך לעדכן אותנו טלפונית על ביצוע ההזמנה. אנו רואים אותה מיד ומטפלים בה במהירות.
כמה מהר? לפי הסטטיסטיקה של 3 חודשים האחרונים, הכוללים גם חגים וחופשים, הזמנות שבוצעו בשעות אלה (יום חמישי בין השעות 16 ל-17) היו מוכנות תוך 46 שעות ו-15 דקות.
פרטים נוספים';
if (document.readyState !== "loading") {
rightTipProcessing();
} else {
document.addEventListener("DOMContentLoaded", rightTipProcessing);
}
function leftTipProcessing() {
const parentE = document.getElementById('left-tips');
divTip = getTipDiv();
parentE.appendChild(divTip);
}
function rightTipProcessing() {
const parentE = document.getElementById('right-tips');
divTip = getTipDiv();
parentE.appendChild(divTip);
}
function getTipDiv() {
div = document.createElement('div');
div.id = tipID;
div.className = 'panel-box shadow tip-entry';
div.setAttribute('style', 'animation-delay:' + tipDelay + '; -webkit-animation-delay:' + tipDelay + ';');
html = '';
html += '';
html += '';
html += '';
html += '';
html += tipContent;
html += '
';
div.innerHTML = html;
return div;
}
function CloseTip(id) {
var e = document.getElementById(id);
e.style.display = "none";
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "/tip_action.php?action=close&id=" + id, true);
xmlhttp.send();
}