Do you know there are design patterns implementation for Java Script and jQuery?
Please refer this eBook for hands-on http://addyosmani.com/resources/essentialjsdesignpatterns/book/
instead of writing either inline java script or .js file with set of client side java script functions, if we could follow few pattern(s) respect to our development, coding implementation would be much more easy and reusable.
Spend some time to read this.
Happy Java Script coding J