﻿var ImageDisplayed, BigImageWidth, BigImageHeight, MouseX, MouseY;
ImageDisplayed = 0;
BigImageWidth = 300;
BigImageHeight = 390;
      
function show_BigImage(_this) 
{    
     document.getElementById("enlarge_images").innerHTML = "<table  bgcolor='#0E4D70'><tr><td><img src='" + _this.src + "' width='"+BigImageWidth+"' height='"+BigImageHeight+"' ></td></tr></table>";
     ImageDisplayed = 1;
}
function hide_BigImage(_this) 
{
    document.getElementById("enlarge_images").innerHTML = "";
    ImageDisplayed = 0;
}
function move_layer(event)
{
     event = event || window.event;
     MouseX = event.clientX;
     MouseY = event.clientY;
    if (ImageDisplayed == 1)
        {
        window.status="X="+MouseX+", Y="+MouseY+", document.body.scrollTop="+document.body.scrollTop;
        if ((MouseX + BigImageWidth + 25) >= document.body.clientWidth)
            {
            imgW = MouseX - BigImageWidth - 25
            }
        else
            {
            imgW = MouseX + 25
            }
        if ((MouseY + BigImageHeight + 25) >= document.body.clientHeight)
            {
            imgH = MouseY - BigImageHeight - 25 + document.body.scrollTop;
            if (imgH < 1) imgH = 1
            }
        else
            {
            imgH = MouseY + 25 + document.body.scrollTop
            }   
         //enlarge_images.style.left=event.clientX+document.body.scrollLeft+10;
         enlarge_images.style.left=imgW;
         enlarge_images.style.top= imgH;
         }
}
document.onmousemove = move_layer;