<?php echo Wo_LoadPage('forum/headers/header'); ?>
<div class="row" id="search">
	<label class="col-md-2"></label>
	<div class="col-md-8">
		<div class="page-margin wow_content mt-0">
			<div class="wo_page_hdng pag_neg_padd pag_alone">
				<div class="wo_page_hdng_innr">
					<span><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><path fill="currentColor" d="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"></path></svg></span> <?php echo $wo['lang']['search'];?>
				</div>
			</div>
		</div>

		<div id="forum-search-container" class="page-margin wow_content wow_sett_content">
			<form id="forum-search" action="<?php echo Wo_SeoLink('index.php?link1=forum-search-result');?>" method="get" class="forum form-horizontal">
				<input type="hidden" name="mode" value="search">
				<div class="wow_form_fields">
					<label for="search-subject"><?php echo $wo['lang']['search_for_term']; ?></label>
					<textarea rows="4" name="search-terms" id="search-subject"></textarea>
					<span class="help-block"><?php echo $wo['lang']['search_terms_more4']; ?></span>
				</div>
				<div class="wow_form_fields">
					<label for="search-only"><?php echo $wo['lang']['search_type']; ?></label>
					<select id="search-only" name="search-only">
						<option value="0" ><?php echo $wo['lang']['search_subject_only']; ?></option>
						<option value="1" ><?php echo $wo['lang']['search']; ?> <?php echo $wo['lang']['post']; ?></option>
					</select>
				</div>
				<div class="wow_form_fields">
					<label for="search-in"><?php echo $wo['lang']['search_in']; ?></label>
					<select id="search-in" name="search-in">
						<option value="forums"><?php echo $wo['lang']['search_in_forums']; ?></option>
						<option value="messages"><?php echo $wo['lang']['search_in_messages']; ?></option>
						<option value="threads" selected><?php echo $wo['lang']['search_in_threads']; ?></option>
					</select>
				</div>
				<div class="wow_form_fields">
					<label for="section"><?php echo $wo['lang']['search_section']; ?></label>
					<select id="section" name="section">
						<?php foreach ($wo['sections'] as $wo['section']): ?>
							<option value="<?php echo $wo['section']['id']; ?>"><?php echo $wo['section']['section_name_lang']; ?></option>
						<?php endforeach; ?>
					</select>
				</div>
				<div class="text-center">
					<button class="btn btn-main btn-mat btn-mat-raised add_wow_loader" id="forum-search-btn" type="submit"><?php echo $wo['lang']['search']; ?></button>
				</div>
			</form>
		</div>
		<div class="clear"></div>
	</div>
	<label class="col-md-2"></label>
</div>


<?php echo Wo_LoadPage('forum/headers/footer'); ?>
<script>
	jQuery(document).ready(function($) {
		//Toggle search panel
		$("#togg-search-cont").click(function(){
          $("#forum-search-container").slideToggle();
        });


        $("#forum-search").submit(function(event) {
	        var empty = $("#search-subject").val();
            if ($("#search-subject").val().length < 4) {
            	event.preventDefault();
            	$("#search-terms").addClass('alert alert-danger');
            	scrollToTop();
            	$("#search-subject").focus();
            }
        });
	});
</script>