//Code for glossary and external link popups
var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){
    if (!e){
        var e = window.event;
    }
    cX = e.clientX; cY = e.clientY;
}

if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }

function AssignPosition(d) {

    if(self.pageYOffset) {
        rX = self.pageXOffset;
        rY = self.pageYOffset;
    }
    else if(document.documentElement && document.documentElement.scrollTop) {
        rX = document.documentElement.scrollLeft;
        rY = document.documentElement.scrollTop;
    }
    else if(document.body) {
        rX = document.body.scrollLeft;
        rY = document.body.scrollTop;
    }
    if(document.all) {
cX += rX;
cY = cY+rY+10;
    }
    d.style.left = (cX-155) + "px";
    d.style.top = (cY+15) + "px";
}

function toggleDiv(id,flagit) {
    if (flagit=="1"){
        if (document.layers){
            document.layers[''+id+''].visibility = "show";document.layers[''+id+''].display="block";AssignPosition(document.layers[''+id+'']);
        }else if (document.all){
            document.all[''+id+''].style.visibility = "visible";document.all[''+id+''].style.display="block";AssignPosition(document.all[''+id+'']);
        }else if (document.getElementById){
            document.getElementById(''+id+'').style.visibility = "visible";document.getElementById(''+id+'').style.display="block";AssignPosition(document.getElementById(''+id+''));
        }
    }else{
        if (flagit=="0"){
            if (document.layers){
                document.layers[''+id+''].visibility = "hide";document.layers[''+id+''].display="none";
            }else if (document.all){
                document.all[''+id+''].style.visibility = "hidden";document.all[''+id+''].style.display="none";
            }else if (document.getElementById){
                document.getElementById(''+id+'').style.visibility = "hidden";document.getElementById(''+id+'').style.display="none";
            }
        }
    }
}
