function returnObjById( id )
{
    if (document.getElementById)
        var returnVar = document.getElementById(id);
    else if (document.all)
        var returnVar = document.all[id];
    else if (document.layers)
        var returnVar = document.layers[id];
    return returnVar;
}


var IE = document.all?true:false

if (!IE) document.captureEvents(Event.MOUSEMOVE)

document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX;// = 0
var tempY;// = 0


function showImg(imgPath)
{
	var imgPreview = returnObjById("imgPreview");
	var myDiv = returnObjById("myDiv");
	imgPreview.src=imgPath;
	myDiv.style.left= tempX;
	myDiv.style.top= tempY;
	//myDiv.style.top=document.body.clientHeight/2-imgPreview.height/2 + document.body.scrollTop - 100;
	myDiv.style.visibility='visible';
}

function getMouseXY(e) {
  if (IE) { // browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  

  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
 
  return true
}