input text lose value when window.location.href is called

input text lose value when window.location.href is called

Hi, 
I have an input text and button search, when a user type a text a script redirect the page with the text as parameter, but after the redirect (in the same page) the input text lose the value, I tried to reload value from paramters with no luck
Help please ?
this is my code :
  1. <script type="text/javascript">

  2. function RedirectUrlSearch()
  3. {
  4. var tb = document.getElementById("tbSearch").value;
  5. if((tb != null))
  6. {
  7. window.location.href="?FilterName=SalesforceCaseNumber&FilterMultiValue=*"+tb+"*";
  8. if (window.location.href.search("SalesforceCaseNumber")!=-1){

  9. function getUrlVars()
  10. {
  11.     var vars = [], hash;
  12.     var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
  13.     for(var i = 0; i < hashes.length; i++)
  14.     {
  15.         hash = hashes[i].split('=');
  16.         vars.push(hash[0]);
  17.         vars[hash[0]] = hash[1];
  18.     }
  19.     return vars;
  20. }

  21. var first = getUrlVars()["FilterMultiValue"];
  22. document.getElementById('tbSearch').value = first;

  23. }
  24. return false;
  25. </script>
  26. <table>
  27. <tr>
  28. <td>SalesforceCaseNumber : <input name="T1" id="tbSearch" type="text"/></td>
  29. <td><input id="btnSearch" onclick="return RedirectUrlSearch();" type="button" value="search"/> </td>
  30. </tr>
  31. </table>