oh, and the javasacript must go in the layout.master file of your skin which is located under /Data/Sites/[SiteID]/skins/[skinname]
skinname is shown in the skin dropdown in site settings, siteid is usually 1 unless its a multi site installation
putting in in the one in App_MasterPages isn't going to work