var background = function() {
    var win = $(window),
        isIE8 = $("#isIE8").length > 0,
        isIE9 = $("#isIE9").length > 0;

    if (isIE8 || isIE9) {
        var bgImg = $("<img src=\"/module.php/lifestyle/worldwide/images/bgIE8.jpg\" />");
        $("#bg").append(bgImg);
        $(".header-logo").attr("src", "/module.php/lifestyle/worldwide/images/logoIE8.png");

        win.resize(function() {
            var win_w = win.width(),
                win_h = win.height();
            if ((win_w / win_h) < (bgImg.width() / bgImg.height())) {
                bgImg.css({height: '100%', width: 'auto'});
            } else {
                bgImg.css({width: '100%', height: 'auto'});
            }
        }).resize();
    }

};

module.exports = background;