How do I change:

<http://test.dev/event?event=94&page=4>

to 

<http://test.dev/contest?contest=94&page=4>

using Jquery?

I have the following code and would like to change it in the event of a right click: (CASE 2)

```
// will_paginate + ajax 
// updates two divs: #pages and #pagelink
// see places#search controller; passes 4 parameters to the search action

$(function(){
  $('.pagination a').mousedown(function(event) {
      switch (event.which) {
          case 1:
              $(".pagination a").live("click", function(event) {
              event.preventDefault();

              // Javascript Regular expression function; extracts page number from full url
              var extractPageNumber = function(s) {
                var r=/page=(\d+)/, m=(""+s).match(r);
                return (m) ? Number(m[1]) : undefined;
              };
              var pageregex = extractPageNumber($(this).attr('href'));
              $(".pagination").html("Page is loading...")
              $.get("/event", {  event: $("input[name=event]").val(), page: pageregex }, function(data) {
                $('#pagelink').html(data.page_link);
                console.log(data.page_link);
                $('#tweets').html(data.html);
                });
              return false;
              });
          break;

          case 2:
                break;
    }
  });
});

```