$(function() {

    $('#login-form .input-text, #search-form .input-textsearch')
        .each(function() {
            $(this).attr('lang', this.value);
        })
        .focus(function() {
            if(this.value == $(this).attr('lang')) this.value = '';
        })
        .blur(function() {
            if(this.value == '') this.value = $(this).attr('lang');
        })
    ;


    $('#search-form').submit(function(e) {

        var elem = $('.input-textsearch', this);

        if(elem.val() == elem.data('def') || elem.val() == '') {

            e.preventDefault();
            return false;

        }

    });


    $('form').submit(function(e) {

        var flag = true;

        $('.required', this).each(function() {

            if(this.value == '' || this.value == '0') {

                flag = false;
                return false;

            }

        });

        if(!flag) {

            alert(fill);

            e.preventDefault();
            return false;

        }

    });


    $('#featureJavaScript').hide();
    if(!navigator.cookieEnabled) $('#featureCookie').show();

    var img = new Image;
    img.src = root + 'images/upload.gif';

});

