
var eve;
var mouse_x;
var mouse_y;
var obj;
var str_px;
var BrowserName = navigator.appName;

function ShowDetails(pd) {
  obj.innerHTML = '<table style="font-family: Verdana, Arial, sans-serif; font-size : 10px; background: #fafafa; border-width:4px; border-color:#FFFFFF; border-style:ridge" width="280px"><tr><td>' + pd + '</td></tr></table>';
  moveAction();
}

function HideDetails() {
  obj.innerHTML = '';
}

function ShowPicture(pic) {
  if (pic != "") {
    obj.innerHTML = '<table style="font-family: Verdana, Arial, sans-serif; font-size : 10px; background: #ffffff; border-width:4px; border-color:#5588ff; border-style:ridge;"><tr><td>' + pic + '</td></tr></table>';
	obj.style.zIndex = 1;
    moveAction();
  }
}

function HidePicture() {
  obj.innerHTML = '';
}

function moveAction(eve) {
  if (!eve) {
    eve = window.event;
  }
  if (!obj) {
    if (document.getElementById) {
      obj = document.getElementById("divTag");
      str_px = "px";
    } else if (document.all) {
      obj = document.all.divTag;
      str_px = "";
    }
  }
  
  mouse_x = parseInt(eve.clientX);
  mouse_y = parseInt(eve.clientY);
  
  if (BrowserName.match(/microsoft/i)) {
    mouse_y = mouse_y + document.body.scrollTop;
    window_width = document.body.offsetWidth;
    window_height = document.body.offsetHeight;
  } else {
    mouse_y = mouse_y + window.pageYOffset;
    window_width = window.innerWidth;
    window_height = window.innerHeight;
  }
  
  if (obj.innerHTML.lastIndexOf(".jpg") > 0) {
    obj.style.left = (mouse_x - 250) + str_px;
  } else if (mouse_x < (window_width / 3)) {
    obj.style.left = (mouse_x - 70) + str_px;
  } else if (mouse_x > (window_width / 1.5)) {
    obj.style.left = (mouse_x - 210) + str_px;
  } else {
    obj.style.left = (mouse_x - 140) + str_px;
  }
  obj.style.top = (mouse_y + 25) + str_px;
}

document.onmousemove = moveAction;

