// OVERTRAIL
var OverTrailHeight, OverTrailWidth;

function OverTrail(html,width,height,padding) {
  OverTrailWidth = width+padding*2+2;
  OverTrailHeight = height+padding*2+2;
  ObjTrail = document.getElementById("overtrail");
  ObjTrail.style.width = (document.all?OverTrailWidth:width)+"px";
  ObjTrail.style.padding = padding+"px";
  ObjTrail.innerHTML = html;
  document.onmousemove = FollowMouse;
}

function FollowMouse(e) {
  x=15, y=-300;
  xmax=document.all? document.body.clientWidth+document.body.scrollLeft : window.innerWidth+window.pageXOffset-15;
  ymax=document.all? document.body.clientHeight+document.body.scrollTop : window.innerHeight+window.pageYOffset-15;
  if (typeof e != "undefined") {
    x+=e.pageX; y+=e.pageY;
  } else if (typeof window.event !="undefined") {
    x+=document.body.scrollLeft+event.clientX; y+=document.body.scrollTop+event.clientY;
  }
  if (x+OverTrailWidth>xmax) x=x-OverTrailWidth-30;
  if (y+OverTrailHeight>ymax) y=y-OverTrailHeight-15;
  document.getElementById("overtrail").style.left=x+"px";
  document.getElementById("overtrail").style.top=y+"px";
  document.getElementById("overtrail").style.visibility="visible";
}

function OverTrail_Img(imagename,width,height) { OverTrail('<img src="' + imagename + '" border="0">',width,height,10); }

function OverTrail_Txt(html,width,height) { OverTrail(html,width,height,5); }

function HideTrail() {
  document.getElementById("overtrail").style.visibility="hidden";
  document.onmousemove="";
}



