﻿// used in Results
function showDetail(link, detail)
{
    if (document.getElementById(detail) != null)
    {
        if (document.getElementById(detail).style.display == "block")
	      {
	        //if it's already showing, do nothing
	      }
	      else
	      {
	        var pos = findPos(document.getElementById(link));
	        document.getElementById(detail).style.left = pos[0] - 16 + 'px';
		    document.getElementById(detail).style.top = pos[1] + 118 + 'px';
            document.getElementById(detail).style.display = "block";
          }
    }
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}


