<div id="primary_header">
  <h1><?php print $this->translate('Register Serial')?></h1>

</div>

<div id="primary_content">
  <div id="primary_content_inner">
  <div id="Flash" class="flash_notice"></div>

  <form id="settingsForm" method="post" action="<?php echo $this->moduleBaseUrl ?>/license/registersave">

    <input type="hidden" name="save" value="1" />

	<?php if($this->oldLicense == 1): ?>
		<?php include('oldlic.phtml'); ?>
	<?php elseif($this->licenseExpired == 1): ?>
		<?php include('expiry.phtml'); ?>
		
    <?php elseif( license::le() ): ?>
    <div id="licence-register">
    	
		<p><?php echo $this->translate("User licenses can be purchased, upgraded or renewed at any time via the <a href='http://order.atmail.com/' target='_blank'>Atmail store</a>.") ?></p>

    </div>
<?php 	else : ?>
<?php 		if( Zend_Registry::get('w4m70Yt0hYNduM2r2lrrIuY0zgKG4A3vvftl4UbbCWfW') == true ) : 
				$storeUrl = "http://atmail.com/store/index.php?Type=" . ($this->installType=='c'?'Webmail':'Server');
?>
	<div id="licence-error"><img class="regerror" src="<?php echo $this->siteBaseUrl; ?>/images/icons/error.png"/><span><?php echo $this->translate("Trial period has expired. Please contact Atmail sales for an extension or purchase your license via the <a href=\"$storeUrl\" target=\"_blank\">Atmail store</a>") ?>.</span></div>
<?php 		elseif( Zend_Registry::get('w4m70Yt0hYUduMWr2lrrIuY0zgKG4A3vvftl4NbbC2fW') == '5' ) : ?>
	<div id="licence-error"><img class="regerror" src="<?php echo $this->siteBaseUrl; ?>/images/icons/error.png"/><span><?php echo $this->translate("Free 5 User Serial registered. Purchase a commercial license for more seats and support anytime via the <a href='http://atmail.com/order/' target='_blank'>Atmail store</a>") ?>.</span></div>
<?php 		else : ?>
	<div id="licence-error"><img class="regerror" src="<?php echo $this->siteBaseUrl; ?>/images/icons/error.png"/><span><?php echo $this->translate("Serial registered. Upgrade anytime via the <a href=\"http://upgrade.atmail.com/?DownloadID={$this->reg['downloadId']}\" target=\"_blank\">Atmail store</a> for additional users or user class upgrades.") ?></span></div>
<?php 		endif ?>
<?php 	endif ?>
	
    <table class="settings">

      <tr>
        <td class="label"><?php print $this->translate('Specify ClientID')?></td>
        <td>
			<input type="text" class="medium" name="fields[downloadId]" id="downloadId" value="" />
      </tr>

      <tr>
        <td class="label"><?php print $this->translate('Serial Key')?></td>
        <td>
			<input type="text" class="large" name="fields[serialKey]" id="serialKey" value="" maxlength="64"/>
			<small style="width:auto; padding-top:10px;"><?php print $this->translate('Your ClientID and serial key have been sent via email. Please note that you must enter the DownloadID and serial key exactly as provided.')?></small></td>
		</td>
      </tr>

	</table>
	</form>
	<div class="divider"></div>
	<div id="back_button">
		<a href="#">
			<span class="stronglastword"><?php echo $this->translate('Register Serial') ?></span>
		</a>
	</div>
  </div>
</div>

<script type="text/javascript">
$( function()
{

    $('#back_button a', '#License').bind("click", function() { $("#Register_License #Flash").hide(); return $('#settingsForm', '#License').submit()})

	// bind to the form's submit event and cancel legacy submit 
	$('#settingsForm', '#License').submit(function()
	{     
	 	$.php($("#settingsForm", '#License').attr("action"),$("#settingsForm", '#License').serializeArray());
	    return false; 
	})

	$('.stronglastword', '#License').each( function() { $(this).stronglastword() });
  
});
</script>

