function runScript(n){if(n.keyCode==13)return n.preventDefault(),btnShareMail(),!1}function generateLink(n){var r=window.location.origin,t="",u,i;return typeof n=="object"&&n.hashedMemberId!=null?(u=typeof _catName!="undefined"&&_catName!="",i=n.hashedMemberId,t=u?r+"/b144_sip/"+i+".aspx":r+"/bezeq_phone/"+i+".aspx"):t=typeof n=="object"&&n.link!=null?n.link:window.location.href,t}function mailShare(n,t){function i(){btnShareMail(n,t)}ShowNotificationWithInput("שיתוף "+t+" במייל","אנא הזן את שמך כפי שיופיע בהודעה שתשלח לחבר","הזן את שמך",i)}function btnShareMail(element,mailsubject){var senderName;if(element=eval(element),senderName=$("#popUpNotificationInput").val(),senderName=="")return $("#popupResponseText").text("יש להזין שם"),!1;HideNotification();var title=document.title,theTitle="{0} שיתף עמך {1}".format(senderName,mailsubject),first="שלום,",second=element.shareableSMS,generatelink=generateLink(element),link=" מצורף קישור: "+generatelink,end1="לשימושך האישי,",end2="אתר B144",replaceMailBodySender="{0}%0A{1}%0A{2}%0A{3}%0A{4}".format(first,second,link,end1,end2);return window.location.href="mailto:?subject="+theTitle+"&body="+replaceMailBodySender,!1}function faceBookShare(n){var t=generateLink(n),i=document.title.replace(re,"");return window.open("https://www.facebook.com/sharer/sharer.php?u="+t+"&title="+i,"","menubar=no,toolbar=no,resizable=no,scrollbars=yes,height=600,width=600"),!1}function messengerShare(n){var t=generateLink(n);isMobile?window.open("fb-messenger://share?link="+encodeURIComponent(t)+"&app_id="+encodeURIComponent(app_id)):window.open("https://www.facebook.com/dialog/send?redirect_uri="+encodeURIComponent(t)+"&link="+encodeURIComponent(t)+"&app_id="+encodeURIComponent(app_id))}function twitterShare(n){var t=generateLink(n);return window.open("https://twitter.com/share?url="+t,"","menubar=no,toolbar=no,resizable=no,scrollbars=yes,height=600,width=600"),!1}function whatsappShareFunc(currentMember){var link,text;if(currentMember=eval(currentMember),link=generateLink(currentMember),currentMember!=null&&currentMember.MID!=null&&currentMember.ReportClick(27,null),text="",currentMember!=null&&currentMember.shareableSMS!=null?text=currentMember.shareableSMS+" "+link:typeof shareableSMS!="undefined"&&shareableSMS!=null&&(text=shareableSMS),isMobile)nativeAppProxyEx.OpenWhatsapp("whatsapp://send?text="+text);else{function n(){var t=$("#popUpNotificationInput").val(),n;if(t=="")return $("#popupResponseText").attr("placeholder","יש להזין מספר"),$("#popupResponseText").text("יש להזין מספר"),!1;n=whatIsMyPhone(t);n.error==""?(HideNotification(),window.open("https://web.whatsapp.com/send?phone="+escape("972"+t)+"&text="+text,"_blank")):($("#popupResponseText").attr("placeholder",n.error),$("#popupResponseText").text(n.error))}ShowNotificationWithInput("שיתוף בוואטסאפ","מספר הטלפון אליו נשלח לך את הפרטים","לדוגמה: 0501111111",n)}}function copyLink(n,t){var i=generateLink(t);$(n).attr("data-clipboard-text",i);copyToClipboard(n)}function sendDetailsToPhone(n,t,i){function e(){var u=this.toString();if(u=="true"){function u(){var t=$("#popUpNotificationInput").val();sendDetails(t,"popupResponseText",n,r,!0,i)}ShowNotificationWithInput("שיתוף בנייד","מספר הטלפון אליו נשלח לך את הפרטים","לדוגמה: 0501111111",u,!1);t!=""&&$("#popUpNotificationInput").val(t)}else ShowNotification("שליחת פרטי העסק לנייד","שלום, חרגת ממגבלת כמות השליחות. אנא נסה מאוחר יותר")}var u;$("#popUpadditionalBody").html("");var r="1",f={capchaOrigin:r,isInsert:!1};u=function(){console.log(isValidIp);$("#"+responseElementId).text("ישנה שגיאה.");$("#"+responseElementId).attr("role","alert")};ajaxCall(f,e,u,"/Services/BsoftCaptcha.asmx/isValidIp","POST")}function sendDetails(inputValue,responseElementId,element,capchaOrigin,isPopup,originPage){var originElement=element,phoneNumber,data,_url,mid,message;if(element=eval(element),phoneNumber=whatIsMyPhone(inputValue),_url="",typeof element=="object"&&element.MID!=null?(mid=element.MID,_data={MID:mid,phoneNum:phoneNumber.areaCode+phoneNumber.number,token:element.Token,reCaptchaToken:"",isNativApp:nativeAppProxyEx.IsInNativeApp()},_url="/MemberCardResp/businessCard.aspx/sendDetailsViaSms",originPage=="privateCard"&&(_url="/MemberCardResp/privateCard.aspx/sendDetailsViaSms")):(message=element.shareableSMS+" מצורף קישור: "+generateLink(element),_url="/Services/Cities.asmx/sendDetailsViaSms",_data={phoneNum:phoneNumber.areaCode+phoneNumber.number,message:message}),phoneNumber.error.trim()!=""){$("#"+responseElementId).text(phoneNumber.error);$("#"+responseElementId).attr("role","alert");return}var _successPopupFunc=function(){var n,t,i,r;google_captcha_code="";this.d==!0?(n="/Services/BsoftCaptcha.asmx/insertUserIP",t="POST",ajaxCall({capchaOrigin:capchaOrigin},null,null,n,t),isPopup==!0?(dataLayer.push({event:"GAEvent",smsdetails:"success"}),typeof element=="object"&&element.MID!=null&&(element="member_"+element.MID),$("#popUpNotificationWithInputClose").click(),i=phoneNumber.areaCode+phoneNumber.number,r=`<div><span>לא קיבלתי את ההודעה,</span><span onclick="HideNotification();sendDetailsToPhone('${originElement}', '${i}', '${originPage}');"> שילחו לי שוב</span></div>`,ShowNotification("שליחת פרטי העסק לנייד","<span>ההודעה נשלחה בהצלחה!<\/span><\/br><span class='msg'>לפעמים לוקח להודעה דקה או שתיים להגיע<span>","סגור",r)):(dataLayer.push({event:"GAEvent",smsdetails:"success"}),$("#modal_phone").css("display","none"),$("#sendInputData").css("display","none"),$("#orange_sendInputData").css("display","none"),$("#send-to-phone-captcha-container").css("display","none"),$("#"+responseElementId).text("הפרטים נשלחו בהצלחה. תודה."),memberCardProductClick("sendMemberNumber"))):_errorPopupFunc()},_errorPopupFunc=function(){$("#"+responseElementId).text("ישנה שגיאה.");$("#"+responseElementId).attr("role","alert")},method="POST";ajaxCall(_data,_successPopupFunc,_errorPopupFunc,_url,method)}function getShareContantElements(n){var t,i;return n=="privateCard"&&(t={sms:{showinMobile:!0,showinDesktop:!1},whatsapp:{showinMobile:!0,showinDesktop:!0},mail:{showinMobile:!0,showinDesktop:!0,mailsubject:"פרטי איש קשר"},twitter:{showinMobile:!1,showinDesktop:!1},facebook:{showinMobile:!1,showinDesktop:!1},messenger:{showinMobile:!0,showinDesktop:!0},link:{showinMobile:!0,showinDesktop:!0}}),n=="businessCard"&&(i=_catName==""?"כרטיס העסק":"כרטיס העסק בתחום: "+_catName,t={sms:{showinMobile:!0,showinDesktop:!1},whatsapp:{showinMobile:!0,showinDesktop:!0},mail:{showinMobile:!0,showinDesktop:!0,mailsubject:"כרטיס עסק"},twitter:{showinMobile:!0,showinDesktop:!0},facebook:{showinMobile:!0,showinDesktop:!0},messenger:{showinMobile:!1,showinDesktop:!1},link:{showinMobile:!0,showinDesktop:!0}}),n=="article"&&(t={sms:{showinMobile:!0,showinDesktop:!0},whatsapp:{showinMobile:!0,showinDesktop:!0},mail:{showinMobile:!0,showinDesktop:!0,mailsubject:"את הכתבה"},twitter:{showinMobile:!0,showinDesktop:!0},facebook:{showinMobile:!0,showinDesktop:!0},messenger:{showinMobile:!1,showinDesktop:!1},link:{showinMobile:!0,showinDesktop:!0}}),n=="priceList"&&(t={sms:{showinMobile:!0,showinDesktop:!0},whatsapp:{showinMobile:!0,showinDesktop:!0},mail:{showinMobile:!0,showinDesktop:!0,mailsubject:"את המחירון"},twitter:{showinMobile:!0,showinDesktop:!0},facebook:{showinMobile:!0,showinDesktop:!0},messenger:{showinMobile:!1,showinDesktop:!1},link:{showinMobile:!0,showinDesktop:!0}}),n=="categoryMarketing"&&(t={sms:{showinMobile:!0,showinDesktop:!0},whatsapp:{showinMobile:!0,showinDesktop:!0},mail:{showinMobile:!0,showinDesktop:!0,mailsubject:"את המדריך"},twitter:{showinMobile:!0,showinDesktop:!0},facebook:{showinMobile:!0,showinDesktop:!0},messenger:{showinMobile:!1,showinDesktop:!1},link:{showinMobile:!0,showinDesktop:!0}}),n=="mipanuy"&&(t={sms:{showinMobile:!0,showinDesktop:!1},whatsapp:{showinMobile:!0,showinDesktop:!1},mail:{showinMobile:!0,showinDesktop:!1,mailsubject:"שירות מי פנוי"},twitter:{showinMobile:!1,showinDesktop:!1},facebook:{showinMobile:!1,showinDesktop:!1},messenger:{showinMobile:!0,showinDesktop:!1},link:{showinMobile:!0,showinDesktop:!1}}),n=="zipCode"&&(t={sms:{showinMobile:!0,showinDesktop:!0},whatsapp:{showinMobile:!0,showinDesktop:!0},mail:{showinMobile:!0,showinDesktop:!0,mailsubject:"מיקוד"},twitter:{showinMobile:!1,showinDesktop:!1},facebook:{showinMobile:!1,showinDesktop:!1},messenger:{showinMobile:!0,showinDesktop:!0},link:{showinMobile:!0,showinDesktop:!0}}),t}function openShareContent(n,t,i){var r=getShareContantElements(t),u=[],f=n;typeof n=="object"&&n.MID!=null&&(f="member_"+n.MID);(r.link.showinMobile||r.link.showinDesktop)&&u.push({imageDesktop:"/images/icons/shareIcons/bc-links.svg",imageMobile:"/images/icons/shareIcons/bc-links.svg",name:"קישור",id:"copyLink",showInMobile:r.link.showinMobile,showInDesktop:r.link.showinDesktop,"function":`copyLink(this,${f},HideSlidingPopup())`});(r.sms.showinMobile||r.sms.showinDesktop)&&u.push({imageDesktop:"/images/icons/businessCard/bc-message.svg",imageMobile:"/images/icons/businessCard/bc-message.svg",name:"sms",id:"btnSms",showInMobile:r.sms.showinMobile,showInDesktop:r.sms.showinDesktop,"function":`sendDetailsToPhone("${f}",HideSlidingPopup(),"${t}")`});(r.whatsapp.showinMobile||r.whatsapp.showinDesktop)&&u.push({imageDesktop:"/images/icons/shareIcons/whatsapp-share.svg",imageMobile:"/images/icons/shareIcons/whatsapp-share.svg",name:"וואטסאפ",id:"btnWhatsapp",showInMobile:r.whatsapp.showinMobile,showInDesktop:r.whatsapp.showinDesktop,"function":`whatsappShareFunc("${f}",HideSlidingPopup())`});(r.mail.showinMobile||r.mail.showinDesktop)&&u.push({imageDesktop:"/images/icons/shareIcons/email-share.svg",imageMobile:"/images/icons/shareIcons/email-share.svg",name:"מייל",id:"btnDialog",showInMobile:r.mail.showinMobile,showInDesktop:r.mail.showinDesktop,"function":`mailShare("${f}","${r.mail.mailsubject}",HideSlidingPopup())`});(r.twitter.showinMobile||r.twitter.showinDesktop)&&u.push({imageDesktop:"/images/icons/shareIcons/twitter-share.png",imageMobile:"/images/icons/shareIcons/twitter-share.png",name:"טוויטר",id:"twitterShare",showInMobile:r.twitter.showinMobile,showInDesktop:r.twitter.showinDesktop,"function":`twitterShare(${f},HideSlidingPopup())`});(r.facebook.showinMobile||r.facebook.showinDesktop)&&u.push({imageDesktop:"/images/icons/shareIcons/facebook-share.svg",imageMobile:"/images/icons/shareIcons/facebook-share.svg",name:"פייסבוק",id:"faceBookShare",showInMobile:r.facebook.showinMobile,showInDesktop:r.facebook.showinDesktop,"function":`faceBookShare(${f},HideSlidingPopup())`});(r.messenger.showinMobile||r.messenger.showinDesktop)&&u.push({imageDesktop:"/images/icons/shareIcons/facebook-share.svg",imageMobile:"/images/icons/shareIcons/facebook-share.svg",name:"מסנג'ר",id:"messengerShare",showInMobile:r.messenger.showinMobile,showInDesktop:r.messenger.showinDesktop,"function":`messengerShare(${f},HideSlidingPopup())`});isMobile?createPopUpMobileDown("",u):createSharePopUpDesktop("",u,i)}function toggleMyClass(n,t,i){$("#"+t).toggle(i)}function closeAllShareContainerPopUp(n,t){t!=""?$("[id^='shareContentContainer']:visible").not("#"+t).toggle(n):$("[id^='shareContentContainer']:visible").toggle(n)}function sendDetailsToPhoneWithCaptche(n,t,i){function r(){if(!nativeAppProxyEx.IsInNativeApp()&&typeof google_captcha_code!="string"||google_captcha_code.length===0){$("#popupResponseText").text("יש לאשר שאינך רובוט");$("#popupResponseText").attr("role","alert");return}var t=$("#popUpNotificationInput").val();sendDetails(t,"popupResponseText",n,google_captcha_code,!0,i)}ShowNotificationWithInput("שיתוף בנייד","מספר הטלפון אליו נשלח לך את הפרטים","לדוגמה: 0501111111",r,!0);t!=""&&$("#popUpNotificationInput").val(t)}var re=/""''?/;String.prototype.format||(String.prototype.format=function(){var n=arguments;return this.replace(/{(\d+)}/g,function(t,i){return typeof n[i]!="undefined"?n[i]:t})});$(document).on("click",function(n){n.target.id!="shareContentContainer"&&$(n.target).closest("#iconWrapShareContainer").length<1&&$("[id^='shareContentContainer']:visible").length>0&&closeAllShareContainerPopUp("closePopUp")});var PERMISSION_DENIED=1,POSITION_UNAVAILABLE=2,TIMEOUT=3,GeoLocationObj=function(){function r(i,r){if(_getLocationCallBack=i,t=r,typeof _globalAppXYPoint!="undefined")_globalAppXYPoint.xCoord!=0&&_globalAppXYPoint.yCoord!=0&&typeof _getLocationCallBack!="undefined"?_getLocationCallBack(_globalAppXYPoint):f("no gps");else{var u=new bsoftNativeAppProxy;u.IsInNativeApp()==!0?u.RequestXY(function(t){t.xCoord==0&&t.yCoord==0&&(_HasErrorObj.value=!0,_HasErrorObj.errors.push("position value is 0"));n=t;typeof _getLocationCallBack!="undefined"&&_getLocationCallBack(n)}):(_HasErrorObj.errors=[],navigator.geolocation.getCurrentPosition(s,f,{timeout:2e3,maximumAge:75e3,enableHighAccuracy:!0}))}}function o(){var n=/iphone/i.test(navigator.userAgent.toLowerCase());return n?!0:!1}function u(){ShowNotification("גישה למיקום","<strong>שימוש ב- B144 מצריך גישה למידע על מיקומך<\/strong> יש להפעיל את ה- GPS כדי ליהנות מכל מה שיש לנו להציע","אישור",function(){return!1})}function f(n){_HasErrorObj.value=!0;_HasErrorObj.errors.push(n);n.code==PERMISSION_DENIED;n.code==POSITION_UNAVAILABLE;n.code==TIMEOUT;typeof t!="undefined"&&_HasErrorObj.errors.length==1&&t(n)}function s(t){var i=new xyPoint(t.coords.longitude,t.coords.latitude);i.xCoord==0&&i.yCoord==0&&(_HasErrorObj.value=!0,_HasErrorObj.errors.push("position value is 0"));n=i;typeof _getLocationCallBack!="undefined"&&_getLocationCallBack(n)}navigator.geolocation.getCurrentPosition(function(){},function(){},{timeout:1e4,maximumAge:1e4,enableHighAccuracy:!0});var h=this,i=function(){this.value=!1;this.error="דפדפן לא תומך בזיהוי מיקום גיאוגרפי"},e=function(){this.value=!1;this.errors=[]},c=function(){},t=function(){},n=function(){},l=function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?!0:!1};_GeoLocationAvailablityObj=new i;_HasErrorObj=new e;"geolocation"in navigator?_GeoLocationAvailablityObj.value=!0:(_GeoLocationAvailablityObj.value=!1,_HasErrorObj.errors.push(i.error));this.GetCurrentLocation=function(n,t){o()?navigator.geolocation.getCurrentPosition(function(){r(n,t)},u,{timeout:1e4,maximumAge:1e4,enableHighAccuracy:!1}):navigator.geolocation.getCurrentPosition(function(){r(n,t)},u,{timeout:1e4,maximumAge:1e4,enableHighAccuracy:!1})}},xyPoint=function(n,t,i){this.XCoord=n;this.YCoord=t;this.IconUrl=i}