function queryField(opt)
{
  var keyloc;		
  var nextkey;
  var start;
  var opts;
  var optval;
  opts=location.search;
  keyloc = opts.indexOf("&" + opt + "=");
  if(keyloc == -1) {
    keyloc = opts.indexOf("?" + opt + "=");
  }
  if (keyloc == -1) {
    return "";
  } 
  nextkey = opts.indexOf("&",keyloc+1); 
  if (nextkey == -1) {
    nextkey = opts.length;
  }
  if (nextkey < keyloc) {
    return "";
  }  
  sval = keyloc+2+opt.length;
 // optval = plustospace(unescape(opts.substring(sval,nextkey)));
  optval = opts.substring(sval,nextkey);
  return optval;
} 
