tmp=document.location.href.search("#access_token");if(tmp>0){s=document.location.href.substring(tmp+1);if(document.location.href.indexOf("?")>0)document.location.replace(document.location.href.substring(0,tmp)+"&fromVKauth=1&"+s);else
document.location.replace(document.location.href.substring(0,tmp)+"?fromVKauth=1&"+s);}(window.Zepto||window.jQuery,window,document),$(function(){setTimeout(()=>{var script=document.createElement("script");script.type="text/javascript";script.src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit";document.getElementsByTagName("head")[0].appendChild(script);},500);$(".open-modal").click(function(){$('body').css('overflow','hidden');var e=$(this).attr("href");if(e=="#modal-auth"&&window.innerWidth<=1150){$("#modal-pre-auth").show();return false;}$(".modal-registration").show();$(e).show();}),$(".open-modal-login").click(function(){$('body').css('overflow','hidden');var e=$(this).attr("href");$(".modal-login").show();$(".modal-registration").hide();$(e).show();}),$(".open-modal-registration").click(function(){$('body').css('overflow','hidden');var e=$(this).attr("href");$(".modal-login").hide();$(".modal-registration").show();$(e).show();}),$(".modal").click(function(e){if(!e.target.classList.contains('page-login-and-reg')&&!e.target.classList.contains('modal-country')&&!e.target.classList.contains('modal-addplace')){var t=$(this);0===t.find(".modal-content").has(e.target).length&&t.hide()&&$('body').css('overflow','');}}),(isLoading=!1),$(document).on("click","#btn-show-more .btn",function(e){e.preventDefault(),isLoading||((btn=$(this)),$.ajax("/ajax/kupons/",{data:{action:"getActions",id:btn.attr("data-group"),search:btn.attr("data-search"),page:btn.attr("data-page"),},success:function(e){$(".btn-show-more").remove(),$(".content-posts .kupons").append(e),(isLoading=!1),$(".lazy").lazyload();},beforeSend:function(){btn.css("color","#ccc"),(isLoading=!0);},}));}),$(".btn-change-content-wrapper").click(function(e){e.preventDefault();var t=$(this).closest(".col-12");t.find(".modal-content--wrapper__visible").hasClass("active")?(t.find(".modal-content--wrapper__visible").slideUp().removeClass("active"),setTimeout(function(){t.find($(".modal-content--wrapper__hidden")).slideDown().addClass("active");},300)):(t.find(".modal-content--wrapper__hidden").slideUp().removeClass("active"),setTimeout(function(){t.find($(".modal-content--wrapper__visible")).slideDown().addClass("active");},300));}),(dotcount=1),$(".cart-item").each(function(e,t){var n=$(this).find(".price-item--price > div > span"),i=Number(n.text()),o=$(this).find(".price-item--sum > div > span"),r=Number(o.text()),s=$(this).find('input[type="number"]'),a=$(this).find(".count-calc > input"),l=Number(a.attr("max"));function c(e){(r=i*e),s.val(e),s.change(),o.text(r);}a.keyup(function(){Number(a.val())>l&&a.val(100),0==Number(a.val())&&a.val(1),c(Number(s.val()));}),$(this).find(".count-calc > div").click(function(){var e=Number(s.val());$(this).hasClass("plus")?e+1<l&&(e+=1):1<e&&(e-=1),c(e);}),$(this).find(".price-item--delete").click(function(){var e=$(t).index()+1;$(".form-cart .cart-item:nth-child("+e+")").slideUp(),setTimeout("el.remove()",400);});}),$(".pay-variants .pay-variants--item").click(function(){var e=$(this);$(this).parent().find(".pay-variants--item__active").removeClass("pay-variants--item__active"),e.addClass("pay-variants--item__active");$("#realPayType").val($(this).data("paytype"));}),$(".pay-way--tab").click(function(){var e=$(this).attr("tab");$(".pay-way--tab__active").removeClass("pay-way--tab__active"),$(this).addClass("pay-way--tab__active"),$(".pay-way--tabs-content .tab__active").removeClass("tab__active"),$(".pay-way--tabs-content .tab[tab="+e+"]").addClass("tab__active");}),$(".tabs-nav--item").click(function(e){e.preventDefault();var t=$(this).attr("href");console.log(t),$(".tabs-nav--item__active").removeClass("tabs-nav--item__active"),$(this).addClass("tabs-nav--item__active"),$(".tabs-content .tab__active").removeClass("tab__active"),$(".tabs-content .tabs-content-item[tab="+t+"]").addClass("tab__active");}),"undefined"!=typeof offDate&&setInterval("startTimerInterval()",1e3);});if(document.location.href.search("fromAuthMailru=1")>0&&document.location.href.search("#")>0){document.location.replace(document.location.href.replace("#","&"));}function mainRuAuth(){var tmp=document.location.href;tmp=tmp.replace("new.","");tmp=socialkey+":"+tmp;window.open("https://oauth.mail.ru/login?client_id=f8a5e733d16248ee94f14be5fba97c0c&scope=userinfo&response_type=code&redirect_uri="+encodeURIComponent("https://fc.city/?fromAuthMailru=1")+"&state="+encodeURIComponent(tmp),"_self");}function OKauth(){var tmp=document.location.href;tmp=tmp.replace("new.","");tmp=socialkey+":"+tmp;window.open("https://connect.ok.ru/oauth/authorize?client_id=1258800640&scope=VALUABLE_ACCESS;GET_EMAIL&response_type=code&redirect_uri="+encodeURIComponent("https://fc.city/?fromAuthOK=1")+"&state="+encodeURIComponent(tmp),"_self");}function AppleAuth(){var tmp=document.location.href;tmp=tmp.replace("new.","");tmp=socialkey+":"+tmp;window.open("https://appleid.apple.com/auth/authorize?client_id=city.fc.singin&scope=email+name&response_type=code&response_mode=form_post&redirect_uri="+encodeURIComponent("https://fc.city/?fromAppleAuth=1")+"&state="+encodeURIComponent(tmp),"_self");}function googleAuth(){var tmp=document.location.href;tmp=tmp.replace("new.","");tmp=socialkey+":"+tmp;window.open("https://accounts.google.com/o/oauth2/auth?client_id=869269673342-pe45sbqut5s2kai1lmgem5a7odm6q6ss.apps.googleusercontent.com&response_type=code&scope="+encodeURIComponent("https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile")+"&redirect_uri="+encodeURIComponent("https://fc.city/?fromGoogleAuth=1")+"&state="+encodeURIComponent(tmp),"_self");}function yandexAuth(){window.open("https://oauth.yandex.ru/authorize?response_type=code&client_id=5befa52e4ba94066b5c61eaa868157a9&state="+socialkey+":"+encodeURIComponent(document.location.href),"_self");}function VKauth(type){window.open("https://oauth.vk.com/authorize?client_id=6823420&scope=email&redirect_uri="+encodeURIComponent("https://fc.city/?fromVKauth=1")+"&response_type=code&v=5.31&state="+type,"_self");}function VKinit(callback){if(document.getElementById("vkontakte-api")){callback();return false;}(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return;}js=d.createElement(s);js.id=id;js.src="//vk.com/js/api/openapi.js?116";js.onload=callback;fjs.parentNode.insertBefore(js,fjs);})(document,"script","vkontakte-api");}function FBauth(){FB.login(function(response){console.log(response);tmp=response.authResponse.signedRequest;if(response.authResponse){FB.api("/me?fields=name,email,gender,picture",function(response2){document.location.replace("/?fromFBauth=1&redirect="+encodeURIComponent(document.location.href)+"&id="+response2.id+"&email="+response2.email+"&name="+encodeURIComponent(response2.name)+"&gender="+response2.gender+"&picture="+encodeURIComponent(response2.picture.data.url));});}else
jAlert("Вы отменили авторизацию через FaceBook.",{isError:true});},{scope:"public_profile,email"});}function twitterAuth(){$.post("/ajax/users/",{action:"getTwitterToken"},function(s){if(s.status)window.open("https://api.twitter.com/oauth/authenticate?oauth_token="+s.text,"_self");else jAlert(s.text,{isError:true});},"json");}