function page_block()
{
    $.blockUI({
                fadeOut: 700,
                fadeIn: 700,
                timeout: 2000,
                showOverlay: false,
                centerY: false,
		 css: { 
                border: 'none', 
                width: '400px',
                padding: '15px', 
                right: '10px',
                left: '',
                top: '80px',
                backgroundColor: '#000', 
                '-webkit-border-radius': '10px', 
                '-moz-border-radius': '10px', 
                opacity: .7, 
                color: '#fff'
                },message: '<h1> Wymagane minimum 4 znaki!</h1>'}); 
}
                                                                                            	    
function page_unblock()
{
    $.unblockUI({ fadeOut: 200 }); 
                                                                                            		
}
                        
 function findValue(li) {
  if( li == null ) return alert("No match!");
 
  // if coming from an AJAX call, let's use the CityId as the value
  if( !!li.extra ) var sValue = li.extra[0];
 
 // otherwise, let's just display the value in the text box
 else var sValue = li.selectValue;
 
 //alert("The value you selected was: " + sValue);
 }
 
 function selectItem(li) {
  findValue(li);
 }
 
 function formatItem(row) {
/*  return row[0] + " (" + row[1] + ")";*/
  return row[0] ;

 }
 
 
 $(document).ready(function()
 {
 
 $("#whattofind").autocomplete(
 "/cgi-bin/koha/opac-autocomplete.pl",
 {
  delay:10,
  minChars:4,
  matchSubset:1,
  matchContains:1,
  cacheLength:10,
  maxItemsToShow:10,
  selectFirst:false,
  onItemSelect:selectItem,
  onFindValue:findValue,
  formatItem:formatItem
 }
 );
 
 $('.tooltip').tipTip();
 
 $('.draggable').draggable();
 
 });
                                                                    		
