// A function to determine whether a specified inside element is a member or subelement of the specified external element.
function elementContains(elmOuter, elmInner)
{
  while (elmInner && elmInner != elmOuter) 		// For each Element specified, AND the element is not equal to the outer element.
  {
    elmInner = elmInner.parentNode;			// Set the element to the parent element.
  }
  if (elmInner == elmOuter)				// Previous while exited, if the current element equals the outside element...
  {
    return true;					// ... it IS a child of the outter element. Return true and exit.
  }
  return false;						// If we have gotten this far it is NOT a child of the outter element.
}

// A function to determine the position, horizontal and vertical, of the specified element.
function getPageXY(elm)
{
  var point = { x: 0, y: 0 };				// Set up an array called point to save an X and Y value.
  while (elm)						// For each element we specify in the loop...
  {
    point.x += elm.offsetLeft;				// X equals the position from the left.
    point.y += elm.offsetTop;				// Y equals the position from the top.
    elm = elm.offsetParent;				// Set the current element to add in the info from the parent element and cycle.
  }
  return point;						// Return the current X and Y value.
}

// A function to set the position, horizontal and vertical, of the specified element.
function setPageXY(elm, x, y)
{
  var parentXY = {x: 0, y: 0 };				// Create an array to save the position of the parent element.

  if (elm.offsetParent)					// If the element is not flush against its parent element...
  {
    parentXY = getPageXY(elm.offsetParent);		// ...Get the position of the element relative to its parent.
  }

  elm.style.left = (x - parentXY.x) + 'px';		// Set the horizontal position of the element via CSS.
  elm.style.top  = (y - parentXY.y) + 'px';		// Set the vertical position of the element via CSS.
}

// Determine if the browser is Internet Explorer and output a separator if so.
function IEPathPrepend()
{
	// Check to see if the browser is Microsoft Internet Explorer
	if(navigator.userAgent.indexOf('MSIE') != '-1')
	{
		document.write("&raquo; ");
	}
}

// Determine if the browser is Internet Explorer and output a bracket if so.
function IELatestPrepend()
{
	// Check to see if the browser is Microsoft Internet Explorer
	if(navigator.userAgent.indexOf('MSIE') != '-1')
	{
		document.write("<font color='orange'>&raquo;</font> ");
	}
}

// Determine if the browser is Internet Explorer and output a bracket if so.
function IEPersonalPrepend()
{
	// Check to see if the browser is Microsoft Internet Explorer
	if(navigator.userAgent.indexOf('MSIE') != '-1')
	{
		document.write("<font color='orange'>&raquo;</font> ");
	}
}
