window.addEvent('domready',
    function()
    {
        /**
        * Cerco tutti i campi form con classe "field" e le textarea e imposto gli stili
        * per quando sono attivi, resettandoli quando non lo sono
        */
        $$('input.field, textarea').addEvents({
            'focus': function()
            {
                this.addClass('fieldFocus');
            },
            'blur': function()
            {
                this.removeClass('fieldFocus');
            }
        });

        /**
        * Cerco tutti i campi form con classe "button" e imposto gli stili
        * per quando sono attivi, resettandoli quando non lo sono
        */
        $$('input.button').addEvents({
            'focus': function()
            {
                this.addClass('buttonFocus');
            },
            'blur': function()
            {
                this.removeClass('buttonFocus');
            }
        });

        if ($(document.body).getElement('.defaultSelected')) $(document.body).getElement('.defaultSelected').focus();
    }
);
