//total docs always on line 2 below
totaldocs = 267;
lastjoke = 0;


var disclaimer = "Be advised that many of the jokes here are a little raunchy. Ok, some are a LOT raunchy. Some are offensive, some use bad language, some have no taste, some are degrading to women and some are degrading to men. Several contain blatant references to sex and several contain references to religion. In short, there's something here to offend everyone.\n\nIf you'd rather not partake in such vile amusements, then just close the page and you won't hear another peep. If however, you are of an appropriate age, if you're not bothered by a little amusement that occasionally leans toward the raunchy side, and you enjoy breaking up your day with a good belly laugh, then help yourself...";


// Random number generator. If max=3 then function returns 1,2 or 3
function getRandom(max) {return (Math.floor(Math.random()*max))+1;}


function randomJoke()
{
   randomjoke = getRandom(totaldocs);

   if(randomjoke == lastjoke)
   {
      randomJoke();
   }
   else
   {
      lastjoke = randomjoke;
      randomjokestring = randomjoke;

      if(randomjoke < 100)
      {
         randomjokestring = "0" + randomjokestring;
      }
      if(randomjoke < 10)
      {
         randomjokestring = "0" + randomjokestring;
      }

      this.location.href = randomjokestring + ".html";
   }

}




