activeMenu = null;
timerId = 0;

function changeClass(obj, new_class)
{
    obj.className = new_class;
}

function changeBgColor(obj, new_color)
{
	obj.style.backgroundColor=new_color;
}

function changePic(name, pic)
{
	name.src = pic;
}

function colorizeTableCell(elem)
{
	elem.style.backgroundColor = '#FFFFE0';
	elem.style.cursor = 'hand';
}

function decolorizeTableCell(elem)
{
	elem.style.backgroundColor = '';
	elem.style.cursor = 'hand';
}

function followTdHyperLink(hyperlink)
{
	document.location.href=hyperlink;
}



function showMenu(id, event) 
{
    if (!document.getElementById) {
        return;
    }
    clearTimeout(timerId);
    if (activeMenu == id) {
	    return;
    }      
    if (activeMenu != null) {
        hideMenu();
    }
	leftImg = getXYcoord('left_' + id);
    activeMenu = id;
    document.getElementById(id).style.top = 193;
    document.getElementById(id).style.left = leftImg.x;
	document.getElementById(activeMenu).style.visibility = "visible";
}


function getXYcoord ( nvn )
{
   var elm = document.images[nvn];
   if ( document.layers ) return elm;

   var rd = { x:0 ,y:0};
   do { rd.x += parseInt( elm.offsetLeft );
        rd.y += parseInt( elm.offsetTop );
        elm = elm.offsetParent;
   } while ( elm );   
   return rd;
} 


function hideMenu()
{
    if (!document.getElementById) {
        return;
    }
    if (activeMenu == null) {
        return;
    }
    document.getElementById(activeMenu).style.visibility = "hidden";
    activeMenu = null;
    return;
}


function changeClass(obj, new_class)
{
    obj.className = new_class;
}
