function Outline()
{
	window.event.returnValue=0;	

	//Expand or collapse if a list item is clicked.
	var open = event.srcElement;

	//Verify that the tag which was clicked was either the 
	//trigger tag or nested within a trigger tag.
	var el = checkParent(open,"A");
	if(null != el)
	{
		var elmId=el.id;	
		var incr=1;

		//Get the position of the element which was clicked
		var elemPos = window.event.srcElement.sourceIndex;

		//Determine where the span to be expanded is.  
		for (incr=1; (elemPos+incr) < document.all.length; incr++)
		{	
			//verify we are at an expandable Div tag
			if(document.all(elemPos+incr).id==elmId)
			{
			    if(document.all(elemPos+incr).className == "collapsed")
		        {
		            document.all(elemPos+incr).className = "expanded";
		        }
		        else if(document.all(elemPos+incr).className == "expanded")
	            {
	                document.all(elemPos+incr).className = "collapsed";
	            }
			}
		}
		// collapse all the others
		collapseAll(elmId);
	}
	else
	{
		return;
	}
	event.cancelBubble = true;
}

function collapseAll(idToBeExcluded)
{
	// check navigator: If not IE, do not collapse
//	var ms = navigator.appVersion.indexOf("MSIE");
//	var ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4);
//	if (!ie4)
//	{
//	    return;
//	}
 	//Iterate through all elements  
	for (incr=1; (incr) < document.all.length; incr++)
	{	
		//verify we are at an expandable Div tag
	    if (document.all(incr).id != idToBeExcluded)
	    {
			if(document.all(incr).className=="expanded")
			{
				document.all(incr).className="collapsed";
			}
	    }
	}
}

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;
}

//This function displays content from different source HTML files
function showPopup(filename, theSpan){


	//Get the position of the element which was clicked
	elemPos = window.event.srcElement.sourceIndex;
	theIFRAME.location.replace(filename);
	tempSpan = theSpan;
	window.setTimeout("showPopup2(tempSpan,elemPos)", 800);
	

}

function showPopup2(theSpan, elemPos){
//var elemPos=0;
//Get the position of the element which was clicked
//elemPos = window.event.srcElement.sourceIndex;

	defSpan = document.all(theSpan);
	if (defSpan && document.readyState == "complete" && theIFRAME.document.readyState == "complete"){
        	if (defSpan.style.display == "none"){
			theIFRAME.document.all.tags("H1").item(0).outerHTML="";
			
			if(theIFRAME.document.all.tags("P").item("ExpandAllLine") != null) {theIFRAME.document.all.tags("P").item("ExpandAllLine").outerHTML="";}			
			///defSpan.innerHTML = theIFRAME.document.all.glosdef.innerHTML;
			defSpan.innerHTML = theIFRAME.document.body.innerHTML;
			defSpan.style.display = "";
			defSpan.parentElement.style.display = "";

			document.all(elemPos+1).src="../img/bluedrop.gif";
			document.all(elemPos).src="../img/bluedrop.gif";
		}
    		else{
			defSpan.style.display = "none";
			defSpan.parentElement.style.display = "none";
			document.all(elemPos+1).src="../img/blueup.gif";
			//if(oSource.tagName=="IMG"){open.src="../img/blueup.gif";}
    		}
	}
}

//Swapping images
function MM_swapImgRestore() { //v2.0
  if (document.MM_swapImgData != null)
    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
      document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}

function MM_swapImage() { //v2.0
  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
    objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
      swapArray[j++] = obj;
      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
      obj.src = MM_swapImage.arguments[i+2];
  } }
  document.MM_swapImgData = swapArray; //used for restore
}


function openWindow(url, example) {
  var popupWin;
  if (typeof(popupWin) != "object") 
	popupWin = window.open(url, example, "width=452,height=572,top=0,left=0,alwaysRaised=yes,toolbar=0,directories=0,menubar=0,status=1,resizable=yes,location=0,scrollbars=1,copyhistory=0");
  else {
    if (!popupWin.closed) 
      popupWin.location.href = url;
    else 
	  popupWin = window.open(url, example, "width=452,height=572,top=0,left=0,alwaysRaised=yes,toolbar=0,directories=0,menubar=0,status=1,resizable=yes,location=0,scrollbars=1,copyhistory=0");
 }	  
   
   popupWin.focus();
}
