$(document).ready(function() {
  		    
  $("form[name=quick_find_header] input[name=keyword]").livequery('blur',function(){
        setTimeout(function () {
            $("#XNaseptavac").hide();
        }, 200);
	});
	
  $(".g_item a").livequery('click', function(){
  		    $("form[name=quick_find_header] input[name=keyword]").val($(this).html().replace('<b>','').replace('</b>',''));
  		    $("#XNaseptavac").hide();
  });                              
	
	$("form[name=quick_find_header] input[name=keyword]").livequery('focus',function(){
		  if ($("#XNaseptavac").html()!="") $("#XNaseptavac").show();
	});
	
	
	$("form[name=quick_find_header] input[name=keyword]").data('timeout', null)
    .keyup(function(){
      $(this).data('timeout', setTimeout(function(){
          var mytext = $('form[name=quick_find_header] input[name=keyword]').val();
          naseptavac(mytext);
          //$('form[name=quick_find] input[name=keyword]').next().html(mytext);
        }, 200)
     )
     .keydown(function(){
       clearTimeout($(this).data('timeout'));
     });
    });
	
	function naseptavac(mytext){
		$.ajax( {
			type : "GET",
			url : '?',
			data : "keyword=" + mytext + "&ajax=true",
			success : function(msg) {
				$("#XNaseptavac").html(msg);
				if (msg!='') 
          $("#XNaseptavac").slideDown("60");
				else 
          $("#XNaseptavac").hide();
			}
		});
	}
});

