 <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>

<?php if(Mage::getSingleton('core/session')->getPostData()):?>
<form action="<?php echo $this->getAction()?>" method="post" id="revalidate-form">
	<div>
		<?php echo $this->__("Please confirm your inquiry.") ?>
	</div>	
	<div class="label"><?php echo $this->__("Enter digits <b>%s</b>", $this->getFailKey())?></div>
	<input type="text" name="fail_key" value=""/>
	
	<?php
		if(!($uenc = $this->getRequest()->getParam('uenc'))){
			$uenc = Mage::helper('core')->urlEncode($this->getRequest()->getServer('HTTP_REFERER'));
		}
	?>
	<input type="hidden" name="uenc" value="<?php echo $uenc?>">
	<button type="submit" onclick="$('revalidate-form').submit(); this.disabled = true;"><?php echo $this->__("Submit")?></button>
	<?php foreach(unserialize(Mage::getSingleton('core/session')->getPostData()) as $k=>$v){
		echo array2post($k, $v);
		
	}?>
		<input type="hidden" value="<?php echo  $this->getFailKeyHash()?>" name="fail_key_hash"/>
</form>
<?php endif;?>


<?php
	function array2post($k, $v, $out=''){
		if(!is_array($v)){
			if($k != 'hdu_seed' && $k!='fail_key' && $k!='fail_key_hash'){
				$out .= '<input type="hidden" value="'.htmlentities($v, ENT_QUOTES, AW_Helpdeskultimate_Model_Data_Parser_Abstract::STORAGE_ENCODING).'" name="'.$k.'"/>';				
			}
		}else{
			foreach($v as $key=>$value){
				$out .= array2post($k."[$key]", $value);
			}
		}
	return $out;
	}
?>