  function GetQueryString(strParam) {
    hu = window.location.search.substring(1);

    gy = hu.split("&");

    for (i=0;i<gy.length;i++) {
      ft = gy[i].split("=");
      if (ft[0] == strParam) {
        return ft[1];
      }
    }
  }

function URLDecode(encoded) {
   // Replace + with ' '
   // Replace %xx with equivalent character
   // Put [ERROR] in output if %xx is invalid.
   var HEXCHARS = "0123456789ABCDEFabcdef";
   var plaintext = "";
   var i = 0;
   while (i < encoded.length) {
       var ch = encoded.charAt(i);
	   if (ch == "+") {
	       plaintext += " ";
		   i++;
	   } else if (ch == "%") {
			if (i < (encoded.length-2)
					&& HEXCHARS.indexOf(encoded.charAt(i+1)) != -1
					&& HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) {
				plaintext += unescape( encoded.substr(i,3) );
				i += 3;
			} else {
				alert( 'Bad escape combination near ...' + encoded.substr(i) );
				plaintext += "%[ERROR]";
				i++;
			}
		} else {
		   plaintext += ch;
		   i++;
		}
	} // while
   return plaintext;
};

if (GetQueryString("bti") > '') document.getElementById("bus").value = URLDecode(GetQueryString("bti"));
if (GetQueryString("bis") > '') document.getElementById("bus").value = URLDecode(GetQueryString("bis"));
if (GetQueryString("ban") > '') document.getElementById("bus").value = URLDecode(GetQueryString("ban"));
if (GetQueryString("bct") > '') document.getElementById("bus").value = URLDecode(GetQueryString("bct"));
if (GetQueryString("bau") > '') document.getElementById("bus").value = URLDecode(GetQueryString("bau"));
if (GetQueryString("bed") > '') document.getElementById("bus").value = URLDecode(GetQueryString("bed"));
if (GetQueryString("bus") > '') document.getElementById("bus").value = URLDecode(GetQueryString("bus"));

