function InitAdminAutocomplete( id , data ) {
	$("#"+id).data( "data" , data );
	if (data.strict) {
		$("#"+id+"_inp").autocomplete( {
			source: function( request ,response ) {	
				$.ajax( {
					type: "POST",
					data: {
						"inajax" : 1 ,
						"ajaxevent" : "get_autocomplete_hints",
						"id" : id,
						"filter" : request.term
					},
					success: function( d ) {
						response( d );
					}
				} );
			},
			select: function( event , ui ) {
				$("#"+id).val( ui.item.id );
			}
		} );
		// doubleclick clear
		$("#"+id+"_inp").dblclick( function() {
			$("#"+id).val("");
			$("#"+id+"_inp").val("");
		} );
	}
}

function AdminAutocompleteBeforeSubmit( id ) {
	$("#"+id+"_inp").attr( "disabled" , "disabled" );
}
