function initTopLinks() {
	//this function adds event handlers to the top links
	//first get the top links holder
	positionChart = document.getElementById("position_chart");
	//look in top links for hyperlinks
	links = positionChart.getElementsByTagName("a");
	//loop through toplinks and add event handlers
	for(i=0;i<links.length;i++){
		links[i].onmouseover  = showBubble;
		links[i].onmouseout = hideBubble;
	}
	
}

function showBubble() {
	//look in chart_options for the same class name
	var chartOptions; //object that holdes all list items
	var chartOption; //all list items in array
	var theBubble; //individual bubble ojbects
	var targetClass; //used to determine if the call is from a list or a straight anchor
	var jumpBubble; //flag to jump the bubble to the cursor
	
	chartOptions = document.getElementById("chart_options");
	//get all the list items
	chartOption = chartOptions.getElementsByTagName("li");
	//look for the class name
	if(this.className){
		targetClass = this.className;
	} else {
		targetClass = this.parentNode.className;
	}
	
	for(var i=0;i<chartOption.length;i++){
		//check to see if a class is assigned to the current node
		if(chartOption[i].className==targetClass){
			//find the bubble
			theBubble = chartOption[i].getElementsByTagName("span");
			for(var j=0;j<theBubble.length;j++){
				if(theBubble[j].className=="bubble"){
					//found the bubble, show it!
					theBubble[j].style.visibility = "visible";
				}
			}
		}
	}

}

function hideBubble(){
	//just hide all bubbles on the page
	var theBubbles; //reference to all bubble objects
	theBubbles = document.getElementsByTagName("span");
	for(i=0;i<theBubbles.length;i++){
		if(theBubbles[i].className=="bubble"){
			theBubbles[i].style.visibility="hidden";
		}
	}
}

Event.addEvent(window,"load",initTopLinks);
