﻿x = 20;
y = 70;
function setVisible(obj) {
    obj = document.getElementById(obj);
    if (obj.style.visibility == 'visible') {
        obj.style.visibility =  'hidden';
    }
    else {
        showdeadcenterdiv(obj);
        obj.style.visibility =  'visible';
    }
}
function placeIt(obj) {
    obj = document.getElementById(obj);
    if (document.documentElement) {
        theLeft = document.documentElement.scrollLeft;
        theTop = document.documentElement.scrollTop;
    }
    else if (document.body) {
        theLeft = document.body.scrollLeft;
        theTop = document.body.scrollTop;
    }
    theLeft += x;
    theTop += y;
    obj.style.left = theLeft + 'px';
    obj.style.top = theTop + 'px';
    setTimeout("placeIt('MessageLayer')", 500);
}
function showdeadcenterdiv(obj) {
    // First, determine how much the visitor has scrolled
    var scrolledX, scrolledY;
    if (self.pageYOffset) {
        scrolledX = self.pageXOffset;
        scrolledY = self.pageYOffset;
    } else if (document.documentElement && document.documentElement.scrollTop) {
        scrolledX = document.documentElement.scrollLeft;
        scrolledY = document.documentElement.scrollTop;
    } else if (document.body) {
        scrolledX = document.body.scrollLeft;
        scrolledY = document.body.scrollTop;
    }
    // Next, determine the coordinates of the center of browser's window
    var centerX, centerY;
    if (self.innerHeight) {
        centerX = self.innerWidth;
        centerY = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        centerX = document.documentElement.clientWidth;
        centerY = document.documentElement.clientHeight;
    } else if (document.body) {
        centerX = document.body.clientWidth;
        centerY = document.body.clientHeight;
    }
    // Xwidth is the width of the div, Yheight is the height of the 
    // div passed as arguments to the function:
    var leftOffset = scrolledX + (centerX - obj.offsetWidth) / 2;
    var topOffset = scrolledY + (centerY - obj.offsetHeight) / 2;
    //Adjust Left slightly for BettingSlip Overlaping
    leftOffset -= 23;
    // The initial width and height of the div can be set in the 
    // style sheet with display:none; divid is passed as an argument to // the function 
    var r = obj.style;
    r.position = 'absolute';
    r.top = topOffset + 'px';
    r.left = leftOffset + 'px';
//    r.display = "block";
}
function popUpIsVisible(obj) {
    obj = document.getElementById(obj);
    if (obj.style.visibility == 'visible')
        return true;
    else
        return false;
}