var ve=ve||{};ve.sessiontimer=function(){"use strict";function t(){i()}function i(){var t,e=n(),o=r(),i,f;t=new u(function(n){n==o&&(f=i,$("#SessionExpireModal").modal({backdrop:"static",keyboard:!1}));n==0&&(window.location="/Account/LogOut")});t.start();$(document).on("click","#SynchronizeLoginSession",function(){$.ajax({type:"POST",url:"/Account/SynchronizeSession",dataType:"json",success:function(n){n==!0&&($("#SessionExpireModal").modal("hide"),t.reset(e))},error:function(){window.location="/Account/LogOut"}})});$(".modal").on("hidden.bs.modal",function(){$(".modal:visible").length&&($(".modal-backdrop").first().css("z-index",parseInt($(".modal:visible").last().css("z-index"))-10),$("body").addClass("modal-open"),$("#video-instructies").scrollTop(f))}).on("show.bs.modal",function(){$(".modal:visible").length&&($(".modal-backdrop.in").first().css("z-index",parseInt($(".modal:visible").last().css("z-index"))+10),$(this).css("z-index",parseInt($(".modal-backdrop.in").first().css("z-index"))+10))});$("#video-instructies").scroll(function(){i=$(this).scrollTop()})}function n(){return $("#SessionExpireModal").data("login-expire-time").split("|")[0]}function r(){return $("#SessionExpireModal").data("login-expire-time").split("|")[1]}function u(t){function f(){var n=i%60,t=Math.floor(i/60)%60;n=n<10?"0"+n:n;t=t<10?"0"+t:t;$("#sessionTimer span.second").html(n);$("#sessionTimer span.minute").html(t)}var i=n(),u=0,r=0,e;this.start=function(n){n=typeof n!="undefined"?n:1e3;r==0&&(r=1,e=setInterval(function(){switch(u){default:i&&(i--,f(),typeof t=="function"&&t(i));break;case 1:i<86400&&(i++,f(),typeof t=="function"&&t(i))}},n))};this.stop=function(){r==1&&(r=0,clearInterval(e))};this.reset=function(n){n=typeof n!="undefined"?n:0;i=n;f(i)};this.mode=function(n){u=n};this.getTime=function(){return i};this.getMode=function(){return u};this.getStatus=r}return{init:t}}()