﻿		function SwitchStyle(imgObj, CollapseImagePath, ExpandImagePath)
		{
			if (imgObj.alt=='Expand') 
			{
				//img.td.tr.tbody.table.siblingTable = children table
				getNextSibling(imgObj.parentNode.parentNode.parentNode.parentNode).style.display='';	
				//imgObj.parentNode.parentNode.childnodes.item(1).childnodes.item(0).title = 'Collapse';
				getNextSibling(imgObj.parentNode).childNodes[0].alt = 'Collapse';
				imgObj.alt = 'Collapse';
				//imgObj.src = 'images/arrow_down.gif';
				imgObj.src = CollapseImagePath;
			}
			else
			{
				//img.td.tr.tbody.table.siblingTable = children table
				getNextSibling(imgObj.parentNode.parentNode.parentNode.parentNode).style.display='none';
				getNextSibling(imgObj.parentNode).childNodes[0].alt = 'Expand';
				imgObj.alt = 'Expand';
				//imgObj.src = 'images/arrow_side.gif';
				imgObj.src = ExpandImagePath;	
			}
		}

function SwitchStyleLink(LnkObject)
		{
			if (LnkObject.alt=='Expand') 
			{
				//img.td.tr.tbody.table.siblingTable = children table
				getPrevSibling(LnkObject.parentNode).childNodes[0].alt = 'Collapse';
				getNextSibling(LnkObject.parentNode.parentNode.parentNode.parentNode).style.display='';
				
				getPrevSibling(LnkObject.parentNode).childNodes[0].src = 'images/arrow_down.gif';
				LnkObject.alt = 'Collapse';
				
			}
			else
			{
				getNextSibling(LnkObject.parentNode.parentNode.parentNode.parentNode).style.display='none';
				getPrevSibling(LnkObject.parentNode).childNodes[0].alt = 'Expand';
				LnkObject.alt = 'Expand';
				getPrevSibling(LnkObject.parentNode).childNodes[0].src = 'images/arrow_side.gif';
						
			}
		}
		
function getNextSibling(startBrother)
{
endBrother=startBrother.nextSibling;
while(endBrother.nodeType!=1)
{
endBrother = endBrother.nextSibling;
}
return endBrother;
} 
function getPrevSibling(startBrother)
{
endBrother=startBrother.previousSibling;
while(endBrother.nodeType!=1)
{
endBrother = endBrother.previousSibling;
}
return endBrother;
} 


