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 boyGirlCap = "Boy"
  var heShe = "he"
  var heSheCap = "He"
  var hisHer = "his"
  var hisHerCap = "His"
  var himHer = "him"
  var himherSelf = "himself"  
  var opheSheCap = "She"
  var ophisHer = "her"
  } 
  else {
  var boyGirl = "girl"
   var boyGirlCap = "Girl"
   var heShe = "she"
   var heSheCap = "She"
   var hisHer = "her"
   var hisHerCap = "Her"
   var himHer = "her"
   var himherSelf = "herself"
   var opheSheCap = "He"
   var ophisHer = "his"
 }

var firstNme = fern.firstNme.value;
  firstNme = CkNme(firstNme);
var lastNme = fern.lastNme.value;
  lastNme = CkNme(lastNme);
var firstNmeCap = firstNme.toUpperCase();
var lastNmeCap = lastNme.toUpperCase();
var rel = fern.rel.value;
var relCap=rel.charAt(0).toUpperCase() + rel.substring(1,15);

var x = fern.rel.selectedIndex;
 if(x/2==Math.floor(x/2)){
 var RheSheCap="He"
 var RheShe="he"
 var RhimHer="him"
 var RhisHer="his"
 var RhimselfHerself="himself"
 }
 else{
 var RheSheCap="She"
 var RheShe="she"
 var RhimHer="her"
 var RhisHer="her"
 var RhimselfHerself="herself"
}

var foodword1 = new Array("red ball of gum","can of soda pop","bag of yellow popcorn","cupcake with pink icing on top","brown sugar cookie","brown ice cream bar")
var foodword2 = new Array("red gumball","can of soda","bag of popcorn","cupcake with icing","brown cookie","ice cream bar")
var foodword3 = new Array("gum","soda pop","popcorn","cupcake","cookie","ice cream")
var foodword4 = new Array("some gum","a soda","some popcorn","a cupcake","a cookie","some ice cream")
var food=fern.food.value;
var x = fern.food.selectedIndex
   var food1 = foodword1[x]
   var food2 = foodword2[x]
   var food3 = foodword3[x]
   var food4 = foodword4[x]

var colorword1 = new Array("red","orange","yellow","white","blue","purple")
var color=fern.color.value;
var x = fern.color.selectedIndex
   var color1 = colorword1[x]

var age = fern.age.value;
var street = fern.street.value;
var toy = fern.toy.value;
var collect = fern.collect.value;



var story = ("<html><HEAD><TITLE> "+firstNme+"\'s Tale</TITLE> <LINK REL=stylesheet Type='text/css' HREF='SansTxt.css'></HEAD>");

story +="<BODY text='#000000' BGCOLOR = '#6699FF'><Font size='+2'>";
story +="<h1 align='center'>"+firstNme+"\'s Tale";
story +="<br><sup>by " + firstNme + " " + lastNme + "</sup></h1><P>";

story +="<div align=center>~Part One~</div>";

story +="<P>"+firstNme+" lived in a white house on "+street+" Street. "+heSheCap+" had many friends. They played up and down the street. They rode their bikes. They played ball games. They jumped rope and played tag. They had fun on "+street+" Street.";

story +="<P>"+firstNme+"\'s "+rel+" said to people, \"Our "+firstNme+" is four years old. "+heSheCap+" is so smart and quick. "+heSheCap+" makes us happy.\" "+firstNme+" liked hearing this.";

story +="<P>One day a friend had a big "+food1+". "+firstNme+" liked "+food+". "+heSheCap+" wanted a big "+food2+". "+heSheCap+" said, \"I must have one too.\" ";

 story +="<P>The friend said, \"I will give you a big "+food1+", if you give me your "+toy+".\"";

 story +="<P>"+firstNme+" made the trade. They went away happy."; 

 story +="<P>That night "+heShe+" missed "+hisHer+" "+toy+". "+heSheCap+" wanted it back. The "+food3+" was gone. "+hisHerCap+" "+toy+" was gone. But, it was too late. "+firstNme+" went to bed sad."; 

story +="<P>The next day a friend came to "+hisHer+" house to play. The friend liked "+firstNme+"’s best "+collect+". "+heSheCap+" said, \"Let\'s make a trade. You give me your "+collect+". And, I will give you my best gel pen.\"";

 story +="<P>"+firstNme+" wanted the gel pen. It was "+color+". It glittered. "+firstNme+" said, \"My name will look good when I write. I must have it.\"";
 
 story +="<P>"+firstNme+" made the trade. They went away happy."; 

 story +="<P>That night the pen ran out of ink. "+heSheCap+" missed "+hisHer+" best "+collect+". The pen did not write. "+hisHerCap+" best "+collect+" was gone. It was too late. "+firstNme+" went to bed sad.";
 
story +="<p><div align=center>~Part Two~</div>";

story +="<P>Then one day "+firstNme+" went for a walk. "+heSheCap+" took "+hisHer+" backpack. "+heSheCap+" felt big. "+heSheCap+" felt like a first grader. "+firstNme+" came to the end of "+street+" Street.";

story +="<P>A big kid was standing in the sidewalk. "+firstNme+" did not know "+himHer+". The kid said, \"Hey, Little "+boyGirlCap+". Who are you?\"";

 story +="<P>\"I\'m "+firstNme+". I live in a white house on "+street+" Street,\" "+firstNme+" said.";  

 story +="<P>Then the big kid said, \"I like your backpack. Will you trade it for this?\"";

story +="<P>"+heSheCap+" pulled out a small, "+color+" box. It glittered in the sunlight. "+heSheCap+" shook it. The box made a little rat-a-tat.";

story +="<P>"+firstNme+" liked the "+color+" box that glittered. "+heSheCap+" liked "+hisHer+" backpack too. It made "+himHer+" feel like a first grader. Still, "+heShe+" wanted the "+color+" box that went rat-a-tat. And so "+heShe+" made the trade.";

story +="<P>The big kid took the backpack and went down the next street. "+firstNme+" ran back to "+hisHer+" house on "+street+" Street.";

story +="<P>Then "+heShe+" looked in the box. "+heSheCap+" saw three little, brown seeds. That\'s all. "+hisHerCap+" backpack was gone. "+heSheCap+" had traded it for seeds and a little box. What would "+heShe+" tell "+hisHer+" family?";

story +="<p><div align=center>~Part Three~</div>";

story +="<P>That night "+hisHer+" tale spilled out. "+firstNme+" said, \"I\'m so sad. I traded my "+toy+" for "+food4+" that is gone. I traded my "+collect+" for a pen that does not write. And, I traded my backpack for these no-good seeds. I know you are going to be mad at me.\"";

story +="<P>At first "+hisHer+" "+rel+" did not talk. Then "+RheShe+" said, \""+firstNme+", did you learn from what you did?\"";

story +="<P>"+firstNme+" said, \"I learned never to trade. And, I\'m a bad "+boyGirl+".\"";

story +="<P>"+hisHerCap+" "+rel+" said, \"No, "+firstNme+". You are not bad. You like to trade. It is fun for you. But, you must ask first. We will help you think. Then you will not make bad trades.\"";

story +="<P>"+RheSheCap+" went on. “If you learn, it is not a mistake. You can grow from what you did. O.K.?\"";

story +="<P>"+firstNme+" nodded and went to bed.";

story +="<P>The next day "+firstNme+" put the box away. "+heSheCap+" started to toss the seeds into "+hisHer+" yard. "+hisHerCap+"  "+rel+" stopped "+himHer+".";

story +="<P>\"Let\'s plant your seeds,\" "+RheShe+" said. \"Maybe they will grow.\"";

story +="<P>And so they planted the seeds. Then "+firstNme+" went up the street to play with a friend.";

story +="<p><div align=center>~Part Four~</div>";

story +="<P>Many days passed. "+firstNme+"\'s "+rel+" was first to see them. "+RheSheCap+" called to "+firstNme+". "+RheSheCap+" said, \""+firstNme+", come here and look. Your little seeds are growing into plants.\"";

story +="<P>Today "+firstNme+" is "+age+" years old. "+hisHerCap+" plants are still growing. Every year big, "+color1+" flowers grow on them. All the people on "+street+" Street come to see the flowers.";

story +="<P>They say, \"These plants are taller than last year. The flowers are bigger too. This is the best show on "+street+" Street.\"";

story +="<P>"+firstNme+"\'s "+rel+" tells them, \"You never know what may come from a little, brown seed. And, you never know how much a "+boyGirl+" named "+firstNme+" can learn.\"";

story +="<P>"+firstNme+" feels taller and smarter every time "+heShe+" hears that. Then a big smile grows on "+hisHer+" face!";


story +="<br><br></font><font color='blue' size='-4'>&copy;2004 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()
}
