<p class="pagedesc">
<?php if (!$this->hasPermission) {
        echo $this->lang("Guest ticket access is disabled, please login.");
        return;
    } else
        echo $this->lang("If you can't find a solution to your problems in our <a href=\"index.php?fuse=knowledgebase&amp;view=KB_MainView\">knowledgebase</a>, you can submit a ticket by selecting the appropriate department below.");
?>
</p>

 <script type="text/javascript">
 var RecaptchaOptions = {
    theme : 'clean'
 };
 </script>

<form name="SupportForm" action="<?php echo $this->formAction; ?>" method="post" enctype="multipart/form-data">
    <input type="hidden" name="userid" value="<?php echo $this->userid; ?>" />
    <input type="hidden" name="clientid" value="<?php echo @$this->clientid; ?>" />
    <input type="hidden" name = "ticketfilter" value = "All" />

<table class="ts2" cellspacing="0">
    <?php if($this->userid==0) { ?>
    <tr>
    	<td class="label"><?php echo $this->lang("First Name");?>:</td>
        <td><input type="text" id="guestFirstName" name="guestFirstName" />
   		<input type="hidden" name="r_guestFirstName" value="<?php echo $this->lang("First Name");?>" /></td>
    </tr>
    <tr>
    	<td class="label"><?php echo $this->lang("Last Name");?>:</td>
    	<td><input type="text" id="guestLastName" name="guestLastName" />
    	<input type="hidden" name="r_guestLastName" value="<?php echo $this->lang("Last Name");?>" /></td>
    </tr>
    <tr>
    	<td class="label"><?php echo $this->lang("Email");?>:</td>
        <td><input type="text" id="guestEmail" name="guestEmail" />
    	<input type="hidden" name="r_guestEmail" value="<?php echo $this->lang("Email");?>" />
    	<input type="hidden" name="e_guestEmail" value="<?php echo $this->lang("Email");?>" /> </td>
    </tr>
    <?php } //end guest info ?>
    <tr>
    	<td class="label"><?php echo $this->lang("Ticket Type");?>:</td>
        <td><select id="messagetype" name="messagetype">
        <option value='0' selected="selected"><?php echo $this->lang("Select a Type ...");?></option>
        <?php foreach ($this->tickettypes as $ticketType) { ?>
        <option value='<?php echo $ticketType['value']; ?>' <?php echo $ticketType['selected']; ?>><?php echo $ticketType['name'];?></option>
        <?php }//end foreach ?>
    	</select></td>
    </tr>
    <tr>
    	<td class="label"><?php echo $this->lang("Priority");?>:</td>
        <td><select id="priority" name="priority" onchange="highPriorityWarning(document.forms['SupportForm'].priority)">
        <option value="1"><?php echo $this->lang("High");?></option>
        <option value="2"><?php echo $this->lang("Medium");?></option>
        <option value="3" selected="selected" ><?php echo $this->lang("Low");?></option>
    	</select></td>
    </tr>
    <?php if (isset($this->domainDropDown)) { ?>
    <tr>
    	<td class="label"><?php echo $this->lang("Select Package"); ?>:</td>
        <td><?php echo $this->domainDropDown; ?></td>
    </tr>
    <?php } //end select package ?>
    <tr>
    	<td class="label"><?php echo $this->lang("Message Subject");?>:</td>
        <td><input class="st_subject" onkeyup="<?php echo $this->subjectOnkeyup; ?>" type="text" id="supportTicketSubject" name="subject" maxlength="200" /><input type="hidden" name="r_subject" value="<?php echo $this->lang("Msg. Subject");?>" /></td>
    </tr>
    <tr>
    	<td class="label"><?php echo $this->lang("Message");?>:</td>
        <td><textarea name="message" rows="10"></textarea></td>
    </tr>

    <?php if ($this->maxfilesize > 0) { ?>
    <tr>
    	<td class="label"><?php echo $this->lang("Upload File(s)");?>:</td>
        <td><div id="fileFieldsContainer">
                <div id="fileFields_0">
                    <input type="file" value="" name="file_0" id="file_0" /><a style="visibility:hidden; margin-left:10px;position: relative;top:-10px;" ><?php echo $this->lang("Delete");?></a><br />
                </div>
            </div><br />(<?php echo $this->lang("Max file size");?>: <?php echo $this->maxfilesize; ?><?php echo $this->extnsmessage; ?>)<br />
                <a class='liveupdate' href="javascript:Clon('fileFields_0');"><?php echo $this->lang("Add a New File");?></a>
            <input type="hidden" name="validExtns" value="<?php echo $this->extns; ?>" />
        </td>
    </tr>
    <?php } //attach file ?>

<?php if ($this->showCaptcha) { ?>
    <tr>
    	<td class="label"><?php echo $this->lang("Enter the code");?>:</td>
        <td><?php echo recaptcha_get_html($this->publickey); ?></td>
    </tr>
<?php }//end if show captcha  ?>

</table>

<input type="hidden" name="r_message" value="<?php echo $this->lang("Message");?>" />

<div id="kb_wrap" style="margin:20px 0;"></div>


<input type="submit" class="submit" name="button" onclick="return validateSupportForm(form);" value='<?php echo $this->lang("Submit");?>' />

</form>