<%
  path =   File.dirname(__FILE__)
  $:.unshift path + '/lib'           # necessary for some installs
  require 'cgi'
  require 'lump'
  cgi = CGI.new

  lump = Lump.new(path + '/lump.conf')

  puts lump.page_head

  if lump.config['head']['link']
    lump.config['head']['link'].each do |link|
      print '    <link rel="'
      print link[1]['rel']
      print '" type="'
      print link[1]['type']
      print '" title="'
      print link[1]['title']
      print '" href="'
      print link[1]['href']
      puts '" />'
    end
  end
%>
    <title><% print lump.config['head']['title'] %>: Contact Page</title>
  </head>

  <body>

    <h1><a href="./"><% print lump.config['head']['title'] %>: Contact Page</a></h1>

    <div class="sidebar">
      <ul>
<%
        lump.anchor_list('menu').each {|a| puts '      ' + a }
#        lump.config['menu'].each do |a|
#          print %Q{        <li><a href="#{a[1]['url'].to_s}">}
#          puts  a[0]['name'].to_s << '</a></li>'
#        end
%>
      </ul>
    </div>

    <div class="physique">

      <div class="midblock">

        <% print '<p class="message">Previous Message Sent</p>' if cgi['message'] == 'sent' %>

        <p>To contact Chad Perrin, please fill out the form below.  The name and message fields are required.  You should also fill out the email field if you wish to receive an email response.</p>

        <form action="http://blogstrapping.com/cgi-bin/sendmail.rb" method="post">
          <input type="hidden" name="required" value="realname, comments" />
          <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT" />
          <input type="checkbox" name="owl" checked="checked" /> <abbr title="If the &quot;share&quot; checkbox is unchecked, I will assume you want your message kept private.  Otherwise, I will feel free to share it as an update to a blogstrapping essay to which it was addressed, to quote it in a later essay, or to otherwise share with other people, attributing it to the name you provide.">"Share my message under <a href="http://owl.apotheon.org">Open Works License</a> terms."</abbr><br />
          <input type="text" class="twofifty" name="realname" maxlength="150"><abbr title="Use the name to which you want your message credited if shared, or the name you would like me to use when addressing you in a reply."><strong>Your Name</strong></abbr></input><br />
          <input type="text" class="twofifty" name="email" maxlength="100"><abbr title="This email address will not be shared, even if the &quot;share&quot; checkbox is checked, unless you specifically request otherwise.">Your Email</abbr></input><br />
          <input type="text" class="twofifty" name="telephone" maxlength="100"><abbr title="This telephone number will not be shared, even if the &quot;share&quot; checkbox is checked, unless you specifically request otherwise.">Your Telephone</abbr></input><br />
          <input type="text" class="twofifty" name="uri" maxlength="100"><abbr title="If the &quot;share&quot; checkbox is checked, your name may be made into a link to the site URI entered here when your message is attributed to you.">Your Site URI</abbr></input><br />
          <input type="text" class="twofifty" name="subject" maxlength="100" value="<% print cgi['subject'] %>">Subject</input><br /><br />
          <span class="noleft">Enter Message Text Here:</span><br />
          <textarea name="comments" rows="12" columns="70" style="width: 400px"></textarea><br />
          <div class="noright">
            <input type="reset" value="Clear" />
            <input type="submit" value="Send" />
          </div>
        </form>

        <p style="margin-top: 3em">None of the informational fields in this form are necessary.  See the "tooltip" notes for each field by hovering your mouse pointer over the text for the field.</p>
      </div>

    </div>

  </body>
</html>
