var IsIE = 0;
var IsOpera = 0;
var IsFF = 0;
var BeforeId = "";
var IsOpen = 0;
var MX = 0;
var MY = 0;
var NX = 0; 
var NY = 0; 
var SX = 0; 
var SY = 0;
/* browser check */
if(window.opera) {
    if(document.getElementById) IsOpera = true;
} else if(document.all) { 
    IsIE = true;
} else if(document.getElementById) { 
    IsFF = true;
}
/* Open Popup */
function OnLink(_Id, _mX,_mY,_nX,_nY,_sX,_sY){
    if(BeforeId == _Id) {
        if(IsOpen == 1) {
            return;
        }
    } else {
        if(IsOpen == 1) { 
            OffLink(BeforeId);
        }
        MX = _mX;
        MY = _mY;
        NX = _nX;
        NY = _nY;
        SX = _sX;
        SY = _sY;
    }
    document.getElementById(_Id).style.display = "block";
    document.getElementById(_Id).style.visibility = "visible";
    if(IsIE) {
        if (typeof document.documentElement.style.msInterpolationMode != "undefined"){
            pX = document.documentElement.scrollLeft;
            pY = document.documentElement.scrollTop;
        }else{
            pX = document.body.scrollLeft;
            pY = document.body.scrollTop;
        }
        document.getElementById(_Id).style.left = pX + MX +  SX + "px";
        document.getElementById(_Id).style.top = pY + MY + SY + "px";
        document.getElementById(_Id).style.position = "absolute"; 
    } else if(IsOpera) {
        pX = document.body.scrollLeft;
        pY = document.body.scrollTop;
        document.getElementById(_Id).style.left = MX + SX;
        document.getElementById(_Id).style.top = MY + SY;
        document.getElementById(_Id).style.position = "absolute";
    } else if(IsFF) {
        document.getElementById(_Id).style.left = NX + SX + "px";
        document.getElementById(_Id).style.top = NY + SY + "px";
        document.getElementById(_Id).style.position = "absolute";
    }
    BeforeId = _Id;
    IsOpen = 1;
}
/* Open Popup for not close*/
function OnLink2(_Id) {
    document.getElementById(_Id).style.display = "block";
    IsOpen = 1;
}
/* Close Popup */
function OffLink(_Id){
    document.getElementById(_Id).style.display = "none";
    IsOpen = 0;
}
