tabs and change URL

tabs and change URL

Good day,
I have the problem. I'm using TABS. I have 4 bookmarks in the Tabs. And I need that If I clicked on the bookmarks then variable (val) in URL will be changed to value 0. I need exactly this: Every click on the bookmark change variable "www.sample.cz/index.php?val=0" in URL. Is it possible?

Or the variable don't may be in the URL, but I need the variable to be available in the GET (global variable). Get a variable via GET. Understand me? If not, explain more. Thank you very much...

something like this I think:

$("#tabs").tabs({
select: function(event, ui) { ... }
});