$(document).ready(function() {

    $('input[name="banner"]').change(function(e) {
        var reader = new FileReader();

        reader.onload = function(event) {
            $('.banner img').attr('src', event.target.result);
        }

        reader.readAsDataURL(this.files[0]);
    });

    $('.edition h1').bind('focusout', function(e) {
        $('input[name="title"]').val($(this).text());
    });

    $('.edition p').bind('focusout', function(e) {
        $('input[name="description"]').val($(this).text());
    });

    $('.edition a').bind('focusout', function(e) {
        $('input[name="action"]').val($(this).text());
    });

});