﻿function highlight(t)
{
    o = document.getElementById(t)
    o.className="toplinkhover";
}

function highlightoff(t)
{
    o = document.getElementById(t)
    o.className="toplink";
}


function getAbsoluteLeft(objectId) {
	// Get an object left position from the upper left viewport corner
	// Tested with relative and nested objects
	o = document.getElementById(objectId)
	oLeft = o.offsetLeft            // Get left position from the parent object
	while(o.offsetParent!=null) {   // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent    // Get parent object reference
		oLeft += oParent.offsetLeft // Add parent left position
		o = oParent
	}
	// Return left postion
	return oLeft
}

function getAbsoluteTop(objectId) {
	// Get an object top position from the upper left viewport corner
	// Tested with relative and nested objects
	o = document.getElementById(objectId)
	oTop = o.offsetTop            // Get top position from the parent object
	while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent  // Get parent object reference
		oTop += oParent.offsetTop // Add parent top position
		o = oParent
	}
	// Return top position
	return oTop
}

function ShowPrMenu()
{
    td=document.getElementById("ux_ptd");
    m=document.getElementById("ux_pmenu");
    m.style.top = (parseInt(getAbsoluteTop("ux_ptd"))+35) + 'px';
    m.style.left = (parseInt(getAbsoluteLeft("ux_ptd"))-1) + 'px';
    m.style.display="block";
    highlight("ux_ptd");
}

function ux_menu_h(o,m)
{
    if(m==1)
        o.className="menulinkshover";
    else
        o.className="menulinks";
}

function HidePrMenu()
{
    m=document.getElementById("ux_pmenu");
    m.style.display="none";
    highlightoff('ux_ptd');
}