<!--

cast1=new Array("Roberta","Chrissy","Crazy Pete","Angela","Wiladene");
cast2=new Array("Samantha","Teeny","Scott","Grandma Albertson","Bobby Fricker");

var message = new Array(); 
var thotnum; 
var flagthot;
var trivianum; 
var flagtrivia;
var quiznum; 
var flagquiz;

var answer1level = null;
var answer2level = null;
var answer3level = null;
var answer4level = null;
var chrissylevel = null;
var questionlevel = null;
var quizlevel = null;
var robertalevel = null;
var samanthalevel = null;
var teenylevel = null;
var trivia1level = null;
var trivia2level = null;
var trivia3level = null;
var trivia4level = null;
var trivia5level = null;

var uchat_log = new Array(); // Modified by SM
var bchat_log = new Array(); // Modified by SM
var chat_count=0;            // Modified by SM


function Parse() { 
var input = new String(document.chat.input.value); 
var sm_uinput = input;                          // Modified by SM
sm_uinput = sm_uinput.split(",").join('~');     // Modified by SM
var sm_binput = document.result.result.value;   // Modified by SM
sm_binput = sm_binput.split(",").join('~');     // Modified by SM
uchat_log[chat_count] = sm_uinput;              // Modified by SM
bchat_log[chat_count] = sm_binput;              // Modified by SM
chat_count ++;                                  // Modified by SM

document.chat.input.value=""; 
input=input.toLowerCase(); 

if (input.search(/\b`\b/)!=-1) input=input.replace(/\b`\b/,"'");
if (input.search(/\bī\b/)!=-1) input=input.replace(/\bī\b/,"'");
if (input.search(/\bu\b/)!=-1) input=input.replace(/\bu\b/,"you");
if (input.search(/\br\b/)!=-1) input=input.replace(/\br\b/,"are");
if (input.search(/\bur\b/)!=-1) input=input.replace(/\bur\b/,"your");
if (input.search(/\byoure\b/)!=-1) input=input.replace(/\byoure\b/,"you're"); 
if (input.search(/\by\b/)!=-1) input=input.replace(/\by\b/,"why"); 
if (input.search(/\bk\b/)!=-1) input=input.replace(/\bk\b/,"ok"); 
if (input.search(/\bplayed\b/)!=-1) input=input.replace(/\bplayed\b/,"plays");
if (input.search(/\broberta martin\b/)!=-1) input=input.replace(/\broberta martin\b/,"roberta");
if (input.search(/\bsamantha albertson\b/)!=-1) input=input.replace(/\bsamantha albertson\b/,"samantha");
if (input.search(/\bteeny tercell\b/)!=-1) input=input.replace(/\bteeny tercell\b/,"teeny");
if (input.search(/\bchrissy dewitt\b/)!=-1) input=input.replace(/\bchrissy dewitt\b/,"chrissy");
if (input.search(/\bchristina ricci\b/)!=-1) input=input.replace(/\bchristina ricci\b/,"christina");
if (input.search(/\bgaby hoffmann\b/)!=-1) input=input.replace(/\bgaby hoffmann\b/,"gaby");
if (input.search(/\bgaby hoffman\b/)!=-1) input=input.replace(/\bgaby hoffman\b/,"gaby");
if (input.search(/\bthora birch\b/)!=-1) input=input.replace(/\bthora birch\b/,"thora");
if (input.search(/\bashleigh aston moore\b/)!=-1) input=input.replace(/\bashleigh aston moore\b/,"ashleigh");
if (input.search(/\brosie o'donnell\b/)!=-1) input=input.replace(/\brosie o'donnell\b/,"rosie");
if (input.search(/\bmelaine griffith\b/)!=-1) input=input.replace(/\bmelanie griffith\b/,"melanie");
if (input.search(/\bdemi moore\b/)!=-1) input=input.replace(/\bdemi moore\b/,"demi");
if (input.search(/\brita wilson\b/)!=-1) input=input.replace(/\brita wilson\b/,"rita");
if (input.search(/\bscot\b/)!=-1) input=input.replace(/\bscot\b/,"scott");
if (input.search(/\bsam\b/)!=-1) input=input.replace(/\bsam\b/,"samantha");
if (input.search(/\brobertas\b/)!=-1) input=input.replace(/\brobertas\b/,"roberta's");
if (input.search(/\bsams\b/)!=-1) input=input.replace(/\bsams\b/,"samantha's");
if (input.search(/\bashley\b/)!=-1) input=input.replace(/\bashley\b/,"ashleigh");
if (input.search(/\bsamanthas\b/)!=-1) input=input.replace(/\bsamanthas\b/,"samantha's");
if (input.search(/\bteenys\b/)!=-1) input=input.replace(/\bteenys\b/,"teeny's");
if (input.search(/\bchrissys\b/)!=-1) input=input.replace(/\bchrissys\b/,"chrissy's");
if (input.search(/\bcrazy petes\b/)!=-1) input=input.replace(/\bcrazy petes\b/,"crazy pete's");
if (input.search(/\bwalter sparrow\b/)!=-1) input=input.replace(/\bwalter sparrow\b/,"walter");
if (input.search(/\bdevon sawa\b/)!=-1) input=input.replace(/\bdevon sawa\b/,"devon");
if (input.search(/\brumer willis\b/)!=-1) input=input.replace(/\brumer willis\b/,"rumer");
if (input.search(/\brumor willis\b/)!=-1) input=input.replace(/\brumor willis\b/,"rumer");
if (input.search(/\brumor\b/)!=-1) input=input.replace(/\brumor\b/,"rumer");
if (input.search(/\bjaneane garofalo\b/)!=-1) input=input.replace(/\bjaneane garofalo\b/,"janeane");
if (input.search(/\bbrendan fraser\b/)!=-1) input=input.replace(/\bbrendan fraser\b/,"brendan");
if (input.search(/\bbonnie hunt\b/)!=-1) input=input.replace(/\bbonnie hunt\b/,"bonnie");
if (input.search(/\blolita davidovich\b/)!=-1) input=input.replace(/\blolita davidovich\b/,"lolita");
if (input.search(/\bcloris leachman\b/)!=-1) input=input.replace(/\bcloris leachman\b/,"cloris");
if (input.search(/\bhank azaria\b/)!=-1) input=input.replace(/\bhank azaria\b/,"hank");
if (input.search(/\bbrandon kleyla\b/)!=-1) input=input.replace(/\bbrandon kleyla\b/,"brandon");
if (input.search(/\bjamison dowd\b/)!=-1) input=input.replace(/\bjamison dowd\b/,"jamison");
if (input.search(/\bfilm\b/)!=-1) input=input.replace(/\bfilm\b/,"movie");
if (input.search(/\btown\b/)!=-1) input=input.replace(/\btown\b/,"city");
if (input.search(/\btreehouse\b/)!=-1) input=input.replace(/\btreehouse\b/,"tree house");
if (input.search(/\bboyfriend\b/)!=-1) input=input.replace(/\bboyfriend\b/,"boy friend");


input=input.replace(/[!|?|,|:|.]/g,"");
word=input.split(" ");
num_of_words=word.length;

if ((input.search("old")!= -1 || input.search("adult")!= -1) && (robertalevel==0)) 
{document.result.result.value = "The adult Roberta was played by Rosie O'Donnell."; 
SpeechPlugin.Speak ("The adult Roberta was played by Rosie O'Donnell.");
robertalevel=1;
return true;} 

if (input.search("young")!= -1 && robertalevel==0)  
{document.result.result.value = "The young Roberta was played by Christina Ricci."; 
SpeechPlugin.Speak ("The young Roberta was played by Christina Ricci.");
robertalevel=1;
return true;} 

if ((input.search("both")!= -1) && (robertalevel==0)) 
{document.result.result.value = "Christina Ricci played the young Roberta and Rosie O'Donnell played the old."; 
SpeechPlugin.Speak ("Christina Ricci played the young Roberta and Rosie O'Donnell played the old.");
robertalevel=1;
return true;} 

if ((input.search("old")!= -1 || input.search("adult")!= -1) && (samanthalevel==0))  
{document.result.result.value = "The adult Samantha was played by Demi Moore."; 
SpeechPlugin.Speak ("The adult Samnantha was played by Demi Moore.");
samanthalevel=1;
return true;} 

if (input.search("young")!= -1 && samanthalevel==0)  
{document.result.result.value = "The young Samantha was played by Gaby Hoffmann."; 
SpeechPlugin.Speak ("The young Samantha was played by Gaby Hoffmann.");
samanthalevel=1;
return true;} 

if ((input.search("both")!= -1) && (samanthalevel==0)) 
{document.result.result.value = "Gaby Hoffmann played the young Samantha and Demi Moore played the old."; 
SpeechPlugin.Speak ("Gaby Hoffmann played the young Samantha and Demi Moore played the old.");
samanthalevel=1;
return true;} 

if ((input.search("old")!= -1 || input.search("adult")!= -1) && (teenylevel==0))  
{document.result.result.value = "The adult Teeny was played by Melaine Griffith."; 
SpeechPlugin.Speak ("The adult Teeny was played by Melanie Griffith.");
teenylevel=1;
return true;} 

if (input.search("young")!= -1 && teenylevel==0)  
{document.result.result.value = "The young Teeny was played by Thora Birch."; 
SpeechPlugin.Speak ("The young Teeny was played by Thora Birch.");
InitObject()
teenylevel=1;
return true;} 

if (input.search("both")!= -1 && teenylevel==0) 
{document.result.result.value = "Thora Birch played the young Teeny and Melanie Griffith played the old."; 
SpeechPlugin.Speak ("Thora Birch played the young Teeny and Melanie Griffith played the old.");
teenylevel=1;
return true;} 

if ((input.search("old")!= -1 || input.search("adult")!= -1) && (chrissylevel==0)) 
{document.result.result.value = "The adult Chrissy was played by Rita Wilson."; 
SpeechPlugin.Speak ("The adult Chrissy was played by Rita Wilson.");
chrissylevel=1;
return true;} 

if (input.search("young")!= -1 && chrissylevel==0)  
{document.result.result.value = "The young Chrissy was played by Ashleigh Aston Moore."; 
SpeechPlugin.Speak ("The young Chrissy was played by Ashleigh Aston Moore.");
chrissylevel=1;
return true;} 

if (input.search("both")!= -1 && chrissylevel==0) 
{document.result.result.value = "Ashleigh Aston Moore played the young Chrissy and Rita Wilson played the old."; 
SpeechPlugin.Speak ("Ashleigh Aston Moore played the young Chrissy and Rita Wilson played the old.");
chrissylevel=1;
return true;} 

if ((input.search("yes")!= -1 || input.search("yea")!= -1 || input.search("yep")!= -1 || input.search("yup")!= -1 || input.search(/\bok\b/)!= -1 || input.search("okie dokie")!= -1 || input.search("okay")!= -1 || input.search("aight")!= -1 || input.search("ask")!= -1 || input.search("go ahead")!= -1 || input.search("go on")!= -1 || input.search("shoot")!= -1 || input.search("sure")!= -1 || input.search("why not")!= -1 || input.search("if you want")!= -1 || input.search("if you must")!= -1 || input.search("what")!= -1 || input.search("of course")!= -1) && (questionlevel==0)) {  
if(!flagtrivia) {
trivianum = [Math.floor(Math.random()*5)]
flagtrivia=true;}
message[0] = "What year did Dear Johnny die? Was it 1945, 1970, 1958, 1933?";  
message[1] = "Who played Chrissy's mother in the movie? Was it Lolita Davidovich, Clois Leachman, Janeane Garofalo or Bonnie Hunt?";  
message[2] = "What college did Roberta graduate from? Was it Harvard Medical School, Johns Hopkins University, University of Indiana, or Georgia Tech?";  
message[3] = "What was the name of Crazy Pete's wife? Was it Susan Simms, Brenda Simms, Beverly Anne Simms or Mary Simms?";  
message[4] = "What was the name of the local newspaper? Was it The Shelby Gazette, The Shelby Herald, The Shelby Star, or The Shelby Enquirer?";  
document.result.result.value = message[trivianum]; 
SpeechPlugin.Speak (message[trivianum]);
if (trivianum==0) {trivia1level=0; questionlevel=1;} 
if (trivianum==1) {trivia2level=0; questionlevel=1;} 
if (trivianum==2) {trivia3level=0; questionlevel=1;} 
if (trivianum==3) {trivia4level=0; questionlevel=1;} 
if (trivianum==4) {trivia5level=0; questionlevel=1;} 
trivianum++
if(trivianum>4){trivianum=0}
return true;}

if ((input.search("yes")!= -1 || input.search("yea")!= -1 || input.search("yep")!= -1 || input.search("yup")!= -1 || input.search(/\bok\b/)!= -1 || input.search("okie dokie")!= -1 || input.search("okay")!= -1 || input.search("aight")!= -1 || input.search("ask")!= -1 || input.search("go ahead")!= -1 || input.search("go on")!= -1 || input.search("shoot")!= -1 || input.search("sure")!= -1 || input.search("why not")!= -1 || input.search("if you want")!= -1 || input.search("if you must")!= -1 || input.search("what")!= -1 || input.search("of course")!= -1) && (quizlevel==0)) {  
if(!flagquiz) {
quiznum = [Math.floor(Math.random()*4)]
flagquiz=true;}
message[0] = "What brand of cigarette did the adult Samantha smoke? Was it Kent, Marlboro, Kool, or Camel?";  
message[1] = "How did Roberta's mother die? Was it from cancer, homicide, car crash, or airplane crash?";  
message[2] = "What flavor of pudding did Teeny used for her fake breast? Was it chocolate, vanilla, strawberry, or tapioca?";  
message[3] = "How much did the tree house cost? Was it $129.95, $100.00, $150.00 or $199.99?";  
document.result.result.value = message[quiznum]; 
SpeechPlugin.Speak (message[quiznum]);
if (quiznum==0) {answer1level=0; quizlevel=1;} 
if (quiznum==1) {answer2level=0; quizlevel=1;} 
if (quiznum==2) {answer3level=0; quizlevel=1;} 
if (quiznum==3) {answer4level=0; quizlevel=1;} 
quiznum++
if(quiznum>3){quiznum=0}
return true;}

if ((input.search(/\bno\b/)!=-1 || input.search("nope")!= -1 || input.search("i don't think so")!= -1 || input.search("nah")!= -1) && (questionlevel==0 || quizlevel==0))     
{document.result.result.value = "Ok, ask me a question then."; 
SpeechPlugin.Speak ("Ok, ask me a question then."); 
questionlevel=1;
quizlevel=1;
return true;} 

if ((input.search("dunno")!= -1 || input.search("don't know")!= -1 || input.search("don't have a clue")!= -1 || input.search("not sure")!= -1 || input.search("no idea")!= -1) && (trivia1level==0 || trivia2level==0 || trivia3level==0 || trivia4level==0 || trivia5level==0 || answer1level==0 || answer2level==0 || answer3level==0 || answer4level==0)) 
{document.result.result.value = "Well, take a guess then. It's multiple choice."; 
SpeechPlugin.Speak ("Well, take a guess then. It's multiple choice.");
return true;} 

if (input.search("1945")!= -1 && trivia1level==0)   
{document.result.result.value = "Congratulations, you are correct."; 
SpeechPlugin.Speak ("Congratulations, you are correct.");
trivia1level=1;
return true;} 

if (input.search("")!= -1 && trivia1level==0)   
{document.result.result.value = "You are incorrect. Dear Johnny died in 1945."; 
SpeechPlugin.Speak ("You are incorrect. Dear Johnny died in 1945.");
trivia1level=1;
return true;} 

if ((input.search("bonnie")!= -1 || input.search("hunt")!= -1) && (trivia2level==0)) 
{document.result.result.value = "Congratulations, you are correct."; 
SpeechPlugin.Speak ("Congratulations, you are correct.");
trivia2level=1;
return true;} 

if ((input.search("")!= -1) && (trivia2level==0)) 
{document.result.result.value = "That is incorrect. Bonnie Hunt played Chrissy's mother."; 
SpeechPlugin.Speak ("That is incorrect. Bonnie Hunt played Chrissy's mother."); 
trivia2level=1;
return true;} 

if (input.search("indiana")!= -1 && trivia3level==0) 
{document.result.result.value = "Congratulations, you are correct."; 
SpeechPlugin.Speak ("Congratulations, you are correct.");
trivia3level=1;
return true;} 

if ((input.search("")!= -1) && (trivia3level==0)) 
{document.result.result.value = "That is incorrect. Roberta earned her medical degree from the Univeristy of Indiana."; 
SpeechPlugin.Speak ("That is incorrect. Roberta earned her medical degree from the Univeristy of Indiana."); 
trivia3level=1;
return true;} 

if (input.search("beverly")!= -1 && trivia4level==0) 
{document.result.result.value = "Congratulations, you are correct."; 
SpeechPlugin.Speak ("Congratulations, you are correct.");
trivia4level=1;
return true;} 

if ((input.search("")!= -1) && (trivia4level==0)) 
{document.result.result.value = "That is incorrect. Her name was Beverly Anne Simms."; 
SpeechPlugin.Speak ("That is incorrect. Her name was Beverly Anne Simms."); 
trivia4level=1;
return true;} 

if (input.search("star")!= -1 && trivia5level==0) 
{document.result.result.value = "Congratulations, you are correct."; 
SpeechPlugin.Speak ("Congratulations, you are correct.");
trivia5level=1;
return true;} 

if ((input.search("")!= -1) && (trivia5level==0)) 
{document.result.result.value = "That is incorrect. The paper was called the Shelby Star."; 
SpeechPlugin.Speak ("That is incorrect. The paper was called the Shelby Star."); 
trivia5level=1;
return true;} 

if (input.search("marlboro")!= -1 && answer1level==0) 
{document.result.result.value = "Congratulations, you are correct."; 
SpeechPlugin.Speak ("Congratulations, you are correct.");
answer1level=1;
return true;} 

if ((input.search("")!= -1) && (answer1level==0)) 
{document.result.result.value = "That is incorrect. The answer is Marlboro."; 
SpeechPlugin.Speak ("That is incorrect. The answer is Marlboro."); 
answer1level=1;
return true;} 

if (input.search("car")!= -1 && answer2level==0) 
{document.result.result.value = "Congratulations, you are correct."; 
SpeechPlugin.Speak ("Congratulations, you are correct.");
answer2level=1;
return true;} 

if ((input.search("")!= -1) && (answer2level==0)) 
{document.result.result.value = "That is incorrect. She died in a car crash."; 
SpeechPlugin.Speak ("That is incorrect. She died in a car crash."); 
answer2level=1;
return true;} 

if (input.search("vanilla")!= -1 && answer3level==0) 
{document.result.result.value = "Congratulations, you are correct."; 
SpeechPlugin.Speak ("Congratulations, you are correct.");
answer3level=1;
return true;} 

if ((input.search("")!= -1) && (answer3level==0)) 
{document.result.result.value = "That is incorrect. Teeny used vanilla pudding."; 
SpeechPlugin.Speak ("That is incorrect. Teeny used vanilla pudding."); 
answer3level=1;
return true;} 

if (input.search("12995")!= -1 && answer4level==0) 
{document.result.result.value = "Congratulations, you are correct."; 
SpeechPlugin.Speak ("Congratulations, you are correct.");
answer4level=1;
return true;} 

if ((input.search("")!= -1) && (answer4level==0)) 
{document.result.result.value = "That is incorrect. The tree house cost $129.95."; 
SpeechPlugin.Speak ("That is incorrect. The tree house cost $129.95."); 
answer4level=1;
return true;} 

answer1level=1;
answer2level=1;
answer3level=1;
answer4level=1;
chrissylevel=1;
questionlevel=1;
quizlevel=1;
robertalevel=1;
samanthalevel=1;
teenylevel=1;
trivia1level=1;
trivia2level=1;
trivia3level=1;
trivia4level=1;
trivia5level=1;

if ((input.search("who play")!= -1) && (input.search("old")!= -1 || input.search("adult")!= -1) && (input.search("roberta")!= -1)) 
{document.result.result.value = "The adult Roberta was played by Rosie O'Donnell."; 
SpeechPlugin.Speak ("The adult Roberta was played by Rosie O'Donnell.");
return true;} 

if ((input.search("who play")!= -1) && (input.search("old")!= -1 || input.search("adult")!= -1) && (input.search("sam")!= -1)) 
{document.result.result.value = "The adult Samantha was played by Demi Moore."; 
SpeechPlugin.Speak ("The adult Samantha was played by Demi Moore.");
return true;} 

if ((input.search("who play")!= -1) && (input.search("old")!= -1 || input.search("adult")!= -1) && (input.search("teeny")!= -1)) 
{document.result.result.value = "The adult Teeny was played by Melanie Griffith."; 
SpeechPlugin.Speak ("The adult Teeny was played by Melanie Griffith.");
return true;} 

if ((input.search("who play")!= -1) && (input.search("old")!= -1 || input.search("adult")!= -1) && (input.search("chrissy")!= -1)) 
{document.result.result.value = "The adult Chrissy was played by Rita Wilson."; 
SpeechPlugin.Speak ("The adult Chrissy was played by Rita Wilson.");
return true;} 

if (input.search("who play")!= -1 && input.search("roberta")!= -1 && num_of_words==3)   
{document.result.result.value = "The young Roberta or the adult Roberta?"; 
SpeechPlugin.Speak ("The young Roberta or the adult Roberta?");
robertalevel=0;
return true;} 

if (input.search("who play")!= -1 && input.search("samantha")!= -1 && num_of_words==3)   
{document.result.result.value = "The young Samantha or the adult Samantha?"; 
SpeechPlugin.Speak ("The young Samantha or the adult Samantha?");
samanthalevel=0;
return true;} 

if (input.search("who play")!= -1 && input.search("teeny")!= -1 && num_of_words==3)     
{document.result.result.value = "The young Teeny or the adult Teeny?"; 
SpeechPlugin.Speak ("The young Teeny or the adult Teeny?");
teenylevel=0;
return true;} 

if (input.search("who play")!= -1 && input.search("chrissy")!= -1 && num_of_words==3)   
{document.result.result.value = "The young Chrissy or the adult Chrissy?"; 
SpeechPlugin.Speak ("The young Chrissy or the adult Chrissy?");
chrissylevel=0;
return true;} 

if (input.search("roberta's last name")!= -1) 
{document.result.result.value = "Roberta's last name is Martin."; 
SpeechPlugin.Speak ("Roberta's last name is Martin.");
return true;} 

if (input.search("samantha's last name")!= -1)  
{document.result.result.value = "Samantha's last name is Albertson."; 
SpeechPlugin.Speak ("Samantha's last name is Albertson.");
return true;} 

if (input.search("teeny's last name")!= -1)  
{document.result.result.value = "Teeny's last name is Tercell."; 
SpeechPlugin.Speak ("Teeny's last name is Tercell.");
return true;} 

if (input.search("chrissy's last name")!= -1)  
{document.result.result.value = "Chrissy's last name is Dewitt."; 
SpeechPlugin.Speak ("Chrissy's last name is Dewitt.");
return true;} 

if (input.search("crazy pete's last name")!= -1 || input.search("dear johnny's last name")!= -1) 
{document.result.result.value = "Simms!"; 
SpeechPlugin.Speak ("Simms!"); 
return true;} 

if (input.search("dear johnny's father")!= -1 || input.search("father of dear johnny")!= -1 || input.search("dear johnny's dad")!= -1 || input.search("dad of dear johnny")!= -1)    
{document.result.result.value = "Crazy Pete!"; 
SpeechPlugin.Speak ("Crazy Pete!");
return true;} 

if (input.search("roberta's job")!= -1 || input.search("roberta's future job")!= -1 || input.search("roberta's occupation")!= -1 || input.search("roberta grow up to be")!= -1 || input.search("roberta later grow up to be")!= -1)  
{document.result.result.value = "Roberta became a medical doctor."; 
SpeechPlugin.Speak ("Roberta became a medical doctor.");
return true;} 

if (input.search("samantha's job")!= -1 || input.search("samantha's future job")!= -1 || input.search("samantha's occupation")!= -1 || input.search("samantha grow up to be")!= -1 || input.search("samantha later grow up to be")!= -1)   
{document.result.result.value = "Samantha became a writer."; 
SpeechPlugin.Speak ("Samantha became a writer.");
return true;} 

if (input.search("teeny's job")!= -1 || input.search("teeny's future job")!= -1 || input.search("teeny's occupation")!= -1 || input.search("teeny grow up to be")!= -1 || input.search("teeny later grow up to be")!= -1) 
{document.result.result.value = "Teeny became an actress."; 
SpeechPlugin.Speak ("Teeny became an actress.");
return true;} 

if (input.search("chrissy's job")!= -1 || input.search("chrissy's future job")!= -1 || input.search("chrissy's occupation")!= -1 || input.search("chrissy grow up to be")!= -1 || input.search("chrissy later grow up to be")!= -1)  
{document.result.result.value = "Chrissy became a mother and a house wife."; 
SpeechPlugin.Speak ("Chrissy became a mother and a house wife.");
return true;} 

if (input.search("morton's job")!= -1 || input.search("morton's future job")!= -1 || input.search("morton's occupation")!= -1 || input.search("morton grow up to be")!= -1 || input.search("morton later grow up to be")!= -1)  
{document.result.result.value = "Morton became a dentist."; 
SpeechPlugin.Speak ("Morton became a dentist."); 
return true;} 

if (input.search("who is christina")!= -1 || input.search("what character did christina play")!= -1 || input.search("who did christina play")!= -1) 
{document.result.result.value = "Christina Ricci played the young Roberta Martin."; 
SpeechPlugin.Speak ("Christina Ricci played the young Roberta Martin."); 
return true;} 

if (input.search("who is gaby")!= -1 || input.search("what character did gaby play")!= -1 || input.search("who did gaby play")!= -1) 
{document.result.result.value = "Gaby Hoffmann played the young Samantha Albertson."; 
SpeechPlugin.Speak ("Gaby Hoffmann played the young Samantha Albertson."); 
return true;} 

if (input.search("who is thora")!= -1 || input.search("what character did thora play")!= -1 || input.search("who did thora play")!= -1) 
{document.result.result.value = "Thora Birch played the young Teeny Tercell."; 
SpeechPlugin.Speak ("Thora Birch played the young Teeny Tercell."); 
InitObject()
return true;} 

if (input.search("who is ashleigh")!= -1 || input.search("what character did ashleigh play")!= -1 || input.search("who did ashleigh play")!= -1) 
{document.result.result.value = "Ashleigh Aston Moore played the young Chrissy Dewitt."; 
SpeechPlugin.Speak ("Ashleigh Aston Moore played the young Chrissy Dewitt.");
return true;} 

if (input.search("who is demi")!= -1 || input.search("what character did demi play")!= -1 || input.search("who did demi play")!= -1) 
{document.result.result.value = "Demi Moore played the adult Samantha Albertson."; 
SpeechPlugin.Speak ("Demi Moore played the adult Samantha Albertson."); 
return true;} 

if (input.search("who is melanie")!= -1 || input.search("what character did melanie play")!= -1 || input.search("who did melanie play")!= -1) 
{document.result.result.value = "Melanie Griffith played the adult Teeny Tercell."; 
SpeechPlugin.Speak ("Melanie Griffith played the adult Teeny Tercell."); 
return true;}

if (input.search("who is rosie")!= -1 || input.search("what character did rosie play")!= -1 || input.search("who did roberta play")!= -1) 
{document.result.result.value = "Rosie O'Donnell played the adult Roberta Martin."; 
SpeechPlugin.Speak ("Rosie O'Donnell played the adult Roberta Martin."); 
return true;} 

if (input.search("who is rita")!= -1 || input.search("what character did rita play")!= -1 || input.search("who did rita play")!= -1) 
{document.result.result.value = "Rita Wilson played the adult Chrissy Dewitt."; 
SpeechPlugin.Speak ("Rita Wilson played the adult Chrissy Dewitt."); 
return true;}

if (input.search("who is walter")!= -1 || input.search("what character did walter play")!= -1 || input.search("who did walter play")!= -1 || input.search("who plays crazy pete")!= -1 || input.search("who plays peter")!= -1) 
{document.result.result.value = "Walter Sparrow played Crazy Pete."; 
SpeechPlugin.Speak ("Walter Sparrow played Crazy Pete."); 
return true;} 

if (input.search("who is devon")!= -1 || input.search("what character did devon play")!= -1 || input.search("who did devon play")!= -1 || input.search("who plays scott")!= -1 || input.search("oldest wormer brother")!= -1) 
{document.result.result.value = "Devon Sawa played Scott Wormer."; 
SpeechPlugin.Speak ("Devon So wa played Scott Wormer."); 
return true;} 

if (input.search("who is janeane")!= -1 || input.search("what character did janeane play")!= -1 || input.search("who did janeane play")!= -1 || input.search("who plays wiladene")!= -1) 
{document.result.result.value = "Janeane Garofalo played Wiladene."; 
SpeechPlugin.Speak ("Janeane Garofalo played Wiladene.");
return true;} 

if (input.search("who is cloris")!= -1 || input.search("what character did cloris play")!= -1 || input.search("who did cloris play")!= -1 || input.search("who plays grand")!= -1 || input.search("who plays samantha's grand")!= -1) 
{document.result.result.value = "Cloris Leachman played Grandma Albertson."; 
SpeechPlugin.Speak ("Cloris Leachman played Grandma Albertson."); 
return true;} 

if (input.search("who is brendan")!= -1 || input.search("what character did brendan play")!= -1 || input.search("who did brendan play")!= -1 || input.search("who plays the soldier")!= -1 || input.search("who plays the vietnam veteran")!= -1 || input.search("who plays the veteran from the war")!= -1 || input.search("who plays the war guy")!= -1 || input.search("who plays the guy from the war")!= -1) 
{document.result.result.value = "Brendan Fraser played the Vietnam Veteran."; 
SpeechPlugin.Speak ("Brendan Fraser played the Vietnam Veteran."); 
return true;} 

if (input.search("who is bonnie")!= -1 || input.search("what character did bonnie play")!= -1 || input.search("who did bonnie play")!= -1 || input.search("who plays chrissy's mom")!= -1 || input.search("who plays chrissy's mother")!= -1 || input.search("who plays mrs dewitt")!= -1) 
{document.result.result.value = "Bonnie Hunt played Chrissy's mom."; 
SpeechPlugin.Speak ("Bonnie Hunt played Chrissy's mom."); 
return true;} 

if (input.search("who is lolita")!= -1 || input.search("what character did lolita play")!= -1 || input.search("who did lolita play")!= -1 || input.search("who plays samantha's mom")!= -1 || input.search("who plays samantha's mother")!= -1 || input.search("who plays mrs albertson")!= -1) 
{document.result.result.value = "Lolita Davidovich played Samantha's mom."; 
SpeechPlugin.Speak ("Lolita Davidovich played Samantha's mom.");
return true;} 

if ((input.search("who is hank")!= -1) || (input.search("what character did hank play")!= -1) || (input.search("who did hank play")!= -1) || (input.search("who plays bud kent")!= -1) || (input.search("who plays the boy friend of samantha's mother")!= -1) || (input.search("who plays samantha's")!= -1 && input.search("mom's boyfriend")!= -1)) 
{document.result.result.value = "Hank Azaria played Bud Kent who was the boy friend of Samantha's mom."; 
SpeechPlugin.Speak ("Hank Azaria played Bud Kent who was the boy friend of Samantha's mom."); 
return true;} 

if (input.search("who is rumer")!= -1 || input.search("what character did rumer play")!= -1 || input.search("who did rumer play")!= -1 || input.search("who plays angela")!= -1 || input.search("who plays samantha's younger sister")!= -1 || input.search("who plays samantha's sister")!= -1) 
{document.result.result.value = "Rumer Willis played Samantha's younger sister Angela."; 
SpeechPlugin.Speak ("Rumer Willis played Samantha's younger sister Angela."); 
return true;} 

if (input.search("who is brandon")!= -1 || input.search("what character did brandon play")!= -1 || input.search("who did brandon play")!= -1 || input.search("who plays bobby fricker")!= -1) 
{document.result.result.value = "Brandon Kleyla played Bobby Fricker."; 
SpeechPlugin.Speak ("Brandon Kleyla played Bobby Frick er.");
return true;} 

if (input.search("who is jamison")!= -1 || input.search("what character did jamison play")!= -1 || input.search("who did jamison play")!= -1 || input.search("who plays the bully")!= -1) 
{document.result.result.value = "Jamison B. Dowd played the bully."; 
SpeechPlugin.Speak ("Jamison B. Dowd played the bully.");
return true;} 

if ((input.search("who")!= -1 || input.search("what")!= -1) && (input.search("character")!= -1 || input.search("girl")!= -1) && (input.search("taped")!= -1 || input.search("taping her")!= -1) && (input.search("breast")!= -1 || input.search("boobs")!= -1))  
{document.result.result.value = "Roberta!"; 
SpeechPlugin.Speak ("Roberta!"); 
return true;} 

if ((input.search("who")!= -1 || input.search("what")!= -1) && (input.search("character")!= -1 || input.search("girl")!= -1) && (input.search("faked her death")!= -1 || input.search("drown")!= -1))  
{document.result.result.value = "Roberta!"; 
SpeechPlugin.Speak ("Roberta!");
return true;} 

if ((input.search("who")!= -1 || input.search("what")!= -1) && (input.search("character")!= -1 || input.search("girl")!= -1) && (input.search("actress")!= -1 || input.search("actor")!= -1 || input.search("movie star")!= -1))  
{document.result.result.value = "Teeny!"; 
SpeechPlugin.Speak ("Teeny!"); 
return true;} 

if ((input.search("teeny's")!= -1) && (input.search("real name")!= -1 || input.search("real first name")!= -1))  
{document.result.result.value = "Tina!"; 
SpeechPlugin.Speak ("Tina!"); 
return true;} 

if ((input.search("who")!= -1 || input.search("what")!= -1) && (input.search("character")!= -1 || input.search("girl")!= -1) && (input.search("favorite color")!= -1 || input.search("always wore")!= -1) && (input.search("pink")!= -1))  
{document.result.result.value = "Chrissy!"; 
SpeechPlugin.Speak ("Chrissy!"); 
return true;} 

if ((input.search("who")!= -1 || input.search("what")!= -1) && (input.search("character")!= -1 || input.search("girl")!= -1) && (input.search("wore black")!= -1 || input.search("dressed in black")!= -1))  
{document.result.result.value = "Samantha as an adult."; 
SpeechPlugin.Speak ("Samantha as an adult.");
return true;} 

if ((input.search("who")!= -1 || input.search("what")!= -1) && (input.search("character")!= -1 || input.search("girl")!= -1) && (input.search("parent")!= -1) && (input.search("divorce")!= -1))  
{document.result.result.value = "Samantha!"; 
SpeechPlugin.Speak ("Samantha!");
return true;} 

if ((input.search("who")!= -1 || input.search("what")!= -1) && (input.search("character")!= -1 || input.search("girl")!= -1) && (input.search("liked")!= -1 || input.search("was into")!= -1) && (input.search("science fiction")!= -1 || input.search("super natural")!= -1))  
{document.result.result.value = "Samantha!"; 
SpeechPlugin.Speak ("Samantha!");
return true;} 

if ((input.search("who")!= -1 || input.search("what")!= -1) && (input.search("character")!= -1 || input.search("girl")!= -1 || input.search("in charge")!= -1) && (input.search("tree house money")!= -1 || input.search("money for tree house")!= -1))  
{document.result.result.value = "Chrissy!"; 
SpeechPlugin.Speak ("Chrissy!");
return true;} 

if ((input.search("who")!= -1 || input.search("what")!= -1) && (input.search("character")!= -1 || input.search("girl")!= -1) && (input.search("favorite color")!= -1 || input.search("always wore")!= -1) && (input.search("pink")!= -1))  
{document.result.result.value = "Chrissy!"; 
SpeechPlugin.Speak ("Chrissy!");
return true;} 

if (input.search("roberta never leave without")!= -1 || input.search("never leaves the house without")!= -1) 
{document.result.result.value = "A picture of her mother."; 
SpeechPlugin.Speak ("A picture of her mother.");
return true;} 

if (input.search("the girl's live")!= -1 || input.search("the girls live")!= -1 || input.search("name of the subdivision")!= -1) 
{document.result.result.value = "In a subdivision called \"The Gaslight Addition\"."; 
SpeechPlugin.Speak ("In a subdivision called The Gaslight Addition."); 
return true;} 

if (input.search("how old is christina")!= -1 || input.search("christina's age")!= -1)   
{document.result.result.value = "Christina Ricci was born on February 12, 1980."; 
SpeechPlugin.Speak ("Christina Ricci was born on February 12, 1980."); 
return true;} 

if (input.search("how old is thora")!= -1 || input.search("thora's age")!= -1)   
{document.result.result.value = "Thora Birch was born on March 11, 1982."; 
SpeechPlugin.Speak ("Thora Birch was born on March 11, 1982."); 
return true;} 

if (input.search("how old is gaby")!= -1 || input.search("gaby's age")!= -1)   
{document.result.result.value = "Gaby Hoffmann was born on January 8, 1982."; 
SpeechPlugin.Speak ("Gaby Hoffmann was born on January 8, 1982."); 
return true;} 

if (input.search("how old is ashleigh")!= -1 || input.search("ashleigh's age")!= -1)   
{document.result.result.value = "Ashleigh Aston Moore was born on November 13, 1981."; 
SpeechPlugin.Speak ("Ashleigh Aston Moore was born on November 13, 1981."); 
return true;} 

if (input.search("how old was roberta")!= -1 || input.search("how old was teeny")!= -1 || input.search("how old was samantha")!= -1 || input.search("how old was chrissy")!= -1 || input.search("roberta's age")!= -1 || input.search("teeny's age")!= -1 || input.search("samantha's age")!= -1 || input.search("chrissy's age")!= -1)   
{document.result.result.value = "She was 12."; 
SpeechPlugin.Speak ("She was 12."); 
return true;} 

if (input.search("how old were the girls")!= -1 || input.search("how old are the girls")!= -1 || input.search("girl's ages")!= -1 || input.search("girls ages")!= -1)   
{document.result.result.value = "They were all 12 years old."; 
SpeechPlugin.Speak ("They were all 12 years old."); 
return true;} 

if (input.search("how old was dear johnny")!= -1 || input.search("dear johnny's age")!= -1 || input.search("dear johnnys age")!= -1)     
{document.result.result.value = "He was 12 at the time of his death."; 
SpeechPlugin.Speak ("He was 12 at the time of his death."); 
return true;} 

if (input.search("who are")!= -1 && input.search("wormer")!= -1)   
{document.result.result.value = "The Wormers were the brothers who have a running feud with the girls. At least in the beginning."; 
SpeechPlugin.Speak ("The Wormers were the brothers who have a running feud with the girls. At least in the beginning.");
return true;} 

if (input.search("who is roberta")!= -1 || input.search("who was roberta")!= -1) 
{document.result.result.value = "Roberta is one of the 4 girls in the movie. She is played by Christina Ricci. She grows up to be a doctor."; 
SpeechPlugin.Speak ("Roberta is one of the 4 girls in the movie. She is played by Christina Ricci. She grows up to be a doctor.");
return true;} 

if (input.search("who is teeny")!= -1 || input.search("who was teeny")!= -1) 
{document.result.result.value = "Teeny is one of the 4 girls in the movie. She is played by Thora Birch. She grows up to be a movie star."; 
SpeechPlugin.Speak ("Teeny is one of the 4 girls in the movie. She is played by Thora Birch. She grows up to be a movie star."); 
return true;} 

if (input.search("who is samantha")!= -1 || input.search("who was samantha")!= -1) 
{document.result.result.value = "Samantha is one of the 4 girls in the movie. She is played by Gaby Hoffmann. She grows up to be an author."; 
SpeechPlugin.Speak ("Samantha is one of the 4 girls in the movie. She is played by Gaby Hoffmann. She grows up to be a author."); 
return true;} 

if (input.search("who is chrissy")!= -1 || input.search("who was chrissy")!= -1) 
{document.result.result.value = "Chrissy is one of the 4 girls in the movie. She is played by Ashleigh Asston Moore. She grows up to be a house wife."; 
SpeechPlugin.Speak ("Chrissy is one of the 4 girls in the movie. She is played by Ashleigh Aston Moore. She grows up to be a house wife."); 
return true;} 

if (input.search("who is dear johnny")!= -1 || input.search("who was dear johnny")!= -1)   
{document.result.result.value = "Crazy Pete's son."; 
SpeechPlugin.Speak ("Crazy Pete's son."); 
return true;} 

if (input.search("who is crazy pete")!= -1 || input.search("who was crazy pete")!= -1)   
{document.result.result.value = "Crazy Pete is the older gentleman who saves Samantha from drowning."; 
SpeechPlugin.Speak ("Crazy Pete is the older gentleman who saves Samantha from drowning.");
return true;} 

if (input.search("who is angela")!= -1 || input.search("who was angela")!= -1)   
{document.result.result.value = "Samantha's younger sister."; 
SpeechPlugin.Speak ("Samantha's younger sister.");
return true;} 

if (input.search("who is wiladene")!= -1 || input.search("who was wiladene")!= -1)    
{document.result.result.value = "Wiladene was the fortune teller the girls visited to learn more about Dear Johnny."; 
SpeechPlugin.Speak ("Will a dean was the fortune teller the girls visited to learn more about Dear Johnny."); 
return true;} 

if (input.search("who is bud kent")!= -1 || input.search("who was bud kent")!= -1)    
{document.result.result.value = "Samantha's mom's boy friend."; 
SpeechPlugin.Speak ("Samantha's mom's boy friend.");
return true;} 

if (input.search("who saved samantha from drowning")!= -1 || input.search("who saved samantha's life")!= -1 || input.search("who saved samantha from dying")!= -1)  
{document.result.result.value = "Crazy Pete!"; 
SpeechPlugin.Speak ("Crazy Pete!");
return true;} 

if (input.search("what happens to crazy pete")!= -1 || input.search("how does crazy pete end up")!= -1)  
{document.result.result.value = "Near the end of the movie we hear from Roberta that Crazy Pete has passed away."; 
SpeechPlugin.Speak ("Near the end of the movie we hear from Roberta that Crazy Pete has passed away.");
return true;} 

if (input.search("roberta like")!= -1)  
{document.result.result.value = "Scott Wormer."; 
SpeechPlugin.Speak ("Scott Wormer.");
return true;} 

if (input.search("oldest wormer brother")!= -1)  
{document.result.result.value = "Scott played by Devon Sawa!"; 
SpeechPlugin.Speak ("Scott played by Devon So wa!");
return true;} 

if (input.search("how many wormer brothers")!= -1)  
{document.result.result.value = "Four!"; 
SpeechPlugin.Speak ("Four!");
return true;} 

if (input.search("who plays")!= -1 && input.search("wormer brother")!= -1)   
{document.result.result.value = "Devon Sawa, Travis Robertson, Justin Humphrey, and Bradley Coryell."; 
SpeechPlugin.Speak ("Devon Sawa, Travis Robertson, Justin Humphrey, and Bradley Coryell."); 
return true;} 

if (input.search("how did roberta's mother die")!= -1 || input.search("how did roberta's mom die")!= -1)  
{document.result.result.value = "In a car crash."; 
SpeechPlugin.Speak ("In a car crash.");
return true;} 

if (input.search("name")!= -1 && input.search("newspaper")!= -1)   
{document.result.result.value = "The Shelby Star"; 
SpeechPlugin.Speak ("The Shelby Star");
return true;} 

if (input.search("movie")!= -1 && input.search("teeny was watching")!= -1)   
{document.result.result.value = "Love Story"; 
SpeechPlugin.Speak ("Love Story");
return true;} 

if (input.search("how did dear johnny die")!= -1)  
{document.result.result.value = "He was shot during a robbery."; 
SpeechPlugin.Speak ("He was shot during a robbery.");
return true;} 

if (input.search("chrissy's favorite color")!= -1)  
{document.result.result.value = "Pink."; 
SpeechPlugin.Speak ("Pink");
return true;} 

if ((input.search("crazy pete")!= -1 && input.search("wife")!= -1) || (input.search("dear johnny")!= -1 && input.search("mother")!= -1))   
{document.result.result.value = "Beverly Anne Simms"; 
SpeechPlugin.Speak ("Beverly Anne Simms");
return true;} 

if (input.search("dear johnny")!= -1 && input.search("born")!= -1)   
{document.result.result.value = "May 22, 1933"; 
SpeechPlugin.Speak ("May 22, 1933");
return true;} 

if ((input.search("when")!= -1 || input.search("what year")!= -1) && (input.search("dear johnny")!= -1) && (input.search("die")!= -1))   
{document.result.result.value = "June 10, 1945"; 
SpeechPlugin.Speak ("June 10, 1945");
return true;} 

if (input.search("the first name of the movie")!= -1 || input.search("movie's original name")!= -1 || input.search("movie originally called")!= -1 || input.search("movie's first name")!= -1)  
{document.result.result.value = "The Gaslight Addition."; 
SpeechPlugin.Speak ("The Gaslight Addition.");
return true;} 

if (input.search("was chrissy's husband")!= -1 || input.search("name of chrissy's husband")!= -1)  
{document.result.result.value = "Morton!"; 
SpeechPlugin.Speak ("Morton!");
return true;} 

if ((input.search("keep")!= -1) && (input.search("tree house money in")!= -1 || input.search("money for tree house in")!= -1))  
{document.result.result.value = "A coffee can."; 
SpeechPlugin.Speak ("A coffee can.");
return true;} 

if ((input.search("teeny's")!= -1) && (input.search("boob")!= -1 || input.search("breast")!= -1) && (input.search("made of")!= -1))     
{document.result.result.value = "Vanilla Pudding!"; 
SpeechPlugin.Speak ("Vanilla Pudding!"); 
return true;} 

if (input.search("roberta")!= -1 && input.search("college")!= -1)     
{document.result.result.value = "University of Indiana!"; 
SpeechPlugin.Speak ("Unversity of Indiana!"); 
return true;} 

if (input.search("teeny")!= -1 && input.search("award")!= -1)     
{document.result.result.value = "People's Choice Award."; 
SpeechPlugin.Speak ("People's choice Award."); 
return true;} 

if (input.search("teeny")!= -1 && input.search("times")!= -1 && input.search("married")!= -1)     
{document.result.result.value = "Technically three as the first marriage was annulled"; 
SpeechPlugin.Speak ("Technically three as the first marriage was annulled."); 
return true;} 

if (input.search("saving up to buy")!= -1)  
{document.result.result.value = "A tree house from Sears."; 
SpeechPlugin.Speak ("A tree house from Sears."); 
return true;} 

if (input.search("where did the girls buy the tree house")!= -1)  
{document.result.result.value = "From Sears."; 
SpeechPlugin.Speak ("From Sears."); 
return true;} 

if (input.search("tree house")!= -1 || input.search("cost")!= -1)  
{document.result.result.value = "$129.95"; 
SpeechPlugin.Speak ("$129.95"); 
return true;} 

if (input.search("name of library")!= -1)  
{document.result.result.value = "Greenfield."; 
SpeechPlugin.Speak ("Greenfield."); 
return true;} 

if (input.search("where is the softball game")!= -1 || input.search("where was the softball game")!= -1 || input.search("location of the softball game")!= -1 || input.search("softball game held")!= -1 || input.search("name of the field")!= -1)  
{document.result.result.value = "Kendall's Field."; 
SpeechPlugin.Speak ("Kendall's Field."); 
return true;} 

if (input.search("magazine teeny was reading")!= -1 || input.search("magazine teeny is reading")!= -1)  
{document.result.result.value = "Cosmopolitan."; 
SpeechPlugin.Speak ("Cosmopolitan."); 
return true;} 

if ((input.search("drink")!= -1 && input.search("order")!= -1) || (input.search("favorite drink")!= -1))  
{document.result.result.value = "4 Black Cows!"; 
SpeechPlugin.Speak ("4 Black Cows!"); 
return true;}

if (input.search("what year did the movie take place")!= -1 || input.search("what year did the flash back")!= -1) 
{document.result.result.value = "The summer of 1970."; 
SpeechPlugin.Speak ("The summer of 1970."); 
return true;} 

if (input.search("what year was the movie filmed")!= -1 || input.search("what year did the filming take place")!= -1) 
{document.result.result.value = "Filming began on November 7, 1994."; 
SpeechPlugin.Speak ("Filming began on November 7, 1994."); 
return true;}

if ((input.search("city")!= -1 || input.search("state")!= -1) && (input.search("girls live")!= -1 || input.search("girls from")!= -1))  
{document.result.result.value = "Shelby, Indiana!"; 
SpeechPlugin.Speak ("Shelby, Indiana!");
return true;} 

if (input.search("where did the movie take place")!= -1 || input.search("the setting of the movie")!= -1)  
{document.result.result.value = "In Shelby, Indiana!"; 
SpeechPlugin.Speak ("In Shelby, Indiana!");
return true;} 

if (input.search("what state was the movie filmed in")!= -1 || input.search("where was the movie filmed")!= -1) 
{document.result.result.value = "In Georgia!"; 
SpeechPlugin.Speak ("In Georgia!");
return true;} 

if (input.search("who directed")!= -1 || input.search("who was the director")!= -1) 
{document.result.result.value = "\"Now and Then\" was directed by Lesli Linka Glatter."; 
SpeechPlugin.Speak ("Now and Then was directed by Lesli Linka Glatter."); 
return true;} 

if (input.search("who wrote")!= -1) 
{document.result.result.value = "\"Now and Then\" was written by I. Marlene King."; 
SpeechPlugin.Speak ("Now and Then was written by I. Marlene King."); 
return true;} 

if (input.search("who are you")!= -1 || input.search("what are you")!= -1) 
{document.result.result.value = "I am the \"Now and Then\" Trivia Bot."; 
SpeechPlugin.Speak ("I am the Now and Then Trivia Bot."); 
return true;} 

if (input.search("thanks")!= -1 || input.search("thnx")!= -1 || input.search("thx")!= -1 || input.search("thanx")!= -1 || input.search("thank you")!= -1 || input.search("thankyou")!= -1)
{document.result.result.value = "You're welcome!";
SpeechPlugin.Speak ("You're welcome!"); 
return true;}

if (input.search("hello")!= -1 || input.search(/\bhey\b/)!= -1 || input.search(/\bhi\b/)!= -1 || input.search(/\bhallo\b/)!=-1 || input.search("hiya")!= -1 || input.search("greetings")!= -1 || input.search("howdy")!= -1 || input.search("g'day")!= -1 || input.search("bonjour")!= -1) {
if(!flagthot) {
thotnum = [Math.floor(Math.random()*3)]
flagthot=true;}
message[0] = "Hello there!"; 
message[1] = "Hi!"; 
message[2] = "Hey there!"; 
document.result.result.value = message[thotnum]; 
SpeechPlugin.Speak (message[thotnum]);
thotnum++
if(thotnum>2){thotnum=0}
return true;}

if ((input.search("bye")!= -1) || (input.search("good by")!= -1) || (input.search("goodby")!= -1) || (input.search("see ya")!= -1) || (input.search("so long")!= -1) || (input.search("sionara")!= -1) || (input.search("farewell")!= -1) || (input.search("ciao")!= -1) || (input.search("adios")!= -1) || (input.search("i'm going now")!= -1) || (input.search(/\bcya\b/)!=-1 && num_of_words==1) || (input.search(/\bby\b/)!=-1 && num_of_words==1) || (input.search("see you")!= -1 && num_of_words==2) || (input.search("take care")!= -1 && num_of_words==2)) { 
if(!flagthot) {
thotnum = [Math.floor(Math.random()*3)]
flagthot=true;}
message[0] = "Bye bye, take care.";  
message[1] = "Good bye, see you later.";  
message[2] = "Good bye!";  
document.result.result.value = message[thotnum]; 
SpeechPlugin.Speak (message[thotnum]);
thotnum++
if(thotnum>2){thotnum=0}
return true;}

if (input.search("cool")!= -1 || input.search("kewl")!= -1 || input.search("kool")!= -1) { 
message[0] = "yep, really cool."; 
message[1] = "that's cool."; 
message[2] = "yeah, really kool."; 
message[3] = "Kewl."; 
message[4] = "way cool."; 
num = [Math.floor(Math.random()*5)]
document.result.result.value = message[num]; 
SpeechPlugin.Speak (message[num]);
return true;}

if (input.search(/\bok\b/)!= -1 || input.search("okie dokie")!= -1 || input.search("okay")!= -1 || input.search("aight")!= -1) {    
message[0] = "okay, I see!"; 
message[1] = "ok that's good."; 
message[2] = "ok, I suppose so."; 
message[3] = "okay, I understand."; 
message[4] = "ok that's cool."; 
num = [Math.floor(Math.random()*5)]
document.result.result.value = message[num]; 
SpeechPlugin.Speak (message[num]);
return true;}

if (input.search(/\byes\b/)!= -1 || input.search(/\byea\b/)!= -1 || input.search(/\byup\b/)!= -1 || input.search(/\byep\b/)!= -1 || input.search(/\bya\b/)!= -1 || input.search("yeah")!= -1 || input.search("uh huh")!= -1) { 
message[0] = "ok, yes it is."; 
message[1] = "yes, I suppose so."; 
message[2] = "ok, I guess so."; 
message[3] = "yeah, I reckon so."; 
num = [Math.floor(Math.random()*4)]
document.result.result.value = message[num]; 
SpeechPlugin.Speak (message[num]);
return true;}

if (input.search(/\bno\b/)!= -1 || input.search("nope")!= -1 || input.search(/\bnah\b/)!= -1) { 
message[0] = "alrighty, no it is!"; 
message[1] = "No, I suppose not."; 
message[2] = "yeah, I reckon not."; 
message[3] = "ok, I guess not."; 
message[4] = "okay, I understand."; 
num = [Math.floor(Math.random()*5)]
document.result.result.value = message[num]; 
SpeechPlugin.Speak (message[num]);
return true;}

if (input.search("#test")!= -1)
{document.result.result.value = "Everything seems to be working properly"; 
SpeechPlugin.Speak ("Everything seems to be working properly"); 
return true;}

if (!flagthot) {
thotnum = [Math.floor(Math.random()*8)]
flagthot=true;}
message[0] = "Sorry, you stumped me on that one.";  
message[1] = "Sorry, a search of my data base comes up empty."; 
message[2] = "Not sure, but I'll ask "+cast1[Math.floor(Math.random()*5)]+" about it and get back with you.";
message[3] = "I don't know so can I ask you a question instead?";
message[4] = "Sorry, I don't know the answer to that just yet.";
message[5] = "Not sure sorry.";
message[6] = "Don't know but I bet "+cast2[Math.floor(Math.random()*5)]+" does. I'll ask and get back with you.";
message[7] = "Sorry don't know. So are you ready for a trivia question from me?";
document.result.result.value = message[thotnum]; 
SpeechPlugin.Speak (message[thotnum]);
if (thotnum==3) questionlevel=0;
if (thotnum==7) quizlevel=0;
thotnum++
if (thotnum>7){thotnum=0}
return true;}


function logit() {
  document.chatbot.ulog.value=uchat_log;
  document.chatbot.blog.value=bchat_log;
  document.chatbot.submit();
}
//-->
