var IsIE = 0, IsOpera = 0, IsFF = 0;
var BeforeId = "", IsOpen = 0;
var MX = 0, MY = 0, NX = 0, NY = 0, SX = 0, 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) {
		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(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;
}

