<?php /*?><?php include '../../getStat.html';?><?php */?>
<div class="nav-bar">
	<div class="nav-bar-container">
        <div class="logo2f">
   	    	<img src="images/logo.png" title="IPST | E-MAGAZINE">
        </div>
	
    
    	<div class="search-bar">
        	<form name="form_search" id="form_search" method="post" action="search_result.html">
            <input name="search" type="text" id="textsearch" />
            <input name="bookid" value="52" type="hidden" />
            </form>
        </div>
        <!--<div id="dossier-number" class="dossier-number"><p><span>02</span>/ 60</p></div>-->
	</div><!--Div nav-bar-container-->
</div><!--Div nav-bar-->
<script type="text/javascript">
        $(document).ready(function() {

            // $('input[name="search"]').autocomplete();
            $( '#textsearch' ).autocomplete({ 
                source: function(request, response) { 
                    $.ajax({ url: "../../getTagAuto.html", 
                        data: { tag: $('#textsearch').val(),book_id:52}, 
                        dataType: "json", 
                        type: "POST", 
                        success: function(data) 
                        { 
                            // console.log(data);
                            response(data); 
                        } 
                    }); 
                }, 
                select: function( event, ui ) { 
                    var value=ui.item.value; 
                    // console.log(value);
                    if (value!='') {
                        $('#textsearch').val(value);
                        $('#form_search').submit();
                    };
                    
                    } 
            }); 
$.ui.autocomplete.prototype._renderItem = function( ul, item){ 
        var term = this.term.split(' ').join('|'); 
        var re = new RegExp("(" + term + ")", "gi") ; 
        var t = item.label.replace(re,"<b>$1</b>"); 
        return $( "<li></li>" ) 
            .data( "item.autocomplete", item ) 
            .append( "<a>" + t + "</a>" ) 
            .appendTo( ul ); 
}; 
            });
        </script>