<!--
function LPPSearch(s)
  {
  // This function converts the string from the form as follows:
  // (1) Replaces any non-alphanumeric character with a space
  // (2) Omits the words 'and', 'or', & 'the'.
  // (3) Trims all whitespace from beginning and end of string
  // (4) Collapses any multiple spaces to a single space
  // (5) Replaces any single space with a dash "-"
  // 
  // Example: this string: "  this*(+++1 isn't  a ())*good string    "
  //          becomes      "this-1-isnt-a-good-string"

  // Prepare the banner code argument
  strBanner  = '?b=1006';

  // Convert the string
  reAlphaNum = new RegExp('[^A-Za-z0-9\\s]', 'gi');
  reOneSpace = new RegExp('\\s+', 'gi');
  reTrim     = new RegExp('^\\s+|\\s+$', 'gi');
  reEndDash  = new RegExp('-$', 'gi');
  reAndOrThe = new RegExp('^and\\s|^or\\s|^the\\s|\\sand\\s|\\sor\\s|\\sthe\\s|\\sand$|\\sr$|\\sthe$', 'gi');

  s = s.replace(reAlphaNum, ' ');
  if (s.length == 0)
    {
    // document.write('string resolved to NULL after alphanum conversion');
    top.location.replace("http://www.livepornpasses.com/"+strBanner);
    return(0);
    }

  s = s.replace(reAndOrThe, ' ');
  s = s.replace(reOneSpace, ' ');
  if (s.length == 1 && s == ' ')
    {
    // document.write('string resolved to a single space');
    top.location.replace("http://www.livepornpasses.com/");
    return(0);
    }

  s = s.replace(reTrim, '');
  s = s.replace(reOneSpace, '-');
  s = s.replace(reEndDash, '');
  if (s.length == 0)
    {
    // document.write('string resolved to NULL');
    top.location.replace("http://www.livepornpasses.com/"+strBanner);
    return(0);
    }
  else
    {
    top.location.replace("http://www.livepornpasses.com/~"+s+".html"+strBanner);
    return(0);
    }
  return(0);
  } // -->
