How to use $scripts_for_layout

Finally discovered how $scripts_for_layout works.I have put < ?php echo $javascript->link('jtip', false); ?>in my view. False just means do not put it here, but put it where $scripts_for_layout is in my layout, so in the header.Still looking for a way to have js scripts automatically included. It exists, but I still haven't found what I'm looking for... Anyone?