function replyForm(comid) {
	if (document.getElementById('sec_add_form')) {
		var newForm = document.getElementById('sec_add_form');
	}
	else {		
		var newForm = document.getElementById('add_comment').cloneNode(true);
		newForm.id = 'sec_add_form';
	}
	var insertHere = document.getElementById('commentholder'+comid);
	insertAfter(newForm,insertHere);
	newForm.replyto.value = comid;
}

function insertAfter(newElement, targetElement)
{
    // Target is what you want it to go after.
    // Look for this elements parent.
    var parent = targetElement.parentNode;

    // If the parents lastchild is the target
    // element...
    if(parent.lastchild == targetElement) {
        // Add the newElement after the target
        // element.
        parent.appendChild(newElement);
    } else {
        // Else the target has siblings, insert
        // the new element between the target and
        // it's next sibling.
        parent.insertBefore(newElement, targetElement.nextSibling);
    }
}


function switchOpenId() {
	document.getElementById("openid_url").disabled = ! document.getElementById("openid_on").checked;

}

window.onload = switchOpenId;
