<search function="pg">
  <name>Project Gutenberg</name>
  <description>
    Search the Project Gutenberg Public Domain online book collection.<br/>
    <div class="helpboxDescLabels">Usage:</div>
  	<table class="helpboxDescTable">
  		<tr><td>pg &lt;<i>book title</i>&gt; [/author] [{/reader | /dmoz}]</td></tr>
  	</table>
    <div class="helpboxDescLabels">Switches:</div>
  	<table class="helpboxDescTable">
  		<tr><td>/author</td><td> - </td><td>Search for an Author instead of a Title</td></tr>
      		<tr><td>/reader</td><td> - </td><td>Search for Public Domain books on the more friendly but less complete <a href="http://www.pgreader.org">pgreader.org</a>.<br />
      			HTML formatted version of some books are also offered here.</td></tr>
      		<tr><td>/dmoz</td><td> - </td><td>Search through the Project Gutenberg book titles and authors on the <a href="http://dmoz.org/">Open Directory Project</a>. The author switch is ignored. It seems to be faster and more accurate than the official search sometimes.</td></tr>
      		<tr><td>/ebi</td><td> - </td><td>Search through Tecriture's eBook Initiative site. Fairly good automated HTML conversion is available here for any book in PG's archives. Due to a lot of hidden javascript you may need to go through the <a href="http://ns2.tecriture.com/">Tecriture Home</a> to browse properly.</td></tr>
  	</table>
    <div class="helpboxDescLabels">Examples:</div>
    <table class="helpboxDescTable">
  		<tr><td>pg Alice In Wonderland</td></tr>
      		<tr><td>pg Dostoevsky /author</td></tr>
      		<tr><td>pg Sun Tzu /author /reader</td></tr>
      		<tr><td>pg Beowulf /ebi</td></tr>
      		<tr><td>pg Time Machine /dmoz</td></tr>
  	</table>
  </description>
  <category>Other</category>
  <link>http://www.gutenberg.net/</link>
  <contributor>Thad Kerosky</contributor>
  
  <form name="pgsearch" method="get" action="http://promo.net/cgi-promo/pg/t9.cgi"> 
    <input type="hidden" name="ftpsite"
	        value="ftp://ibiblio.org/pub/docs/books/gutenberg/" />
    <input type="hidden" name="title" value=""/>
    <input type="hidden" name="author" value=""/>  
  </form>
  
  <form name="readersearch" method="get" action="http://www.pgreader.com/apps/proc_query.asp"> 
      <input type="hidden" name="title_txt" value=""/>
      <input type="hidden" name="author_txt" value=""/>  
  </form>
  
  <form name="dmozsearch" method="get" action="http://search.dmoz.org/cgi-bin/search">
    <input type="hidden" name="cat" value="Arts/Literature/Electronic_Text_Archives/Project_Gutenberg"/> 
    <input type="hidden" name="search" value=""/>
    <input type="hidden" name="all" value="no"/> 
  </form>
  
   <form name="ebisearch" method="post" action="http://ns2.tecriture.com/cgi-bin/ebi.cgi">
     <input type="hidden" name="author"/>
     <input type="hidden" name="title"/>
     <input type="hidden" name="keyword"/>
     <input type="hidden" name="dates"/>
     <input type="hidden" name="language"/>
     <input type="hidden" name="action" value="search"/>
     <input type="hidden" name="line" value="1"/>
  </form>

   <script><![CDATA[
   
    function pg(q)
    {
    
    var searchID = 0;
    var AuthorQuery = false;
    
      if( nullArgs("pg",q) )
        return false;
      else
      {
        var args = parseArgs(q, "reader, dmoz, ebi, author");
        
        if( args.switches.length > 0 )
          for( var j=0; j<args.switches.length; j++ )
            switch( args.switches[j].name )
            {
              case "reader":
	        searchID = 1;
                break;
              case 'dmoz':
                document.dmozsearch.search.value = args.q;
                searchID = 2;
                break;
              case "ebi":
                searchID = 3;
                break;
                
              case "author":
                AuthorQuery = true;
                break;              
            }
       }
      
      if (!AuthorQuery) {
      	  document.pgsearch.title.value = args.q;
      	  document.readersearch.title_txt.value = args.q;
      	  document.ebisearch.keyword.value = args.q;
      	}
        else 
        {
          document.pgsearch.author.value = args.q;
          document.readersearch.author_txt.value = args.q;
          document.ebisearch.author.value = args.q;
        }
        
      	
      switch (searchID) {
      
      	case 1:
      	  submitForm(readersearch);
      	  break;
      	case 2:
      	  submitForm(dmozsearch);
      	  break;
      	case 3:
      	  submitForm(ebisearch);
      	  break;
      	default:
      	  submitForm(pgsearch);
      	  break;
      	}
      	
      	//for some reason if I don't clear these they show in the next query of a different type.
      	//document.pgsearch.author.value = "";
        //document.readersearch.author_txt.value = "";
        
        //document.pgsearch.title.value = "";
        //document.readersearch.title_txt.value = "";
    }
  ]]></script>

  <copyright>
	Copyright (c) 2002 David Bau
	Distributed under the terms of the
	GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
  </copyright>
</search>

