function ExpandAll()
{
	var iSpan
	var iSpanSource
	var oSpan
	var sCaption
	var sAction
	var sImage
	
	sCaption=document.all("ExpandAll").innerHTML;
	if (sCaption==L_EXPAND_TEXT)
		{
		sAction="expanded";
		sImage=L_IMAGES_FOLDER+"/bluedrop.gif"
		document.all("picHeader").src=L_IMAGES_FOLDER+"/collapsetri.gif";
		document.all("ExpandAll").innerHTML=L_COLLAPSE_TEXT;
		}
	else
		{
		sAction="collapsed";
		sImage=L_IMAGES_FOLDER+"/blueup.gif"
		document.all("picHeader").src=L_IMAGES_FOLDER+"/expandtri.gif";
		document.all("ExpandAll").innerHTML=L_EXPAND_TEXT;
		}
	for (iSpan=0; iSpan < document.all.tags("DIV").length; iSpan++)
		{	
			oSpan=document.all.tags("DIV").item(iSpan);
			iSpanSource=oSpan.sourceIndex;
			if (oSpan.id=="ExpCol")
			{
				document.all.tags("DIV").item(iSpan).className=sAction;
				if(document.all(iSpanSource-1).tagName=="IMG" && document.all(iSpanSource-2).tagName!="IMG")
				{
					document.all(iSpanSource-1).src=sImage;
				}
				else if(document.all(iSpanSource-2).tagName=="IMG")
				{
					document.all(iSpanSource-2).src=sImage
				}
				 
			}
			if (document.all(iSpanSource-1).tagName=="Q")
			{
				document.all(iSpanSource-2).src=sImage;
			}
		}
	document.all("ExpandAll").className="DropDown";

	var cLinks = document.all.tags("A");
	var iNumLinks = cLinks.length;

  	for (var i=0;i<iNumLinks;i++)
  	{
		cLink=document.all.tags("A").item(i);
		switch (sAction)
		{
			case 'expanded':
				if (cLink.className=="glossary" && cLink.getAttribute("State")!="On")
				{
					cLinks[i].click();
				}
				else if (cLink.className=="HidePopUp")
				{
					cLinks[i].click();
				}
				break;
			case 'collapsed':
				if (cLink.className=="glossary" && cLink.getAttribute("State")=="On")
				{
					cLinks[i].click();
				}
				else if (cLink.className=="HidePopUp")
				{
					cLinks[i].click();
				}
				break;
		}
  	}
}

function Outline2()
{
	window.event.returnValue=0	
	var open = event.srcElement;
	var el = checkParent(open,"A");
	if(null != el)
	{	
		var incr=0;
		var elmPos = 0;
		var parentSpan;
		var fBreak
		elemPos = window.event.srcElement.sourceIndex;
		for (parentSpan = window.event.srcElement.parentElement;
			parentSpan!=null;
			parentSpan = parentSpan.parentElement) 
		{
		    if (parentSpan.tagName=="DIV") 
			{
				incr=1;
				break;
			}
			if (parentSpan.tagName=="BODY" || parentSpan.tagName=="UL" || parentSpan.tagName=="OL"|| parentSpan.tagName=="P") 
			{
				for (incr=1; (elemPos+incr) < document.all.length; incr++)
				{	
					if(document.all(elemPos+incr).tagName=="DIV" && 
					(document.all(elemPos+incr).className=="expanded" ||
					 document.all(elemPos+incr).className=="collapsed"))
					{
						fBreak=1;
						break;
					}
					else if(document.all(elemPos+incr).tagName=="LI")
					{
						return;
					}
				}
			}
			if(fBreak==1)
			{
				break;
			}
		}
	}
	else
	{
		return;
	}
	if(document.all(elemPos+incr).className=="collapsed")
	{
		document.all(elemPos+incr).className="expanded"
		document.all(elemPos+1).src=L_IMAGES_FOLDER+"/bluedrop.gif";
		if(open.tagName=="IMG"){open.src=L_IMAGES_FOLDER+"/bluedrop.gif";}
		if(open.tagName=="B")
			{
			if(open.parentElement.all.tags("IMG").length != 0)
				{open.parentElement.all.tags("IMG").item(0).src=L_IMAGES_FOLDER+"/bluedrop.gif";}
			}
	}
	else if(document.all(elemPos+incr).className=="expanded")
	{
		document.all(elemPos+incr).className="collapsed"
		document.all(elemPos+1).src=L_IMAGES_FOLDER+"/blueup.gif";
		if(open.tagName=="IMG"){open.src=L_IMAGES_FOLDER+"/blueup.gif";}
		if(open.tagName=="B")
			{
			if(open.parentElement.all.tags("IMG").length != 0)
				{open.parentElement.all.tags("IMG").item(0).src=L_IMAGES_FOLDER+"/blueup.gif";}
			}
	}
	else
	{
		return;
	}
	event.cancelBubble = true;
}


function checkParent(src,dest)
{
	//Search for a specific parent of the current element.
	while(src !=null)
	{
		if(src.tagName == dest)
		{
			return src;
		}
		src = src.parentElement;
	}
	return null;
}