$(document).ready(function(){

// obrazki w menu produktów

    $("#js_catalog_menu li a").mouseenter(function(){
        $(this).find(".js_img_white").hide();
        $(this).find(".js_img_red").show();
    }).mouseleave(function(){
        $(this).find(".js_img_red").hide();
        $(this).find(".js_img_white").show();
    });


// usuwa kropkowane obramowanie dookola linkow
    $("a").attr({onfocus: "blur()"});
    $("div").attr({onfocus: "blur()"});

// klasy dla inputow
    $('input[type=text]').addClass('textInput');
    $('input[type=checkbox]').addClass('checkbox');
    $('input[type=submit]').addClass('submit');
    $('input[type=button]').addClass('inputButton');
    $('input[type=radio]').addClass('radio');
    $('textarea').addClass('textarea');
    $('select').addClass('select');

// input hover
    $('input[type=submit]').hover (
            function(){ $(this).addClass('hover');},
            function(){ $(this).removeClass('hover');}
    );
    $('input[type=button]').hover (
            function(){ $(this).addClass('hover');},
            function(){ $(this).removeClass('hover');}
    );

    function delContactVal(obj){
        try {
            if ($(obj).val() == $('.offer_search label[for=id_text]').text()) {
                $(obj).val('');
                $(obj).removeClass('empty');
            }
        }
        catch (e) {
        }
   }

    function reContactVal(obj){
        try {
            if ($(obj).val() == '') {
                $(obj).val($('.offer_search label[for=id_text]').text());
                $(obj).addClass('empty');
            }
        }
        catch (e) {
        }
    }
    $('.offer_search form').submit(function(){

        $('input', $(this)).each(function(){
            if( $(this).hasClass('empty')){
                $(this).val('');
            }
        });

        return true;
    });
});

