function statusChangeCallback(n){n.status==="connected"?(console.log("user is logged to app. call fb api;"),getUserDataAndLog()):n.status==="not_authorized"?console.log("user is not logged to app"):console.log("user is not logged to Facebook")}function checkLoginState(){FB.getLoginStatus(function(n){statusChangeCallback(n)})}function getUserDataAndLog(){FB.api("/me",{fields:"id, name, email"},function(n){console.log("Successful login for: "+n.name);document.getElementById("fbid").value=n.id;document.getElementById("userName").value=n.email;document.getElementById("btnSubmit").click()})}function CheckKey(n){evt=n||window.event;var t=evt.which||evt.keyCode;t==13&&_brow!="Firefox"&&(document.getElementById("btnSubmit").click(),n.preventDefault(),n.stopPropagation())}function PositionLoginDiv(){document.body.style.overflow="hidden";var t=$(window).width()/2,n=$(window).height()/2,i=parseInt($("#divLogin").height());t-=parseInt($("#divLogin").width())/2;n>i?(n-=i,n+=120):n=i/2-80;$("#divLogin").css("left",t+"px");$("#divLogin").css("top",n+"px");$("#divLogin").show();MyBrowser.browser=="Explorer"&&MyBrowser.version<9&&($("#divBrowsers").css("left",t-60+"px"),$("#divBrowsers").css("top",n+parseInt($("#divLogin").height())+20+"px"),$("#divBrowsers").show())}function checkPhone(n,t){if(t&&n=="")return!0;n=n.replace(/ /g,"");return/^0((5[012345678]){1}|[23456789]{1}|(7[5678]){1})(\-)?[^0\D]{1}\d{6}$/.test(n)?!0:!1}function checkAddDetails(){checkPhone(document.getElementById("cellPhone").value,!1)?(setErrorDiv("","none",0),document.getElementById("btnSubmit").click()):setErrorDiv("יש להזין מספר טלפון נייד תקין","",0)}function checkChangeDetails(){checkPhone(document.getElementById("cellPhone").value,!1)?(setErrorDiv("","none",1),document.getElementById("btnSubmitN").click()):setErrorDiv("יש להזין מספר טלפון נייד תקין","",1)}function checkOtp(){isNumber(document.getElementById("authCode").value)?(setErrorDiv("","none",0),document.getElementById("btnSubmit").click()):setErrorDiv("יש להזין מספר בלבד","",0)}function setErrorDiv(n,t,i){document.getElementsByClassName("login-error")[i].children[0].innerHTML=n;document.getElementsByClassName("login-error")[i].style.display=t}function showChangeDetails(n){setErrorDiv("","none",0);setErrorDiv("","none",1);n?(document.getElementById("divOTP").style.display="none",document.getElementById("divNotMe").style.display=""):(document.getElementById("divOTP").style.display="",document.getElementById("divNotMe").style.display="none")}function getNewAuthCode(n){document.frmOTP.action=n;document.frmOTP.submit()}window.fbAsyncInit=function(){FB.init({appId:"864177243651561",cookie:!0,xfbml:!0,version:"v2.12"});errorMessage==""&&FB.getLoginStatus(function(n){statusChangeCallback(n)})},function(n,t,i){var r,u=n.getElementsByTagName(t)[0];n.getElementById(i)||(r=n.createElement(t),r.id=i,r.src="//connect.facebook.net/en_US/sdk.js",u.parentNode.insertBefore(r,u))}(document,"script","facebook-jssdk");var _brow=MyBrowser.browser;console.log(MyBrowser.browser+" "+MyBrowser.version)