Autocomplete selection and insert into CKEditor and standalone version

Autocomplete selection and insert into CKEditor and standalone version

I already have an extensive database of certain items with ID's, like movies for example. Every movie can have actors and locations under it, which can be filled with a wikipedia like editor, I am using CKEditor for that. My main goal would be, to let the users search in an existing (provided sql sample of course) actor and location and similarly any other given set categories, and then after the autocomplete selection has been made, the appropriate html link would be pasted into ckeditor, as a reference link.

Basically, if they add content, but they want to refer to an already stored content, like an actor/location/whatever, I'd like them to be able to select it from an autocomplete popup (can be an always on to seperate window for example) and then after the selection has been made, they don't have to worry about manually settng the text to be a link, like they normally would do, because the selection/pasting already uses the proper html<a tag with id and location, extracted from the sql query that autocomplete does.

This feature should be implemented with CKeditor as a button, which pops up the actually edited movie's available locations/actors/else (already customized version will be provided of CKEDITOR), and a standalone one should be done as well (which is essentially the same, but it needs to be called anywhere if needed with a given jquery/jscript button)

I have absolutely no idea how much this would cost, but someone, who is a jquery/autocomplete guru, with understanding of ckeditor, might understand what I need. If the CKeditor implementation cannot be made, the standalone button/onclick/request version is enough. As a matter of fact, the standalone version is more important, because after that even I myself would be able to put it into ckeditor as a button. :)