Identifying active menu item

Hi guys,

I am helping out a 'friend' with a site that has some static pages due to the nature of a horrific template. Due to this I am forced to use javascript to identify active menu-items (I prefer doing it serverside but that is no option, pennywise). So i found a little script that looks like it should do the trick but it doesn't

As you can see in the code It should alert 2 variables, but it doesn't alert anything. Am I missing something?

Love to hear it

P.s. the moment I go into the .each function I can't alert stuff. above that function I am able to, which for me is an indication that something is wrong there. (I have no other method of identifying errors with javascript)

Last edited by aeternus; February 11th, 2013 at 01:01 PM.
Reason: spelling

Why canít I use certain words like "drop" as part of my Security Question answers?
There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".