/* Tree View Grid Properties & Functions */	var plusImage = "images/arrow_Nav_rt.gif";	var minusImage = "images/arrow_Nav_dwn.gif";	var imageTagPrefix = "img";	var nodeSeparator = ".";	var n = 1;/*	Function to collapse a Node	Function will be called Recursively till the Last Child of the Node*/	function Collapse(Node)	{			/* Get n'th child of Node <n starts from 1 till the last child>*/		objChildNode = document.getElementById(Node + nodeSeparator + n);				/* Get image object of Node */		objImg	= document.getElementById(imageTagPrefix + nodeSeparator + Node);				/* Check if Child exists. If does not exist then Reset n = 1 & exit function & */		if(objChildNode != null)		{				/* Toggle the Child Status i.e. if visible then make it invisible & vis-versa */			if (objChildNode.style.display == "")			{					/* Close all the Childs, Sub-Childs and so on of the Node*/				if (objImg != null)objImg.src = plusImage;				closeAllChilds(Node)				return;			}else 			{					objChildNode.style.display = "";				if (objImg != null)objImg.src = minusImage;			}			/* Call Collapse for the Next Child be increamenting n*/			n = n + 1;			Collapse(Node);		}else n = 1;	}	/*if p_direction = 0 then Close else Open*/	function ExplicitCollapse(Node,p_direction)	{			objChildNode = document.getElementById(Node + nodeSeparator + n);				objImg	= document.getElementById(imageTagPrefix + nodeSeparator + Node);				if(objChildNode != null)		{				if (p_direction == "0")			{					objChildNode.style.display = "none";				if (objImg != null)objImg.src = plusImage;				if(!closeAllChilds(objChildNode.id)) return false;			}else 			{					objChildNode.style.display = "";				if (objImg != null)objImg.src = minusImage;			}			n = n + 1;			ExplicitCollapse(Node,p_direction);		}else n = 1;	}/*	Function to close all the childs of a Node	As Each Child Node ID contains its Parent Node ID, Close all the rows having the Node ID as a prefix in their IDs.*/	function closeAllChilds(nNode)	{	var tempNode,objTempNode,objNode,tempImg,objBody;		objNode= document.getElementById(nNode);		/* Get the Parent Element of Node ie. the Table Object */		objTable = objNode.parentElement;		var tagNm = objTable.tagName;		/* Get the Parent Element is not a Table then exit function */		if(tagNm.toUpperCase() == "TBODY")		{				/* For each TR of the Table*/			for(i=0;i<objTable.rows.length;i++)			{					/* Get the ID of the TR i.e. Node ID */				tempNode = objTable.rows[i].id;								/* If the ID of the TR contains nNode then make the TR invisible*/				if (tempNode != nNode)				{	if(tempNode.indexOf(nNode) >= 0)					{	objTempNode	= document.getElementById(tempNode);						tempImg		= document.getElementById(imageTagPrefix + nodeSeparator + tempNode);						if (tempImg != null)tempImg.src = plusImage;						objTempNode.style.display = "none";					}				}			}		}else		{	alert("Table Tag not found");			return false;		}		return true;	}/*	Function to keep a Node open onLoad	This function also opens up the corresponding Parent Nodes of that perticular Node*/	function OpenNode(strNode,p_direction)	{	var objNode;		var arrNode = strNode.split(nodeSeparator);		var str = "";		for(i=0;i<arrNode.length;i++){			if(str == "")			{  str = arrNode[i];			}else			{			   str = str + nodeSeparator + arrNode[i];			}			objNode = document.getElementById(str);			if (objNode != null)			{				if (p_direction == "1")				{					ExplicitCollapse(str,p_direction);				}else				{					Collapse(str);				}			}			 		}	}