URL Segment matching with Javascript