<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(typeof form.file_0 != 'undefined' && form.file_0.value !=""){
            var fileName=form.file_0.value;
            var fileNameArr=(form.file_0.value).split(".");
            var fileExtn="";
            if(fileNameArr.length>1){
                fileExtn=fileNameArr[fileNameArr.length-1];
            }
            var allowedExtn=0;
            var extns=(form.validExtns.value).split(",");
            for(i=0;i<extns.length;i++){
              if(extns[i]==fileExtn){
                allowedExtn=1;
                break;
              }
            }
            if(form.validExtns.value == '*') {
                allowedExtn=1;
            }

            if(allowedExtn==0){
                strAlertMessageArr.push(lang("File "+fileName+" upload failed."));
                strAlertMessageArr.push(lang("Allowed extensions are "+form.validExtns.value));
            }
            
        }
        if (strAlertMessageArr.length > 0) {
            alert(strAlertMessageArr.join("\n"));
            return false;
        }

        return true;
    }
</script>

<div id="kb" class="block">
    <div class="block_title">
        <h3><b><a href="index.php">[l]Support Center[/l]</a> &raquo; <a href="#">[l]Submit Ticket[/l]</a></b></h3>
    </div>
    <ul>
        <li>
            <h1>[l]Submit Ticket[/l]</h1>
            <p class="st" style="background: url({RELATIVE_PATH}templates/{TEMPLATE}/images/public/icon_submit_ticket.jpg) no-repeat  0 8px;">[l]If you can't find a solution to your problems in our <a href="index.php?fuse=knowledgebase&amp;view=KB_MainView&amp;public=1">knowledgebase</a>, you can submit a ticket by selecting the appropriate department below.[/l]</p>
        </li>
        <li>
            <form name="SupportForm" action="{SUPPORT_FORM_ACTION}" method="post" id="submit_ticket" 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" />

                <div style="padding-left: 15px;">
                    <!-- BEGIN DYNAMIC BLOCK: guestInfo -->
                    <span class="label130">[l]Last Name[/l] :</span>
                    <input type="text" id="guestLastName" name="guestLastName" value="{GUESTLASTNAME}" />
                    <input type="hidden" name="r_guestLastName" value="[l]Last Name[/l]" />
                    <br />
                    <span class="label130">[l]First Name[/l] :</span>
                    <input type="text" id="guestFirstName" name="guestFirstName" value="{GUESTFIRSTNAME}" />
                    <input type="hidden" name="r_guestFirstName" value="[l]First Name[/l]" />
                    <br />
                    <span class="label130">[l]Email[/l] :</span>
                    <input type="text" id="guestEmail" name="guestEmail" value="{GUESTEMAIL}" />
                    <input type="hidden" name="r_guestEmail" value="[l]Email[/l]" />
                    <input type="hidden" name="e_guestEmail" value="[l]Email[/l]" /> 
                    <br />
                    <!-- END DYNAMIC BLOCK: guestInfo -->
                    <span class="label130">[l]Ticket Type[/l] :</span>
                    <select id="messagetype" name="messagetype">
                        <option value='0' selected="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>
                    <br />
                    <span class="label130">[l]Priority[/l] :</span>
                    <select id="priority" name="priority" onchange="highPriorityWarning(document.forms['SupportForm'].priority)">
                        <option value="1" {PRIORITYHIGH} >[l]High[/l]</option>
                        <option value="2" {PRIORITYMEDIUM} >[l]Medium[/l]</option>
                        <option value="3" {PRIORITYLOW} >[l]Low[/l]</option>
                    </select>
                    <!-- BEGIN DYNAMIC BLOCK: selectPackage -->
                    <br />
                    <span class="label130">[l]Select Package[/l] :</span>
            		{DOMAIN_DROP_DOWN}
            		<!-- END DYNAMIC BLOCK: selectPackage -->
                </div>

                <br />

                <fieldset>
                    <legend>[l]Message Details[/l]</legend>
                    <div class="razmak">
                        <label>[l]Msg. Subject[/l] :</label>
                        <input class="st_subject" onkeyup="{subjectOnkeyup}" type="text" id="supportTicketSubject" name="subject" maxlength="200" value="{SUBJECT}" />
                        <input type="hidden" name="r_subject" value="[l]Msg. Subject[/l]" />
                        <br />
                        <textarea name="message" rows="5" cols="40">{MESSAGE}</textarea>
                        <input type="hidden" name="r_message" value="[l]Message[/l]" />
                    </div>
                </fieldset>
                <!-- BEGIN DYNAMIC BLOCK: attachfile -->
                <fieldset>
                    <legend>[l]Upload File(s)[/l]</legend>
                    <div class="razmak">
                        ([l]Max file size[/l] : {MAXFILESIZE})<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; margin-left:10px;" >[l]Delete[/l]</a><br />
                            </div>
                        </div>
                        <p>
                            <a class='liveupdate' href="javascript:Clon('fileFields_0');">[l]Add a New File[/l]</a>
                        </p>
                    </div>
                </fieldset>
		<input type="hidden" name="validExtns" value={extns} />
                <!-- END DYNAMIC BLOCK: attachfile -->
                <div id="kb_wrap">	
	            </div>
                <!-- BEGIN DYNAMIC BLOCK: captcha -->
                <fieldset>
                    <legend>[l]Verification Code[/l]</legend>
                    <div class="razmak">
                        <table>
                            <tr>
                                <td>
                                    <img name="captcha" id="antiflood" src="modules/clients/captcha.php" border="0" alt='' />
                                </td>
                                <td style="padding-left:20px">
                                    <label for="accesscode" style="width:auto">[l]Enter the code[/l]: </label>
                                    <input type="text" id="accesscode" name="accesscode" />
                                    <input type="hidden" name="r_accesscode" value="[l]Verification Code[/l]" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </fieldset>
                <!-- END DYNAMIC BLOCK: captcha -->
                <div class="st_submit">
                    <input type="submit" name="button" onclick="return validateSupportForm(form);" value='[l]Submit[/l]' />
                </div>
            </form>
        </li>
    </ul>
</div>
