	if(document.getElementById && document.getElementsByTagName)
	{
		addEvent(window, 'load', init, false);
	}
	
	function init()
	{
		createDisplayBox();
		addListeners();
	}
	
	function createDisplayBox(e)
	{
		displayBox = document.createElement('div');
		displayBox.id = 'displayBox';
		displayBox.className = 'hide';
		p = document.createElement('p');
		text = document.createTextNode('');
		p.appendChild(text);
		displayBox.appendChild(p);
		document.getElementsByTagName('body')[0].appendChild(displayBox);
	}
	
	function addListeners()
	{
		var hotSpots = document.getElementsByTagName('area');

		for (var i=0; i<hotSpots.length; i++)
		{
			addEvent(hotSpots[i], 'mouseover', doMouseOver, false);			
			addEvent(hotSpots[i], 'mouseout', doMouseOut, false);
		}
	}
	
	function doMouseOver(e)
	{	
		if (window.event)
		{
			e = window.event;
			var id = e.srcElement.id;
		}
		else
		{
			var id = e.target.id;
		}

		positionDisplayBox(e);
		setupFacultyMember(id);
	}
	
	function positionDisplayBox(e)
	{
		var displayBox = document.getElementById('displayBox');
		if (displayBox)
		{
			positionAtCursor(e, displayBox);
		}
	}
	
	function setupFacultyMember(id)
	{	
		doRemoteQuery('include/doFacultyQuery.cfm?id=', id);
	}
	
	function doMouseOut(e)
	{
		if (!e) var e = window.event;
		hideFacultyBlurb();
	}
	
	function hideFacultyBlurb()
	{
		var displayBox = document.getElementById('displayBox');
		if (displayBox)
		{
			displayBox.className = 'hide';
		}
	}
	
	/* Called remotely */
	function setFaculty(name, url, id)
	{
		setDisplayBox(name);
		setFacultyLink(url, id);
	}
	
	function setDisplayBox(strToDisplay)
	{
		var displayBox = document.getElementById('displayBox');
		if (!displayBox)
		{
			createDisplayBox();
		}

		if (displayBox)
		{
			displayBox.getElementsByTagName('p')[0].firstChild.nodeValue = strToDisplay;
			displayBox.className = 'show';
		}
	}
	
	function setFacultyLink(url, id)
	{
		var map = document.getElementById(id);
		if (map && url)
		{
			map.setAttribute('href', url);
		}
	}

	function positionAtCursor(e, me)
	{	
		var posX = 0;
		var posY = 0;
		if (e.pageX || e.pageY)
		{
			posX = e.pageX;
			posY = e.pageY;
		}
		else if (e.clientX || e.clientY)
		{
			posX = e.clientX + document.body.scrollLeft;
			posY = e.clientY + document.body.scrollTop;
		}
		
		//Put in some offset
		posX = posX + 16;
		posY = posY + 16;
		
		displayBox.style.left = posX + "px";
		displayBox.style.top = posY + "px";
	}