// JavaScript Document
var container_div = document.createElement('div');

/*
LeftNavFollowingLink(LinkName, LinkLocation, AppearAfter)
Call this function if you want to have a link on the left hand navigation that follows page scroll.
- NOTE: Call this function only after the #contentarea div is closed.

LinkName: Name of the link.
LinkLocation: Location of the link.
AppearAfter: Enter the number of pixels for the link to appear in the page.

Ex.: LeftNavFollowingLink('Top of the list','#list_top',900);
<a href="#list_top">Top of the list</a> will appear when user scrolls 900 pixels down.
*/
function LeftNavFollowingLink(LinkName, LinkLocation, AppearAfter){
	var content_area = document.getElementById("contentarea");
	
	var newlink = document.createElement('a');
	newlink.setAttribute('href', LinkLocation);
	newlink.innerHTML = LinkName;
	container_div.appendChild(newlink);
	
	container_div.className = 'LeftNavFollowingLink';

	content_area.parentNode.insertBefore(container_div,content_area.nextSibling);
	
	setInterval("positionit("+AppearAfter+")",50);
}

function positionit(AppearAfter){
	//define reference to the body object in IE
	var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body;
	//define universal dsoc left point
	var dsocleft=document.all? iebody.scrollLeft : pageXOffset;
	//define universal dsoc top point
	var dsoctop=document.all? iebody.scrollTop : pageYOffset;

	if ((document.all||document.getElementById) && (dsoctop > AppearAfter)){
		container_div.style.visibility="visible";
		//container_div.style.left=parseInt(dsocleft)+0+"px"; // Set the left
		container_div.style.top=dsoctop+0+"px"; // Set the top
	}
	else{
		container_div.style.visibility="hidden";
	}
}
