Adding a Javascript photo carousel?

I am trying to add a Javascript image gallery carousel to the front page of my Omeka site. I know there is some difficulty with the server- vs. client-side languages, but from what I've read it seems like this still might be able to work.
It seems like I might just be able to change each line of the Javascript that would normally appear in the page's .html file as follows, and include it in the .php page instead:
<script type="text/javascript">
becomes

<?
...other js code here...
echo "<script type=\"text/javascript\"> \n";
...other js code here...
?>

Any thoughts or resources? I'm not very familiar with PHP, so any help or examples of Omeka sites where you've used something similar would be appreciated.

I solved this problem. It might be nice to have a write-up of how to incorporate Javascript into Omeka available on the site for future users, though, as the placement of code and images for JS in the Omeka directory was not intuitive to me.

It might be nice to have a write-up of how to incorporate Javascript into Omeka available on the site for future users, though, as the placement of code and images for JS in the Omeka directory was not intuitive to me. Its on our list of things to add as we continue to improve the documentation.

I agree that a write-up about how to incorporate JavaScript into a theme, in the larger context of theme building in general, would be really useful.

You can put JavaScript libraries in your theme's 'javascript' directory, then call those files using the js() theme helper. Similarly, you can call static images not associated with any items using the img() theme helper, then put those image files in your theme's 'images' directory.