<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Psychology Experiment</title>

    <style>
      body {
          padding: 0;
          margin: 0;
          font-family: Georgia, serif;
          font-size: 1em;
          line-height: 1.25em;
      }

      p {
          margin-top: .625em;
          margin-bottom: .625em;
      }

      h1 {
          font-weight: bold;
          font-size: 1.25em;
          margin-top: .625em;
          margin-bottom: .625em;
      }

      ul { margin: 1em 0; }      

      img.logo { height: 6.25em; }

      button, .next {
          background-color: white;
          box-shadow: 1px 1px 3px;
          border: 1px solid black;
          margin: 1%;
          padding: 1% 2% 1% 2%;
          font-family: Georgia, serif; 
          font-size: 1em;
      }

      button:active, .next:active {
          background-color: #c9c9c9;
          box-shadow: 0px 0px 3px;
      }

      span.warn {
          font-style: italic;
      }
    </style>

    <script>
      function openwindow() {
          popup = window.open('{{ server_location }}/consent?hitId={{ hitid }}&assignmentId={{ assignmentid }}&workerId={{ workerid }}','Popup','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+screen.availWidth+',height='+screen.availHeight+'');
          popup.onunload = function() { location.reload(true) }
      }
    </script>
  </head>

  <body>
    <div style="margin: 1em;">
      {% if assignmentid != "ASSIGNMENT_ID_NOT_AVAILABLE" %}
      <h1>Thank you for accepting this HIT!</h1>
      <div>
	<p>By clicking the following button, you will be taken to the
	experiment, including complete instructions and an informed
	consent agreement.</p>
	<p>
	  Please disable pop-up blockers before continuing.
	</p>
      </div>
      <div class="continue">
	<button type="button" onclick="openwindow()">Ok, I understand, I'm ready to start.</button>
      </div>

      {% else %}

      <h1>Call for participants</h1>
      <div>
	<p>In this experiment you will make judgments about simple scenes. </p>

	<p>The requirements are:</p>

	<ul>
	  <li>You are at least 18 years old,</li>
	  <li>You have normal vision or wear corrective lenses, and</li>
	  <li>You are a fluent English speaker.</li>
	</ul>

	<p>This task can only be completed once. If you have already
	completed this task before the system will not allow you to
	run again. If this looks familiar please release the hit so
	someone else can participate.</p>

	Otherwise, please click the "Accept Hit" button on the Amazon
	site above to begin the task.
      </div>
      {% endif %}
    </div>
  </body>
</html>
