This is tricky. I assume you have been looking at your referrals and have seen that many of them are from different sections of your site. This does not mean they enter your site this way, this means they went back to the homepage (and counter) from these sections either by clicking on the main site url (and therefore counting as a referral) or simply going back (not sure if this registers, probably not).
As for a Javascript that tells you if they came in via the homepage I would say there is not one. First of all, as you know everyone who enters the index registers on your stats system. Second of all if they entered via another section it is probably because they only wanted the ROM and would most likely not care about the homepage.
As far as I can see there is only one way you can (sort of) ensure the only visit the main page. Password protect all of your sections apart from the main and put the details on the main page. Therefore anyone (except freqent users who know the password) could not enter these sections without entering the main site first. Another way would be to assign cookies to users via a regisration system, I do notknow how to do this myself but might be able to find out from a few helpful hands.
http://www.jsworld.com if you find the script you were looking for tell me, as I fear I have entered the severely off topic phase.