/* script.js */

/*function onPageLoad(){
	var ul = document.getElementById('featurelist');
	var lis = document.evaluate('//li[contains(@name, "screen")]', ul, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
	for (var i=0; i<lis.snapshotLength; i++){
		var li = lis.snapshotItem(i);
		li.addEventListener('mouseover', showScreen, true);
		li.addEventListener('mouseout', hideScreen, true);
	}
}*/

tooltip = null;

function onPageLoad(){
	document.onmousemove = updateTooltip;
}

function updateTooltip(e) {
	x = e.pageX;
	y = e.pageY;
	if (tooltip != null) {
		tooltip.style.left = (x + 20) + "px";
		tooltip.style.top = (y + 20) + "px";
	}
}


function showScreen(image){
	tooltip = document.getElementById('tooltip');
	tooltip.innerHTML = '';
	tooltip.setAttribute('class', 'tooltipon');
	var img = document.createElement('img');
	img.setAttribute('src', 'screen/'+image+'.png');
	tooltip.appendChild(img);
}

function hideScreen(){
	if (tooltip != null){
		tooltip.setAttribute('class', 'tooltipoff');
		tooltip.innerHTML = '';
		tooltip = null;
	}
}