var PassThruGET = new Object();
PassThruGET.qs = 'foo=bar';
PassThruGET.expr_pre = "([\\&\\?]?)";
PassThruGET.expr_post = "=\\*(\\&?)";

PassThruGET.passThru = function(key, query_str)
{
  var i, c, reg, matches, link;
  if (RegExp && key.match && key.replace)
  {
    reg = new RegExp(PassThruGET.expr_pre+key+PassThruGET.expr_post, '');
    for (i = 0, c = document.links.length; i < c; i++)
    {
      link = document.links[i];
      if (matches = reg.exec(link.href))
      {
        if (query_str)
        {
          link.href = 
           link.href.replace(reg, matches[1]+query_str+matches[2]);
        }
        else
        {
          if (matches[2])
          {
            link.href = 
             link.href.replace(reg, matches[1]);
          }
          else
          {
            link.href = 
             link.href.replace(reg,'');
          }
        }
      }
    }
  }
}

