<%@page import="java.util.ArrayList"%>
<%@page import="java.util.HashSet"%>
<%@page import="java.util.Iterator"%>
<html>
<!--logoutform-->
 <head>
  <title>ALF SSO Logout</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript">

      function init() {
        
        if(top != self) {//if the login page is in a frame, we need to reload the top
          top.location.reload();
        }
     }
    </script>
    
  <style type="text/css">
    body {
      background-color:#B4B1A0;;
      FONT-WEIGHT:normal;
      MARGIN:80px;
      color:black;
      font-family:Verdana;
      font-size:12;
    }
    .inputField
    {
      font-size:14;
      width:100%;
    }
    .inputButton
    {
      padding-top:5px;
      padding-bottom:5px;
      padding-left:10px;
      padding-right:10px;
      font-size:12;
    }
    .label
    {
      color:black;
      font-family:Verdana;
      font-size:12;
    }
    .heading
    {
      font-family:Verdana;
      font-size:16;
    }
    .wrapper
    {
      vertical-align:center;
      background-color:white;
      border: 3px groove #181818;
      text-align:middle;
      width:60%;
    }
    A 
    {
      font-size:12;
      text-decoration:none;
      color:#4D463B;
    }
    A.visited 
    {
      color:#4D463B;
    }
    A.notVisited 
    {
      color:#4D463B;
    }    
    A:hover, A.visited:hover, A.notVisited:hover 
    { 
      text-decoration:none;
      border-bottom:dashed 1px;
    }
    .err
    {
      color:Maroon;
      font-size:16;
    }
  </style>

</head>

		<%
		String replyURL = (String) request.getAttribute("ATTR_WREPLY");
		ArrayList signoutURIs = (ArrayList) request.getAttribute("ATTR_LOGOUT_SIGNOUT_URLS");
		if (signoutURIs == null)
			signoutURIs = new ArrayList();
		HashSet signoutFriendlyNames = (HashSet) request.getAttribute("ATTR_SIGNOUT_SERVICE_NAMES");
		if (signoutFriendlyNames == null)
			signoutFriendlyNames = new HashSet();
		
		String logoutSubject = (String) request.getAttribute("ATTR_LOGOUT_SUBJECT");
		String msg = "Logout";
		if (logoutSubject != null && logoutSubject.length() > 0) {
			msg = "Logging out " + logoutSubject;
		}
		%>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="init();">      
  <center>
    <div class=wrapper>
      <center>
        <br><br>
        <img src="img/alf.gif" alt="Welcome to ALF" title="ALF Logo"><p>
        <span class="heading"><%=msg%></span><p></p>
		<table summary="" border="0" cellspacing="10" cellpadding="5" width="60%">
			<% Iterator it = signoutFriendlyNames.iterator();
				while (it.hasNext()) { 
			%>
					<tr><td align="center" class="label">Logging out of "<%=(String) it.next()%>"</td></tr>
			<% } %>
			
			<!-- Display the reply URL -->
			<% if (replyURL != null && replyURL.length() > 0) { %>
				<tr><td colspan="2" align="center"><a href="<%=replyURL%>">Press here to relogin</a></td></tr>
			<% } %>	             
			
		</table>
		
		<% for (int i=0; i < signoutURIs.size(); i ++) { %>
			<div style="visibility:hidden"><iframe src="<%=(String)signoutURIs.get(i)%>"></iframe></div>
		<% } %>
      </center>
    </div>
  </center>
</body>
</html>
