function initCommentRules()
{
    var comment_rules = $("commentrules");
    if(comment_rules) new CommentRules(comment_rules);
}

var CommentRules = Class.create();
CommentRules.prototype = {
    initialize: function(obj)
    {
        this.container = obj;
        this.slider = this.container.getElementsByTagName("div")[0];
        Element.hide(this.slider);
        Element.addClassName(this.container, "clickable");
        Event.observe(this.container, "click", this.toggle.bindAsEventListener(this), false);
        Event.observe(this.container, "mouseover", this.addHover.bindAsEventListener(this), false);
        Event.observe(this.container, "mouseout", this.removeHover.bindAsEventListener(this), false);
    },
    addHover: function()
    {
        Element.addClassName(this.container, "hover");
    },
    removeHover: function()
    {
        Element.removeClassName(this.container, "hover");
    },
    toggle: function()
    {
        if (Element.visible(this.slider)) {
            new Effect.BlindUp(this.slider);
        } else {
            new Effect.BlindDown(this.slider);
        }
    }
}

Event.observe(window, "load", initCommentRules, false);