
function tooltipShow(tipType, tipName, imgWidth, imgHeight, tipStyle, e) {
	/*
	tipType = head
	tipName = adria_2001 / none
	tipStyle = more / nomore 
	*/
	e = (e || window.event); //for IE 
	eTarget = (e.target || e.srcElement); //srcelement is for IE
	eTarget.id = "tooltip-on"; //turn it on so tooltip can be absolutely positioned 

	//get cursor position cross-browser compatible google thing
	var cursor = {x:0, y:0};
	if (e.pageX || e.pageY) {
		//not IE
		cursor.x = e.pageX;
		cursor.y = e.pageY;
	} 
	else {
		//IE
		cursor.x = e.clientX + 
		(document.documentElement.scrollLeft || 
		document.body.scrollLeft) - 
		document.documentElement.clientLeft;
		cursor.y = e.clientY + 
		(document.documentElement.scrollTop || 
		document.body.scrollTop) - 
		document.documentElement.clientTop;
	}

	tooltipContent = document.createElement('span');
		tooltipContent.id = "tooltip-content";
		tooltipContent.innerHTML  = '<img src="glossary/head/img/' + tipName + '_t150.jpg" id="tooltip-image" height="' + imgHeight + '" width="' + imgWidth + '" />';
	tooltip = document.createElement('span');
		tooltip.id = "tooltip";
		tooltipContent.style.width = imgWidth + "px";
		tooltip.appendChild(tooltipContent);
		tooltip.style.left = cursor.x + 10 + "px";
		tooltip.style.top = cursor.y - 100 + "px";
	document.body.appendChild(tooltip);
		if(tipStyle == "more") {
			tooltipContent.innerHTML += '<span class="tooltip-content">Click to read about this head</span>';
		}
		else {
			document.getElementById('tooltip-image').style.marginBottom = "8px";
		}
//	alert(tooltipContent.innerHTML);
}
function tooltipHide(e) {
	if (!e) var e = window.event; 
	eTarget = (e.target || e.srcElement); //srcelement is for IE
	eTarget.removeAttribute('id');
	tooltip = document.getElementById('tooltip');
//	eTarget.removeChild(tooltip);
	document.body.removeChild(tooltip);
}

function glossaryPopup(glossaryType,glossaryName) {
//	alert("Popup");
	var url='glossary.php?type=' + glossaryType + '&name=' + glossaryName;
	var name="glossary_popup";
	var settings="scrollbars,resizable,width=" + 500 + ",height=" + 500;
	glossaryWindow = MyNewWindow=window.open(url,name,settings);
	glossaryWindow.focus();
}


function test() {alert('test')};