// handles the form
var FormBot = {
    // the id of the signmeup form
    form_id : "NONE",
    _action : null,
    form : null,
    form_action : "",
    
    setup : function()
    {    
        this.form = document.getElementById(this.form_id);
        if (this.form)
        {
            // get all input fields in the form
            var elements = this.form.getElementsByTagName("input");
            for(idx in elements)
            {
                var ele = elements[idx];
                ele.onkeyup = this.form_keypressed;
            }
        }
    },
    
    // handles the onkeypress event on the signmeup form
    form_keypressed : function()
    {    
        if (this.form == null)    
            return;
        
        // add the action to the form
        this.form.setAttribute("action", FormBot.form_action);
    }
}; 

/**
 * usage:
 * FormBot.form_id = 'the form id'
 * FormBot.form_action = 'the form action'
 * FormBot.setup()
 */
