function post(auth,body,post_id,email,notify_all)
{
	$('hidden0').value=auth;
	$('hidden1').value=body;	
	$('hidden2').value=post_id;
  $('hidden3').value=email;
  $('hidden4').value=notify_all;
	document.commentForm.submit();
}

function make_comment(div_element,parent_id){
	if(div_element.childElements().length>0)
	{
    div_element.childElements().each(Element.remove);
		return;
	}
  var s=div_element.id;
  div_element.appendChild(
      Builder.node("div",
        [Builder.node("input",{className:"comment",type:"text",id:s+"auth",maxlength:30}),
         " Your name"]));
  div_element.appendChild(
      Builder.node("div",
        [Builder.node("button",{className:"comment",onclick:"$('"+s+"email_div').show();this.hide();"},"Email me future comments"),
         Builder.node("div",{id:s+"email_div",style:"display:none;"},
           [Builder.node("div","(You may want to set your spam filter to allow mail from \"noreply@gfredericks.com\". I'm kind of an amateur at sending emails, and I think they can smell fear)"),
            Builder.node("input",{type:"text",id:s+"email",maxLength:100})," Your email address",
            Builder.node("div",[
              Builder.node("input",{type:"radio",id:s+"just_this",name:s+"email_opt"}),
              "Only replies to this comment"]),
            Builder.node("div",[
              Builder.node("input",{type:"radio",id:s+"notify_all",checked:"checked",name:s+"email_opt"}),
              "All future comments to this post"])])]));
  div_element.appendChild(
      Builder.node("div",
        [Builder.node("textarea",{id:s+"body",className:"comment"})]));
  div_element.appendChild(
      Builder.node("div",
        [Builder.node("button",{className:"comment",onclick:"post($('"+s+"auth').value,$('"+s+"body').value,'"+parent_id+"',$('"+s+"email').value,$('"+s+"notify_all').checked);"},"Post")]));
}
