<search function="email">
  <name>Email</name>
  <description>
    Send an email using the default handler.<br/>
    <div class="helpboxDescLabels">Usage:</div>
    <table class="helpboxDescTable">
  		<tr><td>email &lt;<i>recipient1</i>&gt;[,&lt;<i>recipient2</i>&gt;[,...]]; &lt;<i>subject</i>&gt;; &lt;<i>body</i>&gt;</td></tr>
  	</table>
  </description>
  <category>Functions</category>
  <contributor>Glenn Carr</contributor>
  <idea>Nikolai Devereaux</idea>
  
  <script><![CDATA[
    function email(q)
    {
      if( nullArgs("email",q) )
        return false;
        
      var action = "mailto:";
      var tokens = q.split( ';' );
      if( tokens[0] )
      {
        action += tokens[0].replace(/,/, ";");
        if (tokens[1])
        {
          var subject = tokens[1].replace( /^\s/, '' ).replace( /\s$/, '' )
          action += ("?subject=" + subject);
          if (tokens[2])
          {
            var body = tokens[2].replace( /^\s/, '' ).replace( /\s$/, '' )
            action += ("&body=" + body);
          }
        }
      }
      window.location.href = action;
    }
  ]]></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>

