var speed = .2
var fadeDone = true
var d = 1



function ShowMsg() {
    window.scrollTo(0, 0)
    document.getElementById('tblBackground').style.display = "block"
    var lblH = (document.getElementById('msgBody').offsetHeight) / 2;
    document.getElementById('tblBackground').style.width = document.body.clientWidth;
    document.getElementById('tblBackground').style.height = document.body.offsetHeight;
    document.getElementById('msgBody').style.top = (document.body.clientHeight / 2) - lblH;
    document.getElementById('msgBody').style.left = (document.body.clientWidth / 2) - 300;
  
}
function closePreview() {

    var fadeOut = new OpacityTween(document.getElementById('msgBody'),
    Tween.strongEaseIn, 100, 0, speed);
     fadeOut.start();
    fadeOut.onMotionFinished = function () {
        document.getElementById('tblBackground').style.display = "none"
    }
}
