document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. // Chat Bot by George Dunlop, www.peccavi.com
  2. // Note - Eliza is a Classic Model of chat Bots.. but this implementation is mine :)
  3. // May be used/modified if credit line is retained (c) 1997 All rights reserved
  4.  
  5.     loaded = false;             // load flag for interlocking the pages
  6.  
  7. // OBJECT TYPE DEFINITIONS
  8.  
  9. // Keys
  10.  
  11.    maxKey = 36;
  12.    keyNotFound = maxKey-1;
  13.    keyword = new Array(maxKey);
  14.  
  15.     function key(key,idx,end){
  16.     this.key = key;                         // phrase to match
  17.         this.idx = idx;                         // first response to use
  18.         this.end = end;                         // last response to use
  19.         this.last = end;                                // response used last time
  20.     }
  21.     maxrespnses =116;
  22.    response = new Array(maxrespnses);
  23.  
  24.     maxConj = 19;
  25.     max2ndConj = 7;
  26.    var conj1 = new Array(maxConj);
  27.    var conj2 = new Array(maxConj);
  28.    var conj3 = new Array(max2ndConj);
  29.    var conj4 = new Array(max2ndConj);
  30.    
  31.  
  32. // Funtion to replaces all occurances of substring substr1 with substr2 within strng
  33. // if type == 0 straight string replacement
  34. // if type == 1 assumes padded strings and replaces whole words only
  35. // if type == 2 non case sensitive assumes padded strings to compare whole word only
  36. // if type == 3 non case sensitive straight string replacement
  37.  
  38.     var RPstrg = "";
  39.  
  40.     function replaceStr( strng, substr1, substr2, type){
  41.         var pntr = -1; aString = strng;
  42.         if( type == 0 ){  
  43.             if( strng.indexOf( substr1 ) >= 0 ){ pntr = strng.indexOf( substr1 );   }
  44.         } else if( type == 1 ){
  45.             if( strng.indexOf( " "+ substr1 +" " ) >= 0 ){ pntr = strng.indexOf( " " + substr1 + " " ) + 1; }  
  46.         } else if( type == 2 ){
  47.             bstrng = strng.toUpperCase();
  48.             bsubstr1 = substr1.toUpperCase();
  49.             if( bstrng.indexOf( " "+ bsubstr1 +" " )>= 0 ){ pntr = bstrng.indexOf( " " + bsubstr1 + " " ) + 1; }   
  50.         } else {
  51.             bstrng = strng.toUpperCase();
  52.             bsubstr1 = substr1.toUpperCase();
  53.             if( bstrng.indexOf( bsubstr1 ) >= 0 ){ pntr = bstrng.indexOf( bsubstr1 ); }
  54.         }
  55.         if( pntr >= 0 ){
  56.             RPstrg += strng.substring( 0, pntr ) + substr2;
  57.             aString = strng.substring(pntr + substr1.length, strng.length );
  58.             if( aString.length > 0 ){ replaceStr( aString, substr1, substr2, type ); }
  59.         }
  60.         aString =  RPstrg + aString;
  61.         RPstrg = "";
  62.         return aString;
  63.     }  
  64.  
  65.  
  66. // Function to pad a string.. head, tail & punctuation
  67.  
  68.     punct = new Array(".", ",", "!", "?", ":", ";", "&", \'"\', "@", "#", "(", ")" )
  69.  
  70.     function padString(strng){
  71.         aString = " " + strng + " ";
  72.         for( i=0; i < punct.length; i++ ){
  73.             aString = replaceStr( aString, punct[i], " " + punct[i] + " ", 0 );
  74.         }
  75.         return aString
  76.     }
  77.  
  78. // Function to strip padding
  79.  
  80.     function unpadString(strng){
  81.         aString = strng;
  82.         aString = replaceStr( aString, "  ", " ", 0 );      // compress spaces
  83.         if( strng.charAt( 0 ) == " " ){ aString = aString.substring(1, aString.length ); }
  84.         if( strng.charAt( aString.length - 1 ) == " " ){ aString = aString.substring(0, aString.length - 1 ); }
  85.         for( i=0; i < punct.length; i++ ){
  86.             aString = replaceStr( aString, " " + punct[i], punct[i], 0 );
  87.         }
  88.         return aString
  89.     }
  90.  
  91.  
  92.  
  93. // Dress Input formatting i.e leading & trailing spaces and tail punctuation
  94.    
  95.     var ht = 0;                                             // head tail stearing
  96.    
  97.     function strTrim(strng){
  98.         if(ht == 0){ loc = 0; }                                 // head clip
  99.         else { loc = strng.length - 1; }                        // tail clip  ht = 1
  100.         if( strng.charAt( loc ) == " "){
  101.             aString = strng.substring( - ( ht - 1 ), strng.length - ht);
  102.             aString = strTrim(aString);
  103.         } else {
  104.             var flg = false;
  105.             for(i=0; i<=5; i++ ){ flg = flg || ( strng.charAt( loc ) == punct[i]); }
  106.             if(flg){   
  107.                 aString = strng.substring( - ( ht - 1 ), strng.length - ht );
  108.             } else { aString = strng; }
  109.             if(aString != strng ){ strTrim(aString); }
  110.         }
  111.         if( ht ==0 ){ ht = 1; strTrim(aString); }
  112.         else { ht = 0; }       
  113.         return aString;
  114.     }
  115.  
  116. // adjust pronouns and verbs & such
  117.  
  118.     function conjugate( sStrg ){            // rephrases sString
  119.         var sString = sStrg;
  120.         for( i = 0; i < maxConj; i++ ){         // decompose
  121.             sString = replaceStr( sString, conj1[i], "#@&" + i, 2 );
  122.         }
  123.         for( i = 0; i < maxConj; i++ ){         // recompose
  124.             sString = replaceStr( sString, "#@&" + i, conj2[i], 2 );
  125.         }
  126.         // post process the resulting string
  127.         for( i = 0; i < max2ndConj; i++ ){          // decompose
  128.             sString = replaceStr( sString, conj3[i], "#@&" + i, 2 );
  129.         }
  130.         for( i = 0; i < max2ndConj; i++ ){          // recompose
  131.             sString = replaceStr( sString, "#@&" + i, conj4[i], 2 );
  132.         }
  133.         return sString;
  134.     }
  135.  
  136. // Build our response string
  137. // get a random choice of response based on the key
  138. // Then structure the response
  139.  
  140.     var pass = 0;
  141.     var thisstr = "";
  142.        
  143.     function phrase( sString, keyidx ){
  144.         idxmin = keyword[keyidx].idx;
  145.         idrange = keyword[keyidx].end - idxmin + 1;
  146.         choice = keyword[keyidx].idx + Math.floor( Math.random() * idrange );
  147.         if( choice == keyword[keyidx].last && pass < 5 ){
  148.             pass++; phrase(sString, keyidx );
  149.         }
  150.         keyword[keyidx].last = choice;
  151.         var rTemp = response[choice];
  152.         var tempt = rTemp.charAt( rTemp.length - 1 );
  153.         if(( tempt == "*" ) || ( tempt == "@" )){
  154.             var sTemp = padString(sString);
  155.             var wTemp = sTemp.toUpperCase();
  156.             var strpstr = wTemp.indexOf( " " + keyword[keyidx].key + " " );
  157.         strpstr += keyword[ keyidx ].key.length + 1;
  158.             thisstr = conjugate( sTemp.substring( strpstr, sTemp.length ) );
  159.             thisstr = strTrim( unpadString(thisstr) )
  160.             if( tempt == "*" ){
  161.                 sTemp = replaceStr( rTemp, "<*", " " + thisstr + "?", 0 );
  162.             } else { sTemp = replaceStr( rTemp, "<@", " " + thisstr + ".", 0 );
  163.             }
  164.         } else sTemp = rTemp;
  165.         return sTemp;
  166.     }
  167.    
  168. // returns array index of first key found
  169.  
  170.         var keyid = 0;
  171.  
  172.     function testkey(wString){
  173.         if( keyid < keyNotFound
  174.             && !( wString.indexOf( " " + keyword[keyid].key + " ") >= 0 )){
  175.             keyid++; testkey(wString);
  176.         }
  177.     }
  178.     function findkey(wString){
  179.         keyid = 0;
  180.         found = false;
  181.         testkey(wString);
  182.         if( keyid >= keyNotFound ){ keyid = keyNotFound; }
  183.         return keyid;      
  184.     }
  185.  
  186. // This is the entry point and the I/O of this code
  187.  
  188.     var wTopic = "";                                            // Last worthy responce
  189.     var sTopic = "";                                            // Last worthy responce
  190.     var greet = false;
  191.     var wPrevious = "";                                 // so we can check for repeats
  192.     var started = false;   
  193.  
  194.     function listen(User){
  195.         sInput = User;
  196.     if(started){ clearTimeout(Rtimer); }
  197.         Rtimer = setTimeout("wakeup()", 180000);        // wake up call
  198.         started = true;                                     // needed for Rtimer
  199.     sInput = strTrim(sInput);                           // dress input formating
  200.         if( sInput != "" ){
  201.             wInput = padString(sInput.toUpperCase());   // Work copy
  202.             var foundkey = maxKey;                      // assume it\'s a repeat input
  203.             if (wInput != wPrevious){                       // check if user repeats himself
  204.                 foundkey = findkey(wInput);             // look for a keyword.
  205.             }
  206.             if( foundkey == keyNotFound ){
  207.                 if( !greet ){ greet = true; return "Don\'t you ever say Hello?" }
  208.                 else {
  209.                     wPrevious = wInput;                     // save input to check repeats
  210.                     if(( sInput.length < 10 ) && ( wTopic != "" ) && ( wTopic != wPrevious )){
  211.                         lTopic = conjugate( sTopic ); sTopic = ""; wTopic = "";
  212.                         return \'OK... "\' + lTopic + \'". Tell me more.\';
  213.                     } else {
  214.                         if( sInput.length < 15 ){
  215.                             return "Tell me more...";
  216.                         } else { return phrase( sInput, foundkey ); }
  217.                     }
  218.                 }
  219.             } else {
  220.                 if( sInput.length > 12 ){ sTopic = sInput; wTopic = wInput; }
  221.                 greet = true; wPrevious = wInput;           // save input to check repeats
  222.                 return phrase( sInput, foundkey );          // Get our response
  223.             }
  224.         } else { return "I can\'t help, if you will not chat with me!"; }
  225.     }
  226.     function wakeup(){
  227.             var strng1 = "    *** Are We going to Chat? ***";
  228.             var strng2 = "  I can\'t help you without a dialog!";
  229.             update(strng1,strng2);
  230.     }
  231.        
  232. // build our data base here
  233.                                  
  234.     conj1[0]  = "are";          conj2[0]  = "am";
  235.     conj1[1]  = "am";           conj2[1]  = "are";
  236.     conj1[2]  = "were";         conj2[2]  = "was";
  237.     conj1[3]  = "was";          conj2[3]  = "were";
  238.     conj1[4]  = "I";                conj2[4]  = "you";    
  239.     conj1[5]  = "me";           conj2[5]  = "you";    
  240.     conj1[6]  = "you";          conj2[6]  = "me";
  241.     conj1[7]  = "my";           conj2[7]  = "your";    
  242.     conj1[8]  = "your";         conj2[8]  = "my";
  243.     conj1[9]  = "mine";         conj2[9]  = "your\'s";    
  244.     conj1[10] = "your\'s";   conj2[10] = "mine";    
  245.     conj1[11] = "I\'m";          conj2[11] = "you\'re";
  246.     conj1[12] = "you\'re";   conj2[12] = "I\'m";    
  247.     conj1[13] = "I\'ve";         conj2[13] = "you\'ve";
  248.     conj1[14] = "you\'ve";   conj2[14] = "I\'ve";
  249.     conj1[15] = "I\'ll";         conj2[15] = "you\'ll";
  250.     conj1[16] = "you\'ll";   conj2[16] = "I\'ll";
  251.     conj1[17] = "myself";   conj2[17] = "yourself";
  252.     conj1[18] = "yourself";     conj2[18] = "myself";
  253.  
  254. // array to post process correct our tenses of pronouns such as "I/me"
  255.    
  256.     conj3[0]  = "me am";    conj4[0]  = "I am";
  257.     conj3[1]  = "am me";    conj4[1]  = "am I";
  258.     conj3[2]  = "me can";       conj4[2]  = "I can";
  259.     conj3[3]  = "can me";       conj4[3]  = "can I";
  260.     conj3[4]  = "me have";      conj4[4]  = "I have";
  261.     conj3[5]  = "me will";      conj4[5]  = "I will";
  262.     conj3[6]  = "will me";      conj4[6]  = "will I";
  263.    
  264.  
  265. // Keywords
  266.  
  267.     keyword[ 0]=new key( "CAN YOU",         1,  3);
  268.     keyword[ 1]=new key( "CAN I",           4,  5);
  269.     keyword[ 2]=new key( "YOU ARE",         6,  9);
  270.     keyword[ 3]=new key( "YOU\'RE",          6,  9);
  271.     keyword[ 4]=new key( "I DON\'T",         10, 13);
  272.     keyword[ 5]=new key( "I FEEL",          14, 16);
  273.     keyword[ 6]=new key( "WHY DON\'T YOU", 17, 19);
  274.     keyword[ 7]=new key( "WHY CAN\'T I",     20, 21);
  275.     keyword[ 8]=new key( "ARE YOU",         22, 24);
  276.     keyword[ 9]=new key( "I CAN\'T",         25, 27);
  277.     keyword[10]=new key( "I AM",            28, 31);
  278.     keyword[11]=new key( "I\'M",             28, 31);
  279.     keyword[12]=new key( "YOU",             32, 34);
  280.     keyword[13]=new key( "I WANT",          35, 39);
  281.     keyword[14]=new key( "WHAT",            40, 48);
  282.     keyword[15]=new key( "HOW",             40, 48);
  283.     keyword[16]=new key( "WHO",             40, 48);
  284.     keyword[17]=new key( "WHERE",           40, 48);
  285.     keyword[18]=new key( "WHEN",            40, 48);
  286.     keyword[19]=new key( "WHY",             40, 48);
  287.     keyword[20]=new key( "NAME",            49, 50);
  288.     keyword[21]=new key( "CAUSE",           51, 54);
  289.     keyword[22]=new key( "SORRY",           55, 58);
  290.     keyword[23]=new key( "DREAM",           59, 62);
  291.     keyword[24]=new key( "HELLO",           63, 63);
  292.     keyword[25]=new key( "HI",              63, 63);
  293.     keyword[26]=new key( "MAYBE",           64, 68);
  294.     keyword[27]=new key( "NO",              69, 73);
  295.     keyword[28]=new key( "YOUR",            74, 75);
  296.     keyword[29]=new key( "ALWAYS",          76, 79);
  297.     keyword[30]=new key( "THINK",           80, 82);
  298.     keyword[31]=new key( "ALIKE",           83, 89);
  299.     keyword[32]=new key( "YES",             90, 92);
  300.     keyword[33]=new key( "FRIEND",          93, 98);
  301.     keyword[34]=new key( "COMPUTER",        99, 105);
  302.     keyword[35]=new key( "NO KEY FOUND",    106, 112);
  303.     keyword[36]=new key( "REPEAT INPUT",    113, 116);
  304.  
  305.  
  306.     response[  0]="ELIZA - Javascript Version by George Dunlop ( george@peccavi.com )"
  307.     response[  1]="Don\'t you believe that I can<*";
  308.     response[  2]="Perhaps you would like to be able to<*";
  309.     response[  3]="You want me to be able to<*";
  310.     response[  4]="Perhaps you don\'t want to<*";
  311.     response[  5]="Do you want to be able to<*";
  312.     response[  6]="What makes you think I am<*";
  313.     response[  7]="Does it please you to believe I am<*";
  314.     response[  8]="Perhaps you would like to be<*";
  315.     response[  9]="Do you sometimes wish you were<*";
  316.     response[ 10]="Don\'t you really<*";
  317.     response[ 11]="Why don\'t you<*";
  318.     response[ 12]="Do you wish to be able to<*";
  319.     response[ 13]="Does that trouble you?";
  320.     response[ 14]="Tell me more about such feelings.";
  321.     response[ 15]="Do you often feel<*";
  322.     response[ 16]="Do you enjoy feeling<*";
  323.     response[ 17]="Do you really believe I don\'t<*";
  324.     response[ 18]="Perhaps in good time I will<@";
  325.     response[ 19]="Do you want me to<*";
  326.     response[ 20]="Do you think you should be able to<*";
  327.     response[ 21]="Why can\'t you<*";
  328.     response[ 22]="Why are you interested in whether or not I am<*";
  329.     response[ 23]="Would you prefer if I were not<*";
  330.     response[ 24]="Perhaps in your fantasies I am<*";
  331.     response[ 25]="How do you know you can\'t<*";
  332.     response[ 26]="Have you tried?";
  333.     response[ 27]="Perhaps you can now<*";
  334.     response[ 28]="Did you come to me because you are<*";
  335.     response[ 29]="How long have you been<*";
  336.     response[ 30]="Do you believe it is normal to be<*";
  337.     response[ 31]="Do you enjoy being<*";
  338.     response[ 32]="We were discussing you, not me.";
  339.     response[ 33]="Oh... <*";
  340.     response[ 34]="You\'re not really talking about me, are you?";
  341.     response[ 35]="What would it mean to you if you got<*";
  342.     response[ 36]="Why do you want<*";
  343.     response[ 37]="Suppose you got<*";
  344.     response[ 38]="What if you never got<*";
  345.     response[ 39]="I sometimes also want<@";
  346.     response[ 40]="Why do you ask?";
  347.     response[ 41]="Does that question interest you?";
  348.     response[ 42]="What answer would please you the most?";
  349.     response[ 43]="What do you think?";
  350.     response[ 44]="Are such questions on your mind often?";
  351.     response[ 45]="What is it that you really want to know?";
  352.     response[ 46]="Have you asked anyone else?";
  353.     response[ 47]="Have you asked such questions before?";
  354.     response[ 48]="What else comes to mind when you ask that?";
  355.     response[ 49]="Names don\'t interest me.";
  356.     response[ 50]="I don\'t care about names, please go on.";
  357.     response[ 51]="Is that the real reason?";
  358.     response[ 52]="Don\'t any other reasons come to mind?";
  359.     response[ 53]="Does that reason explain anything else?";
  360.     response[ 54]="What other reasons might there be?";
  361.     response[ 55]="Please don\'t apologise!";
  362.     response[ 56]="Apologies are not necessary.";
  363.     response[ 57]="What feelings do you have when you apologise?";
  364.     response[ 58]="Don\'t be so defensive!";
  365.     response[ 59]="What does that dream suggest to you?";
  366.     response[ 60]="Do you dream often?";
  367.     response[ 61]="What persons appear in your dreams?";
  368.     response[ 62]="Are you disturbed by your dreams?";
  369.     response[ 63]="How are you today.. What would you like to discuss?";
  370.     response[ 64]="You don\'t seem quite certain.";
  371.     response[ 65]="Why the uncertain tone?";
  372.     response[ 66]="Can\'t you be more positive?";
  373.     response[ 67]="You aren\'t sure?";
  374.     response[ 68]="Don\'t you know?";
  375.     response[ 69]="Are you saying no just to be negative?";
  376.     response[ 70]="You are being a bit negative.";
  377.     response[ 71]="Why not?";
  378.     response[ 72]="Are you sure?";
  379.     response[ 73]="Why no?";
  380.     response[ 74]="Why are you concerned about my<*";
  381.     response[ 75]="What about your own<*";
  382.     response[ 76]="Can you think of a specific example?";
  383.     response[ 77]="When?";
  384.     response[ 78]="What are you thinking of?";
  385.     response[ 79]="Really, always?";
  386.     response[ 80]="Do you really think so?";
  387.     response[ 81]="But you are not sure you<*";
  388.     response[ 82]="Do you doubt you<*";
  389.     response[ 83]="In what way?";
  390.     response[ 84]="What resemblence do you see?";
  391.     response[ 85]="What does the similarity suggest to you?";
  392.     response[ 86]="What other connections do you see?";
  393.     response[ 87]="Could there really be some connection?";
  394.     response[ 88]="How?";
  395.     response[ 89]="You seem quite positive.";
  396.     response[ 90]="Are you Sure?";
  397.     response[ 91]="I see.";
  398.     response[ 92]="I understand.";
  399.     response[ 93]="Why do you bring up the topic of friends?";
  400.     response[ 94]="Do your friends worry you?";
  401.     response[ 95]="Do your friends pick on you?";
  402.     response[ 96]="Are you sure you have any friends?";
  403.     response[ 97]="Do you impose on your friends?";
  404.     response[ 98]="Perhaps your love for friends worries you.";
  405.     response[ 99]="Do computers worry you?";
  406.     response[100]="Are you talking about me in particular?";
  407.     response[101]="Are you frightened by machines?";
  408.     response[102]="Why do you mention computers?";
  409.     response[103]="What do you think machines have to do with your problems?";
  410.     response[104]="Don\'t you think computers can help people?";
  411.     response[105]="What is it about machines that worries you?";
  412.     response[106]="Say, do you have any psychological problems?";
  413.     response[107]="What does that suggest to you?";
  414.     response[108]="I see.";
  415.     response[109]="I\'m not sure I understand you fully.";
  416.     response[110]="Come, come, elucidate your thoughts.";
  417.     response[111]="Can you elaborate on that?";
  418.     response[112]="That is quite interesting.";
  419.     response[113]="Why did you repeat yourself?";
  420.     response[114]="Do you expect a different answer by repeating yourself?";
  421.     response[115]="Come, come, elucidate your thoughts.";
  422.    
  423.    
  424.    
  425.    
  426.    
  427.     response[116]="Please don\'t repeat yourself!";
  428.    
  429.     loaded = true;          // set the flag as load done
  430.                
  431. ///////////////////////////////////////////////////////////////
  432. //***********************************************************//
  433. //* everything below here was originally in dia_1.html      *//
  434. //***********************************************************//
  435. ///////////////////////////////////////////////////////////////
  436.  
  437. // Chat Bot by George Dunlop, www.peccavi.com
  438. // May be used/modified if credit line is retained (c) 1997 All rights reserved
  439.  
  440. // Put together an array for the dialog
  441.    
  442.     chatmax = 5;                        // number of lines / 2
  443.     chatpoint = 0;
  444.     chatter = new Array(chatmax);
  445.  
  446. // Wait function to allow our pieces to get here prior to starting
  447.  
  448.     function hello(){
  449.         chatter[chatpoint] = "> Hello, I am Eliza.";
  450.         chatpoint = 1;
  451.         return write();
  452.     }
  453.     function start(){
  454.         for( i = 0; i < chatmax; i++){ chatter[i] = ""; }
  455.         chatter[chatpoint] = "  Loading...";
  456.         document.Eliza.input.focus();
  457.         write();           
  458.         if( loaded ){ hello() }
  459.         else { setTimeout("start()", 1000); }
  460.     }
  461.  
  462. // Fake time thinking to allow for user self reflection
  463. // And to give the illusion that some thinking is going on
  464.    
  465.     var elizaresponse = "";
  466.    
  467.     function think(){
  468.         document.Eliza.input.value = "";        
  469.         if( elizaresponse != "" ){ respond(); }    
  470.         else { setTimeout("think()", 250); }
  471.     }
  472.     function dialog(){
  473.         var Input = document.Eliza.input.value;   // capture input and copy to log
  474.         document.Eliza.input.value = "";        
  475.         chatter[chatpoint] = " \\n* " + Input;
  476.         elizaresponse = listen(Input);
  477.         setTimeout("think()", 1000 + Math.random()*3000);
  478.         chatpoint ++ ;
  479.         if( chatpoint >= chatmax ){ chatpoint = 0; }
  480.         return write();
  481.     }
  482.     function respond(){
  483.         chatpoint -- ;
  484.         if( chatpoint < 0 ){ chatpoint = chatmax-1; }
  485.         chatter[chatpoint] += "\\n> " + elizaresponse;
  486.         chatpoint ++ ;
  487.         if( chatpoint >= chatmax ){ chatpoint = 0; }
  488.         return write();
  489.     }
  490. // Allow for unprompted response from the engine
  491.  
  492.     function update(str1,str2){
  493.         chatter[chatpoint] = " \\n> " + str1;
  494.         chatter[chatpoint] += "\\n> " + str2;
  495.         chatpoint ++ ;
  496.         if( chatpoint >= chatmax ){ chatpoint = 0; }
  497.         return write();
  498.     }
  499.  
  500.     function write(){
  501.         document.Eliza.log.value = "";
  502.         for(i = 0; i < chatmax; i++){
  503.             n = chatpoint + i;
  504.             if( n < chatmax ){ document.Eliza.log.value += chatter[ n ]; }
  505.             else { document.Eliza.log.value += chatter[ n - chatmax ]; }
  506.         }
  507.         refresh();
  508.         return false;                              // don\'t redraw the ELIZA\'s form!
  509.     }
  510.     function refresh(){ setTimeout("write()", 10000); }  // Correct user overwrites
  511.  
  512. ///////////////////////////////////////////////////////////////
  513. //***********************************************************//
  514. //* everything below here is manifestation.com stuff        *//
  515. //***********************************************************//
  516. ///////////////////////////////////////////////////////////////
  517.  
  518. <!--
  519. <table cellspacing="0" cellpadding="2" border="0" align="center" class="neurotoy">
  520.     <tr><th bgcolor=#000000 align="left">
  521.         <font color="#FFFFFF">Talk to Eliza</Font>
  522.     </td></tr>
  523.     <tr><td bgcolor=#0097FF>
  524.         <form name="Eliza" onSubmit="return dialog();">
  525.  
  526.         <textarea rows=14 cols=55 name="log"></textarea>
  527.         <center><font color=#000000><br>Input:</font>
  528.             <INPUT TYPE="text" size = 50 NAME="input" VALUE=""></center>
  529.         </form>
  530.     </td></tr>
  531. </table>-->
');