# Organise site's module

I was wondering about on how to organise the code on my site, to make it clearer as possible and clearly readable.

I'm organising it with namespace, separating every single section of the page.

For example:

var Header = {
}

var CentralBody = {
//code relative to the CentralBody
}

$(function(){ //code to execute on doc ready });  First of all, I would know if it is a good way to organise code. In second instance, I was thinking about "what must be placed where". I explain: If, for example, I have to assign some tooltip or to bind event with code like $('someclass').tooltip()
\$('someclass').on( 'event' , ... );


where do I have to place this kind of "functions"? Do I have to place them in the concerning namespace? Do I have to place them on document.ready? Or writing functions in namespace and then call them on document.ready?

Organizing by namespace is not a bad idea, though I would lowercase your namespace ( Header -> header etc. )
Furthermore, I would suggest to look into Movel View Controller and let each namespace have a model, view and controller.
So in document.ready you can call centralBody.init() which could call centralBody.controller.init().