 var story=""

function CkNme(XNme)  {
  var UcNme = XNme.toUpperCase()
  var LcNme = XNme.toLowerCase()
    
  if (XNme==UcNme || XNme==LcNme){
      XNme = LcNme;
      XNme = XNme.charAt(0).toUpperCase() + XNme.substring(1,15);
    }  
 return XNme;
 }

function compute(fern)  {

if(fern.gender.value == "Male"){
 var boyGirl = "boy"
 var heShe = "he"
 var heSheCap = "He"
 var hisHer = "his"
 var hisHerCap = "His"
 var himHer = "him"
 var himherSelf = "himself"
 var hero = "hero"

} 
else {
 var boyGirl = "girl"
 var heShe = "she"
 var heSheCap = "She"
 var hisHer = "her"
 var hisHerCap = "Her"
 var himHer = "her"
 var himherSelf = "herself"
 var hero = "heroine"
};
var foodutil = "spoon"
var x = fern.food.selectedIndex
 var z = x+1
if(z/2 == Math.floor(z/2)){
var foodutil = "fork"
};
var pile= new Array("cold and lumpy", "cold and greasy", "cold and lumpy", "cold and soggy", "warm and mushy", "cold and soggy", "warm and mushy", "cold and soggy");
var mess= new Array("sticky, white mound of oatmeal", "lumpy, yellow pile of eggs", "sticky, white mound of grits", "puddle of brown, gooey syrup", "puddle of warm, white milk", "puddle of brown, gooey syrup", "puddle of warm milk", "puddle of brown, sticky syrup");
var x = fern.food.selectedIndex
var foodmess= mess[x]
var foodpile= pile[x]

var chore1 = fern.chore1.value
var chore2 = fern.chore2.value
var job1 = new Array("washing dishes", "folding the laundry", "cleaning the bathroom", "scrubbing the tub", "cleaning the birdcage", "watering the yard", "vacuuming the rug", "sweeping the patio");

var job2 = new Array("pulling up weeds", "raking the leaves", "mowing the lawn", "washing the car", "bathing the dog", "planting the garden", "cleaning the garage", "washing the windows");
var x = fern.chore1.selectedIndex
var chore1ing =job1[x]
var x = fern.chore2.selectedIndex
var chore2ing = job2[x]

var tree1 = new Array("oranges", "pears", "lemons", "plums", "apples", "peaches", "apricots", "figs");
var x = fern.tree.selectedIndex
var fruit =tree1[x]
var drink1 = new Array("juice glass", "water glass", "milk glass", "juice glass", "juice glass", "cup"); 
var x = fern.drink.selectedIndex
var liquid =drink1[x]
var firstNme = fern.firstNme.value
        firstNme = CkNme(firstNme);
var lastNme = fern.lastNme.value
        lastNme = CkNme(lastNme);

var singtoy = new Array("", "", "", "", "", "", "", "one of", "", "", "one of", "one of");
var x = fern.toy.selectedIndex
var oneof = singtoy[x]
 
var onetoy = new Array("roller blades", "scooter", "skateboard", "doll house", "bike", "baseball mitt", "wagon", "book", "card table", "water gun", "car", "doll");
var x = fern.toy.selectedIndex
var toyone =onetoy[x]

var boss = fern.boss.value
 
var friend = fern.friend.value
       friend = CkNme(friend);
var food = fern.food.value
var drink = fern.drink.value
 var item = fern.item.value
 var cloth = fern.cloth.value
 var drinkutil = "cup"
 
 var toy = fern.toy.value
 var cat = fern.cat.value
 var tree = fern.tree.value
 var fast = fern.fast.value
 var flat = fern.flat.value
 var gone = fern.gone.value
 
 
 var story = ("<html><HEAD><TITLE> " + firstNme +"\'s Getaway</TITLE>  <LINK REL=stylesheet Type='text/css' HREF='SansTxt.css'></HEAD>");

story = (story +"<BODY text='#000000' BGCOLOR = '#6699FF'><Font size='+2'>");
story = (story +"<H1 align=center>" + firstNme +"\'s Getaway!<br><sup>By " + firstNme + " " + lastNme + "</sup></h1><P>");

story=(story+"");
story=(story+"<P>"+firstNme+" was grumpy and still sleepy. "+heSheCap+" was so slow getting up that "+heShe+" had to eat breakfast alone. "+heSheCap+" stared at the "+food+", now  "+foodpile+", and mumbled about  "+hisHer+"  Saturday morning chores.");

story=(story+"<P>\"Oh, brother!\" "+heShe+" complained. \"I have to clean my room  <b><u>and</u></b> "+chore1+ " <b><u>and</u></b> I promised I would help "+chore2+". That's going to take me all day. Maybe I won't even get to invite "+friend+" over.\" Still grumbling, "+firstNme+" lifted up a "+foodutil+"ful of "+food+", paused, and slowly opened "+hisHer+" mouth to eat.");

story=(story+"<P>An instant later and without warning, something absolutely weird happened. "+firstNme+" found "+himherSelf+" standing on the breakfast table. The "+foodutil+" with the "+food+" dropped with a bang making a big "+foodmess+" next to "+himHer+". Looking up, "+heShe+" realized that now "+heShe+" was shorter than "+hisHer+" "+drink+".");

story=(story+"<P>\"Oh, no!\" "+heShe+" cried. \"I'm only two inches tall.\"");
 
story=(story+"<P>"+firstNme+" started to scream for help. Then quickly, "+heShe+" caught "+himherSelf+" and began to think aloud. \"Say, I could escape and go over to "+friend+"'s right now. No one would see me go. We could have all day to play.\"");

story=(story+"<P>"+firstNme+" made a getaway plan. "+heSheCap+" hid behind the "+item+" and waited until it was quiet in the other room. Then "+heShe+" jumped over the "+foodutil+", ran around the "+foodmess+", raced across the table and slid down the table leg. Mouselike, "+heShe+" scurried across the floor to the back door. What luck! Someone had left it open just enough to squeeze through. Out "+heShe+" went!");

story=(story+"<P>Wide-awake and excited, "+firstNme+" plotted the best way to "+friend+"'s house. "+heSheCap+" was almost across their back patio when "+heShe+" saw trouble. "+cat+" - the big, orange cat who lived next door - was warming himself in the sun, only three feet away and blocking "+hisHer+" planned path. His round, yellow eyes were fully open and his orange tail was swishing back and forth slowly.");

story=(story+"<P>A sudden thought made "+firstNme+" freeze. \""+cat+" won't know me. He may be hungry. I'll be "+gone+".\" Crouching behind the nearest flowerpot, "+heShe+" hid again. "+hisHerCap+" heart pounded inside "+himHer+".");

story=(story+"<P>More good luck. "+cat+" got up, stretched, and ambled toward the side of the house. "+fast+", "+firstNme+" took off running the way "+heShe+" had planned.");

story=(story+"<P>It was when "+heShe+" came around the corner that "+heShe+" encountered the wind. At only two inches tall, "+heShe+" was in for a wild ride. A gust struck. It knocked "+himHer+" down then lifted "+himHer+" up. It carried "+himHer+" back across the yard and dropped "+himHer+" beside the neighbor's fruit tree.");

story=(story+"<P>After a moment, "+firstNme+" realized "+heShe+" wasn't hurt. Maybe "+heShe+" should rest there until the wind calmed down.");

story=(story+"<P>A thumping sound caused "+himHer+" to look up. Directly overhead, big, ripe "+fruit+" were swinging in the wind. They were knocking into each other with every powerful gust. What if they fell? What if one hit "+himHer+"? For sure, "+heShe+" would be "+flat+". Forget "+friend+". Forget playing. Now "+heShe+" was totally focused on how to get back to the safety of the breakfast table.");

story=(story+"<P>If "+heShe+" made "+himherSelf+" into a ball, maybe the wind would push "+himHer+" quickly and safely home. It was worth trying. Just as "+firstNme+" was curling up, <b><u>he</u></b> appeared. "+cat+" strolled around the corner and headed for the "+tree+" tree. This time "+cat+" saw "+firstNme+".");

story=(story+"<P>He fixed those bright, unblinking, yellow eyes on "+himHer+". His ears went on alert. His whiskers straightened and quivered. His body tensed. His tail twitched. He was ready to spring into motion.");

story=(story+"<P>"+firstNme+" ran. "+cat+" was close behind. Thud! "+firstNme+" banged into something hard that stopped "+hisHer+" flight. Oh, no! It was "+oneof+" "+hisHer+" "+toy+" that "+heShe+" had carelessly left outside yesterday instead of putting away. Now "+heShe+" was up against an enormous, immovable wall and trapped. Nothing to do but outsmart "+cat+", get around the "+toyone+", and run for "+hisHer+" life.");

story=(story+"<P>Waving "+hisHer+" arms and yelling, \""+cat+", "+cat+". Fancy free. Ha! Ha! Can't catch me!\" "+firstNme+" darted back and forth in front of the startled cat. The song and dance confused him. Then, step over step, step over step, "+firstNme+ " ran straight for the door. "+heSheCap+" didn't look back and "+heShe+" didn't stop. Panting hard, "+heShe+" squeezed through the opening, ran across the kitchen floor and grabbed the kitchen table leg.");

story=(story+"<P>Groan. "+heSheCap+" heard "+cat+" push open the back door. "+heSheCap+" felt him close behind "+himHer+". Quickly, "+heShe+" began to pull "+himherSelf+" up the table leg. Pull. Rest. Pull. Rest. Pull ... but "+hisHer+" muscles gave out and "+heShe+" slipped back down. Kerplunk! "+hisHerCap+" head hit the floor. Next "+heShe+" felt the cat's paw on "+hisHer+" back and something hard pressing on "+hisHer+" ear.");

story=(story+"<P>"+heSheCap+" opened one eye. Right before "+himHer+", a huge shape, resting on a "+cloth+" field, curved upwards. Beyond that, a silver line stretched like a long, low bridge across "+hisHer+" view.  Further back, tall buildings that looked like a "+liquid+" and a "+item+" appeared.");

story=(story+"<P>\""+firstNme+" "+lastNme+"! Haven't you finished eating your "+food+" yet?\" "+hisHerCap+" "+boss+"'s demanding voice broke the spell.");

story=(story+"<P>"+heSheCap+" was no longer confused. "+heSheCap+" was the right size and in the right place. "+heSheCap+" didn't answer "+hisHer+" "+boss+" right away and didn't mind the scolding. Instead, "+heShe+" picked up "+hisHer+" head and finished breakfast quickly. "+heSheCap+" went to work cleaning "+hisHer+" room, "+chore1ing+", and "+chore2ing+". Not once did "+heShe+" complain or mention "+friend+". "+hisHerCap+" jobs that Saturday were beautifully done!");

story=(story+"<P>Oh! The first thing "+firstNme+" did, right after breakfast, was put away "+hisHer+" "+toy+".");


story=(story+"<br><br><div align='center'>The End</div></font>");
story=(story+"<hr><blockquote>PS ...  You can have a wonderful time playing with your imagination. Rest your head in different places. Use your eyes to find a world in which you are just inches tall. Write and draw what you see and do in such extraordinary places.</blockquote><hr>");

story=(story+"<font color='blue' size='-4'>&copy;2003 Kay Wittes</font>"); 
msgWindow=window.open("","displayWindow","toolbar=yes,width=640,height=400,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=yes")
msgWindow.document.write(story)
msgWindow.focus()
msgWindow.document.close()
}
