<?php if($this->subDomainError || (isset($this->subDomainStatus) && $this->subDomainStatus == -2)) { ?>
<!-- Show any domain errors -->
    <div id="error">
        <table class="ts2" cellspacing="0">
          <tr>
            <td colspan="6" style="font-size:16px; font-weight:bold; color:red;"><?php echo ($this->subDomainError)?$this->subDomainError:$this->lang("An unknown error has occurred.");?></td>
          </tr>
        </table>
    </div>
<?php } else { ?>
    <div id="subDomainAvailable">
        <table class="ts2" border="0" cellspacing="0">
            <?php if($this->subDomainStatus == 0) { ?>
            <tr>
                <td colspan="6" style="font-size:16px; font-weight:bold; color:#090;" id="textAvailable"><?php echo $this->subDomainName." ".$this->lang('is available!');?></td>
            </tr>
            <?php if($this->showContinueButton == 1) { ?>
            <tr>
                <td>
                    <a class="button small white" style="cursor:pointer" onclick="if(submitSubDomain()){doSubmitForm();}"> <?php echo $this->lang('Continue'); ?> &raquo;</a>
                </td>
            </tr>
            <?php } ?>
            <?php } else { ?>
              <tr>
                <td colspan="6" style="font-size:16px; font-weight:bold; color:red;" id="textAlreadyRegistered"><?php echo $this->subDomainName." ".$this->lang('is not currently available!');?></td>
              </tr>
            <?php } ?>
        </table>
    </div>
    
    <script type="text/javascript">
        function submitSubDomainOnRegister(searchAgain)
        {
            var tld = false;
            var subDomainName = document.getElementById('subDomain').value;
            if(document.getElementById('subDomainTld') != undefined){
                tld = document.getElementById('subDomainTld').options[document.getElementById('subDomainTld').selectedIndex].value;
                subDomainName = subDomainName + '.' + tld;
            }
            
            if('<?php echo $this->subDomainName;?>' == subDomainName
              && <?php echo $this->subDomainStatus?> == 0)
            {
                return true;
            }else{
                if(searchAgain){
                    searchSubDomain(document.getElementById('subDomain').value,tld,true,true);
                }
                return false;
            }
        }
    </script>
<?php } ?>