// Returns a random YKYBRPTLW...
//
// Greg Kempe (greg@kempe.net) 17/6/99    Copyright Greg Kempe 1999
//
// Call by inserting a <script language=javascript src=pernquote.js></script> tag
// The tag can be placed within a font tag (or whatever) to format the resulting text.
//
// Alternatively, the script can return the item in the document.PernQuote variable as
// a string. To do this, the document.PernQuote variable must be defined in a script
// block BEFORE this script is called.
//
// Eg: <script language=javascript>document.PernQuote = '';</script><script language=JavaScript src=pernquote.js></script>
//     <script language=javascript>document.writeln(document.PernQuote);</script>
//
// Currently there are 55 items
//
// WWW: http://pern.kempe.net/
//

// Init the array
// The non-pern section isn't included. Extra-long items aren't used.

var YKY_list = new Array(
         // FIRELIZARDS - 20/8/98
         "You saw The Lost World and thought the compys were really fire-lizards.",
         "You think the fairy tales Beauty & the Beast and Sleeping Beauty are about firelizards.",
         "You wait for a rock to hatch - no one's impressing this fire lizard but you!",
         "You get frantic when your stuffed firelizard doesn't move.",
         "You keep a bucket of sand and a heating pad in the basement, just in case.",
         // THREAD - 18/1/99
         "You notice Mercury in the morning sky and mistake it for the Buenos Aries.",
         "You carve a hole in a rock and wait for Mars to align with it.",
         "You plan your vacation according to Mars' proximity to the big rock on top of the hill.",
         "You refer to bleeding injuries as &quot;threadscore&quot;.",
         "You wonder why they don't do Threadfall charts on the weather channel.",
         "You pass the weeds on the sidewalk and reach for your flamethrower.",
         // DRAGONS - 17/6/99
         "You wonder when the Weyrs will start their own airline.",
         "You want to duck in between during difficult dates.",
         "You've started a &quot;Don't drink and fly&quot; campaign.",
         "You have bumper sticker saying: &quot;My other vehicle is a dragon.&quot;",
         "You tell your boss to &quot;go *between* and stay there!&quot;",
         "The local strip mall has a tent sale, and you go asking for bubbly pies",
         "You go to your local coffee shop and wonder why they don't have klah.",
         "You go to a fair and ask a worker which stall is selling the bubbly pies.",
         "You start squeezing the oil out of all the fish you catch.",
         "You drink cinnamon herbal tea each day, just so that you can call it klah.",
         "You refer to the weather as being &quot;colder than <em>between</em>.&quot;",
         "When - if you're a male - you will only buy cars that are Bronze, Brown, Blue or Green - or females - Gold, and then after signing the contract you smile and tell the salemen the cars name.",
         "You think the book of Ruth in the Bible is about a dragon.",
         "You call seat belts riding straps.",
         "Your ranking scale of guys/girls goes somthing like: Gold, Bronze, Brown, Green or Blue.",
         // AIVAS - 20/8/98
         "You write &quot;AIVAS&quot; in big letters across your computer's case.",
         "Your printer has wherhide instead of paper.",
         "You run out of pressed sheets instead of paper.",
         "You try to scan documents using the cdrom drive.",
         "You name your harddrives after Pern and other stellar accompaniments.",
         "You actually have a folder on your computer named &quot;Weyr&quot;.",
         // TERMS & PHRASES - 17/6/99
         "You call your room a weyr or your bed a cot.",
         "You refer to being grounded as &quot;all holds barred&quot;.",
         "You call auditioning people &quot;Candidates&quot; and those who made it &quot;those who Impressed&quot;.",
         "You only measure big things in dragonlengths.",
         "You describe a bad sunburn as having &quot;peeled like a tunnel snake.&quot;",
         "You hear some juicy gossip and look around for a harper to help you spread the news.",
         "You go to a local club and wonder which Harpers will be performing tonight.",
         "A huge event occurs and you wonder which Harper will write the ballad about it.",
         "You make up your own teaching ballads.",
         "Your teacher starts discussing morse code and you compare it to the report sequence.",
         "You call an irritating sibling a &quot;deadglow.&quot;",
         "You see a beatle and call it a trundle bug.",
         // PEOPLE - 17/6/99
         "You like Robinton's &quot;A minor miner problem.&quot;",
         "When you hear take me to your leader and the first name that comes to mind is F'lar.",
         "Asked who your favorite singer is and you come up with Robinton or Menolly.",
         "You read a story about con artists and wonder how many of them are Bitran.",
         "You see a good-looking guy and think, &quot;Sure, he's cute, but he ain't no F'lar.&quot;",
         "You insult someone by saying &quot;You son of a Bitran!&quot;",
         "All your passwords are names from Pern books.",
         // PLANTS - 20/8/98
         "You see spots and think you have fire-head.",
         "You cover your mouth in the presence of your pet cat.",
         "You break your leg and frantically scream for numbweed.",
         "You actually know which earth plants correspond to the plants used on Pern.",
         "You feel that only sand can get you a fresh clean feeling.",
         // MISC - 17/6/99
         "You refuse to go into the subway system because of tunnel snakes.",
         "You think of your country's coinage as Marks.",
         "Your spell check has learned words like Pern, Weyr, fire-lizards, harper, etc.",
         "You look in the Sagittarius sector for Rukbat so you can locate Pern."
       );

function randomPernQuote() {
  return YKY_list[Math.floor(Math.random() * 10000) % YKY_list.length];
}

if (document.ReturnPernQuote == null) document.write(randomPernQuote());

// Routines to write a rotating YKYBRPTLW quotation
// Note: MSIE 4 or better required. I
//       If not, then a static quote is written (without <span> tags)
//
//
// Greg Kempe (greg@kempe.net)      1/11/99
//  (http://pern.kempe.net/)
//
// Usage:
//   1) same as above for using the randomPernQuote() function
//
//   2) but, call the rotatePernQuote(<secs>) function instead, where <secs> is the
//      number of seconds to wait between each rewrite. Set to -1 to get the default
//      of 60 (a minute.)
//
// Technical details: writes to a <span> with id YKY_quote;
//

function YKY_writePernQuote(secs) {
  // writes to the div
  
  document.all['YKY_quote'].innerHTML = randomPernQuote();
  setTimeout('YKY_writePernQuote('+secs+')', secs * 1000);
}

function rotatePernQuote(secs) {
  // rotates a pern quote - writes to a <div>
  
  var ua = window.navigator.userAgent;
  var msie = ua.indexOf('MSIE ');
  
  // default count
  if (secs == -1) secs = 60;
  
  if ((msie > -1) && (parseFloat(ua.substring(msie+5, 99)) >= 4)) {
    document.write('<span id=YKY_quote name=YKY_quote></span>');
    YKY_writePernQuote(secs);
  } else {
    document.write(randomPernQuote());
  }
}