<%@ Control Language="vb" AutoEventWireup="false" %>
<%@ Import namespace="System.Collections.Generic" %>
<script runat=server>
    Protected Function IsMappedPage() As Boolean
        Dim skipClose As Boolean = WebFoundations.Menu.Management.MenuItem.List("admin", HttpContext.Current.Request.Url.LocalPath).Any()
        If Not skipClose Then
            Dim adminPages As New List(Of String)
            adminPages.Add("/adminpage.aspx")
            adminPages.Add("/processodesign.aspx")
            adminPages.Add("/maineditor.aspx")
            adminPages.Add("/ninkimobile.aspx")
            adminPages.Add("/formedit.aspx")
            For Each pageName As String In adminPages
                If HttpContext.Current.Request.Url.ToString.ToLower.Contains(pageName) Then
                    skipClose = True
                    Exit For
                End If
            Next
        End If
        If HttpContext.Current.Request.Url.ToString.ToLower.Contains("/wfadmin/") AndAlso Not Page.IsPostBack AndAlso Not skipClose Then
            Return True
        Else
            Return False
        End If
    End Function
</script>
<%If WebFoundations.Library.Settings.GetSetting("Zuri.EnableTutorial", False) Then %>
	<style>.conpassButtonClose{min-width:auto;}</style>
	<script type="text/javascript" src="//api.conpass.io/conpass.js"></script>
	<% If WebFoundations.WFPortal.Management.Settings.Request.CurrentPage IsNot Nothing AndAlso WebFoundations.WFPortal.Management.Settings.Request.CurrentPage.Id = WebFoundations.WFPortal.Management.Settings.AppSettings.HomePageId AndAlso WebFoundations.AccessManagement.AdvancedManagement.UserInfoManager.CurrentUser IsNot Nothing AndAlso Not Page.IsPostBack Then %>
	<script type="text/javascript">
	Conpass.close();
	Conpass.startProject('Apresentação', 'bGVvbmFyZG9Ac29sdWNvZXMud2Y6d2Z6dXJp');
	<%If WebFoundations.Library.Settings.GetSetting("Zuri.EnableTutorialUser", False) Then %>
	Conpass.identifyUser({name:'<%=WebFoundations.AccessManagement.AdvancedManagement.UserInfoManager.CurrentUser.FullName%>',email:'<%=WebFoundations.AccessManagement.AdvancedManagement.UserInfoManager.CurrentUser.Email%>'}, 'bGVvbmFyZG9Ac29sdWNvZXMud2Y6d2Z6dXJp');
	<%End If %>
	</script>
	<%End if %>
	<% If IsMappedPage() Then %>
	<script type="text/javascript" >Conpass.close();</script>	
	<%End if %>
	<% If HttpContext.Current.Request.Url.ToString.ToLower.EndsWith("/wfadmin/adminpage.aspx") AndAlso Not Page.IsPostBack Then %>
	<script type="text/javascript" >Conpass.close();Conpass.startProject('Área Administrativa', 'bGVvbmFyZG9Ac29sdWNvZXMud2Y6d2Z6dXJp');</script>
	<%End if %>
<%End if %>
