// ---------------------------------------------------------------
// Form behavoirs

// Namespace for form fields
var FormField = {

    // Give an input field a placeholder value, which disappears on focus
    AutoClear: function(el, placeholder) {
        var input = $(el);
        if (!input) {
            throw "No such element '" + el + "'";
        }
        input.placeholder = placeholder;
        input.onfocus = function() {
            if (this.value == this.placeholder) {
                this.value = '';
            }
        };
    }
}
