function enableHover(id) {
	var links;
	if (!document.getElementById || !document.getElementsByTagName) { return; }
	if (id == null) {
		links=document.getElementsByTagName("a");
	} else { 
		links=document.getElementById(id).getElementsByTagName("a");
	}
	for (i=0; i<links.length; i++) {		
		prepare(links[i]);
	}
}

function prepare(el) {
	//key = getKey(el.id);
	key = el.id
	key = key.replace("Team","")
	key = key.replace("Link","")
	if (key != null) {
		el.onmouseover = showTooltip;
		el.onmouseout = hideTooltip;
		el.onmousemove = locate;
		el.key = key;
		// pull the element out of the document flow and append it to the
		// body to get around any positioning problems.
		iel = document.getElementById("Team"+key+"Info");
		iel.parentNode.removeChild(iel);
		document.getElementsByTagName("body")[0].appendChild(iel);
		iel.style.position = 'absolute';
	}
}

function getKey(id) {
	id_regex = /\d+/
	match = id_regex.exec(id)
	if (match != null) {
		return match[0];
	} else {
		return null;
	}
}

function showTooltip(e) {
	document.getElementById("Team"+this.key+"Info").style.display = 'block';
	locate(e);
}

function hideTooltip(e) {
	document.getElementById("Team"+this.key+"Info").style.display = 'none';
}

function locate(e) {
	var posx=0,posy=0;
	if (e == null) {
		e = window.event;
	}
	if (e.target) {
		el = e.target;
	} else if (e.srcElement) {
		el = e.srcElement;
		if (el.nodeType == 3) {
			el = el.parentNode;
		}
	}
	if (e.pageX || e.pageY) {
		posx=e.pageX; posy=e.pageY;
	} else if (e.clientX || e.clientY) {
	    if (document.documentElement.scrollTop) {
	        posx = e.clientX+document.documentElement.scrollLeft;
	        posy = e.clientY+document.documentElement.scrollTop;
		} else {
	        posx = e.clientX+document.body.scrollLeft;
	        posy = e.clientY+document.body.scrollTop;
		}
	}
	document.getElementById("Team"+el.key+"Info").style.top=(posy+10)+"px";
	document.getElementById("Team"+el.key+"Info").style.left=(posx-20)+"px";
	document.getElementById("Team"+el.key+"Info").style.background= '#fff';
	document.getElementById("Team"+el.key+"Info").style.padding= '5px';
	document.getElementById("Team"+el.key+"Info").style.border= '1px solid #666';


}