Optimize search.js and prepare for newer versions of jquery

This pull requests makes search.js ready for jquery 1.9 by doing several things like caching of most of the dom search, uses delegate for event binding, cleans up a couple of jslint warnings, removes the dummy ajax div that was added only to get the results of the ajax call and other things that are mentioned in the change log.

I have tested in Chrome 25, FF 18 and IE 7-9 and the search page works like it did before.

You can see from the multitude of commits exactly what was changes alongside with some of the mistakes that were corrected in the sequential commits.

I plan on applying this commits also for the 1.0 branch if a positive review will come out of this pull request and it would be accepted.