<script type="text/javascript" src="javascript/modules/support.js?version={VERSION}"></script>
<script type="text/javascript">
    function validateSupportForm(form)
    {
        var strAlertMessageArr = getFormErrors(form);

        if (typeof form.messagetype != 'undefined' &&  form.messagetype.value == 0) {
             strAlertMessageArr.push(lang("Select a valid ticket type."));
        }

        if (strAlertMessageArr.length > 0) {
            alert(strAlertMessageArr.join("\n"));
            return false;
        }

        return true;
    }
</script>
<!-- BEGIN DYNAMIC BLOCK: clientdropdown -->
{CLIENT_DROP_DOWN}
<!-- END DYNAMIC BLOCK: clientdropdown -->

<div id="wrap">
	<div id="form_wrap">
	<h1>[l]Submit Ticket[/l]</h1>
		<br />
		<form name="SupportForm" method="post" action="{SUPPORT_FORM_ACTION}" enctype="multipart/form-data">
        <input type="hidden" name="userid" value="{USERID}" />
        <input type="hidden" name="clientid" value="{CLIENTID}" />
        <input type="hidden" name = "ticketfilter" value = "All" />		
		<p><label for="client">[l]Select Package[/l]</label><br />
		<!-- BEGIN DYNAMIC BLOCK: domaindropdown -->
		{DOMAIN_DROP_DOWN}
		<!-- END DYNAMIC BLOCK: domaindropdown -->
		</p>					
        <!-- BEGIN DYNAMIC BLOCK: guestInfo -->
			<p>
			<label for="guestLastName">[l]Last Name[/l]</label><br />
			<input class="inputtext1" style="width: 380px;" type="text" name="guestLastName" size="63" />
            <input type="hidden" name="r_guestLastName" value="[l]Last Name[/l]" />
			</p>		
			<p>
			<label for="guestFirstName">[l]First Name[/l]</label><br />
			<input class="inputtext1" style="width: 380px;" type="text" name="guestFirstName" size="63" />
            <input type="hidden" name="r_guestFirstName" value="[l]First Name[/l]" />
			</p>			
			<p>
			<label for="guestEmail">[l]E-mail[/l]</label><br />
			<input class="inputtext1" style="width: 380px;" type="text" name="guestEmail" size="63" />
            <input type="hidden" name="r_guestEmail" value="[l]Email[/l]" />
			</p>        
        <!-- END DYNAMIC BLOCK: guestInfo -->		  		
		<div class="wrap">
			<div class="left">       			
				<p><label for="about">[l]Ticket Type[/l]</label><br/>
				<select id="messagetype" name="messagetype">
                    <option value='0' selected>[l]Select a Type ...[/l]</option>        
                    <!-- BEGIN DYNAMIC BLOCK: supporttickettypes -->
                    <option value='{TICKETTYPE_VALUE}' {TICKETTYPE_SELECTED}>{TICKETTYPE_NAME}</option>
                    <!-- END DYNAMIC BLOCK: supporttickettypes -->
				</select>
				</p>
			</div>
			<div class="right">
				<p><label for="priority">[l]Priority[/l]</label><br />
				<select id="priority" name="priority" onchange="highPriorityWarning(document.forms['SupportForm'].priority)">
                    <option value="1">[l]High[/l]</option>
                    <option value="2">[l]Medium[/l]</option>
                    <option value="3" selected="true" >[l]Low[/l]</option>
				</select>								
				</p>
			</div>
		</div>
		<p>
		<label for="subject">[l]Subject[/l]</label><br />
		<input class="inputtext1" onkeyup="{subjectOnkeyup}" style="width: 380px;" type="text" id="supportTicketSubject" name="subject" maxlength="200" />
        <input type="hidden" name="r_subject" value="[l]Msg. Subject[/l]" />
		</p>
		<p>
		<label for="question">[l]My question is[/l]</label><br />
		<textarea style="width: 380px;" class="textbox" rows=10 cols=5 name="message"></textarea>
        <input type="hidden" name="r_message" value="[l]Message[/l]" />
		</p>
		
		<!-- BEGIN DYNAMIC BLOCK: attachfile -->
		<label for="file">[l]Attach File:[/l] ([l]Max file size[/l] : {MAXFILESIZE})</label><br />
        <div id="fileFieldsContainer"> 
			<div id="fileFields_0" style="margin:2px 0 2px 0">
			<input type="file" value="" name="file_0" id="file_0" /><a style="visibility:hidden" href="#" onclick="javascript:remove(this);">[l]Delete[/l]</a><br />                 
	        </div> 
        </div>
              
        <a class='liveupdate' href="javascript:Clon('fileFields_0');">[l]Add a New File[/l]</a>            
        <!-- END DYNAMIC BLOCK: attachfile -->                
        
        <!-- BEGIN DYNAMIC BLOCK: cantattachfile -->
        <p>
        	<span style="color:red">[l]Directory 'uploads/support' is not writable[/l]</span><br />
		</p>        	
		<!-- END DYNAMIC BLOCK: cantattachfile -->  

		<!-- BEGIN DYNAMIC BLOCK: captcha -->
		<p>
        <img name="captcha" id="antiflood" src="modules/clients/captcha.php" border="0"><br/>
		<label for="subject">[l]Enter the code[/l]</label><br />
		<input class="inputtext1" style="width: 380px;" type="text" id="accesscode" name="accesscode" />
		</p>      
		<!-- END DYNAMIC BLOCK: captcha -->


		<br/><br/>
		<p>					
        <!-- BEGIN DYNAMIC BLOCK: inNameOfUser -->
			<label for="openticket"><input type="checkbox" checked="checked" name="inNameOfUser" value="1" />[l]Open ticket in the name of user[/l]</label>
        <!-- END DYNAMIC BLOCK: inNameOfUser -->
        <!-- BEGIN DYNAMIC BLOCK: notifyUser -->
			<label for="notify"><input type="checkbox" checked="checked" id="notify" name="notifyUser" />[l]Notify user[/l]</label>
        <!-- END DYNAMIC BLOCK: notifyUser -->
        </p>
		<p>
        <input type="submit" name="button" onclick="return validateSupportForm(form);" class=button_large value='[l]Submit ticket[/l]' />
		</p>
		</form>
	</div>
	
	<div id="kb_wrap">	
	</div>
</div>
