I'm trying to add a searchbox for a hotel booking site to my forum index page. The problem is that it needs to have a strip of javascript added after the </body> tag in order to run, but the </body> tag is in overall_footer.tpl, so when ever you navigate to any other page that doesn't have the <div> tag on it to place the searchbox, it gives an alert box that says the <div> tag is missing and won't open the page.
Is there some kind of switch statement I can use to make this JS script run after the </body> tag, but only on the forum index?
Thanks

