//This function is used to select and unselect all the check box of the given name.

function toggleDiv(curObj,pObjId,innerText,top,left) 
{
  pObj = document.getElementById(pObjId);
  
  var topPos=TopPos(curObj,top);
  var leftPos=LeftPos(curObj,left);

  
  document.getElementById(pObjId).style.top=topPos+"px";
  document.getElementById(pObjId).style.left=leftPos+"px";
  document.getElementById(pObjId).innerHTML=innerText; 
  document.getElementById(pObjId).style.display = "block";
 }
 
function hideDiv(pObjId)
{
 //  alert(pObjId);
  document.getElementById(pObjId).style.display="none"; 
   document.getElementById(pObjId).style.top="0px";
  document.getElementById(pObjId).style.left="0px";
  
}

function TopPos(obj, pos)
{
	var topCoord = 0;
	while(obj)
	{
		topCoord += obj.offsetTop;
		obj = obj.offsetParent;
	}
	
   return topCoord + pos;
}

function LeftPos(obj, pos)
{
    var leftCoord = 0;
	while(obj)
	{
	   leftCoord += obj.offsetLeft;
	   obj = obj.offsetParent;
	}
  return leftCoord + pos;
}


