First of all you need to extract the path with something like this:
$("a#myLink").attr("href");
Then take a look at this plugin:
http://plugins.jquery.com/project/query-object
It will help you handle all kinds of querystring things you want to do.
/Peter F