// How the portfolio homepage works!

function defineEvents() {
	check = document.getElementById('check');
	var theareas = 	document.getElementsByTagName('area');
	for (i=0;i<theareas.length;i++) {
		thislink = theareas[i].id;
		theareas[i].onmouseover = moveCheck;
		theareas[i].onmouseout = function() {check.style.display = 'none';}
	}
}


function moveCheck() {
	//finds the second value in the coords list of the image map area (the y value of top left corner)
	startchar = this.getAttribute('coords').indexOf(',')+1;
	endchar = this.getAttribute('coords').indexOf(',',startchar);
	yval = this.getAttribute('coords').slice(startchar,endchar);
	//moves the top of the check to that vertical location
	check.style.top = yval + 'px';
	check.style.display = 'block';
}

if (window.addEventListener)
window.addEventListener("load", defineEvents, false);
else if (window.attachEvent)
window.attachEvent("onload", defineEvents);