function eM(e, obj,menu)
{ 
var targ;
if (!e) {var e = window.event;}
if (e.target) {targ = e.target;}
else if (e.srcElement) {targ = e.srcElement;}
if (targ.nodeType == 3) {targ = targ.parentNode;} // defeat Safari bug
if(targ){
if(targ != obj) {
if(targ.parentNode == obj) {targ = targ.parentNode;}
}
if(targ==obj){		
var newx = findPosX(targ);
var newy = findPosY(targ);
document.getElementById('eP').style.top = newy + 'px';
document.getElementById('eP').style.left = newx + 'px';
document.getElementById('eP').style.display = 'block';
document.getElementById('eP').style.visibility = 'visible';
document.getElementById('ePr').href = "javascript:showDialog('" + menu + "');";
}}
}
function showDialog(ok)
{
var obj = document.getElementById(ok);
obj.style.visibility="visible";
obj.style.display="block";
}

function hideDialog(ok){
var obj = document.getElementById(ok);
obj.style.visibility="hidden";
obj.style.display="none";
}

/** *** DRAG AND DROP FUNCTION FOR THE DIALOG *** **/

var adtTrueIDToDragObject;
var adtTrueIDDragOffsetX;
var adtTrueIDDragOffsetY;
var adtTrueIDDragObjectIsDragging = false;

window.onload = adtTrueIDDragInit;
document.onmousemove = adtTrueIDDragDragger;
document.onmouseup = adtTrueIDDragStop;

function adtTrueIDDragInit() {
	var objs = document.getElementsByTagName('DIV');
	
	for (var i in objs) {
		if (objs[i]) {
			var obj = objs[i];
			var ci = obj.className;
			if ((ci) && (ci.match(/(adtTrueIDDragable)/))) {
				obj.ondrag = function() {
					return false;
				};
				obj.onselectstart = function() {
					return false;
				};
				if (obj.currentStyle) {
					if ((!obj.style.left) || (!obj.style.left.match(/^[1-9]{1,1}[0-9]{0,6}(px)$/))) {
						if ((obj.currentStyle.left) && (obj.currentStyle.left.match(/^[1-9]{1,1}[0-9]{0,6}(px)$/))) {
							obj.style.left = obj.currentStyle.left;
						}
						else {
							obj.style.left = '300px';
						}
					}
					if ((!obj.style.top) || (!obj.style.top.match(/^[1-9]{1,1}[0-9]{0,6}(px)$/))) {
						if ((obj.currentStyle.top) && (obj.currentStyle.top.match(/^[1-9]{1,1}[0-9]{0,6}(px)$/))) {
							obj.style.top = obj.currentStyle.top;
						}
						else {
							obj.style.top = '200px';
						}
					}
				}
				else if (window.getComputedStyle(obj, '')) {
					if ((!obj.style.left) || (!obj.style.left.match(/^[1-9]{1,1}[0-9]{0,6}(px)$/))) {
						if ((window.getComputedStyle(obj, '').getPropertyValue('left')) && (window.getComputedStyle(obj, '').getPropertyValue('left').match(/^[1-9]{1,1}[0-9]{0,6}(px)$/)))  {
							obj.style.left = window.getComputedStyle(obj, '').getPropertyValue('left');
						}
						else {
							obj.style.left = '300px';
						}
					}
					if ((!obj.style.top) || (!obj.style.top.match(/^[1-9]{1,1}[0-9]{0,6}(px)$/))) {
						if ((window.getComputedStyle(obj, '').getPropertyValue('top')) && (window.getComputedStyle(obj, '').getPropertyValue('top').match(/^[1-9]{1,1}[0-9]{0,6}(px)$/)))  {
							obj.style.top = window.getComputedStyle(obj, '').getPropertyValue('top');
						}
						else {
							obj.style.top = '200px';
						}
					}
				}
				else {
					obj.style.top = '300px';
					obj.style.left = '200px';
				}
			}
		}
	}
}

function adtTrueIDDragStart(obj, e) {
	if (window.event) {
		e = window.event;
	}
	var dragX = parseInt(obj.style.left);
	var dragY = parseInt(obj.style.top);
	adtTrueIDToDragObject = obj;
	var mouseX = e.clientX;
	var mouseY = e.clientY;
	adtTrueIDDragOffsetX = mouseX - dragX;
	adtTrueIDDragOffsetY = mouseY - dragY;
	adtTrueIDDragObjectIsDragging = true;
	return false;
}

function adtTrueIDDragDragger(e) {
	if (adtTrueIDDragObjectIsDragging) {
		if (window.event) {
			e = window.event;
		}
		var newX = e.clientX - adtTrueIDDragOffsetX;
		var newY = e.clientY - adtTrueIDDragOffsetY;
		adtTrueIDToDragObject.style.left = newX + "px";
		adtTrueIDToDragObject.style.top = newY + "px";
		return false;
	}
	else {
		return;
	}
}

function adtTrueIDDragStop() {
	if (adtTrueIDDragObjectIsDragging) {
		adtTrueIDDragObjectIsDragging = false;
		return false;
	}
	else {
		return;
	}
}

/** *** END OF DRAG AND DROP FUNCTION FOR THE DIALOG *** **/