
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 self = "himself"
} 
else {
 var boyGirl = "girl"
 var heShe = "she"
 var heSheCap = "She"
 var hisHer = "her"
 var hisHerCap = "Her"
 var himHer = "her"
 var self = "herself"
};
  var firstName = fern.firstName.value
    firstName = CkNme(firstName);
  var lastName = fern.lastName.value
    lastName = CkNme(lastName);
  var walk = fern.walk.value
  var rock1 = fern.rock1.value
  var rock2 = fern.rock2.value
  var rock3 = fern.rock3.value
  var rock4 = fern.rock4.value
  var colors = fern.colors.value
  var story = ("<html><head><TITLE>" + firstName +"\'s Magic Rock!! </TITLE>  <LINK REL=stylesheet Type='text/css' HREF='SansTxt.css'></HEAD>");

story = (story +"<BODY text='#993300' BGCOLOR = '#6699FF'><Font size='+2'>");

story = (story +"<H1 align=center>My Magic Rock!<br><sup>By " + firstName + " " + lastName + "</sup></h1><P>" + firstName + " went outside. " + heSheCap + " was going for a walk by " + self + ". " + heSheCap + " was going to walk " + walk + ". That was a place " + heShe + " liked to go.<P>As " + firstName + " was walking along, " + heShe + " happened upon a very round and very odd rock. It was all by itself on the ground. Not another rock was near. " + firstName + " stared at it then bent down to pick it up.<P>As soon as " + heShe + " held this odd, but beautiful, rock in " + hisHer + " hand, strange things began to happen. " + heSheCap + " looked at it carefully. The " + rock1 + " rock was " + rock2 + ". It was " + rock3 + " and had " + colors + " " + rock4 + " all over it. Then the rock began to hum. The sound was soft and low. " + firstName + " started to rub the " + rock1 + ", " + rock3 + " rock gently. It felt warm - not hot, just a nice warm.<P>Then " + firstName + " surprised " + self + " by remembering a secret wish " + heShe + " had. " + heSheCap + " was just saying to " + self + ",  \"I wish I had " + fern.wish.value + ",\"  when there, right beside " + himHer + ", was what " + heShe + " had wished! " + firstName + " knew " + heShe + " must have found " + hisHer + " very own magic rock and was just about to make a second wish.<P>  \"" + firstName + ", " + firstName + ", wake up!\" " + firstName + "\'s " + fern.elder.value + " was calling " + himHer + " for breakfast.<P>After eating, " + firstName + " went outside still thinking about the beautiful dream. Just then, " + hisHer + " foot bumped into something. There on the ground, all by itself, was a rock. It was " + rock1 + " and " + rock2 + ". It was " + rock3 + " and had " + colors + " " + rock4 + " all over it.<P>Surprised and happy, " + firstName + " quickly picked up the rock. It was not round. It did not hum soft and low. It did not get warm nor make a wish happen. But, it was " + firstName + "'s special, magic rock anyway.<P>" + heSheCap + " put it " + fern.safe.value + ". That was a safe place. " + firstName + " kept the rock for a long, long time. Whenever " + heShe + " held " + hisHer + " special rock, " + heShe + " felt happy inside.<P><hr> <font color='#0066FF' size='-4'>&copy;2002 Kay Wittes </body></html>");
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()
}
