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(" + newx + "," + newy + ",'" + menu + "');";
        }
    }
}

function showDialog(ok) {
    var obj = document.getElementById(ok);
    obj.style.visibility = "visible";
    obj.style.display = "block";
}

function showDialog(x, y, ok) {
    var obj = document.getElementById(ok);
    obj.style.left = x + "px";
    obj.style.top = y + "px";
    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 *** **/var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
var gaJsHost1 = "http://static.";
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
document.write(unescape("%3Cscript src='" + gaJsHost1 + "getclicky.com/js' type='text/javascript'%3E%3C/script%3E"));//toppane script
function adtKeepalive()
{
 obj = document.getElementById('keepalive');
 if(obj)
 {
   var newDate = new Date;
   x = newDate.getTime(); 
   //x = (Math.random() * 1000);
   obj.src ='KeepAlive.aspx?' + x.toString();
   setTimeout("adtKeepalive()",180000);
 }
}initTinyMCE();