$(document).ready(function() {

    $(".aufmacher").find("img").each(function(index) {
        $(this).parents(".aufmacher").css("background-image", 'url("' + $(this).attr("src") + '")');
    });


    $(".einsatzAufmacher").find(".aufmacherContent").each(function(index) {
        $(this).mouseenter(function() {
            var pos = $(this).position();
            if ($('#aufmacherHover').length == 0) {
                $('#col3_content').append('<div id="aufmacherHover" class="hideme"><a href="" class="aufmacherLink" style="display:block;width: inherit;height:inherit">&nbsp;</a></div>');
                $('#aufmacherHover').mouseout(function() {
                    $('#aufmacherHover').hide();
                });
                $('body').hover(function() {
                    $('#aufmacherHover').hide();
                });
            }
            $("#aufmacherHover").css("left", pos.left);
            var href = $(this).find('.ff_link').attr('href');
            if (href.length) {
                $('.aufmacherLink').attr('href', href);
                $("#aufmacherHover").show();
            }
        });
    });
});
