
function toggleDisplay (id,state,total)
{
  if (total != 0)
  {
    toggleProfiles (total,id);
  }
  if (state=='on')
  {  
    document.getElementById(id).style.display='block';
  }
  else
  {
    document.getElementById(id).style.display='none';
  }
}

function toggleProfiles (total,id)
{
  var theElement='';
  var prefix = id.substring(0,3);
  if (prefix=='pro')
  {
    prefix = 'profile';
  }
  else
  {
     prefix = 'director';
  }
  for (i=1;i<=total;i++)
  {
    theElement = prefix + i;
    document.getElementById(theElement).style.display='none';
  }

}

function toggleMenu (id)
{
  if (document.getElementById(id).style.color=='#990000')
  {
    document.getElementById(id).style.cursor="hand";
    document.getElementById(id).style.color='#808080';
  }
  else
  {
    document.getElementById(id).style.color='#990000';
  }
  //document.getElementById(id).style.textDecoration='none';
}

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;
}



