
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->headline): ?>
<<?php echo $this->hl; ?>><?php echo $this->headline; ?></<?php echo $this->hl; ?>>
<?php endif; ?>
<?php if (($this->page > 0) && ($this->page <= count($this->pages))): ?>	
<div class="progressbar_container">
	<div class="progressbar" style="width: <?php echo sprintf("%.1f", 100*$this->page/count($this->pages)); ?>%">
		<span><?php echo sprintf($this->pageXofY, $this->page, count($this->pages)); ?></span>
	</div> 
</div>
<?php endif; ?>
<?php if ($this->show_title || $this->show_cancel): ?>
<div class="surveyhead">
	<div class="left">
		<span class="surveytitle"><?php echo $this->surveytitle; ?></span>
	</div>
	<div class="middle">
	</div>
	<div class="right">
		<?php if ($this->show_cancel): ?><a href="<?php echo $this->cancellink; ?>"><?php echo $this->cancel; ?></a><?php endif; ?>
	</div>
</div>
<?php endif; ?>
<!-- indexer::stop -->
<div class="form">

<form action="<?php echo $this->action; ?>" method="post">
<?php if ($this->errorMsg): ?><div class="tl_error"><?php echo $this->errorMsg; ?></div><?php endif; ?>
<?php if ($this->page == 0): ?>
<div class="introduction">
	<?php echo $this->introduction; ?>
	<input type="hidden" name="FORM_SUBMIT" value="tl_survey_form" />
	<input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}" />
</div>
<?php endif; ?>
<?php if (($this->page > count($this->pages))): ?>
<div class="finalstatement"><?php echo $this->finalsubmission; ?></div>
<?php endif; ?>
<?php if (($this->page > 0) && ($this->page <= count($this->pages))): ?>
<?php if (strlen($this->pages[$this->page-1]['title'])): ?><div class="pagetitle"><?php echo $this->pages[$this->page-1]['title']; ?></div><?php endif; ?>
<?php if (strlen($this->pages[$this->page-1]['introduction'])): ?><div class="pageintroduction"><?php echo $this->pages[$this->page-1]['introduction']; ?></div><?php endif; ?>
<div class="formbody">
	<input type="hidden" name="FORM_SUBMIT" value="tl_survey" />
	<input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}" />
	<input type="hidden" name="page" value="<?php echo $this->page; ?>" />
	<input type="hidden" name="survey" value="<?php echo $this->survey_id; ?>" />
	<input type="hidden" name="pin" value="<?php echo $this->pin; ?>" />
<?php echo $this->questionblock; ?>
</div>
<?php endif; ?>
<?php if (!($this->page > count($this->pages))): ?>
<div class="submit_container">
<?php if (($this->page == 0)): ?>	
<?php if ($this->needsTAN): ?>
	<div class="tl_survey_taninput">
		<p><?php echo $this->txtTANInputDesc; ?></p><?php if (strlen($this->tanMsg)): ?>
		<p class="tl_error"><?php echo $this->tanMsg; ?></p><?php endif; ?>
		<p><label for="tan"><?php echo $this->txtTANInput; ?>:</label> <input type="text" name="tan" id="tan" <?php if (strlen($this->tancode)) echo 'value="' . $this->tancode . '"'?>/> <input type="submit" class="submit" name="start" value="<?php echo $this->start; ?>" /></p>
	</div>
<?php endif; ?>
<?php endif; ?>
	<div class="left">
<?php if ($this->allowback && ($this->page > 1) && ($this->page <= count($this->pages))): ?>	
		<input type="submit" class="submit" name="prev" value="<?php echo $this->prev; ?>" />
<?php endif; ?>
	</div>
	<div class="middle">
	</div>
	<div class="right">
<?php if (($this->page == 0)): ?>	
<?php if (!$this->needsTAN): ?>
<?php if (!$this->hideStartButtons): ?>	
		<input type="submit" class="submit" name="start" value="<?php echo $this->start; ?>" />
<?php endif; ?>	
<?php endif; ?>
<?php endif; ?>
<?php if (($this->page > 0) && ($this->page < count($this->pages))): ?>
		<input type="submit" class="submit" name="next" value="<?php echo $this->next; ?>" />
<?php endif; ?>
<?php if ($this->page == count($this->pages)): ?>
  <input type="submit" class="submit" name="finish" value="<?php echo $this->finish; ?>" />
<?php endif; ?>
	</div>
</div>
<?php endif; ?>
</form>

</div>
<!-- indexer::continue -->

</div>
<script type="text/javascript" charset="utf-8">
window.addEvent('domready', function() {
    Survey.init();
});
</script>