Fixed js issues and search form

Add js function and support the search form. Rearrange the header file