var _index  =   {

    init:   {
        _:  function() {

            this.inputs._();
            this.forms._();
            this.banners._();

        },

        inputs: {
            _:  function() {

                this.clean._();
            },

            clean:  {
                _:  function() {

                    $('input:text')//.assset()
                        .each(function() {

                            $(this)

                                .data('init', $(this).val())

                                .focus(function() {

                                    if ($(this).val() == $(this).data('init'))
                                    {
                                        $(this)
                                            .val('')
                                        ;
                                    }
                                })

                                .blur(function() {

                                    if ($(this).val() == '')
                                    {
                                        $(this)
                                            .val($(this).data('init'))
                                        ;
                                    }
                                })
                            ;
                        })
                    ;
                }
            }
        },

        forms: {
            _:  function() {

                $.tools.validator.localize("fr", _settings.feedbacks.form);

                $('.form2validate')
                    .validator({
                        lang:   'fr'
                    });
                ;
            }
        },

        banners: {
            _:  function() {

                if (! jQuery.support.opacity)//ie
                {
                    $('a ._flash')
                        .css('position', 'relative')
                        .each(function() {

                            $(this)
                                .append(
                                '<a href="'+ $(this).parent('a').attr('href') + '"' +
                                ($(this).parent('a').attr('target') ? (' target="'+$(this).parent('a').attr('target')+'"'):'')+
                                '><img src="/images/x.gif" style="position:absolute;z-index:1;top:0;left:0;width:'+
                                $(this).css('width')+
                                ';height:'+
                                $(this).css('height')+
                                '" /></a>'
                            );
                        })
                };
            }
        }
    }
};

$(document).ready(function() {_index.init._();});


