(function() {

var FX = {
        easing: {
            linear: function(progress) {
                return progress;
            },
            quadratic: function(progress) {
                return Math.pow(progress, 2);
            },
            swing: function(progress) {
                return 0.5 - Math.cos(progress * Math.PI) / 2;
            },
            circ: function(progress) {
                return 1 - Math.sin(Math.acos(progress));
            },
            back: function(progress, x) {
                return Math.pow(progress, 2) * ((x + 1) * progress - x);
            },
            bounce: function(progress) {
                for (var a = 0, b = 1, result; 1; a += b, b /= 2) {
                    if (progress >= (7 - 4 * a) / 11) {
                        return -Math.pow((11 - 6 * a - 11 * progress) / 4, 2) + Math.pow(b, 2);
                    }
                }
            },
            elastic: function(progress, x) {
                return Math.pow(2, 10 * (progress - 1)) * Math.cos(20 * Math.PI * x / 3 * progress);
            }
        },
        animate: function(options) {
            var start = new Date;
            var id = setInterval(function() {
                var timePassed = new Date - start;
                var progress = timePassed / options.duration;
                if (progress > 1) {
                    progress = 1;
                }
                options.progress = progress;
                var delta = options.delta(progress);
                options.step(delta);
                if (progress == 1) {
                    clearInterval(id);
                    options.complete();
                }
            }, options.delay || 10);
        },
        fadeOut: function(element, options) {
            var to = 1;
            this.animate({
                duration: options.duration,
                delta: function(progress) {
                    progress = this.progress;
                    return FX.easing.swing(progress);
                },
                complete: options.complete,
                step: function(delta) {
                    element.style.opacity = to - delta;
                }
            });
        },
        fadeIn: function(element, options) {
            var to = 0;
            this.animate({
                duration: options.duration,
                delta: function(progress) {
                    progress = this.progress;
                    return FX.easing.swing(progress);
                },
                complete: options.complete,
                step: function(delta) {
                    element.style.opacity = to + delta;
                }
            });
        }
    };
    window.FX = FX;

function getCookie(cname) {
    var name = cname + "=";
    var decodedCookie = decodeURIComponent(document.cookie);
    var ca = decodedCookie.split(';');
    for(var i = 0; i <ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') {
            c = c.substring(1);
        }
        if (c.indexOf(name) == 0) {
            return c.substring(name.length, c.length);
        }
    }
    return "";
}


var p = document.createElement("div");

p.innerHTML = '<div style="left: 0px; position: fixed; text-align: left; bottom: 50px; z-index: 10000; background: #FFFFFF; padding: 20px 15px 20px 15px; border-radius: 0px 10px 10px 0px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);font-family:Trebuchet MS;line-height:14px;max-width:200px;opacity:0" id="koelnmesse_widget"><a href="javascript:void(0)" id="btn_close" style="float:right;text-decoration:none;font-weight:bold;background:#ef636d;color:#FFFFFF;padding:1px 4px 0px 4px;font-size:10px;margin:-10px -5px 0px 0px;z-index:10000;border-radius: 4px;">X</a><a href="https://telegra.ph/Facebook-Agency-Ad-Account-05-27-21" target="_blank" style="color:#575656;text-decoration:none;" id="eisenwarenmesse-banner-link"><img src="https://messe.support/widget/eisenwarenmesse/logo_en.gif" border="0" style="width:150px" /><p style="font-weight:bold;font-size:14px;padding:25px 0px 3px 0px;margin:0px;">Visit us!</p><p style="margin:0px;padding:0px;font-size:14px;">Hall 10.2, Stand E048</p></a></div>';
var koelnmesse_widget_close = getCookie("koelnmesse_widget_close");

if (koelnmesse_widget_close == "") {
	
setTimeout(
    function() {
     
     document.body.insertBefore(p, document.body.firstChild);

     FX.fadeIn(document.getElementById('koelnmesse_widget'), {
        duration: 500,
        complete: function() {

        document.getElementById('btn_close').onclick=function(){

        document.cookie = "koelnmesse_widget_close=1";

			     FX.fadeOut(document.getElementById('koelnmesse_widget'), {
			        duration: 500,
			        complete: function() {
			            
			        }
			    });
   		 }
            
        }
    });

    }, 5000);

}


})();