function windowLinks()
{
    if (!document.getElementsByTagName)
	{
         return;
    }
	
	//document.getElementById("referenceHeader").className = "print";
	//document.getElementById("referenceList").className = "print";
	
    var anchors = document.getElementsByTagName("a");
    for (var i = 0; i < anchors.length; i++)
	{
		var anchor = anchors[i];
		var relIndex = anchor.rel;
		if (relIndex)
		{
			var relSplit = relIndex.split("|");		// Split our REL value into parts 
/* XHTML compliant target attribute */
			if (relSplit[0] == "external") {										// If the REL=external...
				anchor.target = "_blank";			// set it's 'target' attribute to '_blank'
				anchor.className = "external";		// attach a CSS class to it to allow us to style it
				anchor.title = "Load in new window: "+ anchor.href;  // Add a new title attribute to warn the users of a new window
			}
/* XHTML compliant popup attribute */
			else if (relSplit[0] == "popup")
			{										// If the REL=popup...
				var strOptions="";
				
				anchor.className = "popup";			// attach a CSS class to it to allow us to style it
				// anchor.title = "Loads in a Popup Window"; // Add a new title attribute to warn the users of a new window
				anchor.popupWidth = relSplit[1];
				anchor.popupHeight = relSplit[2];
				anchor.onclick = function() {strOptions="resizable=no, height="+this.popupHeight+",width="+this.popupWidth+", scrollbars=yes"; window.open(this.href, '', strOptions); return false;};
			}
			else if (relSplit[0] == "footnote")
			{				
				// Grab the id based on the footnote number
				var referenceID = "id" + relSplit[1];						
				
				// We want to use the same text that is displayed in the footnotes at the bottom of the page
				var referenceText = $(referenceID).innerHTML; 
		
				// Create the footnote div that we will popup on mouseover
				new Insertion.After(
					'container', 
					'<div id="tt_' + referenceID + '" class="footnotePopup">' + referenceText + '</span>'
				);
				
				// Wire up the events that will handle the footnote popup
				anchor.onmouseover = showFootnote;
				anchor.onmouseout = hideFootnote;
			}
		}
	}
}

function showFootnote()
{
	toggleFootnote(true, this);
}

function hideFootnote()
{
	toggleFootnote(false, this);
}

function toggleFootnote(show, element)
{
	var relIndex = element.rel;
	var relSplit = relIndex.split("|");		// Split our REL value into parts 
	var referenceID = "id" + relSplit[1];		//grab the id based on the footnote number
	var d = "none";
	if (show)
		d = "block";	

	footnote = $("tt_" + referenceID);
	footnote.setStyle( { 'display' :d } );

	offset = Position.cumulativeOffset(element);

	footnote.style.left = (offset[0] - 50) + "px";
	footnote.style.top = offset[1] + 40 + "px";
}
