Why don't you provide a class on the body tag to identify if you are on this page rather than check your current url.
e.g.
<html>
<body class="somesite">
</body>
</html>
and in your javascript you do this
$('#menu a').each(function() {
if ($('body.somesite').length) {
$(this).addClass('current');
}
});
lambing
Junior Poster in Training
76 posts since Feb 2010
Reputation Points: 10
Solved Threads: 15
Skill Endorsements: 0
Why don't you just use the active pseudo class in CSS?
stbuchok
Practically a Posting Shark
876 posts since May 2011
Reputation Points: 138
Solved Threads: 124
Skill Endorsements: 2