/**
 * Internal mail contact
 * @version:  01.01.01 Alpha
 * @modified: 2009-07-06 15:58:00
 */
var auto_submit = newClass({
        
    init : function(form_id, form_button, event_elements)
    {
        this.form_id = form_id;
        this.event_elements = event_elements;
        this.$w0.createStyle(form_id + ' ' + form_button, "display: none;");
    },

    onready : function()
    {
        var el, k;
        for (k in this.event_elements) {
            el = this.$$(this.form_id + ' ' + k);
            if (el) {
                el.addListener(this, this.event_elements[k], "onEvent");
            }
        }
    },

    onEvent : function(evtWr)
    {
        this.$(this.form_id).elm.submit();
    },
    config : {
    }
});
