Whoa. I didn't know you could declare the same variable twice in the same 'var' statement, and refer to the first declaration in the second to boot.

It might be a bit more conventional to just end the var statement on line 16, and on line 17 assign a new value to the same variable...


I'm also a little nervous about completely taking over the click handling on these link elements. It seems like it might interact badly with other javascript code that might also want to affect the clicks. Is there another way we could pass the next url while still letting this click propagate to any other handlers? Maybe we could change the value of 'href' to include the next=, or update it if it's already got one, and then let the click propagate?