Create local.xml file in your themes layout directory and place your code like this and place your js file here "/skin/frontend/INTERFACE/THEME/js/". If you use addjs methods you have to place your js file under "your magento root/js/" folder. Here is an example.
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="head">
<!-- Magento looks in /skin/frontend/<INTERFACE>/<THEME>/js/buyprinting.js
for this file -->
<action method="addItem"><type>skin_js</type><name>js/buyprinting.js</name></action>
<!-- This removes the item that was set in the page.xml file -->
<action method="removeItem"><type>skin_js</type><name>js/iehover-fix.js</name></action>
<!-- Magento looks in /js/prototype/element.storage.js for this file -->
<action method="addJs"><name>prototype/element.storage.js</name></action>
</reference>
</default>
</layout>
Note:
If you still unsure where to place your js file go to your browser and click on view source. Here check your js file and place the js file accordingly.