Adding JavaScript
From Joomla! Documentation
Adding JavaScript
This chunk should describe in detail how to add JavaScript to the head of a template using the Joomla! 1.5 API calls. It should be aimed at people who have only minimal knowledge of PHP, HTML and JavaScript.