/**
 * @author Cale
 */

function Image(name, caption) {
	var r = '<img src="images/' + name + '">';
	var r = r + '<p style="width:300px; margin: 4px 0;">' + caption + '</p>';
	return r;
}

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX - 100;
    tempY = e.pageY - 75;
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  if (tempX > 600) {tempX = 600}
  if (tempY > 400) {tempY = 400}
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
}
var imageName;
var iTimer;

	showPop = function(img) {
		imageName = img;
		clearTimeout(iTimer); 
		iTimer = setTimeout(showPic, 1000);
	}
	showPic = function() {
		var el = document.getElementById('pop');
		el.style.left=tempX+"px";
		el.style.top=tempY+"px";
		el.style.display="block";
		el.innerHTML = "<img src='images/" + imageName + "'>";
	}

	hidePop = function() {
		var e = document.getElementById('pop');
		e.style.display = "none";
		e.innerHTML = "";
	}
	