
      /**********

          file:     help_lisp.js
          created:  30 oct 2005  by modifying  help_quotes_1.js

          updates:

    
      **********/

      var expiration_date = "Tuesday, 10-Nov-20 23:12:40 GMT" ; // cookie valid until 10 nov 2020


      function name_is_defined ( ck, nam )
         {
              var ss    = remove_blanks( ck ) ;
              var pairs = ss.split( ";" ) ;
              for( var j=0; j<pairs.length; j++ )
                 {
                     var pair_split = pairs[j].split( "=" ) ;
                     if ( pair_split[0] == nam ) 
                        {
                            return true ;
                        }
                 }
              return false ;

         } // name_is_defined
        
      function remove_blanks ( ss )
         {
             var temp = "" ;
             for( var j=0; j<ss.length; j++ ) 
                {
                   var cc = ss.charAt( j ) ;
                   if ( cc != " " )
                      {
                         temp += cc ;
                      }
                }
             return temp ;
        
         } // remove_blanks
       
      function get_cookie_value ( kk, n )
         {
             var ss = remove_blanks( kk ) ;
             var pairs = ss.split( ";" ) ;
             for( var j=0; j<pairs.length; j++ )
                {
                   var pair_split = pairs[j].split( "=" ) ;
                   if ( pair_split[0] == n )
                      {
                          return pair_split[ 1 ] ;
                      }
                }
             return "" ;
       
         } // get_cookie_value

      function read_cookie() 
         {
             var cookie = document.cookie ;

             lisp_text_color = "black" ;

             if ( name_is_defined( cookie, "lisp_background" )) 
                {
                   lisp_background = get_cookie_value ( cookie, "lisp_background" ) ;
                }
             else
                {
                   lisp_background = "white" ;  
                }
       
             if ( name_is_defined( cookie, "lisp_text_color" )) 
                {
                    lisp_text_color = get_cookie_value ( cookie, "lisp_text_color" ) ;
                }

          } // read_cookie


       function setCookie() 
          {
        
             var new_cookie_1 = "lisp_background=" + lisp_background ;

             new_cookie_1 += "; expires="  +  expiration_date ; 
       
             window.document.cookie = new_cookie_1 ;
 
             var new_cookie_2 = "lisp_text_color=" + lisp_text_color ;
       
             new_cookie_2 += "; expires="  +  expiration_date ; 
         
             window.document.cookie = new_cookie_2 ;
       
             window.location="lisp_example.htm"

          } // setCookie


       function set_prefs() 
          {
              //// alert( "Hello from top of set_prefs " ) ;
        
              bg_field     = window.document.my_prefs.my_bg ;
              bg_index     = bg_field.selectedIndex ;
       
              if ( bg_field.options[bg_index].text == "light gray" )     
                 {
                     lisp_background = "#eeeeee" ;  // smooth light gray
                 }
              else if ( bg_field.options[bg_index].text == "blanched almond" )
                 {
                    lisp_background = "blanchedalmond" ; 
                 }
              else
                 {
                     lisp_background  = bg_field.options[bg_index].text ;
                 }
     
       
              fgField              = window.document.my_prefs.my_fg ;
              fgIndex              = fgField.selectedIndex ;
              lisp_text_color  = fgField.options[fgIndex].text ;
              setCookie() ;

       
          } // set_prefs

       function create_prefs_form() 
          {
              document.writeln( '<form   name="my_prefs">' ) ;

              //// document.writeln( 'Background color: ' ) ;
              document.writeln( "<span  class='gmt_choose_color' >"  +
                                "&nbsp;&nbsp;&nbsp;&nbsp;   Background color: </span>" ) ;

              document.writeln( '<select  name="my_bg" size="1" >' ) ;
              document.writeln( '<option>aqua' ) ;
              document.writeln( '<option>blanched almond' ) ;
              document.writeln( '<option>blue' ) ;
              document.writeln( '<option>black' ) ;
              //// document.writeln( '<option>rough_gray' ) ;        
              document.writeln( '<option>light gray' ) ;              
              document.writeln( '<option>lime' ) ;
              document.writeln( '<option>orange' ) ;
              document.writeln( '<option>red' ) ;
              document.writeln( '<option>tan' ) ;
              document.writeln( '<option SELECTED >white' ) ;  
              document.writeln( '<option>yellow' ) ;        
              document.writeln( '</select >' ) ;

              //// document.writeln( ' Text color: ' ) ;

              document.writeln( "<span  class='gmt_choose_color' >"  +
                                "&nbsp Text color: </span>" ) ;

              document.writeln( '<select  name="my_fg" size="1" >' ) ;
              document.writeln( '<option>aqua' ) ;        
              document.writeln( '<option SELECTED >black' ) ;
              document.writeln( '<option>blue' ) ;  
              document.writeln( '<option>gray' ) ;  
              document.writeln( '<option>green' ) ; 
              document.writeln( '<option>lime' ) ;        
              document.writeln( '<option>orange' ) ;
              document.writeln( '<option>red' ) ;
              document.writeln( '<option>silver' ) ;                    
              document.writeln( '<option>tan' ) ;
              document.writeln( '<option>white' ) ;
              document.writeln( '<option>yellow' ) ;        
              document.writeln( '</select >' ) ;

              document.write( ' &nbsp; &nbsp; ' ) ;  // two spaces     

              document.writeln( "<input   "                  +
                                "class='gmt_set_color_btn'"  +
                                "type='button'"              +
                                "value='Set Colors'"         +
                                "onClick='set_prefs()'" ) ;
              document.writeln( '</form>' ) ;

          } // create_prefs_form


