var objTagOk = null; 

function task_mouseEnter(tag,e) { 
	var execute = false;
	if (window.event)
	{
		if (!tag.contains(event.fromElement)) 
			execute = true;
	}
	else 
		execute = true;

	if(execute)
		tag.className = tag.getAttribute('classOver');
}

function task_mouseLeave(tag,e) { 
	var execute = false;
	if (window.event)
	{
		if (!tag.contains(event.toElement)) 
			execute = true;
	}
	else 
	{
		if (typeof e.relatedTarget != 'undefined' && e.relatedTarget)
		{
			if (!contains(tag, e.relatedTarget))
				execute = true;
		}
	}

	if(execute)
	{
		tag.className = tag.getAttribute('classNone');
		var tagPop = tag.getAttribute('pop');
		if (tagPop != null && tagPop != '')
		{
			var objPop = document.getElementById(tagPop);
			if (objPop != null)
				objPop.style.display = 'none';
		}
	}
}

function task_showinpopup(tag) { 
	dlg_show2(400, 465, tag.getAttribute('href'), false);
	return false;
}

function task_showLocation(tag) {
	objTagOk = tag;
	dlg_show2(400, 465, tag.getAttribute('href'), false);	
	return false;
}
function task_shopopup(tag) {
	var objPop = document.getElementById(tag.getAttribute('pop'));
	if ( objPop != null) 
	{
		var valor = getLeft(objPop);
		objPop.style.left = valor - 1;
		objPop.style.top = getTop(objPop) + tag.offsetHeight + 2;
		objPop.style.display = 'block';
	}
}

function getTop(obj) {
	var r = 0;
	var parent = obj.id;
	while (obj != null) 
	{
		if ((obj.tagName != null) && (obj.tagName != 'TBODY') && (obj.tagName != 'TR'))
			r = r + obj.offsetTop;
		obj = obj.parentNode;
	}

	return r;
}

function getLeft(obj) {
	var r = 0;
	var parent = obj.id;
	while (obj != null) 
	{
		if ((obj.id != parent) && (obj.tagName != null) && (obj.tagName != 'TBODY') && (obj.tagName != 'TR'))
			r = r + obj.offsetLeft;
		obj = obj.parentNode;
	}
	return r;
}

function contains (container, containee) 
{
  while (containee) 
  {
    if (container == containee) 
      return true;
    containee = containee.parentNode;
  }
  return false;
}

function HideToolBar()
{
	var objPop = document.getElementById('tsk_toolbar');
	if (objPop != null) 
	{
        objPop.style.visibility = "hidden";
        objPop.style.height = '0px';
    }
}
function ShowToolBar()
{
	var objPop = document.getElementById('tsk_toolbar');
	if (objPop != null) 
	{
        objPop.style.visibility = "visible";
        objPop.style.height = null;
    }
}