/**
 * author: James Mortensen
 * Copyright (c) 2010, Adaptavant, Inc
 * Copyright (c) 2010, AnswerConnect, Inc
 *
 */
function FormUtils() {


    // disable submit button after 1 click
    FormUtils.prototype.disableButton = function(elem) {
	
        elem.disabled = true;

    };


    // locate all submit buttons and bind the disableButton function
    FormUtils.prototype.initDisableButtonEvent = function() {
        try {
            var inputs = document.getElementsByTagName("input");
            var i=0;alert(inputs.length);
	    for(i=0; i<inputs.length; i++) {
		alert(inputs[i]);
		if(inputs[i].getAttribute("type") == "button") {
                    inputs[i].setAttribute("onclick","alert('ddd');var formUtils = new FormUtils();formUtils.disableButton(this);formUtils = null;alert('disabled');");
		alert(inputs[i]);
		}
	    }
        } catch(e) {
            // degrade silently
	    alert(e.message);
	}
    };

}

