slib_lang_exists_tmp=yes

slib_title=Chemical components
slib_parms=4\
 , chemical equation\
 , [optional] the word htmlbuttons followed by a space and one number\
 , [optional] the word shuffle\
 , [optional] a list of words to be appended, enclosed in brackets. Some words are magical: \
 extra expands to '+,->' ; redox_extra expands to 'H^+_aq,OH^-_aq,H2O,e^-'.

slib_out= Outputs a matrix of the reactives in the first line, and the products in \
the second line. 
If the parameter htmlbuttons is specified, the output \
is some code to make clickable buttons; then, the number refers to a reply \
field which will receive the results of the buttons' events. 
If the \
parameter shuffle is specified, the buttons are shuffled. 
These buttons \
can be made active if the following javascript code is added in the page: \

\
<script type="text/javascript">\
function getInput(n){\
  f=window.document.forms[0];\
  for(i=0; i<f.elements.length; i=i+1){\
    if (f.elements[i].name=="reply"+n) { \
      return f.elements[i];\
    }\
  }\
  return null;\
}\
function appendToInput(n,msg){\
  var i=getInput(n);\
  i.value=i.value+msg+' ';\
  i.focus();\
}\
</script>\

slib_comment=use the syntax accepted by the command chemeq
