<!-- This file is shown at the buttom of each page.-->

<%
login_id = Session("Admin_Id")
If (login_id = "") then
  login_id = Session("User_Id")
End If
%>

<!-- Allows to show the Session("ID") and to reference the user profile.-->
<!-- %id must be set as a variable in field supporter of table program_settings to do so. -->

<%
supporter = RSPSETTINGS("Supporter" & Session("UserLanguage"))
If (len(supporter) > 0 and not isnull(supporter)) then
  supporter = REPLACE(supporter,"#:#","'")
  supporter = REPLACE(supporter,"@:@","<")											
  supporter = REPLACE(supporter,"¬:¬",">")
  supporter = REPLACE(supporter,"?:?","&nbsp;")
End If

Set regEx = Server.CreateObject("VBScript.RegExp")
regEx.IgnoreCase = True
regEx.Global = True															' g option in sed

regEx.Pattern = "%id"
if (len(trim(Session("ID"))) >= 1) then
  if not isnull(supporter) then
    supporter = regEx.Replace(supporter, trim(Session("ID")))
  end if
else
  if not isnull(supporter) then
    supporter = regEx.Replace(supporter, "")
  end if
end if
%>

<!-- Disable the user profile href for guests and other dummyusers-->

<%
if (Session("UserType") = "dummyuser" AND thisUsersGroup <> "Administrator") then
  regEx.Pattern = "<a([^>])*>"												' disable all <a href> and </a>
  if not isnull(supporter) then
    supporter = regEx.Replace(supporter, "")
  end if  
end if
%>

<!-- Allows to show Session("UserName") -->
<!-- %username must be set in field supporter. -->

<%
regEx.Pattern = "%username"
if (len(trim(Session("UserName"))) >= 1) then
  username = trim(Session("UserName"))
  username = mid(username,instr(username,",") + 1, 99) + " " + mid(username, 1, instr(username,",") - 1)
  if not isnull(supporter) then
    supporter = regEx.Replace(supporter, trim(username))
  end if  
else
  if not isnull(supporter) then
    supporter = regEx.Replace(supporter, "")
  end if
end if
%>

<!-- Allows to show Session("User_Id") -->
<!-- %login_id must be set in field supporter. -->

<%
regEx.Pattern = "%login_id"
if (Session("Admin_ID") <> "") then
  if not isnull(supporter) then
    supporter = regEx.Replace(supporter, trim(Session("Admin_ID")))
  end if
end if
if (Session("User_ID") <> "") then
  if not isnull(supporter) then
    supporter = regEx.Replace(supporter, trim(Session("User_ID")))
  end if
end if
if (Session("User_ID") = "" AND Session("Admin_ID") = "") then
  if not isnull(supporter) then
    supporter = regEx.Replace(supporter, "")
  end if
end if

regEx.Pattern = "\(\)"
if not isnull(supporter) then
  supporter = regEx.Replace(supporter, "")
end if
regEx.Pattern = "[^a-z&&^A-Z&&^0-9^\.]\)$"
if not isnull(supporter) then
  supporter = regEx.Replace(supporter, ")")
end if
regEx.Pattern = "\([^a-z&&^A-Z&&^0-9^\.^-^_]*FreeCalendar*[^a-z&&^A-Z&&^0-9^\.^-^_]*\)$"
if not isnull(supporter) then
  supporter = regEx.Replace(supporter, "")
end if
regEx.Pattern = "bienvenida.*!"					
if not isnull(supporter) then
  supporter = regEx.Replace(supporter, "bienvenida!")
end if
%> 

<!-- Show the Application Session Counter (nr of open user sessions) in the right down corner when an Administrator is logged in. -->
<!-- This session counter is set in global.asa -->

<%
if (RSPSETTINGS("Font_Size") > 1) then
  smallfontsize = RSPSETTINGS("Font_Size")-1
else 
  smallfontsize = 1
end if
%>

<html>

<tr>

 <td width="1" bgcolor="#000000"><img src="images/clear.gif" height="1" width="1"></td>

 <td colspan="3" align="center" bgcolor="<%=RSPSETTINGS("Menu_Color")%>" height="30">

 <%=supporter%>
 <%If (Session("Admin_Id") <> "") then
   If (Application("SessionCounter") = 1) then
     current_users = "present user"
     if Session("UserLanguage") = "_Eng" then
        current_users = "present user"
     end if
     if Session("UserLanguage") = "_Ger" then
        current_users = "aktueller Benutzer"
     end if
     if Session("UserLanguage") = "_Fra" then
        current_users = "utilisateur courant"
     end if
     if Session("UserLanguage") = "_Ita" then
        current_users = "utente corrente"
     end if
     if Session("UserLanguage") = "_Esp" then
        current_users = "usuario actual"
     end if
   Else
     current_users = "present users"
     if Session("UserLanguage") = "_Eng" then
        current_users = "present users"
     end if
     if Session("UserLanguage") = "_Ger" then
        current_users = "aktuelle Benutzer"
     end if
     if Session("UserLanguage") = "_Fra" then
        current_users = "utilisateurs courants"
     end if
     if Session("UserLanguage") = "_Ita" then
        current_users = "utenti correnti"
     end if
     if Session("UserLanguage") = "_Esp" then
        current_users = "usuarios actuales"
     end if
   End If
   %>
   
 <%End If%>
 
 <%
 copyright = RSPSETTINGS("Copyright")
 If (len(copyright) > 0 and not isnull(copyright)) then 
   copyright = REPLACE(copyright,"#:#","'")
   copyright = REPLACE(copyright,"@:@","<")											
   copyright = REPLACE(copyright,"¬:¬",">")
   copyright = REPLACE(copyright,"?:?","&nbsp;")
 End If
 %>

 <br><%=copyright%>
 
 <!-- Show the text edit link for administrators-->
 
 <%If (Session("Admin_Id") <> "" OR thisUsersGroup = "Administrator") then%>
    <a href="text_edit.asp?ProgramPage=<%=scriptname%>&language=<%=Session("Userlanguage")%>">&nbsp;</a></td>
 <%End If%>
 
 </td>

 <td width="1" bgcolor="#000000"><img src="images/clear.gif" height="1" width="1"></td>

</tr>

</html>