<%@ language = "JavaScript" %>
<!-- #include file="../Shared/common.inc" -->
<html>
<HEAD>
<%  FCLTHeader.Generate(); %>
    <TITLE>Foto</TITLE>
    <script type="text/javascript">
        function click(e) {
        //  if (event.button == 2) {
            alert(L("lcl_prs_photo_dontuse"));
            return false;
        //  }
        }
        document.onmousedown=click;
    </script>
</HEAD>

<body>
<%
  var prs_key = getQParamInt("prs_key");

  var sql = "SELECT prs_kenmerklink_waarde"
          + "  FROM prs_kenmerklink"
          + " WHERE prs_kenmerk_key = " + S("prs_photo_kenmerk_key")
          + "   AND prs_link_key = " + prs_key ;
  var oRs = Oracle.Execute(sql);

    if (oRs.eof) {
    %>
      <div align="center">
      <h3><%=L("lcl_pb_nophoto")%></h3>
      </div>
    <%
    } else {
      if ( oRs("prs_kenmerklink_waarde").value == S("prs_photo_kenmerk_showval")) {
        // Foto is badgenummer + .jpg
        sql = "SELECT prs_kenmerklink_waarde"
            + "  FROM prs_kenmerklink"
            + " WHERE prs_kenmerk_key = " + S("badgenum_kenmerk_key")
            + "   AND prs_link_key = " + prs_key ;

        oRs = Oracle.Execute(sql);

        if (oRs.eof) {
          %>
          <div align="center">
          <h3><%=L("lcl_pb_nophoto")%></h3>
          </div>
          <%
        } else {
          var Photoname = S("prs_image_path") + oRs(0).value+".jpg";
        }
      }
    }
%>
  <img src=<%=safe.htmlattr(Photoname)%> height="200px">
</body>
</html>