<?php $_faq = $this->getFaq() ?>

<?php if ($_faq): ?>
<div class="page-title">
	<h1><?php echo $this->htmlEscape($_faq->getQuestion()) ?></h1>
</div>

<div class="faq-detail">
	<p class="faq-date">
		<?php echo Mage :: getModel('core/date')->date('d.m.Y', $_faq->getPublicationTime()); ?>
	</p>
	
	<?php $_content = $_faq->getAnswerHtml() ? $_faq->getAnswer() : $this->htmlEscape($_faq->getAnswer()) ?>
	<?php if (!empty($_content)): ?>
	<div class="faq-content">
		<?php if ($_faq->getAnswerHtml()): ?>
			<?php echo $_content ?>
		<?php else: ?>
		<?php foreach (explode("\n", $_content) as $paragraph): ?>
		<p><?php echo $paragraph ?></p>
		<?php endforeach; ?>
		<?php endif; ?>
	</div>
	<?php endif; ?>
	
	<p><a href="<?php echo Mage :: app()->getStore()->getUrl('faq') ?>" title="<?php echo $this->__('Back to the FAQ overview') ?>"><?php echo $this->__('Back to the FAQ overview') ?></a></p>
</div>
<?php else: ?>
<div class="page-title">
	<h1><?php echo $this->__('Error') ?></h1>
</div>
	
<p><?php echo $this->__('The requested FAQ item could not be found!') ?></p>
<?php endif; ?>
