function walidacja(){
    $('input[name=email]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            email($(this));
        });
        email($(this));
    });
    
    $('input[name=haslo]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            haslo($(this));
        });
        haslo($(this));
    });

    $('input[name=imie]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            imie($(this));
        });
        imie($(this));
    });
    
    $('input[name=nazwisko]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            nazwisko($(this));
        });
        nazwisko($(this));
    });
    
    $('input[name=noweHaslo]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            haslo($(this));
            var nastepne=$(this).parent().parent().next().find('input:first');
            if(nastepne.val()!=''){//jezeli nastepne pole nie puste
                nastepne.change();
            }
        });
        haslo($(this));
        var nastepne=$(this).parent().parent().next().find('input:first');
        if(nastepne.val()!=''){//jezeli nastepne pole nie puste
            nastepne.change();
        }
    });
    
    $('input[name=noweHaslo2]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            haslo($(this));
            if($(this).parent().next().find('.poleZle').length==0){//jezeli bez bledu
                porownaj($(this));
            }
        });        
        haslo($(this));
        if($(this).parent().next().find('.poleZle').length==0){//jezeli bez bledu
            porownaj($(this));
        }
    });
    
    $('input[name=nazwaFirmy]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            niepuste($(this));
        });
        niepuste($(this));
    });
    
    $('input[name=nip]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            nip($(this));
        });
        nip($(this));
    });
    
    $('input[name=ulica]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            niepuste($(this));
        });
        niepuste($(this));
    });

    $('input[name=numerDomu]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            numerDomu($(this));
        });
        numerDomu($(this));
    });

    $('input[name=numerLokalu]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            numerLokalu($(this));
        });
        numerLokalu($(this));
    });

    $('input[name=miejscowosc]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            miejscowosc($(this));
        });
        miejscowosc($(this));
    });

    $('input[name=kodPocztowy]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            kodPocztowy($(this));
        });
        kodPocztowy($(this));
    });
    
    $('input[name=kierunkowy]').bind('change',function(){
        $(this).unbind("keyup");
        $(this).bind("keyup",function(){
            if($(this).next().val()!=''){//niepuste
                kierunkowy($(this));
            }
        });
        if($(this).next().val()!=''){//niepuste
            kierunkowy($(this));
        }
    });

    $('input[name=telefon]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            telefon($(this));
        });
        telefon($(this));
    });
    
    $('input[name=nowyEmail]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            email($(this));
            var nastepne=$(this).parent().parent().next().find('input:first');
            if(nastepne.val()!=''){//jezeli nastepne pole nie puste
                nastepne.change();
            }
        });
        email($(this));
        var nastepne=$(this).parent().parent().next().find('input:first');
        if(nastepne.val()!=''){//jezeli nastepne pole nie puste
            nastepne.change();
        }
    });
    
    $('input[name=nowyEmail2]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            email($(this));
            if($(this).parent().next().find('.poleZle').length==0){//jezeli bez bledu
                porownaj($(this));
            }
        });        
        email($(this));
        if($(this).parent().next().find('.poleZle').length==0){//jezeli bez bledu
            porownaj($(this));
        }
    });
    
    $('select[name=idZrodla]').bind('change',function(){
        $(this).unbind("keyup");
        $(this).bind("keyup",function(){
            zrodloPochodzenia($(this));
        });
        zrodloPochodzenia($(this));
    });
    
    $('textarea[name=opisPochodzenia]').bind("change",function(){
        $(this).unbind("keyup");
        $(this).bind("keyup",function(){
            opisPochodzenia($(this));
        });
        opisPochodzenia($(this));
    });
    
    $('[name=idAdresu], [name=idPlatnosci]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            niepuste($(this));
        });
        niepuste($(this));
    });

    $('input[name=osobaKontaktowa]').bind('change',function(){
        $(this).unbind('keyup');
        $(this).bind('keyup',function(){
            osobaKontaktowa($(this));
        });
        osobaKontaktowa($(this));
    });
    
    //nowe zlecenie - z kalkulacji bądź zlecenia
    $('#zaloguj, #rejestracja, #haslo, .noweZlecenie, #twojeDane, #noweHaslo, #nowyAdres').bind('submit',function(){
        $(this).find('input, select, textarea').change();
        
        if($(this).find('.poleZle').length!=0){
            return false;
        }
    });
}
