//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function hoverOn(obj)
{
  if ( obj==null )
  {
    return;
  }
  
  obj.style.textDecoration = 'underline';
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function hoverOff(obj)
{
  if ( obj==null )
  {
    return;
  }
  
  obj.style.textDecoration = 'none';
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function changeMenuItemImg(obj, imgSrc)
{
  var img = obj.childNodes.item(0).childNodes.item(0);
  
  if ( img==null || img.tagName=='img' )
  {
    return;
  }
  
  img.src = imgSrc;
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function changeMenuItemLink(obj, className)
{
  if ( obj==null || obj.tagName!='DIV' )
  {
    return;
  }
  
  obj.className = className;
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function setMenuVisibility(obj, visibType)
{
  var menuobj = document.getElementById('popup_'+obj.id);

  if ( menuobj==null )
  {
    return;
  }
  
  if ( menuobj.childNodes.length==0 )
  {
    menuobj.style.visibility = 'hidden';
    return;
  }
  
  menuobj.style.visibility = visibType;
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function setMenuPosition(obj)
{
  var menuobj = document.getElementById('popup_'+obj.id);

  if ( menuobj==null )
  {
    return;
  }

  menuobj.style.left = findPosX(obj)+'px';
  menuobj.style.top = findPosY(obj)+obj.offsetHeight+'px';
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function findPosX(obj)
{
	var curleft = 0;
	
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
	{
		curleft += obj.x;
	}
	
	return curleft;
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function findPosY(obj)
{
	var curtop = 0;
	
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
	{
		curtop += obj.y;
	}
		
	return curtop;
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function mouseOverMenu(obj)
{
  if ( obj==null )
  {
    return;
  }
  
  //changeMenuItemImg(obj, './fileadmin/templates/img/menu_pict_on_small.png');
  changeMenuItemLink(obj, obj.className+' menu_item_selected');
  
  setMenuPosition(obj);
  //setMenuVisibility(obj, 'visible');
  
  var objCh = document.getElementById('popup_'+obj.id);
  
  if ( objCh==null )
  {
    return;
  }
  
  objCh.style.zIndex=0;
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function mouseOutMenu(obj, immed)
{
  if ( obj==null )
  {
    return;
  }
  
  var objCh = document.getElementById('popup_'+obj.id);
  
  if ( objCh==null )
  {
    return;
  }
  
  objCh.style.zIndex=97;
  setTimeout("hideMenuOnTimeout('"+obj.id+"')", 200);
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function hideMenuOnTimeout(id)
{
  var obj = document.getElementById('popup_'+id);

  if ( obj==null )
  {
    return;
  }
  
  if ( obj.style.zIndex!=97 )
  {
    return;
  }
  
  obj.style.visibility = 'hidden';
  
  var objP = document.getElementById(id);
  
  if ( objP==null )
  {
    return;
  }
  
  //changeMenuItemImg(objP, './fileadmin/templates/img/menu_pict_off_small.png');
  
  if ( objP.className.indexOf('menu_item_visited')>=0 )
  {
    changeMenuItemLink(objP, 'menu_item_visited');
  }
  else
  {
    changeMenuItemLink(objP, 'menu_item');
  }
  
  obj.className
  
  
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function popupMenuOver(obj)
{
  if ( obj==null )
  {
    return;
  }
  
  var idm = obj.id;
  idm = idm.substring(6);
  var objP = document.getElementById(idm);
  
  if ( objP==null )
  {
    return;
  }
  
  //changeMenuItemImg(objP, './fileadmin/templates/img/menu_pict_on_small.png');
  changeMenuItemLink(objP, obj.className+' menu_item_selected');
  
  obj.style.zIndex=0;
  obj.style.visibility = 'visible';
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function popupMenuOut(obj)
{
  var idm = obj.id;
  idm = idm.substring(6);
  var objP = document.getElementById(idm);
  
  if ( objP==null )
  {
    return;
  }
  
  //changeMenuItemImg(objP, './fileadmin/templates/img/menu_pict_off_small.png');
  changeMenuItemLink(objP, 'menu_item');
  
  if ( obj==null )
  {
    return;
  }
  
  obj.style.visibility = 'hidden';
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function popupMenuItemOver(obj)
{
  if ( obj==null )
  {
    return;
  }
  
  obj.style.color = '#e2003b';
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
function popupMenuMenuOut(obj)
{
  if ( obj==null )
  {
    return;
  }
  
  obj.style.color = '#000000';
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------

