$(document).on("click","a.smooth",function(n){n.preventDefault();var t=$(this),i=t.attr("href");$("html, body").stop().animate({scrollTop:$(i).offset().top},1e3)});SyntaxHighlighter.all();$(function(){$.ajaxSetup({cache:!1});$("[data-navurl]").each(function(n,t){var i=$(t).attr("data-navurl"),u=$(t).attr("data-nav-home"),r;i==="/"&&document.location.pathname==="/"?$(t).addClass("active"):u===undefined&&(r=document.location.pathname.indexOf(i),r!=-1&&$(t).addClass("active"))});$(".nav").on("click mousedown mouseup touchstart touchmove","a.has_children",function(){return $(this).next("ul").hasClass("open_t")&&!$(this).parents("ul").hasClass("open_t")?($(".open_t").removeClass("open_t"),!1):($(".open_t").not($(this).parents("ul")).removeClass("open_t"),$(this).next("ul").addClass("open_t"),!1)});$(document).on("click",":not(.has_children, .has_children *)",function(){if($(".open_t").length>0)return $(".open_t").removeClass("open_t"),$(".open_t").parent().removeClass("open"),!1});$("#back-top").hide();$(window).scroll(function(){$(this).scrollTop()>100?$("#back-top").fadeIn():$("#back-top").fadeOut()});$("#back-top a").click(function(){return $("body,html").animate({scrollTop:0},500),!1});$("#login-form").submit(function(n){n.preventDefault();$("#login-form #login-form-message").html("");$.ajax({type:"POST",url:"/api/auth/login",data:JSON.stringify({email:$("#login-form #login-form-email").val(),password:$("#login-form #login-form-password").val(),rememberMe:$("#login-form #login-form-rememberme").prop("checked")}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){n.Success===!0?window.location=n.redirectUrl:n.Error===400?$("#login-form #login-form-message").html("Validation error."):n.Error===401?$("#login-form #login-form-message").html("Email or password not found or incorrect."):$("#login-form #login-form-message").html("Unknown error.")},failure:function(n){$("#login-form-message").text("Login failed. "+n)}})});$('[rel="popover"]').popover()});(new WOW).init()