<? Configure::write('debug', 0); ?>

<div id="viewemail">
<dl class="mailheaders"><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Enquiry'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $html->link($email['Enquiry']['title'], array('controller'=> 'enquiries', 'action'=>'view', $email['Enquiry']['id'])); ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Date'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $email['Email']['date']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Subject'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $email['Email']['subject']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('To'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $link->autoLinkEmailsSubject($email['Email']['to'], $email['Email']['subject']); ?>
			
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('From'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $text->autoLinkEmails($email['Email']['from']); ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Cc'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $text->autoLinkEmails($email['Email']['cc']); ?>
			&nbsp;
		</dd>
	</dl>

	<div id="emailbody">
	<?php 
	/* strip out thinks messing up my link styles! */
	$cleanbody = str_replace(array('a:link', 'a:visited'), '', $email['Email']['body']);
	?>
		
	<?php echo $cleanbody;
	if($cleanbody == "") {
		echo '<pre>';
		echo $email['Email']['plainbody']; 
		echo '</pre>';
	} 
	?>
	</div>

</div>
