function writeStory(storyNum) {
 if (storyNum==1) {
  madlibWin.document.write("<html><head><title>The Magic Spell</title></head>");
  madlibWin.document.write("<body bgcolor='#FFFFFF'><strong><center>The Magic Spell</center></strong><br><p></p><table border='0' width='95%'><tr><td>");
  
  madlibWin.document.write("Once upon a time, in the far away land of " + document.madlib.ts17.value + ", there ");
  madlibWin.document.write("lived a " + document.madlib.ts14.value + " princess named " + document.madlib.ts12.value + " and her beloved ");
  madlibWin.document.write("animal companion, a " + document.madlib.ts8.value + " " + document.madlib.ts5.value + " named " + document.madlib.ts0.value + ". One day, ");
  madlibWin.document.write("they were walking through the forest " + document.madlib.ts9.value + " until they ");
  madlibWin.document.write("came upon a " + document.madlib.ts11.value + ". It was " + document.madlib.ts2.value + ", and they became ");
  madlibWin.document.write("very " + document.madlib.ts3.value + ". The princess " + document.madlib.ts12.value + " decided to say a magic ");
  madlibWin.document.write("spell that she knew. `" + document.madlib.ts6.value + "!!!' she shouted, and suddenly ");
  madlibWin.document.write("the " + document.madlib.ts11.value + " turned into a prince! He introduced himself ");
  madlibWin.document.write("as " + document.madlib.ts13.value + " the " + document.madlib.ts4.value + ". He was the king of the legendary ");
  madlibWin.document.write("River of " + document.madlib.ts7.value + " and gave the princess a " + document.madlib.ts1.value + " in token ");
  madlibWin.document.write("of his affection. They got married, and lived " + document.madlib.ts10.value + " ever after!");
  
  madlibWin.document.write("</tr></td></table></body></html>");
  madlibWin.document.close();

} else if (storyNum==2) {
  madlibWin.document.write("<html><head><title>Star Trek Adventure</title></head>");
  madlibWin.document.write("<body bgcolor='#FFFFFF'><strong><center>Star Trek Adventure</center></strong><br><p></p><table border='0' width='95%'><tr><td>");

  madlibWin.document.write("One day, on the bridge of the " + document.madlib.ts3.value + " ship known as the Enterprise, ");
  madlibWin.document.write("Captain Picard was startled by the sudden appearance of a " + document.madlib.ts1.value + " ");
  madlibWin.document.write("aboard his ship. '" + document.madlib.ts6.value + "!' shouted Picard " + document.madlib.ts10.value + " as the " + document.madlib.ts1.value + " ");
  madlibWin.document.write("began " + document.madlib.ts2.value + ".  " + document.madlib.ts12.value + ", the ship's first officer, decided to ");
  madlibWin.document.write("attempt to neutralize it with " + document.madlib.ts7.value + ", but her plan failed. ");
  madlibWin.document.write("Picard then asked the android, " + document.madlib.ts13.value + ", who suggested that they ");
  madlibWin.document.write("beam it to " + document.madlib.ts17.value + ". Picard tried to do that, but the transporter ");
  madlibWin.document.write("began to glow a " + document.madlib.ts4.value + " shade of " + document.madlib.ts8.value + " and didn't work at all. ");
  madlibWin.document.write("in desperation, Picard called on his chief engineer, " + document.madlib.ts0.value + ", who ");
  madlibWin.document.write("stated " + document.madlib.ts9.value + " that they should find a " + document.madlib.ts11.value + " which would ");
  madlibWin.document.write("transform the " + document.madlib.ts1.value + " into a " + document.madlib.ts5.value + ". This worked, and Picard ");
  madlibWin.document.write("became very " + document.madlib.ts14.value + " and started to " + document.madlib.ts15.value + ", and they all lived ");
  madlibWin.document.write(document.madlib.ts10.value + " ever after.");
  
  madlibWin.document.write("</tr></td></table></body></html>");
  madlibWin.document.close();

} else if (storyNum==3) {
  madlibWin.document.write("<html><head><title> The " + document.madlib.ts0.value + " Co. Goes Postal</title></head>");
  madlibWin.document.write("<body bgcolor='#FFFFFF'><strong><center>The " + document.madlib.ts0.value + " Co. Goes Postal</center></strong><br><p></p><table border='0' width='95%'><tr><td>");

  madlibWin.document.write("Once upon a time, there was an office full of " + document.madlib.ts3.value + " people ");
  madlibWin.document.write("called The " + document.madlib.ts0.value + " Company. They worked " + document.madlib.ts9.value + ", except ");
  madlibWin.document.write("for one guy named " + document.madlib.ts13.value + ". In fact, they nicknamed him The " + document.madlib.ts5.value + " ");
  madlibWin.document.write("because he was always " + document.madlib.ts2.value + ". One day, The " + document.madlib.ts5.value + "'s ");
  madlibWin.document.write("most " + document.madlib.ts14.value + " co-worker, who was named " + document.madlib.ts12.value + ", brought a " + document.madlib.ts11.value + " to the ");
  madlibWin.document.write("office, which made everyone want to " + document.madlib.ts15.value + ". `" + document.madlib.ts6.value + "!' shouted ");
  madlibWin.document.write("the staff, as they watched The " + document.madlib.ts5.value + "'s face turn " + document.madlib.ts8.value + ". He ");
  madlibWin.document.write("seemed to be very " + document.madlib.ts4.value + " until " + document.madlib.ts0.value + ", the boss, decided to ");
  madlibWin.document.write("douse him with " + document.madlib.ts7.value + ". Things were soon back to normal. The " + document.madlib.ts5.value + " ");
  madlibWin.document.write("was relocated to " + document.madlib.ts17.value + " and they all continued to " + document.madlib.ts15.value + " ");
  madlibWin.document.write(" " + document.madlib.ts10.value + " for the rest of their lives.");
  
  madlibWin.document.write("</tr></td></table></body></html>");
  madlibWin.document.close();

} else if (storyNum==4) {
  madlibWin.document.write("<html><head><title>Roll Over Shakespeare</title></head>");
  madlibWin.document.write("<body bgcolor='#FFFFFF'><strong><center>Roll Over Shakespeare</center></strong><br><p></p><table border='0' width='95%'><tr><td>");

  madlibWin.document.write("Once upon a time, there were two " + document.madlib.ts3.value + " lovers ");
  madlibWin.document.write("named " + document.madlib.ts13.value + " and " + document.madlib.ts12.value + ". They wanted to be allowed to " + document.madlib.ts15.value + ", but ");
  madlibWin.document.write("their " + document.madlib.ts4.value + " parents wouldn't allow it. One night, " + document.madlib.ts13.value + " ");
  madlibWin.document.write("climbed up the " + document.madlib.ts1.value + " outside the bedroom of his beloved. He ");
  madlibWin.document.write("shouted the immortal words, `Tis the east, and " + document.madlib.ts12.value + " is ");
  madlibWin.document.write("the " + document.madlib.ts11.value + "!' The two lovers had a friend named " + document.madlib.ts0.value + ", who ");
  madlibWin.document.write("approved of the lovers " + document.madlib.ts2.value + " and wanted to help them. " + document.madlib.ts0.value + " ");
  madlibWin.document.write("brought " + document.madlib.ts12.value + " a magic potion of " + document.madlib.ts7.value + " that allowed her ");
  madlibWin.document.write("to fake her own death. When " + document.madlib.ts13.value + " heard that his beloved ");
  madlibWin.document.write("had been killed, he became as " + document.madlib.ts4.value + " as a " + document.madlib.ts5.value + ". He ");
  madlibWin.document.write("went to her grave and killed himself. His last words were ");
  madlibWin.document.write("`" + document.madlib.ts6.value + "!' When she awoke, she turned " + document.madlib.ts8.value + " with emotion ");
  madlibWin.document.write("and stabbed herself " + document.madlib.ts10.value + " with a " + document.madlib.ts14.value + " knife. The two ");
  madlibWin.document.write("lovers were buried side by side in " + document.madlib.ts17.value + " and everyone ");
  madlibWin.document.write("lived " + document.madlib.ts9.value + " ever after.");

 
  madlibWin.document.write("</tr></td></table></body></html>");
  madlibWin.document.close();

} else if (storyNum==5) {
  madlibWin.document.write("<html><head><title>Wanton Lust</title></head>");
  madlibWin.document.write("<body bgcolor='#FFFFFF'><strong><center>Wanton Lust</center></strong><br><p></p><table border='0' width='95%'><tr><td>");

  madlibWin.document.write("The " + document.madlib.ts7.value + " dripped " + document.madlib.ts9.value + " from " + document.madlib.ts12.value + "'s tempting ");
  madlibWin.document.write("flesh.  " + document.madlib.ts13.value + " was overcome with the urge to " + document.madlib.ts15.value + " as if he were a ");
  madlibWin.document.write("wild animal, as if he were a " + document.madlib.ts5.value + ". Ravaging her body, he ");
  madlibWin.document.write("peeled off her " + document.madlib.ts8.value + " dress as if it were merely a " + document.madlib.ts11.value + ". ");
  madlibWin.document.write("She was the most " + document.madlib.ts14.value + " creature he had ever seen. His hands ");
  madlibWin.document.write("sought out her " + document.madlib.ts1.value + ", her most forbidden zone. His " + document.madlib.ts3.value + " ");
  madlibWin.document.write("touch made her cry out, `" + document.madlib.ts6.value + "!' and he shuddered. It ");
  madlibWin.document.write("was " + document.madlib.ts4.value + " in the exotic land of " + document.madlib.ts17.value + ", and the entertwined ");
  madlibWin.document.write("lovers were " + document.madlib.ts2.value + " in the " + document.madlib.ts3.value + " climate. They continued ");
  madlibWin.document.write("their lovemaking until " + document.madlib.ts0.value + " walked in on them ");
  madlibWin.document.write("and turned " + document.madlib.ts8.value + " with astonishment, and everyone lived " + document.madlib.ts10.value + " ");
  madlibWin.document.write("ever after.");
  
  madlibWin.document.write("</tr></td></table></body></html>");
  madlibWin.document.close();

} else if (storyNum==6) {
  madlibWin.document.write("<html><head><title>Masquerade Party</title></head>");
  madlibWin.document.write("<body bgcolor='#FFFFFF'><strong><center>Masquerade Party</center></strong><br><p></p><table border='0' width='95%'><tr><td>");

  madlibWin.document.write("The biggest and most " + document.madlib.ts14.value + " masquerade party of the year ");
  madlibWin.document.write("was about to begin, and " + document.madlib.ts12.value + " had decided to go dressed ");
  madlibWin.document.write("as a " + document.madlib.ts5.value + ". When she walked into the " + document.madlib.ts3.value + " hall, she ");
  madlibWin.document.write("was so impressed that she " + document.madlib.ts9.value + " cried out, '" + document.madlib.ts6.value + "!' ");
  madlibWin.document.write("Over by the " + document.madlib.ts1.value + ", she noticed someone wearing all " + document.madlib.ts8.value + " ");
  madlibWin.document.write("and drinking a cup of " + document.madlib.ts7.value + ". She suspected that it might ");
  madlibWin.document.write("be her good friend " + document.madlib.ts0.value + ", so she went over and pulled ");
  madlibWin.document.write("off the mask. She cried out " + document.madlib.ts10.value + " to find that it was ");
  madlibWin.document.write("her most " + document.madlib.ts4.value + " friend, " + document.madlib.ts13.value + ". 'Where have you been?' ");
  madlibWin.document.write("she asked. 'I've been " + document.madlib.ts2.value + " in " + document.madlib.ts17.value + "', he responded. ");
  madlibWin.document.write("She asked him if he'd like to " + document.madlib.ts15.value + ", but he was not a ");
  madlibWin.document.write("very " + document.madlib.ts3.value + " dancer, and said that he'd rather go play with his " + document.madlib.ts11.value + " ");
  madlibWin.document.write("instead.");
  
  madlibWin.document.write("</tr></td></table></body></html>");
  madlibWin.document.close();

} else if (storyNum==7) {
  madlibWin.document.write("<html><head><title>A Curse</title></head>");
  madlibWin.document.write("<body bgcolor='#FFFFFF'><strong><center>A Curse</center></strong><br><p></p><table border='0' width='95%'><tr><td>");

  madlibWin.document.write("It was a " + document.madlib.ts3.value + " and " + document.madlib.ts14.value + " day when the curse of the ");
  madlibWin.document.write("evil " + document.madlib.ts0.value + " came down upon the unfortunate " + document.madlib.ts13.value + ". Dark ");
  madlibWin.document.write("clouds gathered and " + document.madlib.ts7.value + " began to pour from the sky. " + document.madlib.ts13.value + " ");
  madlibWin.document.write("walked through " + document.madlib.ts17.value + " " + document.madlib.ts9.value + " on that Friday the 13th, until he ");
  madlibWin.document.write("saw an intriguing " + document.madlib.ts8.value + " colored stone on the ground. He picked ");
  madlibWin.document.write("it up, and heard a " + document.madlib.ts4.value + " voice coming from deep within. ");
  madlibWin.document.write("`" + document.madlib.ts6.value + "' it moaned " + document.madlib.ts10.value + ". " + document.madlib.ts13.value + " immediately began to " + document.madlib.ts15.value + ". ");
  madlibWin.document.write("To remove the curse, he killed the nearest " + document.madlib.ts5.value + " and sprinkled ");
  madlibWin.document.write("its blood on the stone. Immediately, the stone started " + document.madlib.ts2.value + " ");
  madlibWin.document.write("and transformed into a " + document.madlib.ts1.value + ". To " + document.madlib.ts13.value + "'s surprise, the " + document.madlib.ts1.value + " ");
  madlibWin.document.write("began to speak. `My name is " + document.madlib.ts12.value + "', it said, `and I have a gift ");
  madlibWin.document.write("for you!' With an evil cackle, the " + document.madlib.ts1.value + " vanished, leaving ");
  madlibWin.document.write("only a " + document.madlib.ts11.value + " in its place, which " + document.madlib.ts13.value + " would be doomed to ");
  madlibWin.document.write("carry with him for all time.");
  
  madlibWin.document.write("</tr></td></table></body></html>");
  madlibWin.document.close();

} else if (storyNum==8) {
  madlibWin.document.write("<html><head><title>The Wedding</title></head>");
  madlibWin.document.write("<body bgcolor='#FFFFFF'><strong><center>The Wedding</center></strong><br><p></p><table border='0' width='95%'><tr><td>");

  madlibWin.document.write("After the " + document.madlib.ts3.value + " engagement of " + document.madlib.ts12.value + " and " + document.madlib.ts13.value + ", all their ");
  madlibWin.document.write("friends were invited to the wedding.  It was held in " + document.madlib.ts17.value + " which ");
  madlibWin.document.write("is a " + document.madlib.ts4.value + " location.  The bridesmaids wore " + document.madlib.ts8.value + " dresses that ");
  madlibWin.document.write("were " + document.madlib.ts9.value + " made. " + document.madlib.ts12.value + " and " + document.madlib.ts13.value + " wrote their own vows.  I ");
  madlibWin.document.write("," + document.madlib.ts12.value + " take you, " + document.madlib.ts13.value + " for my " + document.madlib.ts10.value + " wedded " + document.madlib.ts11.value + ".  To ");
  madlibWin.document.write(" " + document.madlib.ts15.value + " from this day forward, as long as we both shall " + document.madlib.ts16.value + ". ");
  madlibWin.document.write("Everyone thought the vows were " + document.madlib.ts14.value + " and they shouted, " + document.madlib.ts6.value + "!!! ");
  madlibWin.document.write("at the couple.  The best man proposed a " + document.madlib.ts7.value + " toast, and with an ");
  madlibWin.document.write("inflatable " + document.madlib.ts5.value + " tied to the car, the " + document.madlib.ts10.value + " married couple ");
  madlibWin.document.write("drove off for a honeymoon full of " + document.madlib.ts2.value + "!");
  
  madlibWin.document.write("</tr></td></table></body></html>");
  madlibWin.document.close();
 }
}
