<?php if (isset($templateData['showHeader'])): ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <title>Gallery Support - <?php print $templateData['title'] ?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="stylesheet" type="text/css" href="support.css"/>
  </head>

  <body>
    <div id="content">
      <div id="title">
	<a href="../../">Gallery</a> &raquo;
	<a href="<?php generateUrl('index.php') ?>">Support</a> &raquo; 
	<?php print $templateData['title'] ?>
      </div>
<?php endif; ?>
<?php if (isset($templateData['showStatusBlock'])): ?>
  <table id="progressBarTable" class="boxTable" cellspacing="0">
	<tr>
	  <td class="main">
	    <div id="MainPageStatus_statusBlock">
	      <h2><span id="MainPageStatus_title">&nbsp;</span> </h2>

	      <h4><span id="MainPageStatus_description">&nbsp;</span></h4>
	    <table id="statusTable" cellspacing="0">
		<tr>
		  <td id="MainPageStatus_progressMade" class="progressMade">&nbsp;</td>
		  <td id="MainPageStatus_progressToGo" class="progressToGo">&nbsp;</td>
		</tr>
	    </table>
	    </div>

	    <script type="text/javascript">
	      // <![CDATA[
	      var saveToGoDisplay = document.getElementById('MainPageStatus_progressToGo').style.display;
	      function updateStatus(title, description, percentComplete) {
		document.getElementById('MainPageStatus_title').innerHTML = title;
		document.getElementById('MainPageStatus_description').innerHTML = description;

		var progressMade = Math.round(percentComplete * 100);
		var progressToGo = document.getElementById('MainPageStatus_progressToGo');

		if (progressMade == 100) {
		  progressToGo.style.display = 'none';
		} else {
		  progressToGo.style.display = saveToGoDisplay;
		  progressToGo.style.width = (100 - progressMade) + "%";
		}

		document.getElementById('MainPageStatus_progressMade').style.width = progressMade + "%";
	      }
	      // ]]>
	    </script>
	  </td>
	</tr>
      </table>
<?php endif; ?>

<?php if (isset($templateData['showStatus'])): ?>
<script type="text/javascript">updateStatus(<?php printf('"%s", "%s", %s', $templateData['status']['title'], $templateData['status']['description'], $templateData['status']['percentComplete']); ?>)</script>
<?php endif; ?>

<?php if (isset($templateData['hideStatusBlock'])): ?>
<script type="text/javascript">document.getElementById("progressBarTable").style.display="none"</script>
<?php endif; ?>

 <?php if (isset($templateData['showBodyAndFooter'])): ?>
      <table id="regularTable" class="boxTable" cellspacing="0">
  	<tr>

	  <td class="main">

	    <?php if (!empty($templateData['errors'])): ?>
        <div class="error">
          <h2>Errors Occurred</h2>
          <p>
          <?php foreach ($templateData['errors'] as $error): ?>
            <?php print $error ?><br/>
          <?php endforeach; ?>
          </p>
        </div>
	    <?php endif; ?>

	    <?php include(dirname(__FILE__) . '/' . $templateData['bodyFile']); ?>

	  </td>
	</tr>
      </table>
    </div>
  </body>
</html>
<?php endif; ?>

