(function($){
    $.fn.changeInputValue = function() {
        $(this).each(function(){
            this.initial_value = $(this).val();
            $(this).focus(function(){
                if ($(this).val() == this.initial_value){
                    $(this).val('');
                } 
            });
            $(this).blur(function(){
                if ($(this).val() == ''){
                    $(this).val(this.initial_value);
                }
            });
        });
    }
})(jQuery);

function tellToFamiliarSuccess(responseText, status_code) {
    setTimeout(function(){$('#tell_to_familiar_message').html('');}, 5000);
}

$(document).ready(function() {
    $('#email').changeInputValue();
    $('#tell_to_familiar_form').ajaxForm({target: '#tell_to_familiar_message',
                                          success: tellToFamiliarSuccess});
    //ustawienia konkretnego odwarzacza
    if(jQuery.url.param("player")){
      player = $('#flv_player_' + jQuery.url.param("player"));
      player.click();
    }
    //
});

function chars_left(e, max_chars, dst) {
    var left = max_chars - parseInt(e.target.value.length);
    if (left <= 0) { e.target.value = e.target.value.substring(0, max_chars); left = 0;}
    $(dst).text(left);
}