<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean" %>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
<script>
  function hideDialog() {
    var dialogBox = document.getElementById("dialogBox");
    dialogBox.style.visibility = "hidden";
  }

  function showDialog(content) {
    var dialogBox = document.getElementById("dialogBox");
    var dialogContent = document.getElementById("dialogContent");
    dialogContent.innerHTML = content;
    dialogBox.style.visibility = "visible";
  }
</script>
<div id="dialogBox" style="visibility: hidden; position: absolute; left: 165px; top: 50px; width: 640px; border-style: solid; border-width: 1px; border-color: #00006A; background-color: white; z-index: 1000;">
  <table border="0" width="100%">
    <tr>
      <td style="width: 100%" id="dialogContent"></td>
      <td valign="top" align="right">
        <a href="javascript:hideDialog();"><img src="${pageContext.request.contextPath}/img/bt_fermer.gif" border="0"></a>
      </td>
    </tr>
  </table>
</div>
<%
  {
    org.apache.struts.action.ActionMessages attributeErrors = (org.apache.struts.action.ActionMessages) request.getAttribute(org.apache.struts.Globals.ERROR_KEY);
    org.apache.struts.action.ActionMessages sessionErrors = (org.apache.struts.action.ActionMessages) request.getSession().getAttribute(org.apache.struts.Globals.ERROR_KEY);
    org.apache.struts.action.ActionMessages attributeMessages = (org.apache.struts.action.ActionMessages) request.getAttribute(org.apache.struts.Globals.MESSAGE_KEY);
    org.apache.struts.action.ActionMessages sessionMessages = (org.apache.struts.action.ActionMessages) request.getSession().getAttribute(org.apache.struts.Globals.MESSAGE_KEY);
    if ((attributeErrors != null && !attributeErrors.isEmpty()) || (sessionErrors != null && !sessionErrors.isEmpty()) || (attributeMessages != null && !attributeMessages.isEmpty()) || (sessionMessages != null && !sessionMessages.isEmpty())) {
%>
<div id="errorDiv" style="visibility: hidden; ">
  <table border="0" width="100%">
    <tr>
      <td>
        <html:errors name="<%=org.apache.struts.Globals.ERROR_KEY%>"/>
        <html:errors name="<%=org.apache.struts.Globals.MESSAGE_KEY%>"/>
      </td>
    </tr>
  </table>
</div>
<script>
  showDialog(document.getElementById("errorDiv").innerHTML);
</script>
<%
    }
  }
%>