
var tip2 = null; 
var tip3 = null;
var abc = null;
var abcd = null;
var thumbTop = null;
var thumbLeft = null;
var id = null;

function showBox2(id) {
  
  abc = 'bigImage'+id;
  abcd = 'thumb'+id;
  tip2 = document.getElementById(abc);
  tip2.style.display = "block";
  
  tip3 = document.getElementById(abcd);

  thumbTop = document.getElementById(abcd).offsetTop;
  //var thumbTop = 100;  //tip3.offsetTop;
  //var thumbTop = document.all[abcd].offsetTop;
  
  if ( thumbTop == 0 ) {
    thumbTop = -1000;
  }

  var thumbLeft = document.getElementById(abcd).offsetLeft;  
  
  if ( thumbLeft == 0 ) {
    var thumbLeft = -1000;
  }
  
  tip2.style.top = (thumbTop -90) + "px";
  tip2.style.left = (thumbLeft -65) + "px";
}

function hideBox2(id) {
  var abc = 'bigImage'+id;
  var tip2 = document.getElementById(abc);
  tip2.style.display = "none";
}



  var xFromMouse = 10;
  var yFromMouse = 10;
  var boxheight = 180;
  var tip = null; 
 
function showBox(id) {
  tip = document.getElementById(id);
  tip.style.display = "block";
}

function hideBox() {
     tip.style.display = "none";
}
 
function moveBox(e) {
    x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
    y = (document.all) ? window.event.y + document.body.scrollTop : e.pageY;
		height = window.innerHeight;
		height = document.documentElement.clientHeight;
		var boxheight = tip.offsetHeight + 15;

    if (tip != null) {		  
			
			if	(height < y + boxheight)	{
				test = height - y - boxheight;
        tip.style.left = (x + xFromMouse) + "px";
        tip.style.top  = (y + yFromMouse + test) + "px";
			}

			else	{
			tip.style.left = (x + xFromMouse) + "px";
      tip.style.top  = (y + yFromMouse) + "px";
			}
    }
 }
 
 document.onmousemove = moveBox;

 
 





